Skip to main content

Posts

Better Samsung DeX Experience

Samsung Dex  is a pretty amazing technology that turns phone into a full fledged desktop PC. The original device costs about $150 but has some limitations such as not being able to use headphone jack and basically having the phone locked down. A cheaper, and arguably a more functional device can be had for less than $40 with things like the Melopow Doc  that leaves the device in a more usable state with full access to the devices ports at a much better price. And while using DeX, make sure to use the fantastic Dex MaX  app to add support for fullscreen to all your apps. Happy DeXing!

Programming for Kids

I have started to see if I can get my 7 and half year old son interested in programming. This has been quite an educational experience for me. I have always had fond memories of myself self-learning GW-BASIC as a kid in the early 80s. So I was on the look-out for a modern way to teach programming for the young minds. I started with the usual suspect of MIT's Scratch project. However for some reason, beyond structured learning through tutorials, my kids were not too attached to the setup there. I was finding that the environment was too abstract in some sense - for example it expects you to be familiar with messaging passing techniques to do any form of mildly interactive programming. Regardless, it is a good starting point. Similar to Scratch, the GUI based programming available with Lego's Mindstorm EV3  got my attention. Unlike Scratch, this can be an expensive venture but the physicality of actually moving parts can help connect young minds with programming concepts. An...

Tripping on Convention over Configuration

It is with dismay that I sometimes find the trend of moving traditional configuration heavy programming models to convention based troubling. Case in point - I've been trying to adopt the newfangled Spring Data based repository framework. It's been working wonders and I got the QueryDSL support and naming convention based query generation going. After creating a bunch of these repositories, I ran into an issue with one of my custom repositories. It was not recognizing that a method in the custom repo is part of the custom side and not to be a candidate method for spring to do its voodoo magic. For some reason Spring thought the method is a property of the entity bound to the repository. After digging through the Spring code base and spending a lot of time, it finally was clear why this was happening: I had made a typo on the repository naming and the "y" was missing from custom RepositoryImpl class. If only Spring was smart enough to tell me that this is what was c...

Why Microsoft fails on Usability with Win8

GWT: Emulate tab on Enter

Sometimes users expect text boxes to move focus on to the next element after pressing Enter, similar to most spreadsheets. If you are using GWT and jQuery, here is a little snippet to help you along: public class AutoTabbedTextBox extends TextBox implements KeyUpHandler {     public AutoTabbedTextBox() {         super ();         addKeyUpHandler( this );     }     @Override     public void onKeyUp(KeyUpEvent event) {         // emulate tab on key         if (event.getNativeKeyCode() == KeyCodes. KEY_ENTER )             focusNext(event.getNativeEvent());     }     public native void focusNext(NativeEvent event)/*-{        ...

Microsoft Error Reporting crashed on Mac!

Just got this on my Mac: Should I report the crash of the Microsoft Error Reporting to Apple??

System Overload!

Neil deGrasse Tyson on Science and Faith: Plain Wrong

In the video, an argument seems to have been made that Science and Faith can not only easily co-exist, but the idea of any conflict between the two paradigm is  largely  non existing.  By  definition , science is the knowledge obtain by  rigorous   empirical evidence - a body of knowledge that is continually updated, proved, dis-proved and tinkered with. Science fundamentally does not claim to know anything nor does it guarantee an answer to every question that one can pose. It is a way of thinking with clarity, without dogma and and without an overriding theology. Contrast this with what faith in essence is - an adherence to a belief based on authority and to a large degree, fear of uncertainty. For a renowned personality like Tyson to dismiss the contrast and make little of the very fundamental impedance mismatch is, to my mind, just amazing.  

Not all opinions are equal

It appears that some people tend to think that to be in a democratic society, all opinions are valuable and all sides should be treated equal. If we are to go by the recent events in Texas  , this line of thinking can be harmful and dangerous. Here is a prime example of what this type of culture has done to the  the American education system:

Don't switch to Teksavvy

After learning that I actually have a choice when it comes to Cable Internet besides Rogers, I decided to switch over to Teksavvy two weeks ago. As it turns out, out of the two weeks, I was kept offline for 10 days. Now I regret switching over dearly! Having to live offline was bad enough, the support I was given by Teksavvy was even worse. As soon as I went offline, I made a call to their technical support line. I was told since it was weekend on Saturday morning, someone would be sent over to look into my issue on Monday after 5PM. I was still offline till Tuesday when I got a call from Teksavvy telling me that they cannot make it on Monday and they can only send their support staff on SATURDAY after 5!! Having no choice, I agreed and despite having pre-arranged plans on my Saturday evening, I had to stay home for 3 hours waiting for a support guy to show up. As it turns out, no one came knocking in my door till 9PM and then I decided to call again. Now their story got interesting a...

why it's a good idea to answer forum questions

A lot of people use google and forums to figure out technical programming questions, but we are often too lazy to answer people's queries even if we knew the answer. Well today I had a question on how to close window from GWT and by instinct headed to google only to find a reply: http://markmail.org/message/qqr3r7ji6hl7k5vp#query:+page:1+mid:insr656lelc5kebx+state:results that I happened to post myself 3 years ago!

Eclipse issues with JDK 1.6 update 21

A lot of users seem to be having issues running Eclipse with the latest update of Java from Sun/Oracle. Apparently they changes the metadata in the dll that shows Oracle instead of Sun. Here are the details and workarounds to fix it: https://bugs.eclipse.org/bugs/show_bug.cgi?id=319514

Automate SQL Dumps for SQLServer

The backup mechanism in SQL Server may be fine for many cases, but there are limitations with it (like restoring to a different server). I really like how I can just dump the database SQL with mySQL which can be easily processed with custom scripts. I was looking around for a mysqldump equivalent for SQLServer. I know you can do this with the SQL Management Studio through GUI in 2008 version, but I need this to be automated. This lead me to discover the SQL Server Management API . With it, you can do a SQL Dump like: using Microsoft.SqlServer.Management.Smo; using Microsoft.SqlServer.Management.Common; using Microsoft.SqlServer.Management.Sdk.Sfc; namespace SQLGenerator { class Program { static void Main(string[] args) { //Connect to the local, default instance of SQL Server. { Server myServer = new Server(args[0]); Database db = default(Database); db = myServer.Databases["be"]; ...

JavaFX Composer

Just trying out the new FX Composer in Netbeans 6.8. Looks pretty cool! Checkout at http://wiki.netbeans.org/JavaFXComposer

Type safe hibernate criteria

Here is a cool thing I figured out today to use type safe property name in hibernate criteria. Typically this is done with strings, but with lambdaj, it can be done as: .. import static ch.lambdaj.Lambda.on; import ch.lambdaj.function.argument.Argument; import ch.lambdaj.function.argument.ArgumentsFactory; .. DetachedCriteria criteria = DetachedCriteria.forClass(Contract.class); criteria.add(Restrictions.eq(propertyName(on(Contract.class).getContractKey()), 43)); ... public static String propertyName(Object placeHolder) { Argument actualArgument = ArgumentsFactory.actualArgument(placeHolder); return actualArgument.getInkvokedPropertyName(); } ... Notice how the Restrictions does not take string literal and uses lambdaj to evaluate the property name from java method directly. Pretty cool ah?