January 2011
8 posts
Hacker Cup - Problem #2 - Peg Game Solution
The brute force solution solved the sample inputs in a timely manner, which should not be a surprise given that the largest grid in the test set is only 5x4. After I constructed a test set with a 100x100 matrix, things took a predictable turn for the worse. I allowed it run for 30 minutes without result, and didn’t stick around to see the final outcome. Remember, we only have 6 minutes after...
Hacker Cup - Problem #2 - Peg Game
I was saving this problem for last because I suspected it would give me the most trouble. Turns out that intuition was spot on.
Part of the problem, is that the requirements aren’t 100% clear. Read on through the Facebook problem statement and then rejoin at the bottom for my commentary.
————————
Peg Game
At the arcade, you can play a...
Hacker Cup - Double Squares - Solution
At the end of my last post, I mentioned I was going to run my code against the sample set to see if it works and then try out the worst-case dataset.
Well, it worked well against the sample and simply would not complete in the worst case because of my crappy non-algorithm. Let’s think about what I was doing wrong.
My approach was to try and sum the squares of every combination of numbers...
Hacker Cup - Problem #1 - Double Squares
Into the next one. I’m going to save the second one for last because after a brief glance it seems to be the most difficult from a logic context.
Again, straight from the FB:
———————-
Double Squares
A double-square number is an integer X which can be expressed as the sum of two perfect squares. For example, 10 is a double-square because 10 = 3^2...
Hacker Cup - Studious Student Submitted
I implemented a two-core Concurrent Sort in Java and cut the time in half to 38 seconds for the worst-case scenario. Proof positive that this is a viable avenue for tackling future sort algorithms depending on how it scales.
Soon I would like to refactor this code to use an arbitrary number of cores and allow for threshold configuration so that I wouldn’t have to spin up 8 threads just to...
Hacker Cup - Studious Student Optimization
The way this round works is that once you’ve chosen to download the Facebook-provided data, you have 6 minutes from the time of download to paste the output from your program into the Hack Cup web form.
As I mentioned in my previous post, I’m able to execute the worst-case scenario - 100 rows of 9 words of 10 characters in length - in 78 seconds. That may be fast enough for the...
1 tag
Facebook Hacker Cup - Problem #3 - Studious...
I’ve decided to start working problem #3 first… Here is the problem statement Copy & Pasted directly from the site: Studious Student
You’ve been given a list of words to study and memorize. Being a diligent student of language and the arts, you’ve decided to not study them at all and instead make up pointless games based on them. One game you’ve come up with is...
1 tag
Facebook Hacker Cup - Qualification Round →
I’ll be participating in the Qualification Round of the Facebook Hacker Cup.
They’re giving you 72 hours to work through 3 problems. In order to advance to the next round, you need only answer 1 of the problems correctly.
As I work through the problems, I’ll be posting here with live updates.
August 2009
2 posts
11 tags
Deployed Twitcaps v1.1 (Search RSS & Usability...
This deployment marks the first non-beta release of Twitcaps. Very much a non-event from a user perspective, though stability and performance have been significantly improved.
Added the ability to subscribe to RSS Feeds for a particular search. Hackable URLs for the feeds at http://twitcaps.com/rss/%QUERY_STRING%
Many little usability improvements: Twitcaps remembers your auto-refresh...
9 tags
Deployed TwitCaps v1.01b (Search Refactor)
Big release. Nothing short of a wholesale refactor of the search functionality.
Implemented robust search caching. Twitcaps should now be more resilient during times of heavy load and through variations in Twitter Search API response times. The app will now even gracefully handle and still serve results during total outages for trending and otherwise popular / recent / frequent searches.
Removed...
July 2009
3 posts
6 tags
Deployed TwitCaps v0.97b (Refresh Rework)
Implemented a new dynamic auto-refresh framework - I can now add new effects and animations for the auto-refresh mechanism without dropping code. This allows me to not only adjust the animation effect, but the number of results returned and the frequency of polling for new images. Still need to consider a cookie-based method for remembering the user’s preference for auto-refresh.
Added a...
Deployed TwitCaps v0.96b (Videos)
Added support for Videos on Twitcaps (currently only twitvid)
Added support for Twitvid links
Added support for ScreenTweet links
8 tags
Deployed TwitCaps v0.95b (Filter Fun!)
Images can now be filtered by Image Host and Language - This works for both sorting schemes (Newest and Popular)
Search now returns results for ALL Image Hosts, including those which require extra calls to Unshorten URLs or API callbacks
Implemented new, custom cache for Searches. Speedy.
Implemented improved cache for image slurpers. Results should return much more quickly now.
Fixed...
8 tags
Deployed TwitCaps v0.94b (Location Search and...
Implemented Location-based Searching of Real-time Images. Click the “Location Search” button right beside the search box in the upper right. This is some seriously cool shit.
Added support for Flickr2Twitter / flic.kr image links. Still working on search support (takes forever because I need to make a total of 3 HTTP calls (one to Twitter, one to Unshorten the URL, and another to...
June 2009
17 posts
8 tags
Deployed TwitCaps v0.93b
Tuned MySQL Indexes for optimal performance
Tuned Grails Database Pool for optimal performance
Tuned Tomcat Thread Pool for optimal performance
Fixed a bug with Tomcat that was causing hanged threads while being crawled by search engine bots and sometimes for normal users. Explicitly calling request.session now to instantiate session under all circumstances (even 404s).
Excluded all Ajax...
7 tags
Apparently, an app exists called PicFog...
…and it’s creator finds it implausible that I’ve never seen or heard of his site (until Saturday).
His application, like Twitcaps, presents a real-time updated grid of photos that are being linked on Twitter. Click on the picture and you receive a pop-up window that displays a larger version of the image, the text of the tweet and a button for retweeting it. Full-text search is...
Deployed TwitCaps v0.925b
Significantly refined the real-time image search. You WILL get your full page of results if they exist on Twitter. The paging interface still needs polishing up.
Deployed TwitCaps v0.92b
Searches are now paged. You can click forward and backward through the search results. Search behavior is still “mysterious” to the user (not to mention the developer, hah!). Much left to optimize and improve in this area.
Fixed translation bug affecting languages with non-Latin alphabets.
Added translation support for many more languages including Chinese, Arabic, and Hindi
...
8 tags
Deployed TwitCaps v0.91b
TwitCaps v.0.91b - Change Log
Fixed the problem with Translations. The site is purring along again and the translation feature is fully functional. Give it a try it’s fun and useful!
Added a very simple, real-time alert system. I can now add messages (with expiration dates) to Twitcaps as a method of communicating to the users. This should make the server bounces during code drops a...
Issue with Translations
I understand there is an issue with translations that is causing the updates to be not-so-real time. I have disabled translations until I can figure out a solution. A code fix has been deployed which will remove translations and return the updates to real-time status. Stay tuned.
9 tags
Deployed TwitCaps v0.9b (Internationalization)
TwitCaps v0.9b Change Log - Another Massive Update
Implemented Translations! - You can now see translations of all international tweets in your native tongue. Select a language in the “Translations” menu on the toolbar and all tweets in the stream will be instantly readable (to about 75% accuracy because Twitter’s language ISO-code is not always accurate)
Added a flag...
7 tags
Deployed TwitCaps v0.895b
TwitCaps v0.895b Change Log
Added Twitter Trends slurper. Runs every 30 seconds.
Added clickable Trends box below the Search box
Searches are now retweetable by clicking on the title of the search on the results screen
Added new, hackable Search URL - http://twitcaps.com/search/YourSearchString
Changed implementation of Session management - no functionality change
Updated the FAQ
Removed...
11 tags
Performance Tuning Twitcaps (Grails, JVM, GC, and...
Twitcaps has been up for a full week and I had been thinking that the performance and stability was, generally, great. The site was online and available, speedy even, every time I loaded it up. I hadn’t load tested the app, and though I hadn’t spent much time publicising Twitcaps, it got a few nice press notices that generated not insignificant traffic.
Webmonkey Article
Killer...
Deployed TwitCaps 0.89b
Twitcaps 0.89b Change Log
Added support for any image service that uses an URL shortener for its URL
Added support for Tweetphoto.com (via pic.gd)
Changed the way TwitterSlurper works so that it should be more effective at getting the latest images from all image services.
Temporarily disabled MetaCaps functionality while I work on CPU/Memory Optimization
Made Twitcaps more friendly to...
Deployed Twitcaps 0.88b (RSS, Metacaps,Flickr)
Twitcaps 0.88b Change Log
Big update!
Implemented RSS Feeds for the latest 40 pictures and the most popular 40 pictures (Thanks, Alex!)
twitcaps.com/feed = Latest feed
twitcaps.com/popular/feed = Most popular
twitcaps.com/feed/yourusername = Latest with your user filters applied
twitcaps.com/popular/feed/yourusername = Popular with your user filters applied
Implemented MetaCaps...
Deployed 0.8b Code to Live Servers
Twitcaps 0.8b - Change Log
Implemented Auto-Refresh functionality for the home page view. Possibly introduced a whole slew of bugs, but for now, limiting to home-page only (latest view). Will refine for use on offset browsing pages in next release
Changged URLMappings so that people will stop linking http://twitcaps.com/image/caps. You only need go to http://twitcaps.com to get this view. Also,...
6 tags
TwitCaps Gives Photographic Insight to Twitter’s... →
The first bit of press for Twitcaps and it’s a good one!
Deployed 0.7b Code to Live Servers
Twitcaps 0.7b - Change Log
Implemented Session Counter and View of the last 10 users online
Fixed major bug with Filtering. Essentially, a complete re-implementation of the Filtering introduced in 0.6b. Filters now work on Tweet originator as well as @Tweeback user.
Fixed various visual bugs including: floating twitter user icon in image detail view, text with gray background on Safari.
...
May 2009
15 posts
2 tags
Deployed 0.6b code to live servers (Filters &...
Twitcaps 0.6b - Change Log
Implemented Filter functionality. Enter one or more names of Twitter users and you will not see images either posted by or retweeted back to the users in your filter list.
Implemented Friends functionality. You can now access a display of images from everyone that you are following on Twitter.
Added the ability to customize the number of images displayed per-screen...
Deployed 0.5b code to live servers
Twitcaps 0.5b - Change Log
Fixed an issue where the TwitpicsService was not correctly handling file formats other than JPEG. Will now support JPEG, GIF, Animated GIF, PNG and any other arbitrary file format that Twitpics decides to implement in the future.
Fixed CSS styling issue whereby background color may or may not display correctly on Safari 3.2.1
Added a footer with contact email address:...
1 tag
Twitcaps.com is now live.
The site is up and fully usable at http://twitcaps.com. Be aware that this is Beta software. The server has not yet been tuned and there may be a couple of lingering bugs, but nothing that should prevent the fundamental functionality.
Be sure to read the FAQ at the site to get some idea of what that basic functionality is. I will be sending out formal instructions for those who signed up for the...
Hosting the Beast
So, I was thinking all along that I could deploy this bad boy on my Peer 1 VPS server I’ve been using for 8 years to host my other web app, www.the-grotto.com. This is a message board written in Java based on a heavily modified version of Jive forums’ software.
Currently, The Grotto runs on Resin 3.0.1 and the 1.4.2 JVM. I knew if I was going to deploy Twitcaps there, I’d need...
1 tag
RESTful Services In Groovy are Insanely Elegant
As a programmer, I long ago realized that you spend a disheartening (and often unaccounted-for) portion of your development cycle building the plumbing of the application.
One of the turn ons of using Grails / Groovy was the promise of avoiding the usual, tedious tasks of framework gluing, XML configurating, exception handling, and copy-and-pasting reams of useless, brittle boiler-plate code. As...
Howdy pardners.
I’ve slept maybe a total of 6 hours in the last 72. I can’t shake...
– Me
New Project Alert – Twitcaps: Watching the World →