ps:百度是xxx的走狗 回到正题,今天研究了下用一个py文件作为celery的配置文件,所以,还是参考昨天的例子:http://my.oschina.net/hochikong/blog/396079 我们把celery.py的配置项拿出来,在proj目录中创建cel...
分类:
其他好文 时间:
2015-04-05 17:36:45
阅读次数:
118
很多时候我们都通过BaseAdapter.getView()中的convertView来提高ListView的性能,这个时候如果我的的ListView的Item里有一个正在更新ProgressBar,结果就悲惨了。。。 滑动界面时并没有达到我们想要的效果。解决这个问题其实很容易,在数据集中保存一下更新的进度,然后在getView中不断去设置进度。
还有一个问题就是,当有进度更新的时候,我们是要不...
分类:
其他好文 时间:
2015-04-05 17:35:38
阅读次数:
133
学过数据结构的程序猿应该都清楚,栈是一种先入后出,后入先出(LIFO)的表。即插入和删除都只能在一个位置上进行,即栈顶位置。对栈的基本操作有Push(入栈)和Pop(出栈)。在一般软件研发的笔试中,就会经常遇到关于入栈次序一定时,出栈次序有哪些?共有几种?
其实,此处只要了解一下卡特兰数的算法结构,参见:
http://baike.baidu.com/link?url=T7ZR16yiaWKN...
分类:
其他好文 时间:
2015-04-05 17:36:45
阅读次数:
143
1.题目描述:点击打开链接
2.解题思路:本题利用暴力搜索解决。直接从1234开始枚举除数,由于乘积不能超过100000,所以上限是100000/n。然后判断得到的乘积和除数中的所有数是否都各不相同即可。
3.代码:
#define _CRT_SECURE_NO_WARNINGS
#include
#include
#include
#include
#include
#include
#...
分类:
其他好文 时间:
2015-04-05 17:34:41
阅读次数:
133
基础的树链剖分题目,不过是边权,可以向下映射成点权或者按边剖分。
VIEW CODE
#include
#include
#include
#include
#include
#include
using namespace std;
const int mmax=10010;
const int inf=0x3fffffff;
struct edge
{
int st,en,cos...
分类:
其他好文 时间:
2015-04-05 17:35:02
阅读次数:
116
Compared to wildleopard's wealthiness, his brother mildleopard is rather poor. His house is narrow and he has only one light bulb in his house. Every night, he is wandering in his incommodious house, t...
分类:
其他好文 时间:
2015-04-05 17:36:10
阅读次数:
235
Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:
Integers in each row are sorted from left to right.The first integer of each...
分类:
其他好文 时间:
2015-04-05 17:33:31
阅读次数:
125
1.题目描述:点击打开链接
2.解题思路:本题利用暴力搜索解决,由于n,S的范围都比较小,直接利用三重循环枚举。又最大可能乘积不会超过10^18,因此结果用long long保存。注意枚举的时候起点和终点可以重合。
3.代码:
#define _CRT_SECURE_NO_WARNINGS
#include
#include
#include
#include
#include
#incl...
分类:
其他好文 时间:
2015-04-05 17:33:09
阅读次数:
136
神舟在线商城做得太烂了...
分类:
其他好文 时间:
2015-04-05 17:32:48
阅读次数:
115
Given a non-negative number represented as an array of digits, plus one to the number.
The digits are stored such that the most significant digit is at the head of the list.
class Solution {
p...
分类:
其他好文 时间:
2015-04-05 17:33:17
阅读次数:
89
题意: https://leetcode.com/problems/unique-paths/
A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).
The robot can only move either down or right at a...
分类:
其他好文 时间:
2015-04-05 17:33:39
阅读次数:
105
Xcode个人常用快捷键导航快捷键command+1-8:打开 Project/Symbol/Find/Issue/Test/Debug/Breakpoint/Log 导航栏command+0:显示/隐藏 左侧 tool paneloption+command+0:显示/隐藏 右侧 tool paneloption+command+1:显示 右侧 the file inspectoroption+c...
分类:
其他好文 时间:
2015-04-05 17:31:45
阅读次数:
120
接上一篇文章,首先我们再来复习一个listview的缓存优化方法
1,对Imageview使用setTag()方法来解决图片错位问题,这个Tag中设置的是图片的url,然后在加载的时候取得这个url和要加载那position中的url对比,如果不相同就加载,相同就是复用以前的就不加载了
2,对于要加载的图片资源,先在内存缓存中找(原始的方法是使用SoftRefrence,最新的方法是使用a...
分类:
其他好文 时间:
2015-04-05 17:33:30
阅读次数:
146
Description
还记得大学里学过的模电么,今天就让我们将与或非变成一道题吧。
给你一个与或非的表达式,求出这个表达式的值,表达式总共有八种字符。
三种逻辑运算符按照优先级排列如下。
‘!’:表示取反。
‘&’:逻辑与。
‘|’:逻辑或。
两个字符‘T’,‘F‘分别表示true和 false。
另外还有左右括号,空格三种字符。跟一般的表达式一样,括号可以改变优先级。
...
分类:
其他好文 时间:
2015-04-05 17:31:34
阅读次数:
126
1.题目描述:点击打开链接
2.解题思路:根据题目描述,可以解出来y的范围是1≤y≤2k。进而可以求出x=ky/(y-n)。注意x要大于0且是整数。
3.代码:
#define _CRT_SECURE_NO_WARNINGS
#include
#include
#include
#include
#include
#include
#include
#include
#include
#i...
分类:
其他好文 时间:
2015-04-05 17:31:19
阅读次数:
203
Android
查看所有进程内存占用情况
(1)连接设备,打开USE调试模式
(2)打开命令行,执行命令:adb shell procrank
字段说明:
PID:进程id
VSS(Virtual Set Size): 虚拟耗用内存(包含共享库占用的内存)
RSS(Resident Set Size):实际使用物理内存(包含共享库占用的内存)
PSS(Proportional Set Size): 实际使用的物理内存(比例分配共享库占用的内存)
USS(Unique Set Size): 进程独自...
分类:
其他好文 时间:
2015-04-05 17:30:52
阅读次数:
166
这篇文章本来是要在三月底写的,可是因为时间紧的缘故,便计划着在清明节小长假来好好的总结。这个学期课程安排的相当的紧,也就只有周二的下午有空闲的时间,还有就是周六周日,算起来也就是三天的自由时间,还好这个学期有了C#程序设计和数据结构,也有了继续学习下去的动力,再加上这个学期要自学SQL.Server,因此时间安排的还是挺充实的。
对于我来说,初学编程,这个三月的重头戏就是三月的全...
分类:
其他好文 时间:
2015-04-05 17:29:58
阅读次数:
110