Friday, January 27, 2012

Introducing QUnitTestDriver

For the past month or so, I've been working on a library to make JavaScript testing integrate better with my company's Java build (junit/maven/jenkins).  All of the options we've tried have been failures because they either don't work well with jQuery or they require an external browser instance which makes them slow and buggy (Selenium, HTMLUnit end-to-end, js-test-driver).

What we really wanted to do was run very fast (sub-100ms) unit tests written in the language of our production code.  This lead us to qUnit.  The problem with qUnit is that there wasn't a convenient way to exercise those tests inside of our normal build easily.  Sure, there is the qunit-test-runner project, but that doesn't come along with any IDE integration.  It requires the tests be run from within an Ant script.

Enter QUnitTestDriver.  It's a simple library allows you to create a plain old jUnit test in any JVM language you choose that points to a plain old qUnit test suite HTML file.  Under the hood, the library lights up a jetty server to avoid "file://" URLs, and uses HTMLUnit to parse the output of the qUnit test results.  Here's an example Java class that would run an entire qUnit test suite that could contain many tests inside of many different files:

public class QUnitTest { @Test public void testPage(){ QUnitTestDriver.run("path/to/qUnitTest.html"); } }
That's it. I hope you find this useful!

You can find out more about the project on it's new Google Code Site Here.

Monday, January 9, 2012

Book Review: jQuery Mobile






Done.  A quick read.  I think that the jQuery Mobile API, unlike the regular jQuery API, is more "invasive".  jQuery Mobile really alters the way we are supposed to work with HTML - adding enhancements to HTML5 to better support mobile browsers.  I think this is a good thing.  The jQuery Mobile team really did a good job adapting HTML/CSS and Javascript to smaller devices.  One warning: this book is very Apple-heavy.  This really isn't a big deal, but I think that as this new book gains mass acceptance, Android will be the predominant platform developers will want to target first.  These platforms are, for the most part, interchangeable, but the screenshots are a little deceiving to those who aren't really familiar with the IOS browser which appears to bleed navigation into the page a little more, something I don't really like.

I thin that anybody who is writing mobile applications really should START here and move slowly to the world of apps.  This is a great books for developers familiar with jQuery and Javascript, but those uninitiated to web development might need a little introduction to Javascript and HTML first.

Thursday, January 5, 2012

Universal WR7: Say Goodbye To Your Stack Of Remotes


If you're like me, you (at least used to) have a stack of remotes you juggle to watch TV, adjust the volume, switch between devices, etc.  Even if your cable company provided or your television came with a "universal" remote, those "universal" remotes only work with a approved pre-programmed list of manufacturers and models.  Roku?  Nope.  Asus O!Play?  Nope.  Cheap Chinese HDMI switch?  Yeah right!

Enter the Universal WR7.  There are a lot of remotes that bill themselves as "Universal" especially a few knockoffs from RCA and brand-X comapanies on one end of the spectrum that are no better than the remote that comes with most cable company's boxes or perhaps your TV.  On the other end of the spectrum are Harmony remotes that require a Windows or Mac and hundreds of megabytes of software updates to program and cost hundreds of dollars.  What everybody should buy is a remote from Universal.  Unfortunately, all remotes say "Universal" so you have to look for this logo:

How is this different?  Well, this company makes remote controls that cost anywhere from $10 to over $500.  All of them, as far as I know, are "learning remotes".  This means that the remote has an Infrared Receiver capable of listening to another remote control and mimicking back the signal.  This is huge because the remote can learn to behave like nearly anything that sprays Infrared which not only includes anything you point at your TV to do something, but also all kind of other home automation products.

Is it complicated to set up?  Not for me, but I have a degree in Computer Science.  Here's how you do it:
  1. Let's say we want to program the "1" button on the "dvd" setting.  Press and hold [dvd] and [ent] at the same time.  
  2. Then press [1].  
  3. Then point your DVD remote at this remote and press [1] on the old remote.  The new remote flashes three times and your done.  
  4. You can continue to program more buttons by repeating steps 2 and 3.
  5. Press and hold [dvd] and [ent] at the same time to save.
Pretty easy!

This remote also supports:
  • Punch through.  Any button can be programmed to use the button from a different mode.  For example, you can say that volume controls always go to the receiver or TV regardless of what mode you are on.  Channel changes can always go to the cable box even if you are in DVD mode.
  • Macro Mode.  You can program a button to send more than one signal to more than one device.  Example: Turning everything on and off with one button.
  • Old fashioned setup like a normal universal remote (the old three digit code and a giant table in the back of the manual or "press up over and over until the device turns off to search for the right code").
So, for those of you who have been wishing for a $200+ Logitec Harmony, run down to target and grab the Universal WR7 for $30, or save yourself the trouble of a complicated setup and get one of the more expensive URC remotes.

Book Review: History Of Western Philosophy


One of a few passions I discovered back in college was law and philosophy.  Lucky me, I actually enjoy reading about this area quite a bit (as you can see if you look back on my previous books reviews).  This is considered by many to be the seminal work on the history of the study of philosophy, so when I discovered it, I had to read it.  I have been listening to this in the form of an audio-book for a few months between podcasts.  The book is divided up into three main sections (unfortunately called "books").

The first 1/3 is a methodological summary of the most important ancient philosophers leading up to, including, and just after Socrates, Plato, and Aristotle.  Most of these ancients set the groundwork for science and philosophy, but have for the most part been thrown out by scientific method and the separation of church and state.  The only real quantitative remaining ancient philosophy appears to be the foundation of western religion.

The second 1/3 is a horrible slog through the beginning of Judaism right through the Roman empire into the 1400's.  This entire period seems to be a scientific stupification of man-kind through the oppression of religious leaders.  But, just as I prepared to give up on the book, it started to get interesting in the final chapter: The Eclipse Of the Papacy.

The final 1/3 starts off with a brilliant summarization of The Renaissance - Man kind finally started thinking! The final third was the only section worth reading if you aren't actually a student of Philosophy.  Much of what was part of cultural understanding was extincted once religion was set aside for logical and empirical development of thought.

As this final 1/3 of the book neared an end, Russel's own philosophy began to come into focus as he spent increasing time refuting and agreeing with the principals of his predecessors.

History of Western Philosophy was written by one of the great authors on the subject from the point of something rare: both an expert and a talented communicator.

Wednesday, December 28, 2011

Dual Book Review: Desgning Interfaces & Don't Make Me Think




I read these two books over the Christmas Vacation weekend.  Both were great, but serve different purposes.  Don't Make Me Think is teaches us how to discover what works best in the applications we are building while Designing Interfaces is just a catalog of best practices. 

Designing Interfaces is great for developers who have to work in teams and would like a higher abstraction language to use commonly when discussing interface design patterns that might be used to solve specific design problems.  This is as important as software engineering design patterns (flyweight, singleton) that can encapsulate a lot of information into a single word to make design decisions easier to make for a team.

Once those decisions have been made, then the practices outlined in Don't Make Me Think let us determine whether our assumptions about the users is correct.  Designing Interfaces is best skimmed through once and kept as a desk reference and Don't Make Me Think is best read cover-to-cover a few times over for content.


Tuesday, December 6, 2011

Permanently Enable Compiz in XFCE

XFCE is a great little window manage for Linux.  It's now my default window manager in Ubuntu, but I love my Compiz window manager, so I had to do the following to enable Compiz when I log in:
  1. Click Start > Preferences > Xfce 4 Settings Manager
  2. Click on the Application Autostart tab.
  3. Click the Add button.
  4. Enter Compiz for the name, Compiz Startup, for the description, and compiz –replace ccp in the Command section.
  5. Click OK.


Source

Stabilize Your Wi-Fi With CyanogenMod 7

I recently switched from a custom ROM for my phone to CyanogenMod 7.1. Skype seemed to start dropping the connection every time the screen turned off. It turns out that this is a FEATURE of CyanogenMod - to turn the Wi-fi off when the screen turns off to conserve battery life. Here's how to disable this "feature":
  • From the Home Screen, press menu->settings-> Wireless & Networks -> Wi-Fi Settings
  • Press menu->advanced
  • Change "Wifi Sleep Policy" to "Never".

Source

AddThis

Bookmark and Share