//1:字节 byte//1024b = 1kb [千字节]//1024kb = 1mb [兆字节]//1024mb = 1gb [吉字节]//1024gb = 1tb [梯]//1024tb = 1pb //1:创建大小为1024字节缓冲区var buf1 = Buffer.alloc(1024) ...
分类:
其他好文 时间:
2017-08-10 10:15:32
阅读次数:
101
mxnet/src/storage/cpu_device_storage.h 通过两个名字空间 mxnet 和 storage 定义了CPUDeviceStorage类,然后在其中定义了两个静态函数 Alloc 和 Free 负责申请CPU内存,内存是按照 alignment_=16 对齐的 用 宏 ...
分类:
Web程序 时间:
2017-08-08 13:58:23
阅读次数:
178
mxnet/src/storage/gpu_device_storage.h 同cpu_device_storage.h 类似通过两级命名空间 mxnet 和 storage 定义了类 GPUDeviceStorage ,内部有两个静态成员函数 Alloc 和 Free 其实现通过调用CUDA AP ...
分类:
Web程序 时间:
2017-08-08 13:48:43
阅读次数:
237
NSMutableAttributedString *text = [[NSMutableAttributedString alloc] initWithString: [NSString stringWithFormat:@"%@", kRealName]]; [text setYy_color:... ...
分类:
移动开发 时间:
2017-08-08 11:05:39
阅读次数:
513
// 借鉴网络资源- (void)viewDidLoad { [super viewDidLoad]; UILabel * lb = [[UILabel alloc]initWithFrame:CGRectMake(10, 100, self.view.bounds.size.width-20, 1... ...
分类:
移动开发 时间:
2017-08-07 15:20:59
阅读次数:
218
UIToolbar *keyboardDoneButtonView = [[UIToolbar alloc] init]; [keyboardDoneButtonView sizeToFit]; UIBarButtonItem *doneButton = [[UIBarButtonItem allo ...
分类:
其他好文 时间:
2017-08-07 12:01:00
阅读次数:
116
//加入一个图片 UIImageView *imageview = [[UIImageView alloc]init]; imageview.frame = CGRectMake(10, 100, 300, 300); imageview.contentMode = UIViewContentMod ...
分类:
其他好文 时间:
2017-08-05 17:54:52
阅读次数:
116
#include #define NULL 0 #define ALLOCSIZE 1000 //最大存储数量 char allocbuf[ALLOCSIZE]; //定义一个存储区 char * palloc = allocbuf; //palloc总是指向存储区中第一个可用的地址 int mai... ...
分类:
其他好文 时间:
2017-08-04 13:44:08
阅读次数:
288
直接上代码: //UISegmentedControl 对象的创建 //參数为数组,数组为字符串数组,表示各个分段的标题。数组的对象个数确定了分段个数。 UISegmentedControl *segmentControl = [[UISegmentedControl alloc] initWith ...
分类:
其他好文 时间:
2017-08-02 22:15:07
阅读次数:
128
1. malloc,calloc,realloc,free属于C函数库,而new/delete则是C++函数库; 2. 多个-alloc的比较: alloc:唯一在栈上申请内存的,无需释放; malloc:在堆上申请内存,最常用; calloc:malloc+初始化为0; realloc:将原本申请 ...
分类:
其他好文 时间:
2017-08-01 20:52:14
阅读次数:
165