Commerce Sciences Is Hiring!

As most of you know, I left Google a few months ago to join a hot new eCommerce startup (I can finally reveal it’s Commerce Sciences).

So far it’s been just Eyal, Aviv and myself working here at our Herzliya office.

 

Well …

 

We are pleased to announce that we secured an investment of more than 1.5 million dollars, and are now ready to spend that money on you!

That is … if you’re a really top notch developer looking for adventure, learning, teaching, cutting edge tools and challenges, a terrific product (still stealth mode, but we already have some clients) that will change the way we do eCommerce, together with a superior team.

You will be our second or third employee … plenty of room to grow, influence the team, the code/architecture and the product.
I was actually just planning to write a post about “why I love startups so much” when the news of the investment round was made public .. look forward to it.

I can’t elaborate publicly about the product, but technology wise I can say we’re working with Java 7 (thinking about Scala), Groovy, Play! Framework, Javascript/HTML/LessCss (will integrate Coffee Script first chance we get) Amazon EC2, git, and Trello.

Do you want to start a Java/JVM group in the Tel Aviv area?

There’s a new group in town.

If you’re a Java/JVM developer, and live in the Tel Aviv (or Israel) area, please join.

I don’t like repeating myself, so please, if you fit the above criteria, read the linked post.

FollowUpThen – Easy Task Reminder

I just discovered FollowUpThen via Pasha a few weeks ago, and wanted to share. It’s an easy to use website that complements other task management systems, and would be especially useful to those of you that don’t manage your tasks in a full fledged “system”, but just keep them in your inbox.

In shorts – if you send an email to a FollowUpThen address, you’ll get a reminder after a specific time. E.g. send an email to 3days@followupthen.com to get a reminder 3 days from now. Check out the video on their homepage, and just use it – it’s dead simple.

Sometimes a little sleep is ok

Thread.sleep() has always been considered a “bad thing” in programming, something you do when you don’t have a good alternative. You could sleep() when you’re polling for a long operation, but the better solution would always be to get a notification when the operation completes, to avoid blocking a thread and generally wasting time – if the operation finished in 600 milliseconds, and you poll only every second, then you completely wasted 400 milliseconds, right?

Well, it turns out there is at least one use case where you really should waste those extra 400 milliseconds – User Interface.

I recently implemented a web UI component that checks if another website is reachable, and only then proceeds. If the website is not reachable, the user has to stay on that page and try again (perhaps he mistyped the URL). I implemented a server method that checks if the URL is alive, and called it from the client side via AJAX. The code looks something like this:

showLoadingIcon(); // displays a "loading" GIF
$.post(url, function(result) {
  hideLoadingIcon();
  if (result.good) {
    // proceed
  } else {
    // Display error message
  }
});

Well, it turns out that while this code is perfectly correct and efficient, it feels erratic from a usability perspective. If the page took a long time to access, it would behave fine, but if the page was very quick, and the method returned within say 200 milliseconds, the “loading” icon would flicker, creating an annoying experience for the user.

The solution is adding a manual, “artificial” sleep(). If the loading was long, no sleep was necessary, but if it was too short, I added a call to setTimeout, to ensure the loading image is always spinning for at least a full second.

While this is not really an example of Thread.sleep() (that doesn’t really have a javascript equivalent), this does show that sometimes delaying an interaction is required to reduce the user’s pain or confusion.

On SOPA

In case you have been living in a hole and haven’t heard about SOPA, I’ll just explain it briefly – it’s a proposed US bill that if passed, would literally destroy the internet as we know it. This bill includes massive punishment for anyone who hosts or streams copyrighted material, or even merely links to such sites (Go TV Links!).

Even sites that host or index user generated content such as Facebook, Wikipedia, WordPress or Google are not except. What’s especially outrages is that no court order is required for liability – if anyone doesn’t like a certain blog post that contains links to copyrighted material, and they file a complaint, if the owner does not remove the offending content, then he is liable, as well as a vast array of internet infrastructure that “assist him in his activity” – Internet Service Providers are expected to block his domain name, payment networks such as Paypal are expected to refuse to work with him. It’s a literal thought police, and it could happen.

Luckily, a lot of companies have stepped up and announced their objections to SOPA. If passed, SOPA could destroy those companies, but I believe that a major part of their objections is also on moral grounds. SOPA is pure evil, a revert to darker times.

Today, the U.S government still controls the internet. The major internet user-facing business are based on U.S soil, as well as payment processors and ISPs. This will not be the situation forever. Bitcoin is proving to be an alternative to the U.S dollar and Paypal, that no body can shut down or control. Namecoin can be a fully distributed alternative to DNS and SSL Certificates. These technologies are not yet mature, but the very idea of SOPA being proposed in the so called “land of the free” clearly shows the necessity of disentangling the internet from U.S control.

The internet is our home. It’s the force that binds us together, and we will not let it be corrupted and controlled.

KISS Project management with Trello

Update - I advise you to take a look on how the Trello team manage Trello.

When I initially read about Trello, I wasn’t over excited (much like my first thought upon hearing of Stack Overflow was “oh no, yet another Q&A site”). Trello, if you haven’t had the pleasure, is a simple List Management App. No more, no less.

Then, we happened to want a little bit more order in our task management back at <Unnamed Hot New Startup I Recently Joined>. After considering several tools (somehow, always, Excel rears its ugly head in such discussions), we agreed to give Trello a shot.

So far, we’re about three weeks into the process, and while I can’t yet speak for everyone, personally I’m liking the experience a lot.

Trello is a member of the “let’s keep everything simple” family of tools. It is certainly not fully featured (at least not as a project management app), but as a simple tool to manage 1-6 people, it’s really a no overhead, no bullshit tool that gets the job done (we’re currently only 3 people, so I can’t testify to how it scales yet). After a bit of tweaking, we arrived at the follow scheme of working with Trello:

  1. Keep a “current week/sprint” list
  2. Keep three lists for Small, Medium and Large features
  3. Maintain a “deployed, not yet reviewed” list, and another “done, not yet deployed list”

That’s it. This is how it looks like:

Our “sprints” are 1 week long, mostly because of the stage we’re at – we’re only three people at this point, and our priorities are very dynamic (remember, a sprint is just a unit of planning – it doesn’t correlate to how many deployments we do).

At least every week, we review the board together, and see what we’ve done in the last sprint. Any tasks that we haven’t completed, we move to the next sprint (or to the appropriate backlog if its priority has decreased). Completed tasks usually just get archived – well, rather the entire “Sprint X” list gets archived. Sometimes, when there are features that are especially relevant for review, we move the features to the “Code Ready” list, and when deploying, to the “Deployed, ready to review” list. When the features are reviewed, we then archive them individually.

We pick features for the next sprint by looking at the three buckets or backlogs. First we see if there are any “Large” features we want to accomplish or make progress on this week (usually there are). Those gets picked first. After that, we might fit in a few Medium or Small features. Small/Medium features are also useful to fill in gaps in planning – sometimes, I have an hour or less free, and I don’t want to start working on a Large or Medium feature … I know that just getting into the state of mind will often take half an hour, so I pick one of the Small features from the current sprint or from the backlog, drag it to the current sprint, and execute it quickly.

We also have little icons on the cards that show who they’re assigned to (not shown in this image). A feature can be just a headline, or can be very detailed with a description, checklist of sub-tasks, and other shiny items. Most features are simpler, but sometimes you just need to conduct some kind of conversation about the feature, and the best place to keep it is on the card itself.

What I like about our system is that it’s really ultra simple, gives us the ability focus to on what’s important right now, and to plan a bit for the future. It will not scale to long plans or huge teams, and it won’t give us any “smart conclusions”, like Evidence Based Scheduling in FogBugz. But it’s simple, it’s free, and it works (for now).

What are you using to manage your projects? (And please, “Excel” is not a good answer)

WhateverOrigin – Combat the Same Origin Policy with Heroku and Play! Framework

A little while ago, while coding Bitcoin Pie, I found the need to overcome the notorious Same Origin Policy that limits the domains javascript running on a client’s browser can access. Via Stack Overflow I found a site called Any Origin, that’s basically the easiest way to defeat Same Origin Policy without setting up a dedicated server.

All was well, until about a week ago,  Any Origin stopped working for some (but not all) https requests. It just so happened that in that time I had gained some experience with Play! and Heroku, which enabled me to quickly build an open source clone of Any Origin called Whatever Origin (.org!) (on github). For those unfamiliar with Play! and Heroku, let me give a short introduction:

Heroku is one of the leading PaaS providers. PaaS is just a fancy way of saying “Let us manage your servers, scalability, and security … you just focus on writing the appliaction.” Heroku started as a Ruby shop, but they now support a variety of programming languages and platforms including python, java, scala, javascript/Node.Js. What’s extra cool about them is that they offer a huge set of addons ranging from simple stuff like Custom Domains and Logging through scheduling, email, SMS, and up to more powerful addons like Redis, Neo4j and Memcached.

Now for the application part, I had recently found Play! Framework. Play is a Java/Scala framework for writing web applications that borrows from the Ruby on Rails / Django ideas of providing you with a complete pre-built solution, letting you focus on writing your actual business logic, while allowing you to customize everything later if needed. I encourage you to watch the 12 minute video on Play!’s homepage, it shows how to achieve powerful capabilities from literally scratch. Play! is natively supported at Heroku, so really all you need to do to get a production app running is:

  • play new
  • Write some business logic (Controllers/Views/whatnot)
  • git init … git commit
  • “heroku apps add” to create a new app (don’t forget to add “–stack cedar” to use the latest generation Cedar stack)
  • “git push heroku master” to upload a new version of your app … it’s automatically built and deployed.

Armed with these tools (which really took me only a few days to learn), I set out to build Whatever Origin. Handling JSONP requests is an IO-bound task – your server basically does an HTTP request, and when it completes, it sends the response to your client wrapped in some javascript/JSON magic. Luckily Play!’s support for Async IO is really sweet and simple. Just look at my single get method:

public static void get(final String url, final String callback) {
    F.Promise<WS.HttpResponse> remoteCall = WS.url(url).getAsync();
 
    await(remoteCall, new F.Action<WS.HttpResponse>() {
        public void invoke(WS.HttpResponse result) {
            String responseStr = getResponseStr(result, url);   // code for getResponseStr() not included in this snippet to hide some ugly irrelevant details
 
            // http://blog.altosresearch.com/supporting-the-jsonp-callback-protocol-with-jquery-and-java/
            if ( callback != null ) {
                response.contentType = "application/x-javascript";
                responseStr = callback + "(" + responseStr + ")";
            } else {
                response.contentType = "application/json";
            }
 
            renderJSON(responseStr);
        }
    });
}

The first line initiates an async fetch of the requested URL, followed by registration to the completion event, and releasing the thread. You could almost think this is Node.Js!

What actually took me the longest time to develop and debug was JSONP itself. The information I found about it, and jQuery’s client-side support was a little tricky to find, and I spent a few hours struggling with overly escaped JSON and other fun stuff. After that was done, I simply pushed it to github, registered the whateverorigin.org domain for a measly $7 a year, and replaced anyorigin.com with whateverorigin.org in Bitcoin Pie’s code, and voila – the site was back online.

I really like developing websites in 2011 – there are entire industries out there that have set out to make it easy for individuals / small startups to build amazing products.

Be an early adopter now – is LiteCoin the new, fair BitCoin?

tl;dr – If you think Bitcoin is an interesting concept, at least in theory, consider a new fork of it, and start mining … this Wednesday/Thursday.

Little over a year ago, I blogged about Bitcoin, a new high-yield investment.
Since then, through ups and downs, its value has increased 5 folds.

.

Interpret this graph as you wish, Bitcoin has risen X5 in the last 6 months (I still think it will continue to rise, despite the price decline in the last few months).

Now, a new currency is poised to become “The Silver to Bitcoin’s Gold”. I think it has a shot. Introducing … LiteCoin (to be officialy released in a few days).

LiteCoin is extremly similar to Bitcoin. It also has a pre-set limit on the number of coins (84 million). The generation rate halves every four years, just like Bitcoin.
Its major feature, at least IMO, is that it’s fair:

  • By now, a lot of people have at least heard of Bitcoin (certainly the readers of this blog), so they won’t take so much time to digest the idea. If you decide not to buy/mine, that’s fine, but it won’t be because you’re not aware of it.
  • There are no per-mined coins, unlike some other alternative chains.
  • You can actually mine them! When I learned of Bitcoin, I was disappointed to learn that they’re very difficult to mine. They require dedicated GPUs, which the official client did not support. Mining them wasn’t impossible, but it was much too complex, and simply wasn’t worth it for almost everyone that encountered them at this stage. Buying them was much more lucrative (for me, at least).
  • LiteCoin uses scrypt, which cannot be run well on GPUs, and is intended to be “CPU friendly”.
  • Windows binaries are already availble (on testnet, not functional until the release date) – you can prepare in advance, and don’t have to race other people to start mining first.

LiteCoin might succeed, and it might fail – just like Bitcoin. While I might buy some in the future (after an exchange starts trading in them), for now I’ll be content to mine them, starting either this Wednesday or Thursday. It’s dead simple – just download the client, and run it on your spare CPU cores. You can run it on a low priority, so it won’t boggle down your day to day work.

There is one issue – botnets. If this turns out very profitable, it’s possible botnets will use the infected hosts to mine LiteCoin. Still, it remains to be seen whether this will be a major impact or not. Not that even today some botnets mine Bitcoins with the GPUs of their infected host.

I find the very fact I can actually generate money on my computer exciting. It will not be worth a lot at first, but its value might appreciate, like Bitcoin did. I invite you to join the experiment and try it out for yourselves.

Important note – don’t run the miner without making sure your CPU is properly cooled. Even though summer is just ending, the core will run at 100% X how many threads you run. It should be ok as long as your computer case is properly ventilated.

P.S. – to premept any comments in the style of “Bitcoin is a scam”, please read Is Bitcoin a Ponzi Scheme? before posting. The same reasoning applies identically to LiteCoin.