// 学校演讲比赛.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // #include "pch.h" #include #include "string" #include "vector" #include "algorithm" #include "functio... ...
分类:
其他好文 时间:
2019-03-30 18:36:45
阅读次数:
183
// 面试题38:字符串的排列 // 题目:输入一个字符串,打印出该字符串中字符的所有排列。例如输入字符串abc, // 则打印出由字符a、b、c所能排列出来的所有字符串abc、acb、bac、bca、cab和cba。 #include void Permutation(char* pStr, ch... ...
分类:
其他好文 时间:
2019-03-09 15:27:00
阅读次数:
187
获取 nginx 镜像 docker search nginx docker pull nginx 使用nginx镜像开启 nginx 应用容器 docker run -d --name nginx -p 8080:80 -v /tmp:/usr/share/nginx/html docker.io ...
分类:
Web程序 时间:
2019-02-27 01:37:44
阅读次数:
508
//创建队列 NSOperationQueue *queue = [[NSOperationQueue alloc]init]; //封装操作 NSBlockOperation *op1 = [NSBlockOperation blockOperationWithBlock:^{ NSLog(@"1 ...
分类:
其他好文 时间:
2019-02-23 01:16:26
阅读次数:
190
//创建队列 NSOperationQueue *queue = [[NSOperationQueue alloc]init]; //封装操作 NSBlockOperation *op3 = [NSBlockOperation blockOperationWithBlock:^{ NSLog(@"执 ...
分类:
编程语言 时间:
2019-02-23 00:57:57
阅读次数:
182
首先看个产生死锁的代码-(void)syncMain{ //获得主队列 dispatch_queue_t queue = dispatch_get_main_queue(); NSLog(@"start"); //同步函数 dispatch_sync(queue, ^{ NSLog(@" %@",[ ...
分类:
其他好文 时间:
2019-02-19 22:23:29
阅读次数:
222
1、类前缀说明 公司专用前缀:Le 个人类前缀:CH 功能模块专用前缀:Ble(蓝牙) 渠道化专用类:Chan 代码变动专用标志:Chsign 2、文件夹划分 2.1 ApplicationEntry 包含全局通用宏、应用架构方式和程序入口部分代码。 全局通用宏LeBLE.pch: 主要表现为.pc ...
分类:
其他好文 时间:
2019-02-18 13:01:43
阅读次数:
401
多条线程抢夺同一资源时,经常需要加锁,保证同一时间只能有一条线程操作一个资源。 同步锁就是互斥锁 格式:@synchronized (token) { } token:锁对象,要使用全局的对象,建议使用self {} 要加锁的代码段 注意点:加多把锁是无效的。 要注意加锁的位置。 互斥锁的优点: 能 ...
分类:
编程语言 时间:
2019-02-16 00:00:31
阅读次数:
279
一、添加一个图层 添加图层的步骤: 1.创建layer 2.设置layer的属性(设置了颜色,bounds才能显示出来) 3.将layer添加到界面上(控制器view的layer上) 二、添加一个显示图片的图层 代码示例: 执行效果: 说明:在第27行设置需要显示的图片,注意,这里用的是UIImag ...
分类:
移动开发 时间:
2019-02-05 20:56:06
阅读次数:
248