This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div> | |
<input type="text" id="input_value" onkeydown="enterIn(event);" /> | |
<input type="button" value="计算" id="cal_btn" /> | |
</div> | |
<div> | |
结果:<span id="ret_value"></span> | |
</div> | |
<div> | |
公式:<span id="ret_cal"></span> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//常用到的sqlLite操作类,对增删查改进行了简单的封装。 | |
import android.content.ContentValues; | |
import android.content.Context; | |
import android.database.Cursor; | |
import android.database.SQLException; | |
import android.database.sqlite.SQLiteDatabase; | |
import android.database.sqlite.SQLiteOpenHelper; | |
public class DBHelper { | |
static private DatabaseHelper mDbHelper; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
*description:Android HttpPost() | |
*authour:YanEr·Gates | |
*website:http://www.gogogogo.me | |
*/ | |
package me.gogogoog; | |
import java.io.IOException; | |
import java.util.ArrayList; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package a.a; | |
import android.app.Activity; | |
import android.os.Bundle; | |
import android.view.View; | |
import android.widget.Button; | |
import android.widget.EditText; | |
public class AActivity extends Activity { | |
/** Called when the activity is first created. */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
把D:\test\目录下的所有jpg文件重命名为pic###.jpg的代码: | |
Dim i As Integer | |
i = 1 | |
Set fs = CreateObject("scripting.filesystemobject") | |
Set fd = fs.GetFolder("d:\test") | |
For Each f In fd.Files | |
If LCase(f.ShortName) Like "*.jpg" Then | |
f.Name = "pic" & Format(i, "000") & ".jpg" | |
i = i + 1 | |
End If |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Request資訊收集 | |
在Controller的Action之中,Rails提供了一些方法可以讓你得知此request各種資訊,包括: | |
action_name 目前的Action名稱 | |
cookies Cookie 下述 | |
headers HTTP標頭 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
desc "test" | |
task :test do | |
puts "params #{ENV['parmas']}" | |
end | |
如果使用的话: | |
rake test params="test" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Andrew Wayne 2010 | |
# Error messages for Ruby on Rails 3 | |
# This isnt available in Rails 3 and is a custom module | |
# made to work like the previous Rails | |
# Put this in your ApplicationHelper or create an error_messages_helper.rb file | |
# in your helpers dir | |
#------------- START --------------# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#功能: | |
# 自动校正系统时区、日期、时间 | |
#校正方式一: | |
# 通过ssh取得远程主机时区、日期、时间为参照校正本机时区、日期、时间 | |
# 此方式需要设置shost=登陆用户名@参照主机ip | |
#校正方式二: | |
# 手工设置要修改参考的标准信息 | |
# 此方式需要设置sinfo="+0800 09/28/13 16:25:30" | |
#说明: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery.fn.paginate = function(options) { | |
defaults = { childNodeName: 'li'} | |
var opts = $.extend(defaults, options); | |
var childNodeName = opts["childNodeName"]; | |
this.each(function(){ | |
var currentPage = 0; | |
var numPerPage = 10; | |
var $con = $(this); | |
$con.bind('repaginate',function(){ |