s (54 sloc) 2.4 KB

ajrawson.com by ajrawson

ajrawson.com

Writing code and having fun doing it!


Project maintained by ajrawson Hosted on GitHub Pages — Theme by mattgraham

Winning Gold Addy Award

03/05/2011

Late last year, the designer I worked with (Bill Pendry ) on the new Martin Bros website submitted our work to the Cedar Valley’s chapter of the American Advertising Federation for consideration of an Addy award. In January we were notified that our hard work was being recognized with a Gold Addy Award. So in mid February we went to the award ceremony in Waterloo and received our Gold Addy Award (pictured below), it was pretty cool seeing all the cool web apps and advertising stuff created in the last year on display. I came away from the award ceremony truely impressed with the talent and skills of many of people who work with advertising and web promotions in the cedar valley area and feel really lucky and humbled to have been part of a team that won a Gold Addy Award. It was also pretty cool to see some good friends and former coworkers get some recognition for their skills and hard work, so thank you to the CF-AAF for putting on a good show and helping recognize the hard work of so many people in the Cedar Falls/Waterloo area.

Figure 1

Also thank you to Martin Bros for allowing us to upgrade and try some new stuff with the corporate website that allowed us to receive this award. Personally I’d like to thank my coworkers for helping get the site up and running especially Bill who did a ton of awesome design work and Kristin Clark who helped out with a few other important areas.

Now it’s time to go out and start working towards winning another Addy next year!

Tags: Personal


Mask the date format when using jQuery UI datepicker

03/04/2011

In this post I want to cover how we can mask the value of an input thats using the jQuery UI datepicker, so if a user enters a date into the input field it is formatted correctly. Also by supplying a mask to the input field it will give a user an idea of the date format required if they enter the date manually, below is an example if what we will create (using MM/dd/yyyy).

Figure 1

The two things we’ll need to add to our code to get this working, is a reference to the jQuery UI plugin and the jQuery masked input plugin. Also since we’re using jQuery, if your not already referencing the jQuery library you’ll need to reference that as well.

Figure 2

Now that we have the correct jQuery libraries and plugins registered in the page we are ready to setup our html input and javascript code. First add an input text element to the html code:

Figure 3

Next we’ll want to add the javascript code to hook up the datepicker and input masking functionality from the jQuery plugins to the input element we’ve just added to our page. We’ll do this in the jQuery ready function. In the code that follows you’ll first see that the dateValue input is wired up to use the jQuery mask plugin and that we want to use the date format of MM/dd/yyyy. To declare that we want to use the format of MM/dd/yyyy, we say that we want only digits in the textbox and it should be in the format of “99/99/9999”. This works great, the only problem is that it allows users to put any digit in the text box, but it must still follow the date format we are expecting (MM/dd/yyyy). To fix this issue we’ll add some validation later. The other part of the javascript you’ll see being wired up to the dateValue input in the jQuery ready function is the jQuery UI datepicker. For the settings of the datepicker we need to also set the format to follow the masking format we set earlier. If you want to learn more about the dateformat options on the jquery UI datepicker check out this link http://jqueryui.com/demos/datepicker/#option-dateFormat.

Figure 4

(Disclaimer: Just to make this easy to read, I broke up the jQuery selectors, but you could chain them together.)

We now have the jQuery datepicker and masking wired up to our dateValue input element. The only other thing we might want to add to complete this feature is to add some validation to the input. The validtion will be important for users who manually enter a date value rather then using the datepicker. For this we’ll just use jQuery validation plugin and a little regular expression. The code that follows will also reside in the jQuery ready function and wires up the jQuery validation plugin to the dateValue input box. The validtion will be verified before the form is posted back to the server, thus saving you hit on your server, and will notify the user if there is something wrong with their date value.

Figure 5

Hopefully this post helps you out if you are looking to add some masking to your jQuery UI datepickers. If you have questions or comments please leave me a note in the comment section below.

Tags: jQuery and javascript


List of open source libraries I’ve been working with lately

02/02/2011

I’ve been wanting to make a list of open source projects I’ve been working with for some time, and decided today was the day. Some of these libraries I’ve spent a lot of time with and know very well and some I’ve just been using for one purpose or another. But without furher adieu here is the list:

.Net open source libraries

Javascript open source libraries

I’ll probably keep adding to this list as I start using more open source libraries and possibly make an additional list of items I’ve quit using as I grow in my development career.

Tags: MVC, jQuery, javascript, and ASP.NET


Using SquishIt on a site running under a named user (Active Directory).

01/30/2011

I wanted to make some performance improvements on a project I had been working on last week and decided to give SquishIt a try and start compressing and combining my javascript and css files. This is not a post about how to setup SquishIt, others have covered this really well and if you want to learn more about that check this link out Learn SquishIt. In this post I would just like to take a moment and remind people of some things to take into consideration if they are using SquishIt.

First of all setting up and using SquishIt was a breeze, I really enjoyed every part of it and plan on using it in projects I work on the future. I did run into one problem when I was trying to get SquishIt working on my Windows 2008 web server, and I wanted to take some time to get the solution written down. I was able to setup and run SquishIt easily from my development machine but started getting permission errors when I published my MVC application to my staging server. After digging through the error messages and taking some time to understand how SquishIt was working, I was able to figure out the named user my site was running under was causing my issues. What SquishIt does is combine and compress the javascript and css files you’ve selected in your project and places their combined files in the file location you’ve specified. (click the Learn SquishIt link to learn more about this). The issue I saw with permissons had to do with SquishIt not have access to write the combined files to the specified file location. I went and checked if the named user I was running my site under had write access to the folders that needed to be written to and it did not. I then added write access for the named user and saved those changed and reran my application on the staging server and was able to access the site without running into any permission errors. To clearify, if your using any libraries that need to write to the project folders, make sure your named user has access to write to those folders. After getting the site running, I verified the site was using the combined css and javascript files from SquishIt with FireBug, and it was. I then compared stats of my site from using uncombined and uncompressed files to using combinded and compressed files and the size of my site’s download drop by 1/3 in size. Hopefully you’ll find SquishIt as useful and beneficial as I have and if you run into any permission issues on your sites, check to make sure the user the sites running under has write access to the appropriate folder.

Happy Programming!

Tags: MVC


Using Vegas odd’s for football pickem

01/28/2011

During this past football season (2010 sesason), I was part of a football pickem pool with a group of friends of mine. If your even a small of NFL fan you know it’s pretty tough to pick the winners of games. First because free agency makes the teams farily even, secondly because of free agency a team is not the same from year to year and heck week to week because of injuries, and there are a ton of other reasons. Since I decided trying to guess the winners wasn’t an option, and making an educated pick was going to take a lot of work and time I didn’t have I decided to use vegas odds to pick my winners. Another reason I chose to use vegas odds was to see how accurate Vegas was in picking NFL football games, and maybe if I’m lucky they’ll help me win a little money along the way.

Here were my rules for using vegas odds:

  • I would always make my picks on Wednesday from the Vegas.com website.
  • If the point spread was less then 1 pt I would always pick the home team.
  • I would use the vegas totals for guessing the total score for Monday night games.
  • And no changing picks (this cost me when the Metrodome decided to go domeless).

And now for the final results (the numbers will represent the weeks):

  1. 9/16 (0.562)
  2. 9/16 (0.562)
  3. 8/16 (0.500)
  4. 8/14 (0.571)
  5. 6/14 (0.429)
  6. 11/14 (0.786)
  7. 8/14 (0.571)
  8. 9/13 (0.692)
  9. 9/13 (0.692)
  10. 8/14 (0.571)
  11. 12/16 (0.750)
  12. 11/16 (0.688)
  13. 12/16 (0.750)
  14. 13/16 (0.812)
  15. 12/16 (0.750)
  16. 9/16 (0.562)
  17. 12/16 (0.750)

Some things I noticed as the season went along was that vegas was getting better at picking the winner, this didn’t surprise me to much. I also noticed they always seemed to be fairly accurate, never quite accurate enough to let me but they would get you pretty close especially in the 2nd half of the season. From week 1-8 vegas total was 68/117 which was 58.1% accurate, their stats for week 9-17 were 98/139 which was 70.5% accurate. From the stats it definately becomes visible that vegas is pretty good at picking NFL games after the halfway mark the season and pretty average the first half of the season. My take away from this is to use vegas as an assistance tool the first half of the season and a guiding tool for the 2nd half of the season when looking for game winners. Only thing I’d want to add is that even though vegas was picking at a 70% rate in the 2nd half of the season, they were never good enough to actually let me win a week (we got paid for weekly winners).

My season total then was 166/256 for a 64.8% accuracy rate, which was good enough for 2nd in my pickem league and meant a pay day for me ;).

Granted this was only 1 years stats, but I’d say vegas does a pretty good job of picking the winners of NFL football games during the 2nd half of the NFL season. I want to check the stats again next year and see how accurate vegas is at picking NFL games in the long run and make sure this is not a fluke. The other big issue I see with using vegas as your only tool for picking NLF games is if other people are doing the same thing , then you’ll never win and thats no fun :).

Happy picking everyone!

Tags: Random and Personal