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
__author__ = 'dodola' | |
#encoding: utf-8 | |
import time | |
import urllib.request | |
import threading | |
import contextlib | |
import queue | |
import string | |
import shutil | |
import os |
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
__author__ = 'dodola' | |
#encoding: utf-8 | |
import time | |
import urllib.request | |
import urllib | |
import threading | |
import contextlib | |
import queue | |
import string | |
import shutil |
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
__author__ = 'dodola' | |
#encoding: utf-8 | |
from time import sleep, ctime | |
import time | |
import urllib.request | |
import threading | |
import contextlib | |
import queue | |
import string | |
import shutil |
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
__author__ = 'dodola' | |
#encoding: utf-8 | |
from lxml.html import parse | |
from time import sleep, ctime | |
import time | |
import urllib.request | |
import threading | |
import contextlib | |
import queue |
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) 2006 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
#encoding: utf-8 | |
__author__ = 'Dodola' | |
from lxml.html import parse | |
from time import sleep,ctime | |
import time | |
import urllib2 | |
import threading | |
import contextlib | |
import os |
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
long total=Runtime.getRuntime().totalMemory();//获取系统内存总数 | |
long free=Runtime.getRuntime().freeMemory();//获取剩余内存 | |
long used=total-free;//获取已使用内存 |
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
Resources res=getResources(); | |
TypedArray icons =res.obtainTypedArray(R.array.icons); | |
Drawable drawable1=icons.getDrawable(0); | |
Drawable drawable2=icons.getDrawable(1); | |
Drawable drawable3=icons.getDrawable(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
#include <stdio.h> | |
int getchar( void ); //读取一个字符, 一般用来去掉无用字符 | |
char *gets( char *str ); //读取一行字符串 | |
#include <stdlib.h> | |
void * malloc( size_t size ); //动态内存分配, 开辟大小为 size 的空间 | |
void qsort( void *buf, size_t num, size_t size, int (*compare)(const void *, const void *) ); //快速排序 | |
Sample: | |
int compare_ints( const void* a, const void* b ) | |
{ |
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<iostream> | |
using namespace std; | |
bool bin_search(int nums[],int i,int len){ | |
int left=0,right=len-1,middle; | |
while(left<=right){ | |
middle=left+((right-left)>>1); | |
if(i>nums[middle]){ | |
left=middle+1; | |
}else if(i<nums[middle]){ |
OlderNewer