[上海] Android 小伙伴一起来 51offer 玩吧

国内留学行业整体上还是一个传统中介行业,51offer 致力于让人们更方便的通过互联网留学。
留学学生和留学学校虽然五花八门,但既有的留学流程大体一致,相应的盈利模式也比较清晰。但与之对应的如何切实通过产品降低留学门槛,在更多的学生与学校之间建立便利的联系,还有很多好玩的事情可以做。
在互联网留学这一块,51offer 目前可以算国内第一,同时身为一个互联网从业者客观来说,这个行业各公司产品、技术各方面还非常烂(包括我们 51offer)。

要做的事情很多,要决定不做的事情更多,要把不好变好的事情也有不少。
如果你愿意挑战既有现状,喜欢用聪明的方式把事情做好,最好再对这个教育细分领域感兴趣,让我们一起来做些有意义的事。

本人曾铭,ID: mithvv,目前负责公司移动团队。丁香园和百姓网的工作经历让我相信小而扁平的团队组织更加高效。如果前几天耗子和玉伯你站在耗子的一方,嗯,你会喜欢我们目前的合作方式。(ಥ_ಥ,想说玉伯也是我非常尊敬的前辈,他的观点适合支付宝……)

公司状况

  • 刚过 B 轮,两年内完成 5000 万美元融资,自身盈利也一直很好,生死存亡的问题你暂时不用担心
  • 我们基本不加班甚至很难让你加班,因为我们所有的加班(以小时计)都可以调休。我个人是每周三调休带孩子玩,周日上一天班 ;)
  • 公司在上海火车站边上,地铁出站过个路口就到(下雨天忘带伞问题都不大)
  • 技术团队人数目前 50+,谨慎扩张中
  • 技术语言各端不同。后端主要是 Java(大部分),搜索 C++,爬虫 Python,前端和移动各公司应该区别不大,移动这边 Swift 正在一起学习,计划 2.0 正式版出来后用到产品中

招聘要求(不罗列每个职位的技术细节了,意义不大)

  • 招 Android、Java、前端工程师,是工程师或者攻城狮,不招码农
  • 至少作为主程参与过一个产品的完整开发过程
  • 会或者可以快速学会 git,这样我们能快速在 Github 上玩起来
  • 有经验或者了解持续集成、自动化测试及其意义,这样我们在如何快速开发上比较容易达成一致
  • 能把一个技术点用自己的语言阐述清楚,我们的周技术分享期待你的 ShowTime
  • 加分项
    • 践行开源
    • 能跟产品从产品角度阐述清楚技术逻辑
    • 有稳定维护的 Blog 或 Github 帐号
    • 能自由访问国际互联网(如果不会我们教你,这点其实也必备)
    • 对技术有热情,(比如上面一些条件你并不完全满足,但你自认思路清晰,学习能力强,就是要来面一面。我们非常非常欢迎对技术有热情的你!)

薪资待遇

  • 整体 10k - 20k 之间,具体面议,牛人没法封顶

你都看到这了,简历快发给我吧: ming.z[at]51offer.com (24 小时内必有反馈哦)
有意聊天者时间你定,地点我定(工作忙,上海火车站附近即可),咖啡我请 ;)

原始链接:51offer-blog

简单谈谈计算机网络

##计算机网络安全

2015网络安全事件

  • 携程网内部员工误删除代码 网站整体宕机12小时
  • 支付宝机房电缆被挖断 部分区域服务中断
  • 网易骨干网遭攻击 百万用户无法打游戏
  • 海康威视被黑客植入代码 导致被远程监控

敏感数据(账号、密码等)

  • 账号密码(post明文显示)
  • 重要资源数据(防爬虫)
  • 多重账号威胁(网络账号通用)
  • 通讯协议破解(iMessage)

网络传输加密

  • 数据加密算法

    • 对称式加密技术 (加密-解密)
      • DES(Data Encryption Standard)

        数据加密标准,速度较快,适用于加密大量数据的场合。

      • 3DES(Triple DES)

        是基于DES,对一块数据用三个不同的密钥进行三次加密,强度更高。

      • AES(Advanced Encryption Standard)

        高级加密标准,是下一代的加密算法标准,速度快,安全级别高;

- 非对称式加密技术(公钥-私钥)
    - RSA
    >是一个支持变长密钥的公共密钥算法,需要加密的文件块的长度也是可变的;
    - DSA(Digital Signature Algorithm)
    >数字签名算法,是一种标准的 DSS(数字签名标准);
    - ECC(Elliptic Curves Cryptography)
    >椭圆曲线密码编码学。

- 散列算法 (不可逆)
    - MD5(Message Digest Algorithm 5)
    >是RSA数据安全公司开发的一种单向散列算法,非可逆,相同的明文产生相同的密文。
    - SHA(Secure Hash Algorithm)
    >可以对任意长度的数据运算生成一个160位的数值;

3个著名加密算法(MD5、RSA、DES)的解析

简单加密演示

  • 简单位移式加密(经典:凯撒加密)
1
2
3
4
5
6
“恺撒密码”据传是古罗马恺撒大帝用来保护重要军情的加密系统。它是一种替代密码,通过将字母按顺序推后起3位起到加密作用,
如将字母A换作字母D,将字母B换作字母E。据说恺撒是率先使用加密函的古代将领之一,因此这种加密方法被称为恺撒密码。
假如有这样一条指令:
RETURN TO ROME
用恺撒密码加密后就成为:
UHWXUA WR URPH
  • 置换加密
1
2
3
4
5
6
7
8
9
10
11
12
令明文m=m1,m2,...mL。令置换矩阵所决定的置换为pi,则加密置换c=Ek(m)=(c1,c2,...cL)=mpi(1),mpi(2),...,mpi(L)
解密置换
d=Dk(c)=(cn^-1(1),cn^-1(2),...cn^-1(L))
例,置换密码。给定明文为the simplest possible transposition ciphers,
将明文分成长为L=5的段,
m1=thesi, m2=mples m3=tposs m4=iblet,
m5=ransp, m6=ositi m7=oncip m8=hersx
最后一段长不足5,加添一个字母x。将隔断的字母序号按下述置换矩阵进行换位:
Ek= 0 1 2 3 4
3 0 4 2 1
得到密文如下
STIEH EMSLP STSOP EITLB SRPNA TOIIS IOPCN SHXRE

研发路上的那些事儿

心酸研发路 - 杨志平

  • 大版本发布周期过长(原因:团队专业有限,探索前进,频繁修改),导致没有什么机会思考、设计,人也拖的身心疲惫
  • 引入架构思想,软件质量提高。后期频繁加入改动,冲淡架构
  • 老板干涉过多 导致:压力过大 质量无法保证
  • 老板高度重视UI

用 travis-ci 自动部署 hexo 静态博客

各种静态博客引擎中,hexo 已经算比较方便,hexo deploy --generate 一条命令搞定部署工作。

我们团队成员在写静态博客的时候,碰到一些情况想把这一步也省掉:

  • 本地没装 hexo,只想写篇文章就 push
  • push 都不想,只在 github 上修改文章内容
  • 我就是懒,一行 deploy 命令也懒得打

……也都挺有道理。我们看看怎么用 travis-ci 搞定 hexo 自动部署。

实现

hexo 的作者写了篇文章介绍了自动部署,请参考这里

  • 设置 deploy key
1
2
3
4
5
6
ssh-keygen -t rsa -C "your_email@example.com"
# 注意指定 file_key,此处为 travis_key, passphrase 为空
# 之后会生成 travis_key 和 travis_key.pub 两个文件, 把 travis_key.pub 设置到 https://github.com/settings/ssh 中
travis encrypt-file travis_key --add
# 这里会生成 travis_key.enc 文件,同时在 .travis.yml 中新增 openssl 一行
  • 设置 .travis.yml, 附上最终配置
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
language: node_js
node_js:
- '0.12'
before_install:
- npm install hexo -g
# config for `hexo deploy`
- openssl aes-256-cbc -K $encrypted_4dbc5423f685_key -iv $encrypted_4dbc5423f685_iv
-in .travis/travis_key.enc -out ~/.ssh/id_rsa -d
- chmod 600 ~/.ssh/id_rsa
- eval $(ssh-agent)
- ssh-add ~/.ssh/id_rsa
- cp .travis/ssh_config ~/.ssh/config
- git config --global user.name "travis_bot"
- git config --global user.email "mithvv@gmail.com"
script:
- hexo generate
- hexo deploy
branches:
only:
- blog
  • https://travis-ci.org 网站启用对应项目
  • 之后每次有新的 push 或 pull-request,travis-ci 都会自动 build,根据 build log 调试
  • Build Status 加到项目介绍中,Enjoy!

一些 tips

  • repo-setting 中设置 default branch 为 blog,这样访问项目首页直接显示源文件
  • 注意开源项目不要提交 travis_key & travis_key.pub 文件 ;)
  • travis-ci 每次 build 前自动 clone(参见 build log),所以我认为 hexo 作者配置中的 git clone 是不必要的

扯扯线程并发和同步的那些事

###iOS多线程 - 杨志平

####简介

iOS有三种多线程编程的技术,分别是:

  • NSThread

  • Cocoa NSOperation

  • GCD (全称:Grand Central Dispatch)

这三种编程方式从上到下,抽象度层次是从低到高的,抽象度越高的使用越简单,也是Apple最推荐使用的

三种方式的介绍:

NSThread - 文档

优点:NSThread 比其他两个轻量级
缺点:需要自己管理线程的生命周期,线程同步。线程同步对数据的加锁会有一定的系统开销

NSOperation - 文档

优点:不需要关心线程管理,数据同步的事情,可以把精力放在自己需要执行的操作上。
创建NSOperation子类的对象,把对象添加到NSOperationQueue队列里执行。

GCD - 文档

Grand Central Dispatch (GCD)是Apple开发的一个多核编程的解决方法。在iOS4.0开始之后才能使用。GCD是一个替代诸如NSThread, NSOperationQueue, NSInvocationOperation等技术的很高效和强大的技术。

GCD的底层依然是用线程实现,不过这样可以让程序员不用关注实现的细节。

创建线程的开销 - 查看文档

Item Approximate cost Notes
Kernel data structures Approximately 1 KB This memory is used to store the thread data structures and attributes, much of which is allocated as wired memory and therefore cannot be paged to disk.
Stack space 512 KB (secondary threads) 8 MB (OS X main thread) 1 MB (iOS main thread) The minimum allowed stack size for secondary threads is 16 KB and the stack size must be a multiple of 4 KB. The space for this memory is set aside in your process space at thread creation time, but the actual pages associated with that memory are not created until they are needed.
Creation time Approximately 90 microseconds This value reflects the time between the initial call to create the thread and the time at which the thread’s entry point routine began executing. The figures were determined by analyzing the mean and median values generated during thread creation on an Intel-based iMac with a 2 GHz Core Duo processor and 1 GB of RAM running OS X v10.5.

替代线程的一些技术

Item Approximate cost
Operation objects Introduced in OS X v10.5, an operation object is a wrapper for a task that would normally be executed on a secondary thread. This wrapper hides the thread management aspects of performing the task, leaving you free to focus on the task itself. You typically use these objects in conjunction with an operation queue object, which actually manages the execution of the operation objects on one or more threads.For more information on how to use operation objects, see Concurrency Programming Guide.
Grand Central Dispatch (GCD) Introduced in Mac OS x v10.6, Grand Central Dispatch is another alternative to threads that lets you focus on the tasks you need to perform rather than on thread management. With GCD, you define the task you want to perform and add it to a work queue, which handles the scheduling of your task on an appropriate thread. Work queues take into account the number of available cores and the current load to execute your tasks more efficiently than you could do yourself using threads.For information on how to use GCD and work queues, see Concurrency Programming Guide
Idle-time notifications For tasks that are relatively short and very low priority, idle time notifications let you perform the task at a time when your application is not as busy. Cocoa provides support for idle-time notifications using the NSNotificationQueue object. To request an idle-time notification, post a notification to the default NSNotificationQueue object using the NSPostWhenIdle option. The queue delays the delivery of your notification object until the run loop becomes idle. For more information, see Notification Programming Topics.
Asynchronous functions The system interfaces include many asynchronous functions that provide automatic concurrency for you. These APIs may use system daemons and processes or create custom threads to perform their task and return the results to you. (The actual implementation is irrelevant because it is separated from your code.) As you design your application, look for functions that offer asynchronous behavior and consider using them instead of using the equivalent synchronous function on a custom thread
Timers You can use timers on your application’s main thread to perform periodic tasks that are too trivial to require a thread, but which still require servicing at regular intervals. For information on timers, see Timer Sources
Separate processes Although more heavyweight than threads, creating a separate process might be useful in cases where the task is only tangentially related to your application. You might use a process if a task requires a significant amount of memory or must be executed using root privileges. For example, you might use a 64-bit server process to compute a large data set while your 32-bit application displays the results to the user

线程安全 - 文档

原则
  • Immutable objects are generally thread-safe. Once you create them, you can safely pass these objects to and from threads. On the other hand, mutable objects are generally not thread-safe. To use mutable objects in a threaded application, the application must synchronize appropriately.
  • Many objects deemed “thread-unsafe” are only unsafe to use from multiple threads. Many of these objects can be used from any thread as long as it is only one thread at a time. Objects that are specifically restricted to the main thread of an application are called out as such
  • The main thread of the application is responsible for handling events. Although the Application Kit continues to work if other threads are involved in the event path, operations can occur out of sequence
  • If you want to use a thread to draw to a view, bracket all drawing code between the lockFocusIfCanDraw and unlockFocus methods of NSView
Thread-Safe Classes and Functions

The following classes and functions are generally considered to be thread-safe. You can use the same instance from multiple threads without first acquiring a lock.

NSArray
NSAssertionHandler
NSAttributedString
NSCalendarDate
NSCharacterSet
NSConditionLock
NSConnection
NSData
NSDate
NSDecimal functions
NSDecimalNumber
NSDecimalNumberHandler
NSDeserializer
NSDictionary
NSDistantObject
NSDistributedLock
NSDistributedNotificationCenter
NSException
NSFileManager (in OS X v10.5 and later)
NSHost
NSLock
NSLog/NSLogv
NSMethodSignature
NSNotification
NSNotificationCenter
NSNumber
NSObject
NSPortCoder
NSPortMessage
NSPortNameServer
NSProtocolChecker
NSProxy
NSRecursiveLock
NSSet
NSString
NSThread
NSTimer
NSTimeZone
NSUserDefaults
NSValue

Thread-Unsafe Classes

The following classes and functions are generally not thread-safe. In most cases, you can use these classes from any thread as long as you use them from only one thread at a time.

NSArchiver
NSAutoreleasePool
NSBundle
NSCalendar
NSCoder
NSCountedSet
NSDateFormatter
NSEnumerator
NSFileHandle
NSFormatter
NSHashTable functions
NSInvocation
NSJavaSetup functions
NSMapTable functions
NSMutableArray
NSMutableAttributedString
NSMutableCharacterSet
NSMutableData
NSMutableDictionary
NSMutableSet
NSMutableString
NSNotificationQueue
NSNumberFormatter
NSPipe
NSPort
NSProcessInfo
NSRunLoop
NSScanner
NSSerializer
NSTask
NSUnarchiver
NSUndoManager

#####Main Thread Only Classes

The following class must be used only from the main thread of an application.

NSAppleScript

代码开发效率提升方法

2015.06.19 - 技术分享,主题”代码开发效率提升方法”

snippet的制作与使用 - 杨志平

#####备份路径

~/Library/Developer/Xcode/UserData/CodeSnippets/

#####界面
image

#####使用

1.系统自带

很多我们的代码提示都是snippet系统已经有的代码块如:
block变量定义

typedef <#returnType#>(^<#name#>)(<#arguments#>);

2.常用变量
  • strong
  • weak
  • assign
  • block
3.常用方法
  • 比如:hiddenKeyBoard
  • 网络请求:getData
  • 上下拉刷新,等等
4.常用模块
  • 常用的代理协议方法集

#####制作
选中代码块拖入snippet library即可。为了方便调用可简单编辑

image2

#####PaintCode的简单使用

简单的图形绘制,可像xib一样拖拽图形,并添加到view的CALayer层上

  • drawRect方法

如何推广自己的开源项目

如何推广自己的开源项目(github获取更多的star) - 杨志平

####前言
你可能花费几天甚至几个月时间开源一个你写的代码,但是没有人去使用它,靠运气的话可能可以推广. 现在我讲讲如何让人们关注我们的作品。该要点是打破下面的图片的循环

图片一

###六步(4-6是秘诀)

  1. Projects are Everything
  • Read and Research
  • Building the Repo
  • README 文件
  • 图解
  • 更新反馈

###1.Projects are Everything
开源代码就是给其他程序员解决问题或者节约时间的

###2.Read and Research
很多问题都已经解决成千上万次了
你可以想一个你感兴趣的开源项目,上网搜索确认它的实现是不是已经有很多人实现了并有很多人已经使用它了,那就忘了这个想法。但是如果没有,或者解决方案不理想(可以通过issues查看他们的不足)你有时间的话就建一个和他们相识的开源项目,修复一些issues使用自己的文档(感觉有点无耻,但听说很有效)

##3.Building the Repo
有一点就是,通常我们后面的repo的star增加速度比以前的repo要快挺多的,可能是以前的repo使得更多人认识你相信你。

###4.README 文件(推荐布局方案)

图片2

###5.图解(特效,一目了然)

Flipboard playing multiple GIFs

###6.更新反馈
完成以上步骤,并不断更新开源库及时解决issues里面的bug就很有希望进入
star趋势
图片2
贡献名人
图片2

博客分享

2015.06.05 - 博客分享

####博客框架与网站&&博客推荐 - 杨志平

常见博客框架
常见iOS开发博客网站

游戏开发

游戏(APP)开发学习网站小游戏分享 - 杨志平

包含最新的iOS技术、最新语言等教程

随便提一下程序员学习利器 Codecademy 免费, 起码做的比MOOC好