设计模式总结:便于快速查看前言:个人觉得设计模式就是各个对象在不同的时机、不同的调用方被创建,组合结构和封装的侧重点有些不同,从而形成了各个模式的概念。1.简单工厂模式通过在工厂类中进行判断,然后创建需要的功能类。优点:不必使用具体的功能类去创建该类的实例。缺点:新增一个功能类就需要在工厂类中增加一...
分类:
其他 时间:
2015-06-05 00:03:20
收藏:
0 评论:
0 赞:
0 阅读:
311
ABP依赖注入点这里进入ABP系列文章总目录基于DDD的现代ASP.NET开发框架--ABP系列之6、ABP依赖注入ABP是“ASP.NET Boilerplate Project (ASP.NET样板项目)”的简称。ABP的官方网站:http://www.aspnetboilerplate.com...
分类:
其他 时间:
2015-06-05 00:02:00
收藏:
0 评论:
0 赞:
0 阅读:
278
1.NSNumber是用来封装基本类型的对象,任何数据封装成NSNumber的时候都可以进行相互比较,或者逻辑运算2.NSNumber的声明NSNumber * intNumber = [[[NSNumber alloc] initWithInt:9] autorelease];NSNumber *...
分类:
其他 时间:
2015-06-05 00:01:50
收藏:
0 评论:
0 赞:
0 阅读:
281
可以通过此头属性确定通信内容的传输方式,如果指定chunk表示把大资源分为多个小块进行传输通常情况下静态资源等小文件传输时可以指定 Content-Length 告知通信双方文件大小,而当传输资源无法确定大小是可以指定该属性进行传输通信双方也无需知道文件大小,这样可以节省内存空间。此属性和Conte...
分类:
其他 时间:
2015-06-05 00:01:10
收藏:
0 评论:
0 赞:
0 阅读:
449
单精度浮点数 单精度浮点数格式 是一种计算机数据格式,在计算机存储器中占用4个字节(32 bits),利用“浮点”(浮动小数点)的方法,可以表示一个范围很大的数值。 ? 在 IEEE 754-2008 的定义中,32-bit base...
分类:
其他 时间:
2015-06-04 22:57:00
收藏:
0 评论:
0 赞:
0 阅读:
619
代码放在Github上了。https://github.com/lpe234/meizi_spider? 基于Scrapy(0.22)爬虫示例 获取(http://www.meizitu.com/)网站图片,并保存到本地文件夹(meizi_images)下。 运行 python?run_spider.py??#?即...
分类:
其他 时间:
2015-06-04 22:56:20
收藏:
0 评论:
0 赞:
0 阅读:
509
一般我们向cell中添加子视图,有两种方式 1、[cell?addSubview:] 2、[cell.contentView?addSubview:] ????区别在于进行cell编辑时,比如cell内容向左移或者右移时,第一种方式子视图不会移动,第二...
分类:
其他 时间:
2015-06-04 22:56:00
收藏:
0 评论:
0 赞:
0 阅读:
517
这是一个人定闹钟的例子,就是人委托闹钟叫醒自己 main函数: #import <Foundation/Foundation.h> #import "Person.h" #import "Clock.h" int main(int argc, const char * argv[]) { ??? @autoreleasepool ?...
分类:
其他 时间:
2015-06-04 22:55:40
收藏:
0 评论:
0 赞:
0 阅读:
491
今天研究了一下十字链表,当稀疏矩阵的内部元素经常变化时,用三元顺序表操作起来比较麻烦,故用链表来实现对稀疏矩阵的存储,由于矩阵具有二维特性,单链表显然不适用,采用十字链表来实现对稀疏矩阵的存储。
十字链表有三种结点,1.总表头结点 2.行列表头结点 3.非零元素结点。下面一一介绍
1.总表头结点
共有5个子域
Row
Col
Next
...
分类:
其他 时间:
2015-06-04 22:54:30
收藏:
0 评论:
0 赞:
0 阅读:
439
问题描述:
SQL进行IN查询时出现:java.sql.SQLException: ORA-01795: 列表中的最大表达式数为 1000
解决办法:
问题原因是:SQL进行IN查询时,IN中的数据量不能超过1000条。
例如:select * from student where id in (‘S1’,'S2'...........)
如果in后面数据量过多的话就会报错。
...
分类:
其他 时间:
2015-06-04 22:54:10
收藏:
0 评论:
0 赞:
0 阅读:
1416
有时遇到一种情况,.ShowDialog()不显示,也不报错;如下:
private void button1_Click(object sender, EventArgs e)
{
Thread thread = new Thread(show);
thread.Start();
}
void sh...
分类:
其他 时间:
2015-06-04 22:54:00
收藏:
0 评论:
0 赞:
0 阅读:
499
因项目缘故需重新定制SwitchButton,效果如下:
过程如下:
1.圆角矩形的绘制
2.字体绘制
3.小圆绘制
4.左右滑动动画效果绘制
代码如下:
package com.smart.view;
import java.util.Timer;
import java.util.TimerTask;
import android.annotation.Suppre...
分类:
其他 时间:
2015-06-04 22:53:50
收藏:
0 评论:
0 赞:
0 阅读:
582
Mathematically some problems look hard. But with the help of the computer, some problems can be easily solvable.In this problem, you will be given two integers a and b. You have to find the summation o...
分类:
其他 时间:
2015-06-04 22:53:10
收藏:
0 评论:
0 赞:
0 阅读:
294
Description
We say that integer x, 0 < x < p, is a primitive root modulo odd prime p if and only if the set { (xi mod p) | 1 <= i <= p-1 } is equal to { 1, …, p-1 }. For example, the consecutive power...
分类:
其他 时间:
2015-06-04 22:52:40
收藏:
0 评论:
0 赞:
0 阅读:
395
Description
Given n, a positive integer, how many positive integers less than n are relatively prime to n? Two integers a and b are relatively prime if there are no integers x > 1, y > 0, z > 0 such t...
分类:
其他 时间:
2015-06-04 22:52:00
收藏:
0 评论:
0 赞:
0 阅读:
362
题意:
给出一个数字D
我们可以选择1-D中可以被D整除的数字,然后用D出得到一个新的数字D1;
然后在找所有D1的因子,用D1除,直到得到1;
问除的次数的期望值;
思路:
d[i] 代表从i除到0的期望步数;那么假设i一共有c个因子(包括1和本身)
d[i] = ( d[1] + d[a2] + d[a3] + d[a4] ..... + d[i] + c) / c; (...
分类:
其他 时间:
2015-06-04 22:51:54
收藏:
0 评论:
0 赞:
0 阅读:
316
Problem Description
The inversion number of a given number sequence a1, a2, ..., an is the number of pairs (ai, aj) that satisfy i aj.
For a given sequence of numbers a1, a2, ..., an, if we mov...
分类:
其他 时间:
2015-06-04 22:51:20
收藏:
0 评论:
0 赞:
0 阅读:
299
一、DLL中类的导出
在类名称前增加 _declspec(dllexport)定义,例如:
class _declspec(dllexport) CMath{
....
};
通常使用预编译开关切换类的导入导出定义,例如:
#ifdef DLLCLASS_EXPORTS
#define EXT_CLASS _declspec(dllexport)
//DLL
#else
...
分类:
其他 时间:
2015-06-04 22:50:20
收藏:
0 评论:
0 赞:
0 阅读:
219
打开word时,出现“向程序发送命令时出现问题”的解决方法
本人用的是Windows 7的系统,这几天开word的时候,出现无法打开的问题,最后的提示框是“向程序发送命令时出现问题”。上网查看之后,发现是模板文件Normal.dot出错,在关闭word时,在word中的插件都要往Normal.dot中写东西,如果产生冲突,Normal.dot就会出错,导致下一次启动word时,只能以安...
分类:
其他 时间:
2015-06-04 22:49:50
收藏:
0 评论:
0 赞:
0 阅读:
289
本文是在学习中的总结,欢迎转载但请注明出处:http://blog.csdn.net/pistolove/article/details/46366207
Description:
Count the number of prime numbers less than a non-negative number, n.
思路:
(1)题意为给定整数n,求解n以内的整数中有多少个素数(质数)。
(2)该题涉及到数学相关的知识。首先,看下素数的定义:质数(prime...
分类:
其他 时间:
2015-06-04 22:49:41
收藏:
0 评论:
0 赞:
0 阅读:
329