Giter Club home page Giter Club logo

interview's Issues

当重载父类中的属性时,父类和子类均会生成 set 和 get 方法

https://github.com/HIT-Alibaba/interview/blob/master/source/iOS/ObjC-Basic/Class.md#synthesize-和-dynamic 中提到 “当重载父类中的属性时,也必须手动写 synthesize”,但是,通过查看 Xcode 7.0 编译下面的代码,却发现 “当重载父类中的属性时,父类和子类均会生成 setNamename 两个方法”

@interface Father : NSObject

@property NSString *name;

@end

@implementation Father

@end

@interface Son : NSObject

@property NSString *name;

@end

@implementation Son

@end

dispatch_async 阻塞的是当前所在队列 还是队列中线程?

###并发编程案例4中代码: 点击查看代码

NSLog(@"1"); // 任务1
dispatch_async(dispatch_get_global_queue(0, 0), ^{
    NSLog(@"2"); // 任务2
    dispatch_sync(dispatch_get_main_queue(), ^{
        NSLog(@"3"); // 任务3
    });
    NSLog(@"4"); // 任务4
});
NSLog(@"5"); // 任务5

案例的分析结果是: 1最先执行;2和5顺序不一定;4一定在3后面;
我的疑问是如果说4一定在3后面,那么是否能够说明 dispatch_async 阻塞的是当前所在队列;内部的dispatch_sync在阻塞的并发队列的情况下才有可能4一定在3后面,因为任务2,任务4,和同步派发(dispatch_sync)可能分配到不同线程中执行;如果阻塞的是线程,那么任务3和任务4执行的顺序就不一定了. @skyline75489

###这个问题也可以这样描述:

为什么在global中 任务2, dispath_asyn, 任务4,不是放在不同不同的线程中并行执行的?.

Tanks in advance.

冒泡排序代码j的上界错了

source/basic/algo/Sorting.md

目前是

for (var j = 0; j < array.Length - 1; j++)

但应该是

for (var j = 0; j < array.Length - 1-i; j++)

HTTP的生命周期

HTTP的生命周期是shen me gui
我今天就被问到了。。当时我就懵逼了。。
快加进去吧以免学弟们也挂在这里

The AlertDialog pops up is doesn't call onPause method

Android Document:
void onPause ()
Called as part of the activity lifecycle when an activity is going into the background, but has not (yet) been killed. The counterpart to onResume().

When activity B is launched in front of activity A, this callback will be invoked on A. B will not be created until A's onPause() returns, so be sure to not do anything lengthy here.

Android开发-Android基础-Activity/Service生命周期
onPause方法中说到:AlertDialog等弹出窗口时它(Activity)处于暂停状态。只是new出来的对话框是不会调用onPause方法的。

TLS应该是非对称加密算法

HTTP over TLS 这一节中原文

从上面的过程可以看到,TLS 的完整过程需要三个算法(协议),密钥交互算法,对称加密算法,和消息认证算法(TLS 的传输会使用 MAC(message authentication code) 进行完整性检查)。

TLS应该是一种非对称加密算法。
参考资料: TLS/SSL

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.