Saturday, September 1, 2012

Tapp and NFC payments for the masses

If you own an NFC equipped Android phone but have been left out of the Google Wallet fun, check out Tapp . Finally, almost a year after buying my i777 today I was able to buy something with NFC!

Saturday, August 18, 2012

Android, AOSP, Cyanogenmod and life

So I own an AT&T Galaxy SII i777 I can't say enough good things about this device. Nearly a year and a half old, it still kicks the ass of most devices people have in their pocket. It's fabulous

After hemming, hawing and complaining about the carrier's lack of interest in keeping old (but very capable) phones updated with the newest version of android, I took matters into my own hands.

I've been a longtime fan of CyanogenMod and its close relative AOKP. I happily ran AOKP ICS for a while (task650 variant), cheerfully bragging to my oblivious iOS pals about how behind they were.

Well with Google's Jellybean release, the AOKP front has been silent. And the Cyanogenmod (v10) activity is present, but just beginning. But I said to myself, "I'm a developer, I don't have to wait!". So I've been compiling my own CM10 builds. You can find it here.

Yet more opinions..

But my point wasn't to brag so much about that really nifty XDA thread I posted. That's just a happy accident. The real focus was to go on record and say how awesome android development is. I've tried my hand at Windows Mobile, iOS even a tiny bit of Palm OS back in the day. There's no comparison. Android blows them all away. And I don't say this lightly. I am a self-admitted Microsoft lackey, with a deep and passionate love affair with the .NET framework.

When it's good, it's good. And developing on Android is great.

I'm not loving the AOSP build process, but I see the necessity to its complexity. But as far as the OS and apps are laid out, it follows my #1 most important rule of development: predictability. Things are where you expect them to be. And if they aren't, once you learn a bit, you say - AH, that's a good place for them.

Upping the ante

So now that I've been running my own builds for a while, I've learned a few things. Enough to start tweaking some of the inbuilt CyanogenMod apps. Namely, I've had my eye on DSPManager for a long long time. It's not a major thing, but I've always been annoyed that you couldn't switch your EQ curve/audio profiles easily.

So, I've started a github repository and am once again taking matters into my own hands. My ultimate goal is to get it into the official build, but I have a lot of learning to do between now and then.

Friday, May 11, 2012

More jQuery validation shenanigans

Here's my latest custom rule for doing regex within jQuery validation. Lifted & modified from stack overflow.  Not doing a whole lot, but super useful:

* Malachi Burke.  
* (c) 2012 Apprentice Lib
        function (value, element, regexp) {
            var options = "";
            if (typeof (regexp) != "string") {
                options = regexp.options;
                regexp = regexp.match;
            var re = new RegExp(regexp, options);
            return this.optional(element) || re.test(value);
        "Please check your input."
Using it is like:
fieldName: { required: true, regex: { match: "your regex string" } }

Saturday, April 21, 2012

jQuery validation plugin per-field AJAX

UPDATE: sigh. after looking for solutions, not finding any, making this one... I stumble across:

Now I'm gonna read up on those..

Well after tinkering around a bunch with jQuery validation plugin, I managed success doing AJAX validation per field, vs. over the whole form.  There's lots of buggy example code out there, they suck.  This one works - albeit ugly:

 $(function() {   
     var response;  
     var retrigger = 0;  
   $.validator.addMethod("uniqueUserName", function(value, element) {  
     if(retrigger == 1)  
       return true;  
       type: "POST",  
       url: "/TestHandler.ajax.axd",  
       data: "ajaxPost="+element.ID + "&value="+value,  
       success: function(msg)  
         response = (msg == 'True') ? true : false;  
         retrigger = 1;  
         retrigger = 0;  
     return true;  
   }, "Username is Already Taken");  
   $.validator.addMethod("uniqueUserName2", function(value, element) {  
     return response;  
   }, "Username is ALready Taken2");  
   var test2 = $("#Middle");   
   //var test2 = $("#contact-form#Email");   
   test2.rules("add", {  
     uniqueUserName: true,  
     uniqueUserName2: true  

So the basic concept is to allow jQuery validator plugin to manage all the focus/keyup etc. events and call us when we're really interested in validating something.  Most code examples out there do the "uniqueUserName" but not the "uniqueUserName2".  Long story short, AJAX is a 2-step process - the callback comes much later, so "uniqueUserName2" is our placeholder for that.

Flow goes as follows:

  • You type something
  • uniqueUserName validator runs and kicks off AJAX request.  It always succeeds in validation, so it's kind of a dummy just to kick off the request
  • at some point, the AJAX success function runs.  We set our retrigger to 1 and brute force validation again on the same field.  
  • uniqueUserName validation runs again but this time we abort out before making the AJAX call - still returning success.  Without this retrigger check, you'll keep sending AJAX requests forever.
  • finally, uniqueUserName2 is evaluated and it is patiently waiting around with the results of our last AJAX response.  
There are some good jQuery validation frameworks out there, this one in particular actually appears to be the least 'developed' featurewise, but its extensibility is hard to beat.  Some other good ones I found are:


Validation Engine looks really powerful, but I felt constrained by how to present the errors - although his error reporting is perfectly adequate.

Valid8 also looks powerful, but I wasn't confident it was being maintained 

Worth mentioning are both of these actually tout AJAX support, where jQuery validation plugin does not.  But as you can see it's a little clunky but not too difficult to get it working.  

Oh Javascript.  It's like writing untyped C code all over again.... and not in a good way.

Tuesday, April 17, 2012

Apprentice Open Source Edition now available!

After much deliberation, I've decided to piecemeal Apprentice out into the open source community. Certain elements will remain top secret and/or closed - but some juicy goodies are now free and available.  Starting small, but I will be revealing more features on a fairly consistent basis.

Check it out here:

Included presently are:
  • IoC Cache Facade
  • Logger & Logger facade
  • Initializer 
Coming soon:
  • IoC Cache Facade implementations for ASP.NET, Memcached and MSEL

Friday, April 13, 2012

jQuery, validation & clueTip

The sordid world of validation continues to turn. Validation is the red headed step child of development. Ignored, neglected and even scorned it rarely garners the attention it deserves. After you're done twiddling those javascript tricks that please your brainless marketing trendoids, it's time to turn your attention to that sneaky little detail of data integrity. After the fanfare has died down, the tiki torches dark we're left with business web forms gathering data. And are they going to gather the data well? Is the backend+frontend going to be a frightful mess of spaghetti? Frequently this answer is yes. I for one say no, this is not what we should accept. It's been this way for years and needs to end. jQuery has made a move in the right direction with a cohesive and sensible client validation component, which itself has extensive plugin points and ajax capability. The last hurdle, and it is not insignificant, is marrying this to a back end which can feed the hungry baby and keep it from descending into the blob of unmaintainable code that javascript loves to be. Oh Silverlight, why could you not have become more popular? So this became a rant instead of a useful discussion on the title. Sorry about that. Next time I'll do better.

Thursday, April 12, 2012

.NET Apprentice library, where next?

For years, literally, I've debated taking my prized C# closed-source library to the open source community.  It's served me well in its various forms for numerous clients.  However, it (or I) am not ready to give away the keys to the kingdom just yet.

On one hand, I want to.  It's far more work than a single man can complete alone.  Furthermore, I'd love for it to be able to help others.

On the other, there are really some special and unique things in there that just don't feel right to plainly give away, after so many years of work.

While checking some old data on my drive, I found its first iteration going all the way back to July of 2007.  That's closing in on 5 solid years of development.  And it's aged beautifully.  Lacking some refinement sure, but containing features onhand we wish we'd seen in WCF, WF and others.  I just wish I had a few folks to help me with it.

I've opened up just a page or two of the wiki, to give you a taste: