PHP record March

Source: Internet
Author: User

"2010/3/8"

1:
Array_pop ($array ());//php Delete the last element of the array
Array_shift ($array ());//Delete First element

2:
java1.5 written on the program, let put on the java1.4 server running, how to do, Internet search a bit,
The following bytecode conversion tool converts 1.5 compiled *.class files to 1.4, with a tool called Retrotranslator.
How do you retrotranslator from the command line?

   1. Download and unzip the binary distribution file Retrotranslator-n.n.n-bin.zip, where N.N.N is the latest retrotranslator R Elease number.
   2. Compile your classes with Java 5.0 or Java 6 and put them to some directory, e.g. MyClasses.
   3. Go to the unzipped directory and execute:
      Java-jar Retrotranslator-transformer-n.n.n.jar-srcdir myclasses
      use appropriate options to Verify the result and for troubleshooting, e.g.-verify,-classpath,-advanced, And-smart.
   4. Put Retrotranslator-runtime-n.n.n.jar and Backport-util-concurrent-n.n.jar into the classpath of your application if u Se the Java 5.0 API.
   5. Run or debug the application as usual on Java 1.4.

The command line syntax:
Java-jar Retrotranslator-transformer-n.n.n.jar <options>
Or
JAVA-CP Retrotranslator-transformer-n.n.n.jar Net.sf.retrotranslator.transformer.Retrotranslator <options>

Detailed steps
Under the java1.4 environment:
A:
Put together the classes files in the 1.5 environment, such as the directory 1.5classes.

B:
Then enter the relevant directory, create a new 1.4classes directory, and then confirm the directory is correct, execute the following command:
Java-jar Retrotranslator-transformer-1.2.9.jar-srcdir 1.5classes-destdir 1.4classes

C:
Playing jar packs in 1.4 environments
Go to the 1.4classes folder and execute the following command:
Jar CVFM Weqiqiserver.jar MANIFEST.MF *

D:
Put the downloaded Retrotranslator-1.2.9-bin folder under the
Backport-util-concurrent-3.1.jar
Backport-util-concurrent-java12-3.1.jar
Retrotranslator-runtime13-1.2.9.jar
Retrotranslator-runtime-1.2.9.jar
Retrotranslator-transformer-1.2.9.jar
Put it in the java1.4 version of the $java_home/jre/lib/ext directory.

E:
Normal Operation Weiqiserver.jar
Java-jar Weiqiserver.jar Root 123456

"2010/3/9"
1:
The socket server is
Reading data
Is.read (bytes);
Write data OutputStream OS = Socket.getoutputstream ();

Os.write (BMSG);
, when the client breaks the net and will not throw the exception as expected (but do not know when it will be inexplicably thrown out of the exception), which makes the server program to deal with some difficulties,
Because the server should do some business logic when catching the exception, if you can't catch the exception, you can't do the related operation, for example, the server writes the data to the client, if
After the client breaks the net, the server can catch this exception, know that write this data has not been successfully sent to the client, should be saved, and so on the next time the client landing time to send it;
If the server can not catch this exception, will not save the data not sent, when the client again connected to the server, the server will not be sent to the client.

Ninki 13366065774

1) IP Address: 218.206.92.81

"2010/3/10"
1:
Examples of date formatting
Date date = new Date ();

Print out specific year, month, day, hour, minute, second, and time zone
Long val = Date.gettime ();
Date Date2 = new Date (val);
System.out.println ("Date2 is:" + date2);

SimpleDateFormat Bartdateformat = new SimpleDateFormat ("Yyyy-mm-dd hh:mm:ss");
Date Date3 = new Date ();
System.out.println (Bartdateformat.format (date));
System.out.println ("Date2 formate is:" + Bartdateformat.format (date2));

2:
The difference between timestamp in PHP and Date.gettime () in Java
The timestamp in PHP is 10 bits, and the Date.gettime () gets 13 bits, the extra 3 bits are milliseconds, and the range is 0-999, so
When you want to use Date.gettime () to name the table created, pay attention to the last three bits to be removed, otherwise the words in PHP can not be based on the number of milliseconds
To find the corresponding table.
String Timestap = date.gettime () + "";

System.out.println (TIMESTAP);
String tablename = timestap.substring (0, 10);

Processing date and time stamp in PHP:

A: Convert a timestamp to a date
$date 3=date (' y-m-d h:i:s ', "1268207097");
echo $date 3;

B: Convert a date to a timestamp
function Gettimestamp ($date)
{

2010-03-10 15:44:57 substr:
$year = (substr ($date, 0,4))/year of acquisition

$month = (substr ($date, 5,2))//Get Month

$day = (substr ($date, 8,2))/date

$hour = (substr ($date, 10, 3)); When do I get

$minute = (substr ($date, 14,2));

$sec = (substr ($date, 17, 3));//Get a few seconds

echo "<br/>". $year $month $day $hour $minute $sec ". "<br/>";

Echo mktime ($hour, $minute, $sec, $month, $day, $year);

}

"2010/3/11"
1:
PHP in the header with the parameters of the jump, if the jump to be a frameset, then in this frameset a frame is to
Not to the value of the passed parameter, use session.

2:
The error message for MySQL error 1005:can ' t create TABLE (ERRNO:150) occurs when a reference constraint is established in MySQL and cannot establish a referential constraint.

The general situation of the problem

1, foreign key reference type is not the same, the primary key is int foreign key is char

2, the column referenced in the main table could not be found

3, the primary key and the foreign key character encoding inconsistent
4. If you want to establish a foreign key, you must first establish an index. There is also an error if no indexing is established.

3:
http://jythoner.javaeye.com/blog/569987
A programmer's collection of years

"2010/3/15"
1:
For a picture, responding to mouse clicks can be done by <a href= "></a> this way and This way, But the first click cannot execute JavaScript code, and
The second way is to execute JavaScript code.
2:
Yesterday in the IE7 test Ajax, the creation of XMLHTTP is not good, later used for jquery also not good, the results later found that their own IE7 installed problems, would have to uninstall the IE Chong, the result of unloading the
Once, as if not uninstalled successfully, this time again tested the jquery program, and so, more mysterious.
3:
JS Controls page jumps with target:
Window.parent.boardframe.location.href= "board.php?oper=" + $oper, where boardframe is a variable


4:
floating-point conversions to int type in JavaScript
parseint (2.3);

5:
Find in jquery delete the last cell in the specified table
$ ("#testTable"). Find ("Td:last"). Remove ();

The number of cells in jquery that determine a row
var len = $ ("#testTable"). Find ("Tr:last"). Find ("TD"). Size ();

"2010/3/17"

1:
To deal with a party (A) after chess, the other party (B) has not received the position of the step pieces of information on the drop line, a can first take their own walk of this step pieces of information into the Server B client of a property str inside, and so B again connected
When the server is on, the server sends the STR value to B. In this way, it can be solved.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.