顯示具有 SQL 標籤的文章。 顯示所有文章
顯示具有 SQL 標籤的文章。 顯示所有文章

[SQL] 語法整理

  • 0
* [date, time comparison時間比較]
Select * From temp where mydate > '2009-06-29 16:00:44';
* [skip, limit] MySQL skip first 10 results
SELECT * FROM foo LIMIT 10, 50
* [增加欄位] ALTER TABLE 敘述句 (SQL ALTER TABLE Statement)
ALTER TABLE table_name
ADD column_name datatype; 

[Android] [SQLite] No Such Table

  • 0
Tips: 在 database 已存在的情況下要新增 Table 時,記得更改 DATABASE_VERSION,確保 onUpgrade() 帶動執行 onCreate() 裡的 create table 指令
(或者是用 adb shell 把整個 database 刪掉也可以)
--
今天在開發的時候,新增加了一個 database table
但是卻在 LogCat 中看到錯誤訊息
"No Such Table xxx"

Chrome Extension

  • 0
Implement a clickable UI element: browser action

manifest.json + Resource -> Load extension

[CSS] CSS Layout - 達人的階梯

[Android] startActivityForResult 

原理

Code Convention & 變數命名習慣

Reference
F2E Code Style Guideline
Code Style Guidelines for Contributors | Android Developers

Git 基本語法整理

[推薦] GitMagic 
1. 基本使用
  • 安裝、設定
  • init, clone
  • 基本功(status, add, commit, log, .gitignore)
          $ git status               # 目前狀態
          $ git add <fname>       # 將 unstage 的檔案狀態變為 stage
          $ git commit -v          # 提交修改, 列出更動記錄
          $ git log --stat            # 查看 commit 記錄
     -> 修改檔案 => 加入 stage (git add) => 提交( git commit )=> 繼續修改其他檔案

[Android] AlertDialog

new AlertDialog.Builder(this)
.setIcon(R.drawable.ic_launcher)
.setTitle(R.string.dialog_title_quit)
.setMessage(R.string.dialog_msg_quit)
.setNegativeButton(R.string.no, null)
.setPositiveButton(R.string.yes, 
    new DialogInterface.OnClickListener() {
    public void onClick(DialogInterface dialog, int id) {
        YourClass.this.finish();    
    }
})
.show();

Reference
Confirming & Acknowledging | Android Design
Android 最詳細的對話框教學

[Android] Contextual Action Bar - Selection by LongPress

這項功能只在 Android 3.0 (API Lv 11) up 的系統上
Selection | Android Developer
Porting the contextual anction mode for pre-Honeycomb Android apps using Action Bar Sherlock library

[Android] cursorindexoutofboundsexception

  • 0
解決方法:
c.moveToFirst(); // 將Cursor指標移到第一個Row
或是
moveToPosition(int index) //將Cursor指標移到第index個Row

[Android] findViewById in Fragment

  • 0
在實作 fragment 的時候,發現在 initViews 的時候碰到 NullPointerException
如同在 findViewById in fragment android 裡第1個回答的第1個回應提到的
it's works only after onCreateView(). So, you can't use this in onCreate()
所以要注意2點
1. initView 要放在 onCreateView() 裡
2. findViewById 前要多加一個 view 的 instance
e.g. btnRefuel = (Button) v.findViewById(R.id.btnRefuel);

Reference
Fragments | Android Developer
Android Fragments | Google & Android 研究室

Bitnami Redmine + Git

  • 0
Bitnami Redmine
因為我已經有安裝 wamp server, 所以這裡在安裝時記得port要改
80 -> 81
3306 -> 3307