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
Cursor phones = getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null,null,null, null); | |
while (phones.moveToNext()) | |
{ | |
String name=phones.getString(phones.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME)); | |
String phoneNumber = phones.getString(phones.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER)); | |
} | |
phones.close(); |
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
[http] | |
proxy = http://127.0.0.1:8087 | |
sslVerify = false #注意一定要添加这一行用以解决“ SSL certificate problem: unable to get local issuer certificate” | |
[https] | |
proxy = http://127.0.0.1:8087 |
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
int32_t FloorLog2(uint32_t n) | |
{ | |
int32_t p = 0; | |
if (n == 0) return -1; | |
if (n & 0xffff0000) { p += 16; n >>= 16; } | |
if (n & 0x0000ff00) { p += 8; n >>= 8; } | |
if (n & 0x000000f0) { p += 4; n >>= 4; } | |
if (n & 0x0000000c) { p += 2; n >>= 2; } |
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
cout <<"edit distance for t1 & t2:"; | |
long long total_it_ed = 0; | |
for( i = 0; i < it_ed.size(); i++) | |
{ | |
cout << it_ed[i] << "," ; | |
total_it_ed += it_ed[i]; | |
} | |
cout << endl; | |
cout <<"edit distance for c1 & c2:"; |
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
def xrange(start,end,step): | |
''' | |
range [start,end) | |
''' | |
r = start | |
while r < end: | |
yield r | |
r += step | |
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
if ls /path/to/your/files* &> /dev/null; then | |
echo "files do exist" | |
else | |
echo "files do not exist" | |
fi |
If they're both strings you can just do:
#define STR3 STR1 STR2
The preprocessor automatically concatenates adjacent strings.
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
# first manual boot into ubuntu | |
root (hd0,X) | |
kernel /boot/vmlinuz... root=/dev/sdaX | |
initrd /boot/initrd... | |
boot |
OlderNewer