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
把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
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
/** | |
*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
//常用到的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
<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
bundle install --path vendor/bundle | |
gem install rails -v 版本号 |
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 id="picture_show" style="position: absolute; display: none; background: none repeat scroll 0% 0% rgb(211, 211, 211); border-radius: 5px;z-index: 10000; "> | |
<img> | |
</div> | |
//picture show orginal size | |
$("#picture_list img").each(function(){ | |
$img = $(this); | |
$tooltip = $("#picture_show"); | |
$img.hover( |
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
ctrl+a 跳到行首 | |
ctrl+e 跳到末尾 | |
ctrl+d 删除光标后1个字符 | |
ctrl+h 删除光标前1个字符 | |
ctrl+u 清除至行首 | |
ctrl+k 清除至行尾 | |
ctrl+f 光标后移1个字符 |
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
<!-- | |
监视input输入为手机号 | |
即输入内容为11位数字 | |
--> | |
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script> | |
<input type="text" id="number"> | |
<script> | |
function chk_phone_number(input) { | |
if(input.val().toString().match(/^[-]?[0-9]+[\.]?[0-9]*$/)==null || |