Posts

PlanForMe | iOS app

Image
PlanForMe, the iOS app I've been developing for the past few weeks, is now available on the app store!  The official description is: PlanForMe is an automated assistant that optimizes and organizes your schedule for you. It makes planning your day quick and easy, whether you have a lot of overlapping events or just want to prioritize your meetings and activities.   You can:    Order your events by priority    Sort events into "Must do", "Would like to do", and "Don't want to do" categories    PlanForMe:    Integrates with your calendars   Creates your plan for the day, taking into account each event's category and priority     Just tap a button to add the plan to your calendar! I've wanted to create an app like this ever since the start of last fall semester, when my calendar was double, triple, and quadruple booked with meetings, events, classes, parties...

Firebase Presentation

Posting the slides from my presentation about Firebase to the Haystack Group here!

iMessage bug fixed!

Image
This post is just a quick update on the bug I found in iMessage during WWDC a few weeks ago. (UIViews were disappearing in my iMessage app when a user cancels sending a message and transitions back into the expanded view. An Apple engineer told me this was because they were doing some hacky things with Auto Layout and view controllers.) The issue's now fixed in the latest version of iOS 10 beta! (You can find iOS 10 beta 2 at https://developer.apple.com/download/ ) Status: Closed :) 

LevelDB

I've been playing with the LevelDB library recently, so I took some time digging around its source code (https://github.com/google/leveldb) and reading articles/papers. In this post, I’m going to share some things related to LevelDB that I most enjoyed learning about. If you don’t know much about LevelDB, here’s a quick overview: LevelDB is a C++ library that stores key value pairs of byte arrays sorted by key. Operations include Put(key, value), Get(key) and Delete(key). It’s called LevelDB because it is arranged by levels: cache, log, level 0, level 1, level 2 … In general, after Level x reaches a limit of 10^x MB, one of its files gets compacted (merged periodically) into Level x+1. Level 0 is a special level: when it hits its limit of 4 files, at least one of its file gets compacted into Level 1. Furthermore, the files in Level 0 can contain overlapping keys, whereas the keys in the files in the other levels cannot. One of the things that interested me was the underlying d...

iMessage Apps: A More In-Depth Look

Image
This post includes some FAQs about iMessage and tips for developers who are interested in building interactive iMessages and iMessage apps. Click here for an overview of the additions to the iMessage app and WWDC 2016 in general. What does using an iMessage app look like?  Users get to your app by swiping through their Messages App Drawer   They can see both compact and expanded views of your app, and have the ability to switch between the two whenever they want. (You are provided with willTransition and didTransition methods, which you can override to be prepared when users switch between the presentation styles.) Compact view Expanded view How can people get my iMessage app? From the app store dedicated to iMessage apps - your iMessage app doesn't need to be attached to a separate full app.  If someone's friend sends them an iMessage through your app, they will see a link at the bottom of the iMessage where they can download your app.  ...

WWDC 2016

Image
I just wrapped up my second year at WWDC! It was great meeting so many people, making new friends, and talking to Apple engineers in the labs. Some things I thought were especially noteworthy: iMessage . Apple completely revamped their iMessage app to include recorded handwritten messages that you can play back, bubble and screen effects, music sharing, reactions, and more emphasis on emoji, including suggestions and 3x larger sizes. However, I'm most excited about iMessage apps! Not only can non-programmers now quickly make sticker packs without writing a single line of code, but also developers can create interactive iMessages. People can download these apps from an app store in their iMessage apps. Furthermore, the messages can be saved in sessions, so people can save screen space - this is especially useful in group chats. For example, in Apple's demo iMessage app, you see just the final ice cream and the history ("we added scoops") instead of a bunch of...

Fast Fibonacci

My 6.006 TA mentioned a quick way to calculate the nth Fibonacci number that I thought was really cool! It's more efficient than recursion (exponential), memoization (linear), or looping through/keeping track of the previous two numbers (linear). The O(log n) method combines matrix multiplication with repeated squaring. It's based on the fact that [[1, 1], [1, 0]][a, b] = [a+b, b]. I wrote three possible methods in Python, which I copied below this post (full code on Github ). When calculating the millionth Fibonacci number, loopfib took 16.5753660202 seconds, and matrixfib took 0.820223808289 seconds, roughly 20x faster. Side note: Python automatically converts 32-bit ints to bignums, so this code can handle calculating the millionth Fibonacci number. def matrixfib(n):  a = [[1, 1], [1, 0]] t = [[1, 0], [0, 1]] b = [1, 1] while n > 0:  if n % 2 == 1: t = dot(t, a)  n /= 2 a = dot(a, a) return t[1][0]*b[0]+t[1][1]*b[1] def na...