Today is a good day to code

What is Nc3 Bb4

Posted: September 16th, 2011 | Author: | Filed under: chess, nc3bb4 | Tags: , , , , , | 2 Comments »

Other than being Knight to c3, Bishop to b4, and a move from a variation of the French Defense, it is now my hobby HTML5 chess project.  Based on the engine of garbochess, it uses web workers to factor and rank the moves in a map/reduce way.  I used to play chess for an hour and a half every day when I was a kid, and I hadn’t realized how much I missed it until I started playing with my 4 year old recently.  Then when I got onto my Chromebook, there didn’t seem to be any local storage using, HTML5 based apps just for Chrome.  Incidentally, an awesome resource for getting started with chess programming is the chessprogramming wiki.  Check it out if you have an interest as well.

Being a programmer, and starting out looking at map/reduce, I was seduced by the chess bug.  Boy chess programming is fun!  For now, the project is in an MVP state.  I intend to modify garbochess such that the machine will learn how to play better against you by weighting the ranking of moves for successes and failures during the evaluation.  It is going to be tricky to modify it in such a way so as the machine learning algorithm doesn’t get stupid with a simple mod, and that I use a markov chain to make sure to consider the state as a basis for each move down the line.  My current thought is to weight endgame moves logarithmically higher or worse depending on the outcome of the game, however my thinking is likely to change as I learn more.

I do intend to create an online component to this, but I am torn between connecting to freechess.org, and building my own service to facilitate games using XMPP and / or node.js.  I am leaning toward building my own, because freechess’ api is non-existent, however the community over there is awesome.  I guess that since it is a hobby, having a bit of NIH syndrome is probably O.K.  If you like it, please drop me a comment, likewise if you don’t like it, please drop me a comment.

nc3bb4.com


Why My Faith in HTML5 Has Been Reinstated ( Or How I Learned *again* to Love JavaScript )

Posted: July 13th, 2010 | Author: | Filed under: CSS, JavaScript, Programming | Tags: , , | 1 Comment »

Over the long weekend, I was lamenting over how many times I had to write the same routines in different languages… Objective-C, Java, PHP, etc… I realized that I have, and would have wasted tons of time writing native code, and how, really most of the functionality of the application can be handled with various features of HTML 5.  Originally I had been against this, but now that the iPhone has finally caught up and has a reasonable processor, I think that the HTML5 experience can be nearly as good as native.

The funny thing is that much of what is driving my decision is the desire to have my applications have data and interfaces that are available everywhere, mobile, web, desktop, etc… aka, the original promise of the web.  Using local caching, the JavaScript key/value store, and the database will help to allow me to provide a compelling disconnected use experience.  The code that I write will be useful across all of the platforms that I use.  The one caveat that I am making is that I need to focus on one browser, or approach, and for that WebKit based browsers seem to be the logical choice.

Now I realize that not all of my application concepts will be possible with HTML5 and JavaScript, however this recent thought experiment I realized that most of the features that I would have normally insisted needed to be done natively can be done with HTML5.  The biggest issue that I have run across is the 5 MB limit on database sizes in Mobile Safari.  I know it was there in iOS 3.x, I don’t think they have lifted this in the current OS.  The other issue is the forced UTF-16 encoding of characters.  While I understand this technically, it makes it difficult to store data larger than 2.5 MB on a device in the SQLite storage available to JavaScript.  The approach taken in desktop Safari, where you can ask the user to increase the available size if your database creation fails is a much better approach.

Another interesting pattern that I see emerging is that of utilizing HTML5 as the UI tier, and establishing the business logic and control structure behind a HTTP server that would expose additional native functionality to the HTML5 app.  The benefit here is that your local server implementation could match the remote server implementation, such that your client APIs could remain consistent.  This seems to me to be the best architecture for minimizing the work involved with porting solutions across platforms.  I absolutely love Cocoa and Objective-C, I enjoy the concepts behind the Android APIs, while despising Java’s syntax, and I think that .net is pretty cool as well, however when it comes to getting applications deployed to the maximum number of users in the leanest manner possible, I think it makes sense to leverage the web heavily up front, and then backfill the native implementations as necessary.


Google Will Buy Palm

Posted: April 20th, 2010 | Author: | Filed under: android, Apple, Companies, Google, iPhone, Palm | Tags: , , , , | No Comments »

I hear a lot of prognostication about who will buy Palm now that they are officially up for grabs.  People are suggesting that HTC, Lenovo, or even Apple would be the most likely to buy them, however I don’t think any of them will get Palm.  I think that Google will get Palm for around 1 billion dollars, and here is why.

Primarily, the main reason is that Palm’s WebOS falls directly in line with Google’s philosophy of web first, native second.  That with the Google Native Client could make for a compelling addition to Android.  One could argue that Android is lacking only in UI, and WebOS has a UI second only to the iPhone.  Secondarily, buying Palm would give Google patent ammunition to use in assisting HTC in their legal battle with Apple, especially since it is Google’s Android OS that is causing the issue.

It doesn’t make sense for Apple to get Palm, even if they are in the bidding, because Google has shown in the past that it is willing to go way above a company’s valuation to snag them.  This makes just too much sense so it has to happen, that is my prediction, it is sort of hopeful because I like WebOS and Palm, and would like to see it continue, albeit in a more pure HTML 5 sense.