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
WifiManager manager = (WifiManager) getSystemService(Context.WIFI_SERVICE); | |
WifiInfo info = manager.getConnectionInfo(); | |
String address = info.getMacAddress()); |
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 <stdio.h> | |
void main() { | |
char *ans[4]={"yes","no","no","no"}; | |
int i=1; | |
int idx; | |
idx=abs((32767-65535/(i+1))/10000); | |
printf("i=%i, idx=%i, ans=%s\n", i, idx, ans[idx]); |
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 com.example.test; | |
import java.util.ArrayList; | |
import android.os.Bundle; | |
import android.app.Activity; | |
import android.appwidget.AppWidgetHost; | |
import android.appwidget.AppWidgetManager; | |
import android.appwidget.AppWidgetProviderInfo; | |
import android.content.Intent; |
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
/* | |
* Copyright (C) 2009 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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 | |
keep_part=`ls -tr *.tgz | tail -n 60` | |
for i in `ls *.tgz` | |
do | |
is_found=`echo $keep_part | grep $i` | |
if [ -z "$is_found" ]; then | |
echo "purge $i" | |
rm -f $i | |
else |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"> | |
</script> | |
<script> | |
$(document).ready(function(){ | |
// $("button").click(function(){ | |
$.get("http://xxxxxx/api/1.0/xxxx/",function(data,status){ | |
var obj = jQuery.parseJSON(data); |
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
#!/usr/bin/python | |
""" | |
get free sits from API call | |
python example by stanwu | |
""" | |
import urllib2 | |
import json | |
response = urllib2.urlopen('http://xxxx.xxxxx.xxx/') |
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
/* | |
* Copyright (c) 2013 Calvin Rien | |
* | |
* Based on the JSON parser by Patrick van Bergen | |
* http://techblog.procurios.nl/k/618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html | |
* | |
* Simplified it so that it doesn't throw exceptions | |
* and can be used in Unity iPhone with maximum code stripping. | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining |
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 | |
export CC=/opt/arm-2010.09/bin/arm-none-linux-gnueabi-gcc | |
make | |
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
alias updatedb="updatedb --localpaths='/cygdrive/c'" | |
alias df="df -h" | |
alias du="du -h" | |
alias locate="locate -i" |