2016/1/20 周三

今天


今天早起很累,昨晚应该充足运动在睡觉的
我的工作碎片化严重
我的工作是创造性工作。碎片化正常
重复性劳动,碎片化小
长期坚持,可以有效干掉碎片化

打扫3

  1. 早上
    1.1 收拾了办公桌
    1.2 下午刷了茶壶,倒了水

电话4

晚上用iPad和爸爸妈妈视频通话,爸爸傻傻的想去放回放,有点心酸

晚饭23

早餐:牛奶 面包 鸡蛋
晚饭:公司食堂

运动23


环腰:64*2

投篮:64

数据结构23


排序算法习题课
八大排序算法

  1. 插入排序
  2. 希尔排序
  3. 选择排序
  4. 冒泡排序
  5. 归并排序
  6. 快速排序
  7. 堆排序
  8. 基数排序

查找算法

  1. 折半查找
  2. 索引查找
  3. 哈希查找
  4. 二叉树查找

**26课 图的深度遍历 **

  1. 深度遍历
    1.1 可以类比于树的先根序遍历
    1.2 遍历过需要标记


    先根遍历,深度遍历
  2. 面向对象
    2.1 图的每个节点并不复杂
    2.2 用递归的方式走下去。
  3. 深度遍历(递归的实现)
    3.1 根-0 —— 根-1 —— 根2 —— 根1 —— 根3 —— 根1 ——根4


    2016/1/20 周三_第1张图片
    img_0432.png

    3.2 图的表示,邻接矩阵


    2016/1/20 周三_第2张图片
    img_0433.png

    3.3 代码实现
    2016/1/20 周三_第3张图片
    img_0435.png

IOS 10


2课 常量变量

  1. 常量声明: let
  2. 变量声明:var

PS:决定换掉关东升,讲的太水了……

GCD 1课 串行队列与并发队列

  1. 课程概要
    1.1 GCD串行队列与并发队列
    1.2 GCD延时执行
    1.3 GCD线程组
    1.4 GCD定时器
    1.5 GCD信号量
    1.6 GCD综合使用

  2. 串行,并行,UI
    2.1 串行队列,一次只执行一个线程,按照添加队列的顺序
    2.2 并行队列,一次可以执行多个线程,没有固定顺序
    2.3 UI界面所在界面是串行队列

  3. 相关英文概念
    3.1 FIFO:先进先出
    3.2 serial:连续
    3.3 Queue:队列
    3.4 Dispatch:调度
    3.5 conCurrent:并行

  4. 串行队列


    2016/1/20 周三_第4张图片
    串行队列
  5. 并行队列


    2016/1/20 周三_第5张图片
    并行队列
  6. UI在串行队列

- (void)viewDidLoad {
    [super viewDidLoad];
    //执行串行队列
    [self serialQueue];
    //执行并行队列
    [self initConCurrent];

}

//串行队列
- (void)serialQueue
{
    // 创建队列
    GCDQueue *queue = [[GCDQueue alloc]initSerial];
    
    [queue execute:^{
        NSLog(@"1");
    }];
    
    [queue execute:^{
        NSLog(@"2");
    }];
    
    [queue execute:^{
        NSLog(@"3");
    }];
    
    [queue execute:^{
        NSLog(@"4");
    }];
    
    [queue execute:^{
        NSLog(@"5");
    }];
}

- (void)initConCurrent
{
    // 创建队列
    GCDQueue *queue = [[GCDQueue alloc]initConcurrent];
    
    [queue execute:^{
        NSLog(@"1");
    }];
    
    [queue execute:^{
        NSLog(@"2");
    }];
    
    [queue execute:^{
        NSLog(@"3");
    }];
    
    [queue execute:^{
        NSLog(@"4");
    }];
    
    [queue execute:^{
        NSLog(@"5");
    }];
}

- (instancetype)initSerial {
    
    self = [super init];
    if (self) {
        //创建,顺序,调度队列
        self.dispatchQueue = dispatch_queue_create(nil, DISPATCH_QUEUE_SERIAL);
    }
    return self;
}

- (instancetype)initConcurrent {
    self = [super init];
    if (self) {
        self.dispatchQueue = dispatch_queue_create(nil, DISPATCH_QUEUE_CONCURRENT);
    }
    return self;
}

/*!
 * @const DISPATCH_QUEUE_SERIAL
 * @discussion A dispatch queue that invokes blocks serially in FIFO order.
 * 先进先出的顺序
 */
#define DISPATCH_QUEUE_SERIAL NULL
- (void)execute:(dispatch_block_t)block {
    // 异常处理
    NSParameterAssert(block);
    dispatch_async(self.dispatchQueue, block);
}

/*!
 * @typedef dispatch_block_t
 *
 * @abstract
 * The type of blocks submitted to dispatch queues, which take no arguments
 * and have no return value.
 *
 * @discussion
 * When not building with Objective-C ARC, a block object allocated on or
 * copied to the heap must be released with a -[release] message or the
 * Block_release() function.
 *
 * The declaration of a block literal allocates storage on the stack.
 * Therefore, this is an invalid construct:
 * 
 * dispatch_block_t block;
 * if (x) {
 *     block = ^{ printf("true\n"); };
 * } else {
 *     block = ^{ printf("false\n"); };
 * }
 * block(); // unsafe!!!
 * 
 *
 * What is happening behind the scenes:
 * 
 * if (x) {
 *     struct Block __tmp_1 = ...; // setup details
 *     block = &__tmp_1;
 * } else {
 *     struct Block __tmp_2 = ...; // setup details
 *     block = &__tmp_2;
 * }
 * 
 *
 * As the example demonstrates, the address of a stack variable is escaping the
 * scope in which it is allocated. That is a classic C bug.
 *
 * Instead, the block literal must be copied to the heap with the Block_copy()
 * function or by sending it a -[copy] message.
 */
typedef void (^dispatch_block_t)(void);

/*!
 * @function dispatch_async
 *
 * @abstract
 * Submits a block for asynchronous execution on a dispatch queue.
 *
 * @discussion
 * The dispatch_async() function is the fundamental mechanism for submitting
 * blocks to a dispatch queue.
 *
 * Calls to dispatch_async() always return immediately after the block has
 * been submitted, and never wait for the block to be invoked.
 *
 * The target queue determines whether the block will be invoked serially or
 * concurrently with respect to other blocks submitted to that same queue.
 * Serial queues are processed concurrently with respect to each other.
 *
 * @param queue
 * The target dispatch queue to which the block is submitted.
 * The system will hold a reference on the target queue until the block
 * has finished.
 * The result of passing NULL in this parameter is undefined.
 *
 * @param block
 * The block to submit to the target dispatch queue. This function performs
 * Block_copy() and Block_release() on behalf of callers.
 * The result of passing NULL in this parameter is undefined.
 */
#ifdef __BLOCKS__
__OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_4_0)
DISPATCH_EXPORT DISPATCH_NONNULL_ALL DISPATCH_NOTHROW
void
dispatch_async(dispatch_queue_t queue, dispatch_block_t block);
- (void)viewDidLoad {
    [super viewDidLoad];
    
    [GCDQueue executeInGlobalQueue:^{
        // 子线程——业务逻辑
        // 如果在这里写了UI,因为是串行,会卡界面
        
        [GCDQueue executeInMainQueue:^{
            // 主线程——更新UI
        }];
    }];
}

+ (void)executeInMainQueue:(dispatch_block_t)block {
    
    NSParameterAssert(block);
    dispatch_async(mainQueue.dispatchQueue, block);
}

+ (void)executeInGlobalQueue:(dispatch_block_t)block {
    
    NSParameterAssert(block);
    dispatch_async(globalQueue.dispatchQueue, block);
}

+ (void)initialize {
    if (self == [GCDQueue self])  {
        
        mainQueue                     = [GCDQueue new];
        globalQueue                   = [GCDQueue new];
        highPriorityGlobalQueue       = [GCDQueue new];
        lowPriorityGlobalQueue        = [GCDQueue new];
        backgroundPriorityGlobalQueue = [GCDQueue new];
        
        mainQueue.dispatchQueue                     = dispatch_get_main_queue();
        globalQueue.dispatchQueue                   = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
        highPriorityGlobalQueue.dispatchQueue       = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0);
        lowPriorityGlobalQueue.dispatchQueue        = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0);
        backgroundPriorityGlobalQueue.dispatchQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0);
    }
}

读书 15


2016/1/20 周三_第6张图片
言不及义,好行小惠
2016/1/20 周三_第7张图片
有远虑,无近忧
2016/1/20 周三_第8张图片
在其位谋其政,不在其位不谋其政
2016/1/20 周三_第9张图片
治国之法
2016/1/20 周三_第10张图片
工欲善其事,必先利其器

克己 16


自胜者强

碎片化工作思考


  1. 我的工作总是充满了碎片
    1.1 看NBA
    1.2 刷
    1.3 编程
    1.4 聊QQ
    1.5 写博客
    1.6 学IOS开发
  2. 碎片化的课程
    2.1 网络一些视频课程,碎片化严重
    2.2 一节课程一般都是15分钟以内,少的甚至3分钟
    2.3 接受效果超好
  3. 把工作也变成碎片好了
    3.1 分解
    3.2 不用整个的去完成,碎片化好了
    3.3 领导要的时候,碎片化终结
  4. 笛卡尔方法论
    4.1 不相信
    4.2 碎片化——递归,直到可以解决
    4.3 解决
    4.4 整体化碎片
  5. 学习的碎片化
    5.1 碎片化
    5.2 学习
    5.3 整体
  6. 竞技的碎片化
    6.1 打台球,碎片化
  7. 数学的碎片化
    7.1 微分
    7.2 积分

你可能感兴趣的:(2016/1/20 周三)