Date
May. 19th, 2024
 
2024年 4月 12日

Posts Archived at 2014 #1

A Developer's Faux Pas
Dec
27
100 个 iOS 开发/设计面试题,你将如何作答
Published 12:12 Dec 27, 2014 by @ezra.
#Programming# 常见问题 你昨天/这周学习了什么? 你为什么热衷于软件开发? 你对哪一种控制系统比较熟悉? 是否参与过GitHub项目? 是否参与过GitHub或其他同类型网站的iOS开源项目? ...
Dec
25
OS X : 制作系统安装盘
Published 12:12 Dec 25, 2014 by @ezra.
#Programming# 本文主要介绍用终端制作 OS X 安装 U 盘的方法。 下载安装器 首先你需要在 Mac App Store 下载 OS X 系统,下载完成之后你可以在 /Applications 路径下找到它。 准...
Dec
23
Xcode : 修改新创建文件的默认注释
Published 12:12 Dec 23, 2014 by @ezra.
#Programming# 通常我们在 Xcode 中新建源代码文件,会有一些自动生成的注释,他们形如下面这样: // // AppDelegate.m // Spyhole // // Created by Meniny...
Dec
12
Git: .DS_Store
Published 12:12 Dec 12, 2014 by @ezra.
#Version Control# .DS_Store 是个很烦人的家伙, 在使用版本控制工具时, 我们都希望能忽略它的存在, 不过在每一个仓库中都设置一次好像更烦人, 那现在我们想办法一次性解决这个问题吧: vi ~/.gitigno...
Dec
01
iOS: Carthage Useage
Published 12:12 Dec 01, 2014 by @ezra.
#Programming# Carthage:去中心化的Cocoa依赖管理器 Cocoa的依赖管理器,我们已经有了CocoaPods,非常好用,那么为什么还要创建这样一个项目呢?本文翻译自Carthage的Github的READ...
Nov
22
OS Implementation
Published 12:11 Nov 22, 2014 by @ezra.
#Programming# Bootloader 我们知道计算机启动是从BIOS开始,再由BIOS决定从哪个设备启动以及启动顺序,比如先从DVD启动再从硬盘启动等。计算机启动后,BIOS根据配置找到启动设备,并读取这个设备的第0...
Nov
20
UNIX/Linux : ranger
Published 12:11 Nov 20, 2014 by @ezra.
#Technology# ranger 是一款终端文件管理工具,它和大部分同类工具类似,除了它是左右结构。 在使用之前,你可能需要下载。 下载完成后,以 Ubuntu 为例,cd 到文件目录,执行 tar xvf ranger...
Nov
20
iOS: 用 Runtime 实现全局 NSCopying
Published 12:11 Nov 20, 2014 by @ezra.
#Programming# 给每个类手动添加 NSCopying 支持真的很累, 干脆一次性解决吧: #import <Foundation/Foundation.h> @interface MXObject : ...
Nov
16
iOS: UIView 绘制圆角矩形
Published 12:11 Nov 16, 2014 by @ezra.
#Programming# 绘制圆角矩形: @implementation UIView (Draw) void CGContextAddRoundRect(CGContextRef __nullable c, CGRect ...
Nov
12
iOS: UIImage gauss blur
Published 12:11 Nov 12, 2014 by @ezra.
#Programming# 为 UIImage 生成高斯模糊效果: - (UIImage *)gaussBlurWithLevel:(CGFloat)blurLevel { blurLevel = MIN(1.0, MA...
Nov
12
iOS: UIImage 获取主色调
Published 12:11 Nov 12, 2014 by @ezra.
#Programming# 获取一个 UIImage 实例的主色调: // @implementation UIImage (Detector) - (UIColor *)mainColor { #if __IPHONE_OS...
Nov
06
Difference between enum and NS_ENUM in Objective-C
Published 12:11 Nov 06, 2014 by @ezra.
#Programming# First, NS_ENUM uses a new feature of the C language where you can specify the underlying type for an...
Nov
02
Git : 基本指令
Published 12:11 Nov 02, 2014 by @ezra.
#Version Control# 这一篇简单介绍下 Git 中基本的指令。 基本指令 git status: 查看 Git 文件状态,在Git 中文件有三种状态: Untracked: 未追踪 Tracked & ...
Oct
31
数据结构与算法 11: 哈希表
Published 12:10 Oct 31, 2014 by @ezra.
#Programming# 什么是哈希表 哈希表就是一种以 键-值(key-indexed) 存储数据的结构,我们只要输入待查找的值即key,即可查找到其对应的值。 哈希的思路很简单,如果所有的键都是整数,那么就可以使用一个简单...
Oct
20
iOS: HTML 转 NSAttributedString
Published 12:10 Oct 20, 2014 by @ezra.
#Programming# 将 HTML 代码转换成属性文字, 其实很简单: - (NSAttributedString *)attributedStringFromHTML { NSData *data = [self...
Oct
20
iOS: NSLayoutConstraint 动画
Published 12:10 Oct 20, 2014 by @ezra.
#Programming# 直接上代码: // @implementation NSLayoutConstraint (Animation) - (void)setConstant:(CGFloat)constant anima...
Oct
20
iOS: NSString 替换 Unicode 字符
Published 12:10 Oct 20, 2014 by @ezra.
#Programming# 将 NSString 中的 Unicode 字符替换为 UTF-8 字符: - (NSString *)stringByReplacingUnicodeWithUTF8 { NSString ...
Oct
15
OS X: 制作 U 盘安装盘
Published 12:10 Oct 15, 2014 by @ezra.
#Programming# 总有人问怎么用 U 盘安装 OS X 系统,写个博客吧以后可以直接发链接了。 如何安装 首先打开终端,替换并输入下面这条指令: sudo createinstallmedia文件路径 --volume...
Oct
14
RegEx Implementation
Published 12:10 Oct 14, 2014 by @ezra.
#Technology# 实现正则表达式的想法很早就有,各种原因导致没有做,最近花了点时间先实现了几个简单的正则语法,分别是concatenation、alternation和closure,其他语法及metacharacte...
Oct
14
iOS 小知识: App Store Link
Published 12:10 Oct 14, 2014 by @ezra.
#Programming# 介绍一些 iOS 小知识。 直接在 App Store 打开应用页面而不跳转 Safari 打开链接时将 https:// 换成 itms-apps:// 即可。 附上 iTunes Link Mak...
Oct
14
iOS 小知识: KVC 与 简单集合运算符
Published 12:10 Oct 14, 2014 by @ezra.
#Programming# 介绍一些 iOS 小知识。 KVC 与简单集合运算 也就是 @sum、@avg、@count、@max、@min 这五个家伙,分别表示和、平均值、计数、最大值,最小值。 举个栗子: NSArray *...
Oct
14
iOS 小知识: UITableView 收起键盘
Published 12:10 Oct 14, 2014 by @ezra.
#Programming# 介绍一些 iOS 小知识。 UITableView 收起键盘 可能很多用用过 [self.view endEditing:YES]; 这句代码,但对于 UITableView 还有更好的选择: tab...
Oct
14
iOS 小知识: URL 脱义
Published 12:10 Oct 14, 2014 by @ezra.
#Programming# 介绍一些 iOS 小知识。 URL 脱义 适用于 URL 中包含中文、其他 URL 或 URL 关键字的情况: NSString *newURL = (NSString *)CFBridgingRe...
Oct
14
iOS 小知识: 为 UIView 设置图片
Published 12:10 Oct 14, 2014 by @ezra.
#Programming# 介绍一些 iOS 小知识。 给 UIView 设置图片 方法一 UIImage *image = [UIImage imageNamed:@"<#Your Image#>&q...
Oct
14
iOS 小知识: 去除 NSString 两端空白与空行
Published 12:10 Oct 14, 2014 by @ezra.
#Programming# 介绍一些 iOS 小知识。 去除 NSString 两端空白与空行" 去除两端空格 [string stringByTrimmingCharactersInSet:[NSCharacterSet ...
Oct
14
iOS 小知识: 忽略编译器警告
Published 12:10 Oct 14, 2014 by @ezra.
#Programming# 介绍一些 iOS 小知识。 忽略警告 废弃 #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdepre...
Oct
14
iOS 小知识: 模拟 Home 键点击
Published 12:10 Oct 14, 2014 by @ezra.
#Programming# 介绍一些 iOS 小知识。 模拟 Home 键单击 [[UIApplication sharedApplication] performSelector:@selector(suspend)]; 注意...
Oct
14
iOS 小知识: 汉字转拼音
Published 12:10 Oct 14, 2014 by @ezra.
#Programming# 介绍一些 iOS 小知识。 汉字转拼音 @interface NSString (MandarinLatin) - (NSString *)stringByReplacingMandarinToLat...
Oct
14
iOS 小知识: 生成随机浮点数
Published 12:10 Oct 14, 2014 by @ezra.
#Programming# 介绍一些 iOS 小知识。 生成随机浮点数 定义宏 #define ARC4RANDOM_MAX 0x100000000。 使用 arc4random() 来获取 0 ~ 100 的浮点数了: dou...
Oct
14
iOS 小知识: 获取网页内容高度
Published 12:10 Oct 14, 2014 by @ezra.
#Programming# 介绍一些 iOS 小知识。 获取 Web 页面内容高度 利用 JavaScript 来实现,一般写在 UIWebView 代理中。 - (void)webViewDidFinishLoad:(UIWe...
Oct
14
iOS 小知识: 防止锁屏
Published 12:10 Oct 14, 2014 by @ezra.
#Programming# 介绍一些 iOS 小知识。 防止锁屏 [[UIApplication sharedApplication] setIdleTimerDisabled:YES];...
Oct
09
iOS apps and the Open Source they use
Published 12:10 Oct 09, 2014 by @ezra.
#Programming# I've compiled a list of six popular iPhone apps and the iOS Open Source Software they use. I've also...
Sep
25
如何在 Github 搭建静态博客
Published 12:09 Sep 25, 2014 by @ezra.
#Programming# 其实最初做这个博客,可能是因为我暗藏了一颗文青的心,后来老有人问我博客怎么做的,想来想去干脆写个教程好了。 引言 这样的博客系统适合哪些人群呢? 不想、或者不愿意租用服务器 不想、或者不熟悉后端代码...
Sep
20
iOS: 获取应用版本
Published 12:09 Sep 20, 2014 by @ezra.
#Programming# 获取 iOS 应用版本信息: - (NSString *)applicationVersion { return [[[NSBundle mainBundle] infoDictionary]...
Sep
16
UNIX/Linux Command: find
Published 12:09 Sep 16, 2014 by @ezra.
#Technology# find 是 UNIX/Linux 系统中用于查找档案的命令,这里我们来看一下它的用法和相关选项。 命令用法 `find path -option [ -print ] [ -exec -ok com...
Sep
15
reStructuredText 怎么玩
Published 12:09 Sep 15, 2014 by @ezra.
#Mark-up# 其实之前写过一篇 关于 AsciiDoc 的博文,其中提到过 reStructuredText ,最近赋闲,有朋友问了我关于 reStructuredText 的问题,于是也就有了写这篇语法入门的念头...
Sep
13
Markdown Syntax
Published 12:09 Sep 13, 2014 by @ezra.
#Mark-up# Markdown是一种可以使用普通文本编辑器编写的标记语言,通过类似HTML的标记语法,它可以使普通文本内容具有一定的格式。 Markdown具有一系列衍生版本,用于扩展Markdown的功能 (如表...
Sep
12
Cocoa/Cocoa Touch: Hex Color
Published 12:09 Sep 12, 2014 by @ezra.
#Programming# 将 Hex 颜色 (例如 #ffffff) 转换为 UIColor/NSColor, 以 UIColor 举例: 我们通过分类方式实现: @implementation UIColor (MXColo...
Sep
12
iOS: Copy UIColor
Published 12:09 Sep 12, 2014 by @ezra.
#Programming# UIColor 实例默认是不支持 copy 操作的, 但有时候我们还是需要这样的操作, 怎么实现呢? // @implementation UIImage (Copying) + (UIImage *...
Sep
11
iOS : lldb 浅析
Published 12:09 Sep 11, 2014 by @ezra.
#Programming# 做 iOS 开发的小伙伴们肯定对 gdb 和 lldb 不陌生,即便你不知道它是什么。 概念 lldb 都是 Xcode 中的调试器工具,如果你使用的是 Xcode 5 (或是 4.3,记不清了)以后...
Sep
08
Swift 学习资源
Published 12:09 Sep 08, 2014 by @ezra.
#Programming# 本文罗列了一些比较好的 Swift 学习资源。 苹果公司在WWDC 2014上宣布了他们将会推出一款新的编程语言,面向iOS和OS X系统的开发人员,这个新的语言被命名为Swift。 Swift在i...
Sep
01
NULL、0 与 nullptr
Published 12:09 Sep 01, 2014 by @ezra.
#Programming# C的NULL 在C语言中,我们使用NULL表示空指针,也就是我们可以写如下代码: int *i = NULL; foo_t *f = NULL; 实际上在C语言中,NULL通常被定义为如下: #d...
Aug
17
Haskell
Published 12:08 Aug 17, 2014 by @ezra.
#Programming# Haskell有不少让人开阔思路的东西,也有不少看起来很美好,用起来不错,但是读起来费劲的东西。 data, type, newtype Haskell里面用data来定义数据类型,它可以是这样: d...
Aug
03
C 语言 12 个有趣的面试题
Published 12:08 Aug 03, 2014 by @ezra.
#Programming# 12个C语言面试题,涉及指针、进程、运算、结构体、函数、内存,看看你能做出几个! 1.gets()函数 问:请找出下面代码里的问题: #include <stdio.h> int main...
Aug
02
Ruby : 常用哈希方法
Published 12:08 Aug 02, 2014 by @ezra.
#Programming# 一 给Hash添加默认值 : h= {1,2,3,4} #=> {1 => 2,3 => 4} h.default =7 h[1] #=> ...
Jul
20
Linux: 2>&1
Published 12:07 Jul 20, 2014 by @ezra.
#Technology# intro 我们在linux下经常会碰到nohup command>/dev/null 2>&1 &这样形式的命令。首先我们把这条命令大概分解下首先就是一个nohup表示当...
Jul
13
Xcode: TODO 的实现
Published 12:07 Jul 13, 2014 by @ezra.
#Programming# 自从 Xcode Ghost 事件之后苹果就开始收缩插件功能了, 直到现在的 Xcode 已经去掉了旧形式的插件。 安全性在很大程度上算是提高了, 但是也随之带来一些不便, 比如之前不能再使用 TOD...
Jul
12
Android : Layout 基础
Published 12:07 Jul 12, 2014 by @ezra.
#Programming# 好像一直都没有系统的写过 Android 方面的博客,就先从布局开始吧,介绍一些布局属性。 主要的布局方式有: LinearLayout RelativeLayout FrameLayou...
Jul
01
常用汉字简繁对照表
Published 17:07 Jul 01, 2014 by @ezra.
#Culture# 简体 繁体 简体 繁体 一 一 七 七 万 萬 丈 丈 三 三 上 上 下 下 不 不 与 ...
Jun
30
Solarized Cheatsheet
Published 12:06 Jun 30, 2014 by @ezra.
#Desiging# I’ve been enjoying Ethan Schoonover’s Solarized Color Scheme. However, when setting up various progr...
Jun
12
UNIX/Linux: Signals
Published 12:06 Jun 12, 2014 by @ezra.
#Technology# The signals of UNIX/Linux systems: |Signal|Description| |SIGABRT|由调用 abort 函数产生,进程非正常退出| |SIGALRM|用 ...
May
12
C : 浮点数
Published 12:05 May 12, 2014 by @ezra.
#Programming# 其实浮点数的精度缺失应该是个众所周知的问题,而我第一次注意到这件事还是在学生时代,跟随着社会的洪流涌入了 J2EE 的学习热潮中,在一次使用 JavaScript 的过程中出现曾让我无比震惊的一幕: ...
Apr
20
Programming in Clojure 001 : 简介
Published 12:04 Apr 20, 2014 by @ezra.
#Programming# Clojure 是一种 Lisp 方言,属于函数式语言的范畴(主流的函数式语言有 Clojure , Common Lisp , Erlang , F# , Haskell , ML , OCaml ...
Apr
20
Programming in Clojure 002 : 语法糖
Published 12:04 Apr 20, 2014 by @ezra.
#Programming# 现在,如果你真的有兴趣,可能已经迫不及待想要学习 Clojure 的语法了,下面我们再来列举一些 Clojure 的语法糖吧: 作用 语法糖 对应函数 ...
Apr
20
Mac: 注册全局热键
Published 12:04 Apr 20, 2014 by @ezra.
#Programming# 使用 Cocoa 为应用注册热键, 首先需要引入 Carbon.framework, 并包含头文件。 #import <Carbon/Carbon.h> 接下来, 要做两件事, 注册热...
Apr
16
HTML color codes and names
Published 12:04 Apr 16, 2014 by @ezra.
#Programming# Color Name Color Code Red ...
Apr
07
__block directive, a simple explanation
Published 12:04 Apr 07, 2014 by @ezra.
#Programming# Nowadays, if you pass a variable inside a block and try to assign a new value to it, you will encoun...
Mar
21
Python : tree
Published 12:03 Mar 21, 2014 by @ezra.
#Programming# 用 Python 实现一个 tree 指令的模拟,后面有时间再做优化: import os def main(): while True: path = input('Inp...
Mar
20
Python : Calculator
Published 12:03 Mar 20, 2014 by @ezra.
#Programming# 用 Python 实现一个 GUI 计算器的基本思路,后面有时间会添加更高级的计算功能: from __future__ import division import ui shows_result ...
Mar
16
iOS: XCTest
Published 12:03 Mar 16, 2014 by @ezra.
#Programming# XCode自带的单元测试工具已经从OCUnit演变到了XCTest,但其本质还是差不多的,其好处在于XCode集成,简单方便在XCode5中新建一个工程的时候,会默认带一个用于单元测试的target,...
Mar
16
iOS: 测试 View Controllers
Published 12:03 Mar 16, 2014 by @ezra.
#Programming# 我们不是迷信测试,但它应该帮助我们加快开发进度,并且让事情变得更有趣。 让事情保持简单 测试简单的事情很简单,同样,测试复杂的事会很复杂。就像我们在其他文章中指出的那样,让事情保持简单小巧总是好的。除...
Mar
08
Git Workflow
Published 12:03 Mar 08, 2014 by @ezra.
#Technology# 1. 序 这篇指南以大家在 SVN 中已经广为熟悉使用的集中式工作流作为起点, 循序渐进地演进到其它高效的分布式工作流, 还介绍了如何配合使用便利的 Pull Request 功能, 系统地讲解了各种...
Mar
03
Optimizing NSPredicates
Published 12:03 Mar 03, 2014 by @ezra.
#Programming# This week I'm gonna throw three strategies you can use to improve the performance of your NSPredicat...
Feb
17
Game of Life Cellular Automata
Published 12:02 Feb 17, 2014 by @ezra.
#Programming# For this week I want to share a concept and an example repository of something called Cellular Autom...
Feb
02
Easier debugging using breakpoints with actions
Published 12:02 Feb 02, 2014 by @ezra.
#Programming# If you debug solely through NSLog you are missing the better insight the debugger can provide you. A...
Feb
02
Scheme 字符串操作总结
Published 12:02 Feb 02, 2014 by @ezra.
#Programming# 字符串操作是任何一门编程语言中最常用的操作之一,Scheme 也提供了一系列 procudure 来操作字符串。 1、字符串的比较,分别有string=?、string>?、string<...
Jan
22
SBCL with CodeRunner
Published 12:01 Jan 22, 2014 by @ezra.
#Programming# Lisp 是继 FORTRAN 之后历史最悠久的高级语言,作为一名括号爱好者,我简单说明一下在 CodeRunner 中运行 Lisp 的方法,由于 Lisp 分支、实现、方言众多,我们选择其中一个 ...
Jan
20
Xcode: LLVM Error
Published 12:01 Jan 20, 2014 by @ezra.
#Programming# 在使用Xcode5进行iOS7开发时,在打开SDK文件后,可能会不小心对其中的代码进行了一些操作,那么在下一次 Build 或者 Run 的时候就会出现类似以下的错误: After modifying...
Prev
1 2 3 4 5 6
Next
Prev
1 2 3 4 5 6
Next
Pinned Message
HOTODOGO
I'm looking for a SOFTWARE PROJECT DIRECTOR / SOFTWARE R&D DIRECTOR position in a fresh and dynamic company. I would like to gain the right experience and extend my skills while working in great teams and big projects.
Feel free to contact me.
For more information, please view online résumé or download PDF
本人正在寻求任职 软件项目经理 / 软件技术经理 岗位的机会, 希望加⼊某个新鲜⽽充满活⼒的公司。
如有意向请随时 与我联系
更多信息请 查阅在线简历下载 PDF