Divide two integers without using multiplication, division and mod operator.
public class Solution {
public int divide(int dividend, int divisor) {
int sign = 1;
if (dividend < 0) {
...
分类:
其他好文 时间:
2014-05-15 14:40:50
阅读次数:
285
#include
#include
using namespace std;
//下面一个移位是一样的,>>相当于除去2,主要是要用right-left,否则对于大数据来说会产生溢出问题。切记
int binarySearch(int arr[],int len,int number)
{
int left=0;
int right=len-1;
in...
分类:
其他好文 时间:
2014-05-15 07:14:38
阅读次数:
272
如何用AT指令发送短信一、发送英文短信发:AT收:OK发:AT+CMGF=1 收:OK发:AT+CMGS="13798290312"收:>发:ATce123zhouwei→(十六进制格式:41 54 63 65 31 32 33 7A 68 6F 75 77 65 69 1A 1A) //ATce123zhouwei→为发送内容,→为发送符(Ctrl+Z,十六进制0x1A)收:+CMGS:...
分类:
其他好文 时间:
2014-05-15 06:54:50
阅读次数:
203
#include
using namespace std;
class Animal
{
public:
Animal() {}
void eat()
{
cout << "eat\n";
}
protected:
void play()
{
cout << "play\n";
}...
分类:
其他好文 时间:
2014-05-15 06:21:51
阅读次数:
234
/*
* hdu AC Me
* date 2014/5/13
* state AC
*/
#include
#include
#include
#include
using namespace std;
const int MAXN=100001;
char Arr[MAXN];
int cnt[26];
int main()
{
//cout << "Hello wor...
分类:
其他好文 时间:
2014-05-15 06:16:24
阅读次数:
247
#include
using namespace std;
class Animal //动物类
{
public:
Animal() {}
void eat(){
cout << "eat\n";
}
protected:
void play()
{
cout << "play\n";
...
分类:
其他好文 时间:
2014-05-15 06:02:54
阅读次数:
360
接下来几篇文章将对任老师的博文《可下拉的PinnedHeaderExpandableListView的实现》分步骤来详细实现,来学习一下大神的代码并记录一下。原文出处:http://blog.csdn.net/singwhatiwanna/article/details/25546871先看一下最终效果:新建一个activity_main.xml文件<RelativeLayout xmlns:an...
分类:
移动开发 时间:
2014-05-15 04:47:46
阅读次数:
379
window->preference->General->workspace->Text file encoding->utf-8->Apply->ok
project->clean...
分类:
其他好文 时间:
2014-05-15 03:48:15
阅读次数:
320
第一次使用ModelAdmin.date_query,在admin.py中添加后,出现了这样的错误
ImproperlyConfigured exception (pytz isn't installed)
使用以下命令安装pytz之后,问题依然没有解决
$sudo pip install pytz
根据搜索结果,原来需要把settings.p中的USE_TZ = True修改为USE_T...
分类:
其他好文 时间:
2014-05-15 03:42:23
阅读次数:
224
前言
学习任何一个稍有难度的技术,要对其有充分理性的分析,之后果断做出决定---->也就是人们常说的“多谋善断";本系列虽然涉及的是socket相关的知识,但学习之前,更想和广大程序员分享的是一种心境微笑:学习是一个循序渐进的过程,心态应该随时调节,保持戒骄戒躁的状态。比如最近在看网易公开课MIT《算法导论》,老师提到,学习算法之前要计算机数学+离散数学+概率论等课程的知识,所以一直学不好算法的程序员不妨从基础入手,这都是中国式教育惹的祸啊!(此处省略一万字......)...
分类:
编程语言 时间:
2014-05-14 14:30:56
阅读次数:
375