解決方法:
修改php.ini, 加上預設timezone, 重新啟動Apache即可
date.timezone = "Asia/Taipei"
date.timezone = "Asia/Taipei"
cd /opt mkdir java cd java sh jdk-6u22-linux-i586.bin
tar -zxv -f apache-ant-1.8.1-bin.tar.gz -C /opt/ tar -zxv -f apache-tomcat-6.0.29.tar.gz -C /opt/ ln -s /opt/apache-ant-1.8.1/bin/ant /usr/bin
cp /opt/apache-tomcat-6.0.29/lib/servlet-api.jar /opt/apache-ant-1.8.1/lib
export ANT_HOME=/opt/apache-ant-1.8.1/ export JAVA_HOME=/opt/java/jdk1.6.0_22/ export PATH=${PATH}:${ANT_HOME}/bin
cd /opt/apache-tomcat-6.0.29/bin ./startup.sh
less /opt/apache-tomcat-6.0.29/logs/catalina.out
cd /etc/init.d vim tomcat
#!/bin/bash # chkconfig: 234 20 80 # description: Tomcat Server start/shutdown script # processname: tomcat JAVA_HOME=/opt/java/jdk1.6.0_22 export JAVA_HOME TOMCAT_HOME=/opt/apache-tomcat-6.0.29/bin START_TOMCAT=/opt/apache-tomcat-6.0.29/bin/startup.sh STOP_TOMCAT=/opt/apache-tomcat-6.0.29/bin/shutdown.sh start() { echo "Starting tomcat: " cd $TOMCAT_HOME ${START_TOMCAT} echo "Tomcat start done." } stop() { echo "Shutting down tomcat: " cd $TOMCAT_HOME ${STOP_TOMCAT} echo "Tomcat shutdown done." } case "$1" in start) start ;; stop) stop ;; restart) stop sleep 10 start ;; *) echo "Usage: $0 {start|stop|restart}" esac exit 0
chmod 755 tomcat /sbin/chkconfig --add tomcat /sbin/chkconfig --level 234 tomcat on /sbin/chkconfig --list tomcat
public void onAttachedToWindow() { super.onAttachedToWindow(); openOptionsMenu(); }
if(request.getHeader("Referer") == null || request.getHeader("Referer").indexOf("http://localhost:8080/myProject/") < 0) return false;
Conversion to Dalvik format failed with error 1
<ImageButton android:id="@+id/ImageButton01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/normal" android:background="@null" />
package com.demo.activitycycle; import android.app.Activity; import android.os.Bundle; import android.widget.Toast; public class ActivityLifeCycle extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Toast.makeText(this, "OnCreate()", Toast.LENGTH_SHORT).show(); } @Override protected void onDestroy() { super.onDestroy(); Toast.makeText(this, "OnDestroy()", Toast.LENGTH_SHORT).show(); } @Override protected void onPause() { super.onPause(); Toast.makeText(this, "OnPause()", Toast.LENGTH_SHORT).show(); } @Override protected void onRestart() { super.onRestart(); Toast.makeText(this, "OnRestart()", Toast.LENGTH_SHORT).show(); } @Override protected void onResume() { super.onResume(); Toast.makeText(this, "OnResume()", Toast.LENGTH_SHORT).show(); } @Override protected void onStart() { super.onStart(); Toast.makeText(this, "OnStart()", Toast.LENGTH_SHORT).show(); } @Override protected void onStop() { super.onStop(); Toast.makeText(this, "OnStop()", Toast.LENGTH_SHORT).show(); } }
adb [-d | -e | -s <serialNumber>] <command>
adb -s emulator-5554 install helloworld.apk adb uninstall com.myandroid.helloworld
# List of devices attached adb devices # device(運作中), offline(離線), bootloader(開機中) adb get-state # 取得執行模擬器的序號 adb get-serialno
adb shell # ls /data/data # ls /data/app
$route['post/cool'] = "post/list/10";
$mtime = explode(" ", microtime()); $startTime = $mtime[1] + $mtime[0];
$mtime = explode(" ", microtime()); $endTime = $mtime[1] + $mtime[0]; $totalTime = ($endTime - $startTime); echo $totalTime." seconds";