This file contains hidden or 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
<set xmlns:android="http://schemas.android.com/apk/res/android" > | |
<translate | |
android:duration="500" | |
android:fromYDelta="-50%p" | |
android:toYDelta="0" /> | |
<alpha | |
android:duration="500" | |
android:fromAlpha="0.0" | |
android:toAlpha="1.0" /> | |
</set> |
This file contains hidden or 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
// $birthday的格式为yyyy-mm-dd | |
public function getConstellation($birthday, $format=null) | |
{ | |
$pattern = '/^\d{4}-\d{1,2}-\d{1,2}$/'; | |
if (!preg_match($pattern, $birthday, $matchs)) | |
{ | |
return null; | |
} | |
$date = explode('-', $birthday); |
This file contains hidden or 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
@Override | |
public boolean onQueryTextChange(String searchText) { | |
// 清空上一次的搜索结果 | |
GlobalInfo.searchGameResults.clear(); | |
// 取得搜索结果集 | |
int resultCount = 0; | |
for (HashMap<String, String> item : GlobalInfo.searchGameSet) { | |
if (item.get("game_name").contains(searchText)) { | |
resultCount++; |
This file contains hidden or 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
bd = new BitmapDrawable(tmpInfo.bitmap); | |
try { | |
Method m = BitmapDrawable.class.getMethod( | |
"setTargetDensity", | |
new Class[] { DisplayMetrics.class }); | |
m.invoke(bd, GlobalInfo.currentActivity.getResources() | |
.getDisplayMetrics()); | |
} catch (NoSuchMethodException e) { | |
e.printStackTrace(); |
This file contains hidden or 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
void ShuffleArray_Fisher_Yates(char* arr, int len) | |
{ | |
int i = len, j; | |
char temp; | |
if ( i == 0 ) return; | |
while ( --i ) { | |
j = rand() % (i+1); | |
temp = arr[i]; | |
arr[i] = arr[j]; |
This file contains hidden or 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
#!/usr/bin/python | |
#coding=utf-8 | |
import urllib | |
import urllib2 | |
import re | |
import threading | |
import Queue | |
url = 'https://who.is/whois/name_search/' |
This file contains hidden or 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
var addWxContact = function(wxid, cb) | |
{ | |
if (typeof WeixinJSBridge == 'undefined') return false; | |
WeixinJSBridge.invoke('addContact', { | |
webtype: '1', | |
username: wxid | |
}, function(d) { | |
// 返回d.err_msg取值,d还有一个属性是err_desc | |
// add_contact:cancel 用户取消 | |
// add_contact:fail 关注失败 |
This file contains hidden or 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
<?php | |
$api = new apibus(); //创建 ApiBus 对象 | |
$Geo = $api->load( "geoone"); //创建一级地理位置服务对象 | |
// getDriveRoute方法 测试通过 | |
$begin = "121.418687,31.21855"; | |
$end = "121.400263,31.23210"; | |
$drive_route = $Geo->getDriveRoute($begin, $end); | |
echo "drive_rote: "; | |
print_r($drive_route); |
This file contains hidden or 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
private void logMemory(String callingFunction) | |
{ | |
long max = Runtime.getRuntime().maxMemory() / 1024; | |
if (debugJavaMemory) | |
{ | |
long used = Runtime.getRuntime().totalMemory() / 1024; | |
long available = max - used; | |
long change = available - availableJavaMemoryOld; | |
if (availableJavaMemoryOld != 0) |
OlderNewer