The Zibings Starts Here

26 June, 2009

N2F Yverdon: v0.2 Dev Released

After well over a month (heck, almost two) of internal testing, we’ve nailed down enough of the bugs that we are comfortable releasing v0.2 to the public for testing.  This is a development release and will still have bugs so should probably not be used for production development.  As always, you can find the downloads on the N2 Framework website.  Enjoy!

 

- Andy

Labels: , , , , ,

21 June, 2009

Well That’s Interesting…

For a while now, I’ve been meaning to start dabbling with regular expressions in C#.  I’ve held off though, mostly because I just haven’t had the chance to really get into anything with C# in depth on top of work and family.  At this end of this past week, Zibings finally got started on a very long-awaited project which will be done in ASP.NET, and in starting I found myself needing to port my old (almost 11 years old) email validation algorithm from C++ to C#.  I ported this to PHP years ago, and it works beautifully there, but porting it to C# offered me the ability to tweak the algorithm to work with some new tools available in .NET.

I went through, and first did an almost exact port of the script.  It worked, but I thought I should check it’s performance.  It seemed to be slow, so I tried a version of it using C#’s List datatype.  This seemed faster, but I thought I could do better.  I asked for a bit of help from some nice people on FreeNode’s ##asp.net channel (specifically Kim^J) and was given a pretty blazingly fast regular expression version.

Even so, I felt that it was odd you couldn’t create something that didn’t use a complex system like regular expressions which outperformed regular expressions, so I went back and started tweaking my List and Manual versions of the validation routine.  After a lot of work, I actually have made both into something consistently faster (on average) than a comparatively accurate compiled regular expression.  Before I go further, here’s a sampling of the rather consistent results:

Benchmarks

Also, you can view the entire source code of the .cs file here.

The three ‘algorithms’ are each enclosed in their own class.  The only difference between the List and Manual classes is that instead of using a List collection to store and search acceptable characters the Manual class simply traverses an array of the characters.  Otherwise, they should be identical in the logical patterns they use to verify that the email address and domain name are valid.

The regular expression is almost entirely based off of one readily available at this site, so if anyone out there has a pattern they know to be better/faster that should be tried I would love to hear about it, I am not a RegExpert in the least.

The above image was the result of the source code I’ve uploaded, and are derived from running three emails through a test 500 times, taking the average, and then running through again.  All told, the above test did validation of 15,000 email addresses (but of course they were the same 3 addresses).  I have run the test with a few as 5 attempts and as many as 50,000 attempts.  Regardless of the number of attempts or how many times I tell it to run the test, the order is always the same.  First and fastest is always the List version, second and mostly consistent is the Manual version and the Regex version ends up in last place by various margins.

I’ve always known it to be general knowledge that doing things by hand are faster from a computer’s perspective.  Interestingly enough though, this actually proves that at least in C#, that’s not always true.  The List approach uses a supplied method, the Contains() method, to search for the existence of a character within the List instead of looping through the entire list and bailing out when the first match is found (as the Manual approach basically does).

It should also be noted that just because the computer has an easier time handling the List/Manual methods, doesn’t mean it’s necessarily faster.  Most people are not going to be trying to validate 50,000 email addresses in a few seconds regardless of what they’re doing, so the time that I took writing this algorithm all those years ago (and today) were really wasted in a sense, as it would take a very long time to make up the time in saved milliseconds.  Regardless, I had a lot of fun working with Kim^J to look into the possibilities here.

If anyone finds anything that could help any of the algorithms become faster (and remain accurate), I’d be really excited to hear about your ideas.  Thanks again to Kim^J for the help with the regular expression version and with the test code.

 

- Andy

Labels: , , , , , , ,

19 June, 2009

No Idea How To React

Reddit can be the best source of randomness for me sometimes.  I decided to load it up and see if anything new and interesting had appeared on the site since I checked it this morning and was rewarded with a link to this site.  E-603 is a ‘masup artist’, which is something I’d never heard of before.  In listening to the songs with everyone in #Zibings.com, we have unanimously decided that it’s impossible to like or dislike the songs, there just is no appropriate way to react.

Also, check out the other group/person/whatever that they talk about on the page, Girl Talk.

 

- Andy

18 June, 2009

N2F Yverdon: Tested On…

Just had a quick discussion in IRC and found out that we’re already tested as working on a few different environments:

- WAMP
- WIMP (IIS 5.1, 6, 7 & 7.5)
- LAMP
- MAMP

Still waiting for confirmation on Lighttpd but I don’t see why it wouldn’t work.

Not bad really, but I guess that’s more to PHP’s credit that it works so consistently over all the different environments.  Cool times, thanks for the testing guys!

 

- Andy

[Update]
Confirmation of Lighttpd has been received, thanks Anthrax.

Labels: , , ,

A So-So Dinner

Last night’s dinner (Pomegranate Chicken) was a decent adventure into the use of pomegranate as a seasoning/marinade.  I did enjoy it, but not as much as the salmon or the grilled sirloin.  Oh well, I did take a picture though (as usual it looks awesome).

Picture 009

 

- Andy

Labels: , ,

15 June, 2009

The Fat Resistance Diet: Day 1 Complete

I promised I’d do updates for this as often as possible, so here’s one to recap my thoughts on the first day.  This diet is quite possibly the most delicious diet I’ve ever seen.  For dinner I had Green Tea Crusted Salmon with Lemon Ginger Salsa and Baby Spinach Salad with Apples and Roasted Walnuts and a Pomegranate Lime dressing.  Most of the things I’ve just listed, are items I do not eat, because I believed I did not like them.  I’m wondering if I’ve just been fooling myself all this time…

Picture 008

 

- Andy

Labels: , ,

A New Diet

In looking for a good accompaniment to the P90X program (which I will be starting again on June 22nd), I found some talk of something called the “Fat Resistance Diet.”  I have had chronic respiratory problems for the past two years and haven’t ever really found an answer.  Several people claimed though that this diet, created by Dr. Leo Galland, went a long way to resolve things similar to my problem.  The book doesn’t cost much, so I decided to order it and give things a try.  I am not really trying to lose weight, though I wouldn’t be hurt if I did lose a few pounds.  The interesting thing about this diet seems to be that it approaches weight loss from a different direction, so instead of counting calories I’m eating some pretty sweet meals.  So far, I’ve had my first breakfast and am sufficiently impressed with the dish.  It is called “Tuscan Frittata” and has egg whites, basil, tomatoes and minced garlic on top of a bed of baby spinach.  Here’s a picture, though I don’t think it does it justice…

Picture 002

As usual, I’ll keep you posted as I go through the diet (and I’ll keep trying to get pictures of what I’m eating as it appears they’re all going to be amazing).

 

- Andy

Labels: , , ,

14 June, 2009

Unleash The What?

During my usual morning perusal of various blog and social sites, I came across a story about a website attempting to get back at The Pirate Bay by selling Anti-Pirate Bay t-shirts.  The site, called Unleash the Bats, uses the Pirate Bay’s own logo in some t-shirts of it’s own, along with other materials aimed at supposedly helping angry artists spread the message about how evil TPB is to the ‘creative industries’.  As to what “Unleash the Bats” means, I honestly couldn’t take a guess.  Maybe it’s a British thing?  More than likely it’s just an idiotic thing though…

The article on TorrentFreak reminds us that TPB really could care less about their own copyrights, even highlighting how Peter Sunde from TPB has sent Unleash the Bats a message offering them the link to higher quality images to use for their branding.  I guess the ultimate question is, do the ‘creative industry’ executives actually think something like this is going to work?

Though generally I try to stay out of the discussion as much as possible, I should make it clear that I love The Pirate Bay.  I watched the results of their case, and continue to watch as the lines of deceit and deception are revealed.  Watching a group of ‘industries’ completely miss the point time and time again is definitely fun for me, what about you?

 

- Andy

Labels: , , , ,

09 June, 2009

Trying Twitter…

Most people who know me also know that I’m not a huge fan of most of the popular “social networking” sites that exist right now.  Even so, after several months of mild campaigning, Cassandra has convinced me to give it a whirl.  For the next week I’ll be "tweeting” updates to http://twitter.com/AndyM84/ so that I can get a feel for the service.  Having done it for one day so far, I can say that at the least it’s easy to work with, but I feel like I’m just pretending that my life is important enough to give out status updates.

Regardless, I’ll keep at it until Sunday at the least.  If I get used to it and don’t have too many major annoyances, I’ll keep it running.  Now if you’ll excuse me, I need to go attempt moving for the first time today…

 

- Andy

Labels: ,

04 June, 2009

The Oldsongious Effect

After hearing a few ‘old’ songs I loved today, I’ve decided that the ‘Oldsongious Effect’ is indeed a provable effect on music lovers.  The effect occurs when one listens to a song (or group of songs) to the point where it no longer excites the person.  After an indeterminable period of time, said person will experience nostalgic and renewed excitement and/or emotion upon hearing the song(s).  The effect is amplified and it’s timeline shortened when the person is within a group of individuals who are also susceptible to the effect on a particular song.  For the best example of this, please proceed to your local club and note the crowd’s reaction when an older song is played.

 

- Andy

Labels: ,