Saturday, September 1, 2012
Tapp and NFC payments for the masses
Saturday, August 18, 2012
Android, AOSP, Cyanogenmod and life
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
/* * Malachi Burke. * (c) 2012 Apprentice Lib */ // http://stackoverflow.com/questions/280759/jquery-validate-how-to-add-a-rule-for-regular-expression-validation $.validator.addMethod( "regex", 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
http://stackoverflow.com/questions/4687492/ajax-validation-using-jquery
http://docs.jquery.com/Plugins/Validation/Methods/remote#options
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;
$.ajax({
type: "POST",
url: "/TestHandler.ajax.axd",
data: "ajaxPost="+element.ID + "&value="+value,
dataType:"html",
success: function(msg)
{
response = (msg == 'True') ? true : false;
retrigger = 1;
$("#contact-form").validate().element("#Middle");
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.
Tuesday, April 17, 2012
Apprentice Open Source Edition now available!
Check it out here: https://github.com/malachib/Apprentice
Included presently are:
- IoC Cache Facade
- Logger & Logger facade
- Initializer
- IoC Cache Facade implementations for ASP.NET, Memcached and MSEL
Friday, April 13, 2012
jQuery, validation & clueTip
Thursday, April 12, 2012
.NET Apprentice library, where next?
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: http://wiki.factmusic.com/Apprentice.ashx