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
#include "SSLBuffer.h" | |
SSLBuffer::SSLBuffer() | |
:ssl(NULL) | |
,read_bio(NULL) | |
,write_bio(NULL) | |
,write_to_socket_callback(NULL) | |
,write_to_socket_callback_data(NULL) | |
,read_decrypted_callback(NULL) | |
,read_decrypted_callback_data(NULL) |
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
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com | |
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below) | |
module Player | |
describe MovieList, "with optional description" do | |
it "is pending example, so that you can write ones quickly" | |
it "is already working example that we want to suspend from failing temporarily" do | |
pending("working on another feature that temporarily breaks this one") |
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
Dim s | |
s = InputBox("当前Windows系统序列号为:", "Windows序列号", GetWindowsSN) | |
WScript.Quit | |
'取得当前Windows序列号函数 | |
Function GetWindowsSN() | |
Const HKEY_LOCAL_MACHINE = &H80000002 | |
strKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion" |
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
LOCAL_PATH := $(call my-dir) | |
include $(CLEAR_VARS) | |
LOCAL_MODULE := game_shared | |
LOCAL_MODULE_FILENAME := libgame | |
#traverse all the directory and subdirectory | |
define walk |
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
//隐藏软键盘。 | |
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); | |
imm.hideSoftInputFromWindow(view.getWindowToken(), 0); | |
//进入activity不显示软键盘 | |
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE); | |
或者在AndroidManifest.xml中设置android:windowSoftInputMode="adjustUnspecified|stateHidden"。 | |
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
Intent itb = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); | |
itb.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(capturePicFile)); | |
startActivityForResult(itb); | |
//设置MediaStore.EXTRA_OUTPUT可以获取原始大小的图片,否则,相机仅仅返回小图片。 |
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
//显示网页 | |
Uri uri = Uri.parse("http://google.com"); | |
Intent it = new Intent(Intent.ACTION_VIEW, uri); | |
startActivity(it); | |
//显示地图 | |
Uri uri = Uri.parse("geo:38.899533,-77.036476"); | |
Intent it = new Intent(Intent.ACTION_VIEW, uri); | |
startActivity(it); | |
//其他 geo URI 範例 |
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
Intent itb = new Intent(); | |
itb.setType("image/*"); | |
itb.setAction(Intent.ACTION_GET_CONTENT); | |
itb.putExtra("crop", "true"); //选择后对图片进行剪裁 | |
itb.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(capturePicFile)); | |
startActivityForResult(itb, GET_IMAGE_FROM_LOCAL); |
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
Intent intent = new Intent("com.android.camera.action.CROP"); | |
intent.setDataAndType(Uri.fromFile(capturePicFile), "image/*"); | |
//如何选择 | |
intent.putExtra("aspectX", 1); | |
intent.putExtra("aspectY", 1); | |
//输出大小 | |
intent.putExtra("outputX", 96); |
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 | |
# | |
# 多个进行并行执行任务 | |
# | |
SEND_THREAD_NUM=8 | |
tmp_fifofile="/tmp/$$.fifo" # 脚本运行的当前进程ID号作为文件名 | |
mkfifo "$tmp_fifofile" # 新建一个随机fifo管道文件 | |
exec 6<>"$tmp_fifofile" # 定义文件描述符6指向这个fifo管道文件 | |
rm $tmp_fifofile |
OlderNewer