Coach Thrasher

Thursday Sep 13, 2007

Facebook API Better Stronger Faster

Okay, I've released my "better stronger faster" Facebook API on Sourceforge for all to use. It’s code name is F8-API, and it’s available for all to download or browse from the SVN repository and try out.

A download package hasn't been released yet, as I'd rather people provide feedback to validate that a release is warranted before packaging it for distribution. Use this command to get the files from Subversion:


svn co https://f8api.svn.sourceforge.net/svnroot/f8api f8api

I had signed up as a "Facebook developer" in several of the Facebook apps tools, and received about 1 query a day from people looking to "build the next killer app". Unfortunately, I found that people tended to make the assumption that I was a college student with lots of time on my hands to do this, and I'd work for peanuts. Well, that's not the case, but I do reflect fondly on college, and I can afford my own peanuts, thank you. As I result, I decided to give away some of this love on Sourceforge, and such, the project was born.

Today the F8-API is a lightweight stateless interface to Facebook’s web services. It uses Apache HttpClient, and Log4j, and it processes data quickly through SAX parsers. It is completely functional for all API calls today, and it supports both desktop and web based Facebook applications. You can also write unit tests that will hit the live Facebook account and interact with your test environment using Maven and JUnit, for both desktop and web apps.

Hopefully people will find this useful as it is. There is some room for improvement though. The data model used by Facebook needs to be flushed out so a "higher level" API can be interfaced that will act on model objects. As an applications developer, you usually don’t want to fiddle with low level things like the transport layer of an API that you’re interfacing. So, some flushing out is needed here.

I also need to write some example code to show how easy it is to use. If you’re subscribed to my RSS feed, you’ll see the update notice posted to the feed soon.

Saturday Sep 08, 2007

Gridflip Solution

There's a fun puzzle called Grid Flip on Facebook that had me distracted for a while.

Here's my solution:

S = 1624

Which is produced by the grid:


[ 33 30 -10 -6 18 7 -11 -23 6 ] 44
[ -16 19 9 26 8 -19 8 -21 -14 ] 0
[ -17 -12 -14 -31 30 13 13 19 16 ] 17
[ 6 11 1 -17 12 -4 7 14 -21 ] 9
[ -18 31 34 22 -17 -19 -20 24 6 ] 43
[ -33 18 17 15 -31 -5 -3 27 -3 ] 2
[ 18 20 -18 -31 -6 4 2 -12 24 ] 1
[ -27 -14 4 29 3 5 29 8 -12 ] 25
[ -15 -7 23 23 -9 8 6 -8 12 ] 33
[ 33 -23 19 -4 -8 7 11 12 -31 ] 16
[ 20 -19 -15 30 -11 32 -7 14 -5 ] 39
[ 23 -18 -32 2 31 -7 -8 24 16 ] 31
[ -32 4 -10 14 6 -1 0 23 23 ] 27
[ 25 0 23 22 12 -28 -27 -15 -4 ] 8
[ -30 -13 16 -3 -3 32 -3 -27 31 ] 0
[ 22 1 -26 4 -2 13 26 -17 -14 ] 7
[ 9 18 3 20 27 -32 11 27 13 ] 96
[ 17 -33 -7 -19 32 13 31 -2 -24 ] 8
[ -31 27 31 -29 15 -2 29 15 -33 ] 22
[ 18 23 15 -28 0 30 4 12 -32 ] 42
[ 3 -34 27 25 18 26 -1 34 26 ] 124
[ 21 31 -10 13 30 -17 12 -26 31 ] 85
[ 23 -31 19 21 -17 10 2 23 -23 ] 27
[ 3 -6 0 3 32 0 10 -25 14 ] 31
[ 19 -9 14 27 -20 15 5 -27 18 ] 42
[ 11 -6 -24 7 -17 -26 20 31 25 ] 21
[ -25 4 16 30 33 -23 -4 4 -23 ] 12

60 12 105 165 166 32 142 108 22 1624


The shortest possible sequence of such calls which achieves this value S while
satisfying the non-negative property for all elements in SC and SR using
15 steps is:

flip_col(1)
flip_col(2)
flip_col(4)
flip_col(5)
flip_col(7)
flip_row(1)
flip_row(9)
flip_row(10)
flip_row(14)
flip_row(15)
flip_row(16)
flip_row(19)
flip_row(23)
flip_row(26)
flip_row(27)

Calendar

Feeds

Search

Links

Navigation

Referrers

Loading