1.拓展方法是一种特殊的静态方法 2.拓展方法必须在静态类中定义 3.拓展方法的优先级必须低于同名的类方法 4.拓展方法只能在特定的命名空间有效 5.除非必要不要滥用扩展方法 namespace ConsoleApplication1{ class Program { static void Mai ...
分类:
Web程序 时间:
2016-04-16 21:05:22
阅读次数:
126
1#include<stdio.h>
2#include<pthread.h>
3#include<stdlib.h>
4void*thread(void*arg)
5{
6intcount=5;
7while(count--)
8{
9printf("thisisthread,%u\n",pthread_self());
10sleep(1);
11}
12//return(void*)3;
13//pthread_exit((void*)3);
14//pthread_..
分类:
编程语言 时间:
2016-04-16 19:39:57
阅读次数:
196
一、系统应用在开发某些应用时,我们可能希望能够调用iOS系统内置的电话、短信、邮件、浏览器应用,或者直接调用安装的第三方应用,这个要怎么实现呢?这里统一使用UIApplication的一个对象方法来实现://打开不同的系统应用
- (void)openUrl:(NSURL *)url;那怎么区分我是要打电话还是发短信等等呢?
之前我们学习网络的时候,是不是URL最前面使用的是http://,使用本...
分类:
移动开发 时间:
2016-04-16 19:22:12
阅读次数:
283
0. 复习。
1.基本图形绘制
* 线段(线宽、线段样式)
* 矩形(空心、实心、颜色)
* 三角形、四边形等形状
1> 说明 - (void)drawRect:(CGRect)rect
什么时候调用、调用次数等
- 当 view
第一次被显示的时候调用(调用一次)
- 或者是重绘事件被触发的时候
...
分类:
移动开发 时间:
2016-04-16 19:11:03
阅读次数:
199
异常:异常是导致程序中断运行的一种指令流,如果不对异常进行正确处理,则可能导致程序的中断执行,造成不必要的损失,所以在程序的设计中必须考虑各种异常的发生,并正确的做好相应的处理,这样才能保证程序的正常运行。
进行异常处理的目的?
public class ExceptionDemo01{
public static void main(String args[]){
System...
分类:
编程语言 时间:
2016-04-16 19:01:01
阅读次数:
264
1 const int N=1e6+11; 2 int p[N],pr[N],cnt; 3 void init() 4 { 5 for(int i=2;i<N;i++) 6 { 7 if(!p[i]) pr[++cnt]=i; 8 for(int j=1;j<=cnt&&i*pr[j]<N;j++) ...
分类:
其他好文 时间:
2016-04-16 12:33:23
阅读次数:
162
static void Main(string[] args) { int meili = 0; string diyitixuanze=""; int a = 5; int b = 3; int c = 1; Console.WriteLine("第一题:假如世界末日来临,你只能解救一种动物,你会 ...
分类:
其他好文 时间:
2016-04-16 12:25:11
阅读次数:
142
1 public void systemScan(){ 2 sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse( "file://" 3 + Environment.getExternalStorageDirectory() ...
分类:
其他好文 时间:
2016-04-16 12:23:50
阅读次数:
114
@interface people : NSObject -(void)eat; +(void)eat; @end @implementation people -(void)eat { NSLog(@"我是被类的实例调用-方法"); } +(void)eat { NSLog(@"我是被类调用的+方 ...
分类:
其他好文 时间:
2016-04-16 12:20:31
阅读次数:
147
#include<pthread.h>
#include<iostream>
usingnamespacestd;
intglobal=0;
#defineNUMTHREADS2
pthread_mutex_tmutexnum;
structthread_data{
intidx;
};
structthread_datathread_data_array[NUMTHREADS];
void*assign_value(void*param){
structthread_da..
分类:
编程语言 时间:
2016-04-16 11:02:51
阅读次数:
121