]]>2013-01-05T00:00:00-08:00http://jasonbos.co/transcribe-featured-on-thenextweb-again-35-of-the-best-productivity-and-lifehack-apps-of-2012Quite an honor to be featured on TheNextWeb as one of the best productvity apps of 2012: http://thenextweb.com/apps/2012/12/20/35-best-productivity-apps-of-2012/5/
]]>2012-09-09T00:00:00-07:00http://jasonbos.co/two-timestamp-columns-in-mysql

Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause

I can use CURRENT_TIMESTAMP in only one place in the table. So I can’t have MySQL do what I intended it to do -
maintain two timestamps, one to store the record creation timestamp and another to store record update timestamp. So
I thought I’ll maintain those two timestamps by myself in the app. Give me two simple TIMESTAMP fields:

MySQL automatically set the first timestamp field to DEFAULT to CURRENT_TIMESTAMP and ON UPDATE to CURRENT_TIMESTAMP.
The second timestamp field was set to DEFAULT to 0. That was indeed strange.

I thought I found a bug in MySQL. But no, it turns out it is actually a feature! Actually, it’s a result of a
combination of features:

“With neither DEFAULT
CURRENT_TIMESTAMP nor ON
UPDATE CURRENT_TIMESTAMP, it is the same as specifying both DEFAULT
CURRENT_TIMESTAMP and ON
UPDATE CURRENT_TIMESTAMP.”

“It need not be the first TIMESTAMP column in a table that is automatically initialized or updated to the current timestamp. However, to specify automatic initialization or updating for a different TIMESTAMP column, you must suppress the automatic properties for the first one. Then, for the other TIMESTAMP column, the rules for the DEFAULT and ON
UPDATE clauses are the same as for the first TIMESTAMP column, except that if you omit both clauses, no automatic initialization or updating occurs.”

Infering from the above two points from the MySQL manual, if there are two (or more) TIMESTAMP fileds in a table with
no DEFAULT and ON UPDATE clauses specified, MySQL automatically defaults the first timestamp field to have a DEFAULT
CURRENT_TIMESTAMP and an ON UPDATE CURRENT_TIMESTAMP field and the rest of the timestamp fields to have a DEFAULT 0.

Now coming back to the problem at hand, I need to track the creation and update timestamps of a record. This can be
achieved using another feature:

By default, TIMESTAMP columns are NOT
NULL, cannot contain NULL values, and assigning NULL assigns the current timestamp.

So if I assign a NULL value to a NOT NULL TIMESTAMP field, it uses the current timestamp value instead! And that’ll
be my created_at field. The updated_at TIMESTAMP field can have DEFAULT CURRENT_TIMESTAMP and an ON UPDATE
CURRENT_TIMESTAMP to track the update time. So just to keep it a little more obvious I now use the following CREATE
TABLE:

]]>2012-08-15T00:00:00-07:00http://jasonbos.co/solution-nsinternalinconsistencyexception-reason-invalid-nib-registered-for-identifier-null-nib-must-contain-exactly-one-top-level-object-which-must-be-a-uitableviewcell-instanceThis seems pretty obvious now that I know it but my Google fu failed me on this one, so I thought I’ll add a note
about it should someone encounterthis issue. I was working with the TableViewController and my app would crash with
this error:

I’m using a StoryBoard and the issue is that I had more than one prototype cell visible in the table view. The error
says that there is more than 1 cell with the same
Identifier:

The solution is to set the number of Prototype Cells to the actual number of different types of cells you have (the
‘type’ being identified by the ‘identifier’). In my case, I just had 1 type of cell and so I set the number of
Prototype Cells to 1.

]]>2012-07-26T00:00:00-07:00http://jasonbos.co/twitter-has-an-issue-let-me-tweet-about-it]]>2012-05-02T00:00:00-07:00http://jasonbos.co/facebook-login-with-only-email-and-html7magicI happened to stumble on Carl’s Jr.’s Facebook page today and particularly on this post (for no particular reason, I
should add):

and I quickly noticed the login area on the top right. It only had an email field and a login button. (I was not
signed into Facebook when I visited the page.) For a brief moment I thought Facebook had finally done away with the
concept of passwords somehow!

So I clicked on the login button and it took to me the standard Facebook login page. Oh well, passwords are here to
stay.

But here’s the question: why would Facebook do this? Why would they place only an email field on that page and not a
password field? Isn’t it an extra step for users to click on the login button and then be directed to another page
to enter their password?

And then I wondered if this was a CSS issue, and looked at the source code:

And I was able to confirm that it wasn’t a CSS issue causing the password field to be hidden. There wasn’t any input
field for a password on that page.

And now I found something else that’s interesting. A class named “html7magic”. What am I to expect?! Is FB out there
using HTML 7 secretely and somehow translating their HTML7 code to HTML5 to work with current browsers?!

]]>2012-04-18T00:00:00-07:00http://jasonbos.co/scribble-joins-the-ranks-of-evernote-and-springpad-on-the-chrome-web-storeI was curious how people casually browsing through the Chrome web store would discover Scribble. And so I opened up the Chrome Web Store and browsed
through the first few tile sets of apps on the home page. I didn’t find Scribble there. Oh well, I told myself, referals from newssites, blogs
and other sites are our primary traffic source I guess.

Then I went to the Utilities section since we had posted Scribble
under the Utilities category and there it was - Scribble featured right on top of the Utilties section with the biggest banner we had
uploaded. There were three apps featured on the top in rotation:

]]>2012-04-16T00:00:00-07:00http://jasonbos.co/scribble-featured-on-pcworldExciting times as the number of Scribble users increases to 27,000! I wonder how many of those 27,000 users would pay
for a pro-version of Scribble.

5 Business-Savvy Chrome Apps

…

Still using Windows’ notepad to preserve thoughts and ideas? The horror. Scribble brings sticky notes to your
browser, complete with alarms if you have time-sensitive notes.

Even better, it works offline, so your notes are accessible even when the Internet is not.

Someone wants to hire a person to build a game similar to Pixza! I wonder why he mentions that we didn’t respond to
his attempts to get in touch with us.

“I need someone to partner with for a small project that
should not take more than 1-2 weeks (it might take longer idk)”

- How about a year and a half in the midst of undergrad college work?

Here’s wishing our dear friend all the best in his endaevor. May be, given the availability of platforms like node.js, socket.io, Pusher and Meteor today, building
Pixza from scratch might not take such a long time. We didn’t have these luxuries when we started working on Pixza.
All we had was this Richard Jones’ article to start out with.

Spawn 10 background instances of the program to see if they work in all cases

Hmmm, only one instance spews out output. Whatever happened to my other instances.

ps aux | grep java

No more instances show up

But hey look there’s another user running a similar program, using the same package name

There’s someone else doing the assignment at this hour!

I wonder who it could be?

USC campus directory -> Search for user name (from ps output) -> Get full name

Hmmm, do I know this guy?

Ctrl+T -> facebook.com

Search for full name

Hey look we have 5 mutual friends

Wonder how these guys know each other

Hey look he’s worked here here AND here!

What oh what would I have done without Facebook

Now where was I?

Oh snap, I’m writing this post.

Back to my assignment.

3.45am

]]>2012-01-12T00:00:00-08:00http://jasonbos.co/dos-attack-on-a-free-service-come-onIt’s incredibly frustrating when someone launches a DOS attack on a free service like Scribble.
Come on, we host the app and give you cloud sync for free, paying for the server resources ourselves and then
someone does this. So not cool.

Well, I guess there’s no point complaining. We’ll do our best to tackle the attack.

]]>2012-01-02T00:00:00-08:00http://jasonbos.co/prime-candidate-for-sql-injectionI happened to stumble on this site which embeds the SQL query in their URL!

As you can imagine, the first thing that occured to me was to change that SQL query to something fitting, may be
replace the SELECT query with a DELETE? Nah.. I shouldn’t be malicious I thought. And so I tried a simple UPDATE of
one of the attributes, something which if it went through, I could easily revert back and not cause any damage. And
so I tried an UPDATE query. Good for them, they atleast restricted the DB user to only perform SELECTs on the table.

Here I am thinking “I should sanitize all my input” worrying about SQL injection and stuff. And I see this. Made my
day or should I say year. Happy New Year!

]]>2011-12-18T00:00:00-08:00http://jasonbos.co/shifty-a-chrome-extension-to-edit-any-webpage-from-within-the-browserWhen Kishore and I iterate over product designs, I often
feel the need for a tool that will allow me to propose changes to a HTML mockup by simply clicking and dragging DOM
elements from within the browser, instead of taking a screen shot of the page and editing the image.

Thus was born Shifty
- a Chrome extension to move DOM elements or edit text on any webpage, from within the browser. My workflow is now
as easy as turning the extension on, moving elements around and editing text and finally taking a screenshot to
capture my changes.

]]>2011-11-18T00:00:00-08:00http://jasonbos.co/fix-slow-refresh-rate-on-hyper-v-console-running-ubuntu-10-04-ltsWhen I connect to a virtual machine running Ubuntu 10.04 LTS on Hyper-V, the refresh rate of the console used to be
terribly slow. It would refresh the screen line by line with each line taking 1 second! It was
painfully slow. So, all this while, I used putty to SSH into the VM just to avoid using the
console. And then came a situation where I locked myself out of the instance (thank you DenyHosts for doing your job well) and I
had disabled remote root login. So I was forced to use the console and it was time I find a solution for the slow refresh rate. It was quite simple:

Add the line

blacklist vga16fb

to

/etc/modprobe.d/blacklist-framebuffer.conf

and restart the virtual machine. And now the refresh rate is back to normal.

]]>2011-11-18T00:00:00-08:00http://jasonbos.co/an-old-design-of-the-apple-online-store-still-live-on-apple-comToday I had a question for Apple Sales and I googled
for “apple live chat”. The third link in my search results pointed to this page: http://www.apple.com/r/store/livechat/ -
“Apple Store - Live Chat”.

It looks like it is an old page just lying around on apple.com. Ah the classic “Mac look” back in the day. It
reminded me of the first time I saw a Mac at a design studio in a digital press when I was in 8th grade.

I tried submitting values into the form and it didn’t work. The form points to chat.info.apple.com which resolves to
17.112.147.216.

]]>2011-11-10T00:00:00-08:00http://jasonbos.co/json-formatterThis is a handy tool that I use to pretty-print JSON especially when I’m working with APIs: