February 2012
19 posts
If you’re using postgres as the database for your Play-based web application, then you might be interested in this article.
Data model classes derived off the Play Model class come with an auto-generated Id property. With postgres, this id is generated using a global sequence generator which means all data model classes derived off the Model class will share this sequence. To get around this, you’ll need to create a sequence generator for the model/table that you care about (oh and you need to extend off of GenericModel instead of Model).
As an example:
public class Users extends GenericModel { @Id @SequenceGenerator(name = "boards_id_generator", sequenceName = "boards_id_sequence", initialValue = 1) @GeneratedValue(generator = "boards_id_generator") public Long id;...}
Fun stuff huh?
I finally did it.
I finally ditched my self-hosted personal wordpress blog and moved all of my old blog posts to Tumblr. Truth is, I hadn’t posted on my personal blog since sometime in 2010 so this was probably long overdue. Migrating the data was made super easy thanks to this python script that I found here. My friend and colleague Mr. Wunsch also created a ruby script which you can try via here.
My next step? Point my domain to tumblr..
On the subway ride home tonight, I had a question lingering in my head that started at work - ”What’s a good Java-based web application framework?”
Since I’m no Java-guru, I naturally Google’d the question and came across a slew of possible answers. I came across familiar ones like Struts and Spring as well as more recent entries like Grails (I had used Grails at my last company to some success.. I think).
However one fairly recent framework which I had never heard of before started popping up left and right in my search results - the Play framework. (Do forgive me if I’ve never heard of it before - I have to admit that I don’t keep with all the latest frameworks and programming languages out there.)
So what is Play? I’ll let the Play FAQ answer that one:
Nowadays, you have a very large number of choices for developing web applications. Play being a Java web application framework, let’s compare it to other Java frameworks. Play is built for a ‘share nothing’ architecture (think about it as a stateless framework), so it’s very different from all these Java stateful and components based frameworks like Seam, Tapestry or Wicket. It’s closer to Spring MVC or Struts (or Struts 2), but way more opinionated.
However Play is a unique Java framework. It does not really rely on the so-called Java Enterprise standards. It uses Java, but tries to bring all the good things from the frameworks based on scripting languages like Ruby On Rails, Django, Pylons, Symfony, Grails and Cake PHP to the Java world. We really tried to get the best out of the Java platform without getting the pain of traditional Java web development: a slow development cycle, too much abstraction and too much configuration.
So let’s get this straight. I get to have a Rails-like framework, yet I can program entirely in Java (or Scala)? Sounds awesome to me (Yes, I’m one of those that doesn’t mind the verbosity of Java although I do appreciate the conciseness of Scala too) and at the same time, too good to be true?
Needless to say, I was drawn in.. hooked more like it; curious to see if this was indeed a fun framework to play in (get it? hahah ok.. enough of that). Thus I went ahead and installed Play on my OS X MBP which was pretty simple. It involves:
1. Putting the folder somewhere - say the /Applications directory
2. Making sure the play folder is in your path
3. Making sure you have Java installed (which if you’re on OS X, then yeah it’s likely already installed).
From there, I began playing with the online tutorials. Like many other frameworks, the tutorials show you how to create a “Hello World” application followed by your requisite “Let’s build a real world blog application”. Ugh.. yes yes yes..
Yet, I actually didn’t mind going through these tutorials because it really showcased how incredibly easy it was to create web apps using Play (reminded me of my earlier days with Rails). Of course it remains to be seen what using Play would be like on a more complicated web application; what its through-put is like; what its memory-usage is like, yada yada yada.. but at least I’m psyched to try.
here’s hoping that I’ll continue to impressed with Play!
It’s been great to hear from developers over the past two weeks about their plans for the Gilt Public API, and we can only imagine what’s in the works out there that we haven’t heard about yet! Meanwhile, back at Gilt HQ, we’re hard at work on adding more to the API— more data and more ways of…
OK. I recognize I might be in the minority out there but I’m a fan of emacs. Always have been since college and probably always will be. Sure I like IDE’s too (huge fan of Visual Studio BTW) but my first choice to editing a file on OS X is emac.
Having said that, my favorite emacs app on OS X is “GNU Emacs for OS X” - downloadable here: http://emacsformacosx.com/
Once you’ve downloaded and installed the app, it’s likely you’d rather use this app rather than the built-in emacs client on OS X. So how do you get typing in “emacs” on the terminal to fire up the GNU Emacs client instead of the built-in version? Simple - just alias the sucka!
On a bare OS X install - simply edit your “.profile” file in your home directory and add the following line:
alias emacs='/Applications/Emacs.app/Contents/MacOS/Emacs'
Source the profile file (“source .profile”) and then type “emacs” and you’ll see the GNU version launch instead of the built-in version.
That’s it!
I go through these moments in life where I realize I really don’t know a whole lot. These moments typically occur after talking to someone I truly admire, or reading about something truly inspirational, or playing with some technology that is just so cool. Often I feel like I’ve learned just barely enough to get by in life - whether it’s studying for a class or test, learning some programming language or technology, or implementing some solution for a problem - whether in work or in life.
Thus tonight, I decided to pick up and learn a few things well. These things are as follows:
- Know OS X inside and out - I’ve been using OS X for nearly two years now but I can’t say I really know the OS nor the environment. It’s time for me to master it a bit.
- Java - I’m comfortable working in Java; I know how to write code; I know how to deal with concurrency issues - but do I consider myself a Java guru? Hell no. It’s time for me to truly know Java as much as possible.
- Scala - I know zilch about Scala beyond some classes I sat in. Once I’m done with learning Java as much as possible, I’m going to sit down and pick up Scala.
- Being a better leader - Sure I’ve been leading teams, projects, initiatives for some time now - but I want to be a better more effective leader. My ultimate goal is to create something from scratch and to do that well - I want to also know how to lead effectively - learn how to plan effectively; how to inspire people to be their best; how to deliver the best product possible.
Along the way, I also decided that I would start some open source projects to help get my goals moving along. Some thoughts include:
- Building an open source ad server. Why? why not?
- I came up with this notion earlier last year but didn’t follow through - building a service that allows people to find videos available online.
ok.. that’s it for now :) time to learn.
Thanks to everyone who came to Gilt Tech’s latest tech talk, NoSQL in the Real World.
We had a great series of speakers including:
- Ara Anjargolian - Redis
- Matt Parker - CouchDB
- Sean Cribbs - Riak
- Edward Capriolo - Cassandra
- Luke Gotszling - MongoDB
Huge thanks to Rockman and Maureen for organizing the event, and to AOL ventures for sponsoring and hosting.
Enjoy out the video …
The Pictures …
The Slides …
Riak
Redis
Cassandra
Membase and MongoDB
CouchDB
I’m really excited to tell you that we’ve launched our Public API today, providing programmatic access to a constantly-updating collection of flash sales full of the usual kind of awesome stuff we offer on Gilt’s stores.
We held an internal hackathon two weeks ago and saw some really interesting…