超级磁场怪 / Super BT (1)

我们来学校的时刻,遇到了超级磁场怪。当然咯,这个名字也是事后我们给他取的,起初我们也什么都不知道。

那天早上,我当面握着小美的手,我激动死了。我跟她说,“小美,做我女朋友好吗?”

她的脸都涨红了。我沿着那束急切而又试图收敛的目光,看到她睁大的眼睛。

“小美,好吗?”

可是我什么都听不到,我只看到她的嘴巴张了张。面前蒙了层类似热气流的物质,你知道的,透过火焰的上方,就可以看到那种空气略微扭曲的样子。

Continue reading “超级磁场怪 / Super BT (1)”

Machine Learning in iOS

Part 1: Freud the Swift ML Library

Part 2: Core ML, Shazam for Images

Pt. 1: Freud the Swift ML Library

Freud is a Swift (3) machine-learning library dedicated to Sigmund Freud. This Library is implemented under the ‘Ego’ philosophy.

The ego attempts to mediate between id and reality.

Swift has been my favorite programming language of all time since the day Apple released it and playing with Swift is my daily joy. Last year when I was browsing GitHub I came across this project Swift AI by Collin Hundley and decided to try it out because everyone is crazy about it. Later I found out that Swift AI is in Swift 2.2 and by then Swift 3 had been out for months already. I could not compile it of course.

Continue reading “Machine Learning in iOS”

Logic of Peek and Pop in 3D Touch

Logic of Peek and Pop in 3D Touch

TL, DR

In 2015 Apple introduced 3D Touch. Before that there was already Force Touch on Apple Watch and MacBook Pro. Although both “touch” are techniques that make the touchscreen force-sensitive, 3D Touch on iPhone 6s / 7 are in a way of a higher dimension. 3D Touch is sensitive to continuous force changes, while Force Touch is discrete. With 3D Touch coming with new iOS devices, UIKit evolved too. A new way of interaction was introduced, which we’re going to talk about, that is, Peek and Pop.

Continue reading “Logic of Peek and Pop in 3D Touch”

Daedalus, A MineSweeper Game Built w/ Qt

Daedalus

A MineSweeper Game built with Qt

中文版

Build & Run

  • Qt 5.7 or later
  • C++ 11
  • macOS Sierra (Build Target is currently macOS and if you want to run it on Windows or Linux, just modify the .pro file a little bit)

About Daedalus

Daedalus is a MineSweeper game. People have been playing MineSweeper for ages. Most people believe that Microsoft created it while actually it dates back to the 1960s. After years of evolution, the MineSweeper in Windows 10 App Store has got a completely new look, however its rules remain the same:

Continue reading “Daedalus, A MineSweeper Game Built w/ Qt”

Swifty-Klotski – an iOS Game w/ AI Built In

Swifty-Klotski

A Klotski game with a powerful searching AI built in, completely implemented in Swift.

About Klotski

Klotski (华容道 in Chinese), is a sliding block puzzle with special layouts of 10 different blocks and the aim of Klotski is to move a specific block, aka, CaoCao, to some predefined location.

We built Swifty-Klotski in which an AI can automatically search for feasible solutions to a layout.

Continue reading “Swifty-Klotski – an iOS Game w/ AI Built In”

一种孤独(零)

春天一过,夏天就会马上到来。陆衍这样想着,脱掉了外套。那是一件黑色的外套,摸起来很软,他们说他穿上去会显白,像高中生。此时那件外套随意地蜷在办公桌上,在窗外阳光下像一个燥热的影子。

他现在穿的是一件白色的棉质短袖,一条深灰色的运动裤和一双橘红色的跑鞋。他看了看时间,指针在表盘上嘀嗒地走着,离下课还有三十分钟。他决定出去跑一跑。

天空的颜色是蓝的,蓝得太饱以致让人感到胀鼓鼓的疼痛。阳光被聚焦在新翻的草地上,进行着灼热的扫视。一群草籽在地皮下偷着挠痒拔节。一路跑来,草汁润湿了陆衍的鞋尖。不断地有人和他错过,喊,陆老师好!并同时留下汗味、香水味、洗衣粉味、泥土味……各种气味都沿着草尖树干、叶脉血管纷纷从世界的孔洞里跑出来,歪歪扭扭地、扶着热空气向上攀爬,然后在上面汇成一片。

Continue reading “一种孤独(零)”

Brainfuq, a Brainfuck Interpreter

Brainfuq, an interpreter for the language Brainfuck built with ANTLR

Build & Run

There are currently no ready-to-use executable binary now but it’s coming soon.

  • Download jars of ANTLR 4 and Commons IO and add them to your Java $CLASSPATH
  • git clone https://github.com/allenx/Brainfuq
  • cd Brainfuq && javac *.java and then you’re good to go.
  • Use the convinient scripts to run our interpreter: brainfuck to interpret a brainfuck file, and brainfucki to enter the magnificent Brainfuck REPL.

There are a few interesting demos in ./BrainfuckDemo/, and you can just try them out.

Continue reading “Brainfuq, a Brainfuck Interpreter”

iOS 组暑假学习计划

Study Guide for the iOS team @twtstudio in the summer of 2016

暑假的学习主要集中在新语言、iOS SDK 的学习、已有项目的阅读

  • Swift 3.0
  • 「微北洋」 /「 问津」 源代码
  • KVO
  • M-V-C
  • 3rd-Party Repositories on GitHub

Swift 3.0

https://swift.org

Swift 是 Apple 为了取代 Objective-C 而开发的语言,不同于 Objective-C,Swift 是完全开源的,目前可以在 OS X 和 Linux 内核操作系统中编译与运行。「微北洋」与「问津」目前都在逐渐转向 Swift 开发。Swift 实战演练将是我们暑假学习计划的核心。

Continue reading “iOS 组暑假学习计划”