Monday, June 21, 2010

Using jQuery and Templating to Pull and Display Your Twitter Updates

A while back, I wrote a blog post on how to pull in your last three twitter posts into your web page via jQuery and JSON. It's still today a very popular post.

A lot has happened since that post and I wanted to re-address it and show you an alternative way of pulling in your Twitter feed via jQuery and the new Templating plugin developed by Microsoft. On the right is a new Twitter widget I put together using the new jQuery templating plugin.

Microsoft's Templating Plugin

During MIX10, John Resig and Microsoft announced that Microsoft would be contributing code back to the jQuery Project. One of their first contributions was the Templating plugin. Microsoft created templates for jQuery so that JavaScript developers could use jQuery to easily display a set of data.

The source code for the plugin can be found in the jQuery-tmpl GitHub repository. The plugin requires jQuery 1.4.2 or higher.

Getting Setup

Before we start you'll need the following:

Create a html page, and include jQuery, the template plugin and the supporting_methods.js. Then include the style.css doc so that your code from the demo we do looks nice.

The HTML

Since each tweet will be listed as a list item in an unordered list the only required HTML we need is an empty ul:

		<ul id="renderTweets"></ul>
	

In our demo though we want to make it a complete widget. We need some extra layout html to be able to provide a heading and a link to take you to more tweets. Here is the full html we'll use:

		<div id="Tweets">
			<h3>@RedWolves Tweets</h3>
		  	<ul id="renderTweets"></ul>
			<div id="more">
				<a href="http://twitter.com/redwolves">More &gt;</a>
			</div>
		</div>
	

Make sure you replace my twitter name, RedWolves, with yours.

Making the Ajax request

Now let's get the data from Twitter. We'll use a JSONP ajax call to get back the JSON data of the last three tweets from Twitter. To get the JSON data we will use the user timeline of the Twitter API.

		$("document").ready(function(){
			var url = "http://api.twitter.com/1/statuses/user_timeline.json?id=RedWolves&count=3&callback=?"
			$.ajax({
				dataType: 'jsonp',
				url: url,
				jsonpCallback: "renderTweets" 
			});
		});
	

At the end of the Twitter API url that we declare we attach the user id of the user timeline we want to see, in this case mine, RedWolves, so make sure to update with the username you wish to see. We then declare the url and call the .ajax() method and provide it with the dataType 'jsonp' so that we can pull the data via cross-domain. We set the url and then tell it which function we will call after the data is loaded. After the data is loaded we will call the function 'renderTweets', defined below, which will run the data through the template.

Defining the Template

Now let's define the template that will display the data we get back from the Ajax request. We define the template in a script tag and we provide it with a type of "text/template" and a unique ID.

		<script type="text/template" id="twitterTemplate">
			<li>
					<img src="${ user['profile_image_url'] }" /> 
					${ text.linkify().atify() } 
					<span class="created_at">
						${ relative_time(created_at) } via ${ source }
					</span>
			</li>
		</script>
	

On each JSON item we will run it through the template and create an li element with the profile photo, tweet text, when it was created and what source the tweet came from (e.g. Twitter for iPhone, web, etc.).

We are using a couple of supporting methods to help us in formatting. .linkify which will make any link a hyper link, atify which will link up any @screenname to their twitter profile and relative_time which will turn the created time into Twitter style time. You can find these methods in the supporting_methods.js file.

Putting it all together

The last bit of jQuery code we need to do is to actually call the plugin and combine the template with the data and put it into the DOM. Here we will define the renderTweets callback function.

		function renderTweets(data) {
			$("#twitterTemplate")
				.render(data)
				.appendTo("#renderTweets");
		}
	

What we do is select our template, call the template plugin method, .render, which takes in the data from the Ajax call and renders the results against the template, and then append the results to the desired element in the HTML, the ul with id of renderTweets.

The whole HTML

		<!DOCTYPE html>
		<html>
			<head>
				<meta charset=utf-8 />
				<title>twitter</title>
				<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
				<script src="jquery.tmpl.js"></script>
				<script src="supporting_methods.js"></script>
				<link rel="stylesheet" href="style.css" type="text/css" media="screen" title="no title" charset="utf-8">
				<script type="text/template" id="twitterTemplate">
					<li>
							<img src="${ user['profile_image_url'] }" /> 
							${ text.linkify().atify() } 
							<span class="created_at">
								${ relative_time(created_at) } via ${ source }
							</span>
					</li>
				</script>
				<script type="text/javascript">
					$("document").ready(function(){
						var url = "http://api.twitter.com/1/statuses/user_timeline.json?id=RedWolves&count=3&callback=?"
						$.ajax({
							dataType: 'jsonp',
							url: url,
							jsonpCallback: "renderTweets" 
						});
					});

					function renderTweets(data) {
						$("#twitterTemplate")
							.render(data)
							.appendTo("#renderTweets");
					}
				</script>
			</head>
		<body>
		  <div id="Tweets">
			<h3>@RedWolves Tweets</h3>
		  	<ul id="renderTweets"></ul>
			<div id="more">
				<a href="http://twitter.com/redwolves">More ></a>
			</div>
		  </div>
		</body>
		</html>​
		
	



Source Code Demo

Saturday, January 02, 2010

Getting "Up-to-speed"

I was looking over my blog this week while I was out on holiday vacation and noticed I haven't posted a blog post since October.  So much has happened since then I think perhaps a "getting the reader up-to-speed" post is in order.  

So here we go...

jQuery Team member

Early last year, I made it a goal to blog, tweet and personally evangelize jQuery to better myself and the project.  My efforts got noticed by jQuery Evangelist Rey Bango and he brought me in as a advisor to the jQuery team.  While I was an advisor I took advantage of my situation and jumped in on projects the team was working on.  Mainly, the jQuery Conference in September and the Stack Overflow Dev Days talk in Toronto.

In November, it was voted on by the jQuery team to bring me on as a jQuery Team Member and I was added to the evangelism team.  I was truly surprised and honored by this action as I wasn't expecting it at the time. 

Being a team member made it easier for me to launch my new project...

The Official jQuery Podcast

I announced in October, at Stack Overflow Dev Days in Toronto, that I would be starting the Official jQuery Podcast in November.  I worked with the jQuery team to get infrastructure support and found a cohost, in Elijah Manor, that could give an outsiders perspective on topics.

We initially started with streaming the shows live on uStream.  But I think I am finding that to be too stressful and am reevaluating whether that is still viable.  Maybe at a later date.

Our first show, with guest John Resig, got the show ranked to #2 on the top Technology podcasts for the day which was very exciting.

We've since had guests Richard D. Worth, Paul Irish, Cody Lindley and Rey Bango.

Our planned shows for January will sure to be very exciting. We are planning to travel to Washington DC to do some shows live in person with the people we are going to interview.

You can find our show on iTunes or you can subscribe to the show with the raw RSS feed.

My plans for now are to do a weekly show as long as I can sustain them throughout 2010.

Coming up in 2010

I don't have many plans for 2010 at this point but there are a few things I am planning on.

We are currently in the middle of planning something huge for jQuery this month.  I'll be travelling with Elijah to cover the "something huge" for the Official jQuery Podcast.

In addition, there will be physical conferences in San Francisco, London and Boston.  I am hoping to at least attend the conferences that won't require a passport.
I am currently scheduled to give a talk on jQuery at LUGOR (Linux User Group of Rochester) on May 20th at RIT.

So there you go you should now be sufficiently "up-to-speed."

Monday, July 13, 2009

403 Permissions Denied on your users Site in OSX

I came into work today and turned on web sharing and got a 403 Permissions Denied error.

I followed the typical procedure to fix this, to no avail.

The fix was to set the user home directory permissions so everyone had read access.  It currently was set so everyone had no access.

Hope that helps someone someday.

Tuesday, June 16, 2009

Selecting the fastest selector for jQuery using Firebug Profile

Today I needed to select all the h3's within a div and set a margin-top property on all items in the returned set except the first.

I came up with a few ways to return the results I was looking for (here are some jQuery examples):

$("#div h3").slice(1);

$("#div h3:not(:first)");

$("#div h3:gt(0)");

I've been reading a lot about how your selection can be optimized based on how you structure your query. So I ran each query through Firebug Profile to see which selector query was the fastest. Load the page, click on the "Profile" button at the top, run your query in the console, click the "Profile" button again to stop the profile.  You'll get the time it took to execute that statement.  Here are the results for each:

$("#div h3").slice(1); 3.305ms

$("#div h3:not(:first)"); 0.705ms

$("#div h3:gt(0)"); 2.347ms

It's clear from my testing that the second query is 2-3 times faster then the rest for my page and my specific uses.  Your specific profile times may vary based on HTML structure and selector query. So it's always good practice to test the speed of your selector if there is more then one way to get your results so that you are using the most efficient selector for your situation. 

Sunday, June 07, 2009

Hidden C# Feature: Using Alias Directive

You can create an alias to a long namespace or a type like so:

using Project = SolutionName.Data.Project;

Then you use the Alias in place of the namespace:

Project p = new Project();

I wish I would of known about this last summer, probably could of shaved a month off my project just from not having to type in the long namespaces to our data layer.

Related Links:

using Directive (C# Reference)
Hidden Features of C#

Thursday, May 21, 2009

New Features of .NET 4.0

Microsoft recently released Visual Studio 2010 and .NET 4.0 beta.  I'd like to highlight some of the key new features available to .NET 4.0.

Web Forms

  • Developers can manage control IDs that affect rendered client ID
  • Remove ID bloat, and 'mangling'
  • CSS:
    • Ideally remove the need to use CSS adapters
    • Defer to CSS styles and bypass existing style properties
      • non-inline style attributes
    • Support non-table-based HTML rendering
  • URL-routing for web forms
    • Friendly url handling for web forms
    • configuration model for url routing
  • View state
    • Disable on the page, enable on specific controls - they will provide granular control of viewstate - today it is backwards
    • Disable on control, enable on child controls
    • GridView/ListView work better without viewstate
  • ASP.NET dynamic-data

Ajax

  • Continue ASP.NET Ajax innovation : RIA
  • Appeal to JavaScript Developers
  • Provide support for the page developer
  • jQuery including Intellisense
  • Templates and data binding
    • Client side handling, REST or Web Services
    • Covers page developer and component developer scenarios
  • DOM manipulation, selectors ...
  • Ajax higher-level components
    • Ajax Control Toolkit is a part of the strategy - they will make the toolkit part of the overall ASP.NET package
    • New controls
  • Centralized script libraries and break-up for performance

ASP.NET MVC

  • Appeal to those wanting separation of concerns, TDD, full control
  • Ruby on Rails, Django, PHP
  • Building on from ASP.NET MVC 1.0
  • ASP.NET MVC (Model View Controller)
  • Asynchronous controllers
  • Sub-controllers & Views
  • Declarative controls

ASP.NET Dynamic Data

  • Making building data-driven web apps easily
  • Attacking the Ruby on Rails crowd
  • Building on from FX3.5 SP1
  • Dynamic-data and MVC
    • Scaffolding, templates and data validation
  • Support for abstract data layer
    • Removes need for specific DL (SQL, entities ...)
    • Allows scaffolding of objects
  • Support for many to many relationships
  • Dynamic data on MVC -- this is on codeplex today
  • Built around something called field templates
  • Enhanced filtering:
    • Auto-complete, search filters

ASP.NET Core

  • Address customer pain points
  • Improve scale and performance
  • Cache extensibility and performance:
    • Enable caching like Velocity

There's a couple of videos on Mircosoft's Channel 9 that talk specifically about the points mentioned above:

Thursday, April 23, 2009

Kids can do amazing things with Social Networks

Last night my 14 year old asks me in if we can make a web site.  For what, I ask.  For his XBox 360 gaming clan.  Oh, hmm.  Well I am not going to make one from scratch for you, I tell him.

I give it a little thought.  And I suggest to him that he can make a site on Ning.  But he has to figure it out on his own.  He says ok.  I give him the address.

After he asks a few questions of me that I refuse to answer he has a site up in a matter of 10 minutes.  He continued tinkering with it last night and I checked it this morning.  I was somewhat blown away with what he came up with.




I know it's probably just themes and such but I am still pretty impressed with what he was able to come up with in a couple of hours last night.  I will be supervision him (if he knows it or not, although after his incident on MySpace I am sure he now knows that everything he does under our roof is monitored) as he runs this site on his own.  Should be a good learning experience for him.

Here's the site if you'd like to see it.

Tuesday, April 21, 2009

O3D: Google releases 3D API in a Browser Plugin

Google released O3D a 3D API in a browser plugin.  See video of rendering demo:


If the future of computing isn't in the browser then this is all a waste of time.  Pretty impressive.  Check out Ajaxians post on the topic.

Wednesday, March 11, 2009

What Was Apple Thinking?

This morning Apple released the third generation iPod Shuffle.

I own a second generation shuffle and when I saw the third generation I immediately thought it was a step back for Apple. Here is what I don't like about the third-gen:

  1. You now need a headset with the remote control function on the cord.  The standard set from Apple is $29.99 to replace if you lose them.  They are also ear buds.  I dumped ear buds a lot time ago due always having to shove them back in and the eventually hurt your ears.  There is no easy choice for the consumer in which headset 
  2. Still no display.  They try to solve this by adding a voice to tell you what you're listening to when you want to know (Clicking and holding the center button).  I would assume this would be somewhat annoying and not 100% accurate.  
  3. In my opinion, and this is probably a matter of personal taste then anything else.  I think the design is ugly and clumsy.  If you think of what the new shuffle will look like on a person listening to music it'll look clumsy.  Headphones that go to a small faceless block that has no interface.
  4. Finally, the usability of the device is pretty bad.  My parents bought a shuffle for Christmas and they wouldn't touch it until I showed them how to use it.  I can't imagine trying to show them how to use this version.  Looking at the documentation online it looks like a nightmare. Double-click and hold to fast forward, Triple-click and hold to rewind? How is anyone going to remember that?  More importantly how are you going to know if you clicked it two times or three as it's be hard to figure out when the sound is skipping by.  Here's an interesting comment from Ernie Bello :
    
I’ll agree that moving all of the playback functions on the face of the previous shuffle to one button on the headset of the new one is not as discoverable. However, I’d argue that once the new functions are learned, they are more usable.

Unfortunately anything you learn is going to be more usable.  That does not make the usability of the device good.

So how could have Apple made this work?  I'd like to see one set of headphones with the iPod integrated into the frame of the headphones.  Sort of like the Monster iFreePlay Headphones for the Second Generation iPod:

Now if Apple could take this and integrate the electronics of the shuffle into the back of the headphones in one fluid piece not an add on like shown above and provide the controls on the ear pieces you'd have a cool iPod shuffle.

If you think pushing your finger up to your ear is dumb, think about how many times you push the ear buds back into your ear.  If you don't like the design well then think of it as functional.  I've heard many examples how the iPod shuffle is for when people exercise.  If you've ever tried to run with a pair of ear buds in your ears you'll understand it when I say that you'll tire out faster maintaining the buds in your ears before you tire out while running.

I think Apple went too far to the right in simplicity on this design.  In the end though I am not the target buyer for this device.  I have a Touch and a second generation shuffle and there is no need for something this simplistic.

It makes you wonder though, will the next generation iMacs come with a buttonless remote?  You control it by flicking it due to it's accelerometer?  Double-flick to fast-forward triple-flick to rewind? 

Tuesday, March 10, 2009

The Future of Programming Languages is Now

As I was commuting home from work tonight I was listening to StackOverflow #44 where Jeff Atwood and Joel Spolsky were discussing how the future of programming languages will gradually get smaller and more precise in their function. Jeff explains:

"I see the future of languages as a lot of small languages that are good in specific things. And you'd switch between them in a fluid way, to when you are like "Oh, this is a set-based problem" or "Oh, this is a database problem" or "Oh, this is a text manipulation problem" and you sort of drop in a language that is good in that thing."

That statement resonated with me for a little while and I got to thinking the future of languages that Jeff perceives is already here.  Let me share what I mean from my experiences in programming during my career.

Let's first take a step back and look at programming languages back when I first started in 1996.  For me there was HTML and that was it.  For me PHP really hadn't taken off, classic ASP was just coming out and so everything was HTML even the formatting was done within the HTML *shudder*.

Move a head some to 1999 and I got into Classic ASP.  Still a language that was self contained.  You could hook it up to a database either Access or SQL Server being the popular choices but SQL statements were done inline in the spaghetti code mess.  In one ASP file you had the dynamic code the presentation and the data integration.

Let's move now to 2003, ASP.NET 1.0 is prevalant.  SQL Server 2000 is out and you could now separate your data integration into stored procedures with T-SQL on your SQL Server.  You would use ASP.NET to separate your busniess logic and your presentation.  CSS was making headway as the way to separate your presentation code from your markup code. 

In 2006 I feel is the start of segmenting ASP.NET out further.  Why? jQuery was released to the world.  And as the world grew more and more used to working with jQuery we were able to hand off some of the tasks that ASP.NET would of handled dynamically, like form validation, DOM manipulation and page interactions.  So we now have CSS to handle presentation, jQuery to handle DOM manipulation, ASP.NET to handle business logic, HTML to handle page structure and finally T-SQL to handle data manipulation and retrival. 

Seems to me that we've made it to the future.  I would hate becoming a web developer today.  You need to learn at least 5 languages to be able to create a respectable web page.  It's also my experience that colleges aren't teaching students all these languages.  They either learn them on their own or they learn on the job. 

Look at what Microsoft is doing to ASP.NET.  .NET 2.0 is the core which then 3.0 and 3.5 are loaded on top.  These versions of .NET include smaller subsets of the language that you may or may not use WFS, Silverlight, WCF, MVC, Dynamic Data, etc.  The burden on the programmer to keep up is ridiculous.

The question I have, does the future continue to segment languages even further as Jeff predicts or will there be a time where we start merging languages together and come back to one super language? When does the segmentation of languages start to hinder us instead of help us?

Friday, March 06, 2009

Promotional Video of BarCamp Buffalo

And I am in it.  Video was done by WNYMedia and was very well done.


Tuesday, March 03, 2009

My BarCamp Buffalo Slides - Intro to jQuery



Update:

Video of my presentation. 


My BarCamp Buffalo Presentation - Intro to jQuery from Ralph Whitbeck on Vimeo.

Presentation to BarCamp Buffalo on 3/3/09. My slides can be found http://ralphwhitbeck.com/2009/03/03/MyBarCampBuffaloSlidesIntroToJQuery.aspx

Wednesday, February 18, 2009

CPU statistics on yesterday's post

I got a little help promoting yesterday's blog post from the jQuery team.  I knew that a wave of users was coming so I let my host provider know and they gave me an extra CPU for the morning (VMWare rules).  They also sent over the CPU graph for the day.  I found it interesting.

The first spike was when John Resig posted a link on twitter for me. The second biggest spike was when Rey Bango retweeted John's tweet.

Tuesday, February 03, 2009

In case you Missed it: #jQuery Twitter posts

My #jQuery related twitter posts for the week of January 27th - February 2nd:

Friday, January 30, 2009

Selecting a ASP.NET Generated ID with jQuery

I was looking at some of the questions on Stack Overflow this evening and I came across one that had a great tip for selecting a tag whose ID was generated by ASP.NET.  So say you have a label control on your page:
<asp:label id="label1" runat="server"></asp>

The generated output of the html and the ID of that control might look like this:

<span id="ctl00_ContentPlaceHolder1_Label1"></span>

Unfortunately the generated ID of ct100_ContentPlaceHolder1_Label1 isn't always going to be the same from build to build.  So trying to select it like this:

$("#ct100_ContentPlaceHolder1_Label1").hide();
will eventually break and it won't hide the label control.

The trick is to use ASP.NET inside the jQuery selector. Label1.ClientID will return the generated ID everytime. We combine ASP.NET and jQuery into one line like this:
$("#<%= Label1.ClientID %>").hide();

This will get the generated ID of the Label control everytime.



Thursday, January 29, 2009

Building a jQuery-Powered Tag-Cloud with an ASP.NET MVC backend

NETTUTS had a great tutorial by Dan Wellman called "Building a jQuery-Powered Tag-Cloud" The problem for me was that the tutorial showed you how to connect to the database and pull tags and frequencies via PHP.

Because I am currently learning ASP.NET MVC I thought I would try to duplicate the results of the tutorial but with using ASP.NET MVC RC instread of PHP.  Here is how I did it.

I started by creating a Home Controller class.

HomeController.cs

   1:  using System;
   2:  using System.Collections.Generic;
   3:  using System.Linq;
   4:  using System.Web;
   5:  using System.Web.Mvc;
   6:  using System.Web.Mvc.Ajax;
   7:   
   8:  namespace MvcApplication5.Controllers
   9:  {
  10:      public class HomeController : Controller
  11:      {
  12:          //
  13:          // GET: /Home/
  14:          public ActionResult TagCloud()
  15:          {
  16:              return View();
  17:          }
  18:   
  19:          public JsonResult JSON()
  20:          {
  21:              List<object> tagcloud = new List<object>
  22:              {
  23:                      new { tag = "jQuery", freq = "10" },
  24:                      new { tag = "asp.net", freq = "3"},
  25:                      new { tag = "programming", freq = "183"},
  26:                      new { tag = "code", freq = "34" },
  27:                      new { tag = "HTML", freq = "58"},
  28:                      new { tag = "javascript", freq = "23"},
  29:                      new { tag = "people", freq = "43" },
  30:                      new { tag = "Google", freq = "3"},
  31:                      new { tag = "Microsoft", freq = "1"},
  32:                      new { tag = "Apple", freq = "10" },
  33:                      new { tag = "iPhone", freq = "38"},
  34:                      new { tag = "MVC", freq = "1"}
  35:              };
  36:              return Json(tagcloud); 
  37:          }
  38:   
  39:      }
  40:  }

What's happening here is that we are making a action for the View we will create and I am calling it TagCloud.  This action isn't going to provide us any data so it's a stub action.  The next Action we create is to provide TagCloud the JSON data.  In here I am creating a static List to send back serialized as JSON.  You could also tie it to a model and use Linq to SQL to build the List.

Our URL for the .getJSON method will be: /Home/JSON

This will return JSON data that looks like this:



Notice the difference in the JSON I am bringing back and the one Dan was bringing back.  I don't have a tags: with the rest of the data nested under it.  We'll need to update a line in the jQuery to make this work now.

Let's create the View for TagCloud.


TagCloud.aspx

   1:  <%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
   2:   
   3:      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">  
   4:      <html>  
   5:        <head>  
   6:          <link rel="stylesheet" type="text/css" href="/content/tagcloud.css" />  
   7:          <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
   8:          <title>jQuery Tag Cloud</title>  
   9:        </head>  
  10:       <body>  
  11:         <div id="tagCloud">  
  12:           <h2>Tag Cloud</h2>  
  13:         </div>  
  14:         <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js"></script>  
  15:         <script type="text/javascript">
  16:             $(function() {
  17:                 //get tag feed  
  18:                 $.getJSON("/Home/JSON",null, function(data) {
  19:                     //create list for tag links  
  20:                     $("<ul>").attr("id", "tagList").appendTo("#tagCloud");
  21:   
  22:                     //create tags  
  23:                     $.each(data, function(i, val) {
  24:   
  25:                         //create item  
  26:                         var li = $("<li>");
  27:   
  28:                         //create link  
  29:                         $("<a>").text(val.tag).attr({ title: "See all pages tagged with " + val.tag, href: "http://localhost/tags/" + val.tag + ".html" }).appendTo(li);
  30:   
  31:                         //add to list
  32:                         li.appendTo("#tagList");
  33:                         //set tag size  
  34:                         li.children().css("fontSize", (val.freq / 10 < 1) ? val.freq / 10 + 1 + "em" : (val.freq / 10 > 2) ? "2em" : val.freq / 10 + "em");  
  35:            
  36:                     });
  37:                 });
  38:             });  
  39:         </script>  
  40:       </body>  
  41:    </html>  

As we start to loop through the JSON data Dan was telling jQuery to start inside tags with data.tags, since we don't have tags we can just use the variable data like so: $.each(data, function(i, val) {

The rest of setting this up is the same as NETTUTS article.  All that remains is the css.




Download the Source

jQuery-TagCloud_source.zip (44.82 KB)



Wednesday, January 28, 2009

ASP.NET MVC Release Candidate - No Codebehinds on Views

Check out Scott Guthrie's mammoth blog post on what's changed in this release of the ASP.NET MVC RC that was pushed to the public today.  A lot has changed in my opinion.  One change that I wasn't expecting was that Views and View User Controls do not have code-behinds any more.

The problem was the only way to have strongly typed Views was to inherit in the code behind.  This caused an issue with intellisense in the aspx/ascx pages. You would need to create and immediately build in order to have intellisense work.

No one was using the code-behinds anyways.  The code should be in the Controllers.

Here is the write up from Scotts Blog:

Views without Code-Behind Files

Based on feedback we’ve changed view-templates to not have a code-behind file by default.  This change helps reinforce the purpose of views in a MVC application (which are intended to be purely about rendering and to not contain any non-rendering related code), and for most people eliminates unused files in the project.

The RC build now adds C# and VB syntax support for inheriting view templates from base classes that use generics.  For example, below we are using this with the Edit.aspx view template – whose “inherits” attribute derives from the ViewPage<Product> type:

One nice benefit of not using a code-behind file is that you'll now get immediate intellisense within view template files when you add them to the project.  With previous builds you had to do a build/compile immediately after creating a view in order to get code intellisense within it.  The RC makes the workflow of adding and immediately editing a view compile-free and much more seamless.

Important: If you are upgrading a ASP.NET MVC project that was created with an earlier build make sure to follow the steps in the release notes – the web.config file under the \Views directory needs to be updated with some settings in order for the above generics based syntax to work.

Tuesday, January 27, 2009

In case you missed it: #jQuery Twitter posts

My #jQuery related twitter posts for the week of January 20th - January 26th:

Monday, January 26, 2009

BarCamp Rochester 4

BarCamp Rochester 4 has been announced for April 18th at RIT.  I missed last years and wish I could of attended.  This year I kicked myself in the butt and signed up to present on ASP.NET MVC.  This will force me to do a couple of things.  It'll force me to really understand MVC and it'll force me to be prepared.

Now if it'll force me to rewrite my blog in ASP.NET MVC by then who knows. Would be a good talking point.

Anyway, here is an initial structure of my presentation I am thinking about:

  • Introduction
  • MVC
    • Current uses (ruby on rails, CakePHP, etc.)
    • MVC in the wild (StackOverflow)
    • Status of MVC
  • MVC vs Web Forms
  • Demo (perhaps build a simple blog)
Any suggestions?

Friday, January 23, 2009

jQuery vs Prototype and jQuery.noConflict()

While helping people out on twitter with jQuery lately I've found one of the most common asked questions is, "why won't jQuery work when I include prototype as well?" Well the answer to the why is simple.  jQuery and prototype are both competing for how $() is going to be used.

I set out to understand how this would break and how to call jQuery.noConflict(); and make both work.

noConflict_test.html (2.41 KB)

If you look at my code you'll see that I was having a hard time just trying to get a single line of prototype to work as it should.  I tried to display a div that was hidden with css.  A very simple task in jQuery.  Unfortunately, it states right on the Element.show documentation page that prototype is not capable of displaying elements that are hidden with css. 

Next I tried to color the text of the other element on the page.  Which to my bad luck I was injecting into the DOM and I was finding that this is impossible to do in both jQuery and Prototype.

In the end all I wanted to do was fire one prototype command and have it update the DOM in some way.  Needless to say this gave me a bad taste in my mouth for prototype.

Wednesday, January 21, 2009

Apple comments on "netbooks"

In their Quarterly financial conference call today:

Cook also continued to downplay Apple's interest in the "netbook" market:

We're watching that space, but from our [point of view] the products are based on hardware that's much less powerful, software technology that's not good, cramped displays. We don't think that people are going to be pleased with those type of products. It's a category we watch, we have some ideas here, but we think the products there now are inferior and won't provide the kind of experience people want.

They obviously aren't paying much attention to the demand of it's customers.  If I had the money to buy a new machine I would of bought a Samsung NC10 right after MacWorld due to the nonannouncement of a netbook at MacWorld.

Netbooks are cheap and trending.  Recession proof in my opinion.

Update: John Gruber lays into Brian Chen for noticing the same thing as I.  What I think John does not understand is that the more Apple waits and sees the more money they are losing.  In my head, I don't have the confidence that they can pull something out now.  Any netbook that comes out in the future may not have the Steve Jobs stamp of approval.  At this point, it might be a year or more until we see a release of a netbook product from Apple. 

Apple played the wait and see game back when customers were demanding an iPod with video.  Apple's statement then was, we aren't going to make a video iPod, customers don't want to watch video on a little screen.  But a year later they released their first iPod video.  And they were right we didn't want to watch video on a little screen.  It took a couple more years for them to get it right and come out with the iPod Touch. 

Frankly, I am not going to wait and see if Apple is going to come out with a netbook the market is too saturated with netbooks. 

Tuesday, January 20, 2009

In Case you Missed it: #jQuery Twitter posts

My #jQuery related twitter posts for the week of January 13th - January 19th:

Follow me to see what I'll twitter next about jQuery.

Sunday, October 12, 2008

Database Mirroring with SQL Server 2005

    Database mirroring is a software solution, provided by SQL Server 2005, that gives you the ability to replicate your data in real-time.  Mirroring allows for increased database availability and data protection and works at the database level on databases that are set to full recovery mode.  You need two instances ofSQL Server to set up mirroring because it maintains separate copies of data of a single database across both servers.

    Let's look at a common scenario for database mirroring. Take a company that has their customer database in a data center in New York City.  They also have a backup data center in Houston. The database in NY is mirroring the data to the database in Houston.  Let's say the data center in NY loses power and they need to shut the server down.  With a "flip of a switch" they can move the database to Houston and continue as if nothing happened.  When the data center gets power again they can switch to the NY city database as soon as it's resynchronized.

Benefits

    One benefit of database mirroring is the increased data protection of your data.  As each transaction is being written to your principle database it is sending that exact transaction to the mirror database.  This provides complete or almost complete (depending on which mode you set up; I'll get into this later) data redundancy in real time.

    High-availability, this is a huge benefit for mission critical data.  Hardware failures happen and network issues arise, with a "flip of a switch' you can send the responsibility to the mirrored server to become the principled server at any time.  You can also set up automatic failover with the addition of a witness server to monitor the servers.

    Another benefit is that you have the flexibility to install updates on your server without data disruption.  Because you can manually failover to the mirror server at any time you can failover, install the updates and reboot if necessary. When you are done you can then have the new principle server failover again to restore the principle on to the primary server without any data loss or downtime and upgrade the mirror server.

    Finally, you can set up mirroring to sync in synchronous or asynchronous modes.  Synchronous or high-safety mode will write a transaction to the principle database and send that exact transaction to the mirror and then wait for it to finish committing that transaction before moving on. With high-safety you are assured that the data that is on the principle is on the mirror at the exact same time. In that you trade some latency waiting for the transaction for the true redundancy of the data.  Automatic and manualfailovers, explained more below, require the use of high-safety mode.

    Asynchronous or high-performance mode will send the stream of transactions at the mirror server and the mirror will try to keep up.  With high-performance there can be a gap where the mirror has a back log of transactions to complete that the principle already has completed.  This gap can become pretty big with heavy loads on the principle. 

Requirements

    Database mirroring requires two servers. With SQL Server 2005 you can set up mirroring with Standard or Enterprise editions.  It's very important that both servers are running the same edition.  It is also recommended that the hardware for both servers be near identical and have the ability to handle the same load.

Setting up a Database Mirror

    Let's start with some simple preparation:

  1. Make sure that you have the proper logins created on the mirror server.
  2. Create the mirror database by restoring with NORECOVERY a recent full backup of the principle database. The principle database must have been set-up with full recovery when the backup was created.
  3. You must also restore all log backups since the full backup was made. Create a backup of the transaction logs and restore on the mirror server.  You'll want to start the mirror session as soon as you can after taking the log backup.

    Configuring Database mirroring:

  1. Connect to the principle database. Select the database you wish to mirror.
  2. Right-click > Tasks > Mirror; this will bring you to the Mirror tab on the database properties pop-up.
  3. Select the Configure Security button to configure the mirror session through the Configure Database Mirroring Security Wizard (only in this wizard you can add or change the witness server instance).
  4. Upon completion of the security wizard and you are still connected to the principle server click on Start Mirroring.

Client Connections (Connection Strings)

    I am going to assume that you as the reader already know how to connect to a database in your application code in order to access it.  What I'll cover here are the required key strings needed in the connection string to handle connecting to both database servers in a mirror session depending on which one is acting as the principle at the moment.

    Just as you would with a normal connection string you need to provide a initial partner name.  This will be the principle server.  If you are usingTCP/IP then enter in the IP, if you are using named pipes then enter in the name of your server. Additionally, if your SQL Server is using a Instance Name then you will need to add that as well (example: 10.10.2.1\InstanceName.  Now we need to provide the failover partner.  This will be the mirror server.  Add this information similarly as you would for the initial partner name.

    The other item you will need to provide in your connection string is the network attribute.  This will specify the network protocol to be used and ensures that the proper network protocol persists between connections to different partners. ForTCP/IP use the following:

Network=dbmssocn;

    Named Pipes use:

Network=dbnmpntw;

    Putting it all together in a sample connection string, you can get more info on connection string keywords here:

Data Source = 10.10.2.10/InstanceName; Failover partner = 10.10.2.11\InstanceName; Initial Catalog = databaseName; User ID = sa; Password = 12345; Network = dbmssocn;

Failover

    There are three types of failover: automatic, manual and forced.  Automatic requires a witness server and the mirror set-up in high-safety mode.  Manual failover does not use a witness server and also requires the mirror set-up to be in high-safety mode. Forced is usually used because the principle server has been disconnected somehow.  Using forced service may result in data lose as all transactions may not have made it to the mirrored server.  Forced service is supported on high-availability and high-safety mirrored set-up modes.

Automatic Failover

    For automatic failover to occur the following conditions are required:

  • Mirroring sessions must be running high-safety mode and posses a witness server.
  • The mirror database must be synchronised.
  • The principle server has lost communication with the witness and mirror servers but the witness and mirror server are still online.  Note: If all servers lose connectivity but then the witness and mirror server comes online automatic failover does not occur.
  • The mirror server detects the loss of the principle server.

    How it works

  • If the principle server is still online and changes it's state to DISCONNECTED and disconnects all clients.
  • The mirror and witness server both register that the principle server is unavailable.
  • The mirror server waits for all logs to be written from the redo queue before rolling forward the mirror database.
  • The former mirror server now moves online to be the principle. Recovery will roll back any uncommitted transactions, locks isolate those transactions.
  • When the former principle server comes back online and sees that the mirror has moved to principle the former principle server will become the new mirror and start synchronising. Once synchronising is complete failover is possible again.

Manual Failover

    With manual failover it's possible to failover to the mirror server so that updates and upgrades can be performed on the principle server. Manual failover requires the mirror set-up to be in high-safety mode (transaction safety set to FULL). The partners need to be connected and synchronised.

    How it works:

  • Principle server disconnects, sends the last log message to the mirror and switches to be the mirror server.
  • The mirror server records the last log message as the failover log.
  • The mirror server waits for all logs to be written from the redo queue before rolling forward the mirror database.
  • The mirror server becomes the principle server and the principle becomes the new mirror.
  • The new mirror server quickly resynchronizes with the new principle server. Once complete failover is possible again.

    Initiate Manual failover:

  1. Connect to the principle server. Choose your database.
  2. Right-click > Tasks > Mirror; this will bring you to the Mirror tab on the database properties pop-up.
  3. Click Failover.  Confirm that you want to failover to the mirror server.

Note: The client will need to see that the connection to the primary has failed before it will try to connect to the failover partner.

Forced Service

    If the Principle server goes down due to hardware issues or is unreachable you can use forced service to bring the mirror to principle state.  Doing this may cause data loss as the mirror may not have received all of the transaction logs from the principle. Read this Microsoft TechNet article for more information on forced service.

    Initiate Forced Service

  1. Connect to the mirror server.
  2. Run the following T-SQL:
    ALTER DATABASE <database_name> SET PARTNER FORCE_SERVICE_ALLOW_DATA_LOSS

    The mirror will take over as principle and mirroring will be suspended.

Summary and Online Resources

    Database mirroring has many options and ways to be effective in maintaining a high-availability database.  This article is my collected research as I was learning how to set up mirroring. If you would like more information on setting up database mirroring please look at the following resources:


Wednesday, October 08, 2008

Gaining Exclusive Access to database in SQL Server 2005 via T-SQL

Usually, whenever I restore a backup of my database in SQL Server I am presented with the following error:

Msg 3101, Level 16, State 1, Line 1
Exclusive access could not be obtained because the database is in use.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.

Usually, to get around this I just restart the server. This was fine when we were developing on our local server instance on our development machines. But we have a few programmers that need to make changes to the database and the logistics of having everyone script their changes and drop them into Subversion was becoming a nightmare. Regardless our simple solution was to put it on a shared server in the office and backup the server occasionally, in case someone screwed up the data.

Well I screwed up some data and needed to restore. Unfortunately, I have another co-worker in the office who is working on another project and is using the same database server (different database) for development. To be nice I'd want to restore without restarting the SQL Server and possibly disrupting his work.

What I need to do is find all the connection processes to the database and kill them:

Use Master
Go

Declare @dbname sysname

Set @dbname = 'databaseName'

Declare @spid int
Select @spid = min(spid) from master.dbo.sysprocesses
where dbid = db_id(@dbname)
While @spid Is Not Null
Begin
        Execute ('Kill ' + @spid)
        Select @spid = min(spid) from master.dbo.sysprocesses
        where dbid = db_id(@dbname) and spid > @spid
End

Now I can immediately restore:

USE Master
GO
RESTORE DATABASE [databaseName]
FROM  DISK = N'physical disk path to the backup file.bak' --example path: c:\program files\microsoft sql server\mssql\backup\databaseName.bak
WITH  FILE = 1,  NOUNLOADREPLACESTATS = 10
GO

This method works best in a development environment with minimum developer connections. In production/staging environments refer to your database administrator for best practices.


Related Links

How to Gain Exclusive Access to SQL Server 2005 DB to restore?

Tuesday, August 26, 2008

jQuery Plugin - Simple Shadow

UPDATE: Simple Shadow has been set up on Google Code.  You can get the latest here.

We've been researching and trying out javascript shadow solutions for quite sometime.  Our designers are really liking to add subtle dropshadows to elements in their designs.  jQuery UI had a shadow plugin and it looked promising.  I even submitted some bug reports to help it along.  But it's been officially removed from the project for the time being.

We've been using RUZEE.shadedborder to handle our shadow needs.  It works but adds a lot of undesired div tags to make the gradient color.  But the biggest problem was it was really slow and caused IE to crash when I had six items on a page RUZZEEIFIED.

I finally gave in and decided to write my own shadow plugin to handle my specific needs which were to display a shadow of 10px width on the right and bottom sides.  I needed it to be easy as well so it uses graphics to accomplish the shadow.

This will work on any element that has a width and height specified in css.  It requires three image files that are included in the complete zip file below. See demo.

Here is the code to make the shadow:

$(document).ready(function() {     $("div").shadow(); });

Download


UPDATE: Simple Shadow has been set up on Google Code.  You can get the latest here.

Monday, July 14, 2008

Adding link separators to a unordered list using jQuery

I figured out how to easily add a separator to a inline displayed unordered list of links using jQuery and so I'd thought I share.

So for a list like so:



I wanted it to display like this:

Ralph Whitbeck | jQuery | BrandEnsemble

Notice that the separator (|) is only between the links and not at either the beginning or end.  I should also note that when I was rendering the list it was coming from a dynamic source so I didn't have a set list to work from.

I wrote this jQuery:

$(document).ready(function(){
   $(".subnavigation li:lt(" + ($(".subnavigation li").length - 1) + ")").append(" | ");
});


So basically I used the :lt(index) selector to match against all the matches that were less then the index value.  I do that by figuring out the length of how many are selected and subtracting one.  Then finally I append my selector to all of my matches.


Update: John Resig (creator of jQuery) chimes in with an easier way to do the same thing in the comments.

$(document).ready(function(){
   $(".subnavigation li:not(:last-child)").append(" | ");
});

This works by selecting all the li's except the last child (or the last li) in the container. This will work with multiple containers on a page if there are more then one.  Thanks John for the tip.

Saturday, June 28, 2008

How to target="_blank" a link while keeping it XHTML compliant with jQuery

I had to make a bunch of links for a site I am working on for a client at work open in a new window.  It's not ideal but it was what was requested.

So I set up my links like such:

http://ralphwhitbeck.com

I run my page though a HTML validator and am quickly reminded that the target attibute is not allowed in the XHTML 1.0 Strict standard.  I do a quick Google Search and the first couple of results bring back the following function to make it compliant:

function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i    var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}
window.onload = externalLinks;

This function expects there to be a rel="external" attribute inside the links you want to open in a new window.

That function to me looks scary and ugly.  jQuery to the rescue.

$(document).ready(function(){
    $("a[rel='external']").attr("target","_blank");
});

I was able to shrink all that down to one line of jQuery.  And it's a lot easier to read and more importantly it now makes the document XHTML compliant.

Note: I did notice a huge argument/discussion on if this is really truely standards compliant.  As when you take the generated html code and run that through the validator you still get the same compliance error.  While others say that you are separating the action from the presentation and that satisfies the standard.  Thirdly others say that target was depricated and as such we should never use it because the standards people think we shouldn't open new windows on people.   I don't know whose right or whose wrong but I did find the discussion interesting.  Thoughts?

Sunday, June 15, 2008

Book Review: "Smart & Gets Things Done" by Joel Spolsky

I went into Borders the other night to look at books that I wanted to buy.  I wasn't actually going to buy them but just wanted to see what books looked good and would pick them up on Amazon.  Cause let's face it Borders charges full price for it's books Amazon doesn't.

Anyways, I ran across a book by Joel Spolsky called "Smart & Get Things Done".  Now I know of Joel from the Stackoverflow podcast he is doing with Jeff Atwood.  He is the founder of Fog Creek Software that makes the project management software FogBugz. Before that he worked for Microsoft and Juno Online Services.  He was even a paratrooper in the Israeli Defense Forces (an interesting fact that I learned from the book).

The book is pretty small and short. It's 182 pages and I was able to read it cover-to-cover in a few hours in one sitting.  This book is aimed at those who hire technical talent to their organization (aka Programmers).  This affects me as I have recently been tasked with hiring co-ops for 6 month positions at BrandLogic.  I have hired three people so far but I feel that I could learn quite a bit in the interview and selection process.  I actually purchased the book from Borders that day because it was less the $20 ($16.99 at Borders, $11.55 at Amazon) and because I found it to be an easy read and it would be a great help to me going forward.  I think this book would also be great to programmers who are about to head into the job market.  This is a great insight into what hiring managers are looking for.

Joel goes through the whole gamut in hiring a developer.  He starts out by outlining how one measures a great developer, defines where to find great developers, to what makes a developer happy.  He then goes through the selection process with how to sort through the resumes to weeding out candidates with a phone interview. He gets into the details of the interview once you have a candidate that has passed through the selection process before it.  Finally, Joel takes through the hiring process and talks briefly on how to fix suboptimal  teams.

I felt that the book was direct and outlined the issues with hiring developers and talked about how the great developers are not on the market.  Advertising for jobs in traditional job boards (Monster.com, Craigslist, etc.) is only going to bring out the desperate job seekers the great developers are going to seek out the exact job that they want.  Getting resumes from the traditional methods is only going to bring in a lot of noise and lot of resumes that just don't fit.

So where do you find great developers? Joel states three ways to finding great developers: 1. Go to the mountain- Go to conferences where great developers will hang out and start conversations.  WWDC for Apple Devs, PDC for Microsoft Devs, etc. Go to conferences where early adopters might hang out (Ruby on Rails, etc) and talk to them.  2. Internships - This is the method that BrandLogic employs.  Being that 100% of our office is RIT graduates we also feel our duty to help fellow RIT students with achieving their credits to graduate.  Anyways Joel's philosophy is that if you can bring in a student one, two years before they graduate and have them working in a summer internship it's like 6 months of an interview at the end of which you can thank them for their work and send them on their way or give them a offer in which you know exactly how they are going to work for you without anymore risk. And Finally the third way is to Build your own Community.  Basically if you start a blog or are known to people in the blogosphere and have a community following then when it comes down to needing to fill a position and you post a comment on your blog about that you will seem to get a higher quality selection of resumes to pick from.  Of course this is all easier said then done.  The how to build a community and being able to attract people is all hit or miss and Joel alludes to that.  It's not the easiest thing to do but if you can build a community it's a great resource to draw from.

Joel tries to define a developer in terms of how to make them happy and egger to work and thus more productive or be hired.  He stats each  developer needs his own private office.  This will make them more productive.  He goes into the reasons behind all of this.  One point is that developers seem to get into a zone when developing and a private office will help them stay in that zone longer.  Additionally he goes into the physical office, big monitors, Areon chairs, etc.   But the important part and the piece I think we've really tried hard to encompass at BrandLogic is that the personality of developers has to be inline with everyone else.  You can't hire jerks and think that people are going to be happy to work with jerks, even though he states Microsoft does just that.  Ha!

Sorting out the resumes.  Joel lays out his criteria for sorting out the good from the bad.  Don't hire someone based on a resume but eliminate people based on their resume.  Some criteria to look for Passion (look for evidence for passion to work with computers), Pickiness (look at their resume for glaring errors), English (can they communicate effectively in their resume, if not probably aren't going to communicate effectively in a team), Brains (high GPA or some other high honors [I disagree with this as it relates to our selection process at BrandLogic]), Selectivity (Has the applicant been though another selection process meaning did he make it into a school that only accepts 30% of it's applicants or something similar [again at BrandLogic we favor RIT and usually only advertise at RIT that this isn't an issue for us]), Hard-Core (ability to work in hard-core languages like Assembler etc. is seen as being better then working with Java or PHP [again I don't entirely agree with this statement, we look for someone with web programming experience so hard-core languages don't usually add to the experience desired for our needs]) and finally diversity (ability for new people to bring new ideas and ways of thinking to the table [I whole-heartily agree with this statement]).

After you've sorted through the resumes you need to weed through the resumes with a phone interview.  This will save money as you can probably get eliminate many people by just talking to them.  One example Joel gives is that after ten minutes he felt he couldn't stand listening to a candidate any longer. He was able to weed that person out and saved money on not having to bring him out.  The benefits to a phone interview is that you can listen to what someone is saying without visual prejudices getting in the way.

The Interview.  Joel works in NYC so for him he uses the city to entice his potential hires or if they don't work out in the interview at least use that experience to still leave an impression on that person. When they go home and tell their friends how awesome the place was and how awesome the interview was, their friends will apply next summer for that chance for the trip. This all goes back to how to find great developers.  By using your interview as a way to get known virally it's another way to draw them in. 

The interview needs to be a conversation and needs to have the applicant writing some kind of code.  It doesn't matter what language the code is in or if it's right or wrong the purpose is to get the person talking to find out how they think, how are they going to solve a problem.  If they make mistakes see if they catch them, ask them "Are you happy with this code?" and see if they catch their mistake.  Even if they don't make a mistake it'll be great to see if they are confident to say yes it's perfect when you ask them if they are happy with their code. Don't dwell on the technicalities you should base your decision on whether the person is 1. smart and 2. can get things done. 

Joel's company has many developers interview a person and usually has them come back with a HIRE or NO HIRE verdict within 15 minutes of the interview.  One person usually can't decide their fate but once a certain number of people come back with NO HIRE the interview is over and they won't be hired.

The rest of the book goes into how to hire someone and how to deal with a team that might be poisoning the rest of the team.  I'll leave those chapters to you to read.  I think the dealing with a team chapter is just a brief insight into management but Joel gives his recommendation into other books you can pick up to help with project/team management.

I really enjoyed this book. It was easy to read and was clear and to the point.  I have many ideas on how I can update and tweak our interview process at BrandLogic for future hires.

Help support this blog by purchasing this book from my Amazon link.

Monday, June 09, 2008

My first JSON Implementation

I wanted to share my first real use of JSON (JavaScript Object Notation) I created today at work.  The reason I find this exciting is cause I never really understood the use of JSON or how to create and use it.  I found a simple use when I wrote about pulling in twitter updated into my blog using jQuery and the Twitter API using the JSON data, but I didn't create the JSON and was just consumming it.

Well today I was tasked with creating a JavaScript array that could be easily updated by an administrator of a web site and the data would be used to populate a dropdown box.  Yes there are probably better solutions to populate a dropdown box but this was what I was tasked with. 

Now a year ago, I would have probably created an XML file to hold onto this data but a recent blog post from Jeff Atwood over at Coding Horror made me realize that XML is ugly.  From that article JSON seemed like a cleaner choice.

So basically my data needed to hold geographical regions of the US with sections or cities for each region.  Each region/city would have a url associated with it.  So in a separate js file I created this:

{ regions: [
                    {
                        text: "NorthEast",
                        value: "http://ralphwhitbeck.com/northeast",
                        sections: [
                                         {
                                            text: "New York",
                                            value: "http://ralphwhitbeck.com/newyork"
                                         },
                                        {
                                            text: "Boston",
                                            value: "http://ralphwhitbeck.com/boston"
                                         }
                                     ]
                   },
                    {
                        text: "South East",
                        value: "http://ralphwhitbeck.com/southeast",
                        sections: [
                                        {
                                            text: "Orlando",
                                            value: "http://ralphwhitbeck.com/southeast"
                                        }
                                      ]
                    }

                ]

}

So looking at this you can see that it's very clean and easy to read.  We can see that it's two levels deep and we can see which sections are related to which regions at a quick glance.

Now I needed to take this JSON data and consume it and populate a dropdown.  I turn to jQuery to help me out (which was very slow today due to the 1.5 release of the UI plugin).  Here is the code to consume display it:

$(document).ready(function(){
    $.getJSON("sections.js",function(json){
        $.each(json.regions, function(i,ritem){
            $("#select_dropdown").append("");
            $.each(ritem.sections, function(i,sitem){
                $("#select_dropdown").append("");
            });
        });
    });
});

This requires a select element on the page with an id of select_dropdown. 

Download the example code JSON_Example-DamnRalph.zip (1.24 KB)

Update: So an interesting problem came up at work today where we needed to validate the JSON because the data we entered had a syntax error (we figure this was the case cause it wasn't working as expected) and so we needed a validator to validate the JSON data.  Unfortunately the way we are consumming the JSON if it tries to parse it and it's not valid then the user doesn't get an error (is this the desired choice in jQuery's getJSON method?) so there is no feedback to what the sytax problem might be.  We found this online JSON Validator that worked to help us identify the syntax errors.

Wednesday, May 28, 2008

Google I/O 2008 - Day 1

Google IO is a two day developer conference in San Francisco which is held in the Moscone Center.  This year the conference is focusing on technologies like Android (mobile phone OS), Gears (ability to extend the browser to make your site work offline and sync when your online again), Gdata (API to work with Google Services like Calendar, Gmail, etc.) and finally a look into OpenID, OAuth and OpenSocial.

Since this was in San Fran it was fairly heavily covered and TechCrunch has a good write up with live blogging, video demo's (embedded below) and many pics. James Hamilton provides some rough notes from various talks from throughout the day. Update: Andy O posted his blog in the comments which has a well written detailed thoughts of the conference.

Some interesting announcements from the keynote.  MySpace is going to work with GearsGears officially changed it name to Gears dropping Google from the previous name of Google Gears.  The reasoning is that Google wants to strongly urge that Gears is Open Source and is for the community.AOL officially joins OpenSocial.

Here is a video demo of Android:


Finally, Scoble gives an idea of what the hot topics are at the Google Party:


(Photo from flickr user Nancy-. Used undeer the Creative Commons License)

Tuesday, May 27, 2008

Kings of Code 2008

Last month I first heard of ROFLCon from a coworker who asked for a couple of days off to go to Boston to attend this convention.  Well when he went I was doing some searching on Flickr and watched blogs to see if I could see any pictures of him from the uploaded pics.  Needless to say we didn't see any pictures of him.  I did however see 10 or more pics of John Resig and 100+ images of Jay Maynard (the Tron Guy).  So needless to say we are on the verge of firing our employee for lying to us about attending a convention he obviously didn't attend (I am only joking about firing him...or am I?).

Anyways, the point I am trying to make is that I felt that I in some way experienced the convention through the eyes of everyone that attended.  There were countless photos, video's, blog posts and twitter was huge as well.

So today I heard about the Kings of Code conference that is happening in the Netherlands today.  I only heard about it because John Resig is a speaker.  So I try the normal routine of doing flickr searches and blog searches on Kings of Code.  Sure enough I got enough info from people that posted on it that I felt like I truly experienced a part of it.

First I started out with the conferences web site (which is translated via Google Translate) and I got a sense of who the speakers are and what the schedule is like.

I then went to Flickr to see if there are people there that are posting pics.  This usually tells me if there are people there who are willing to post info on the conference.  Sure enough there are people posting pics.  And there is a picture of John speaking.  So that's cool I get the feel of how big the conference is and what the stage and stuff look like.

Now let's see if I can dig up what the speakers are actually talking about.  I go to Google Blogs (or Technorati) and do a search for Kings of Code and sort by date added.  Jackpot, I stumble on to Gijs van Zon's blog who live blogged the whole thing. He broke it up by per break.  We need to use Google Translate again and the translation isn't 100% perfect but you still get a lot of the information that was presented. Here are his live blogs:


I found some of the info in these talks useful and I wanted to share.  Thanks to those who posted pics and took the time to live blog the conference for those of us on the other side of the world to enjoy.

Update: With a little more digging I found some live streams of John Resig's talk.





(Photo from flickr user Inferis. Used under Creative Commons license.)

Wednesday, May 07, 2008

VMWare Fusion 2.0 Beta 1 is released

I heard through Twitter a while ago that VMWare Fusion is a lot better then Parallels at virtualization.  I don't own a Mac or use a Mac at work so I told my boss who does.  He got five copies to try. I overheard him talking with our systems administrator one day and he said "Ralph was right" I even listened to what he said I was right about and it was that Fusion was better.

I heard that 2.0 beta 1 was released the other day.  I went to go check it out and I'll tell you what, Fusion makes me want a Mac just so I can load Windows onto it.

It now supports Multiple desktops and DirectX 9.0 Shader Model 2 3D.  That means it can play a lot of the newer games in a virtualized environment.

Watch this video and be amazed:


Tuesday, January 15, 2008

Observations of MacWorld Blogging

Today was the keynote address at MacWorld 2008.  I observed quite a few things this year that didn't happen in years past.

For instance this year seemed like everyone was live blogging the event. From Fake Steve to Valleywag to the normal web information outlets for MacWorld Keynotes: Engadget, MacRumors and Gizmodo.

But it seemed the first timers didn't have much luck with keeping their servers up.  Fake Steve was using a third party web app to stream the live blogging directly to his blog.  Unfortunately the app crashed almost as soon as the keynote started.

Fake Steve then went to the back up plan of using Twitter. Valleywag had also planned on live blogging via Twitter.  MacRumorsLive had planned on also posting it's updates to twitter as well as on their website and IRC channel.

Ok so with these big names live blogging on Twitter as well as countless others at the keynote and with millions of people trying to refresh to get the latest from twitter on what was happening....well let's just say Twitter buckled.  It went down hard for at least an hour. Even now they are rate limiting the API calls to less then the normal 70 an hour to try to take the pressure off.

With all the live blogging, I found a few who tried to stream video from the Keynote. We watched this stream until someone asked the guy to lower his Camera/phone.  The picture was crappy and the sound quality wasn't the greatest but at least you could sort of make out what was going on and related back to the MacRumorsLive notes.  We observed at the peak the stream had over 9000 concurrent viewers.  The most surprising thing heard in that stream?  A baby crying in the audience, seriously who brings a baby to an event like this?

I heard iJustine tried to Stream as well.  Seems like she suffered the same fate as above.

But that brings me to my next point live video streaming seemed to be big during CES but it was really noticable today.  I caught Scoble recording most of this evening with his Nokia N95.  Here he is with Leo Laporte at MacWorld.  Here Scoble interviews Qik founder when a Video streaming orgy breaks out by four different people one being iJustine.


So who had the best info this year. Engadget had the best write ups but their server were starting to buckle from people constantly reloading.  Their page took forever to come back up.  MacRumorsLive had an awesome AJAX solution that didn't require you to do anything photos and updates "magically" appeared on your screen when updates occured.  In my opinion MacRumorsLive won the bragging rights.

It's fun to see how the new technology made today a much more interesting event to watch from a far.  It was also fun to see how the old technology players struggled as they are the now go to outlets for this event.

Either way with everyone sharing information it makes it easy for everyone to experience the keynote as closely as they do.  Thanks to you all for your hard work.

Wednesday, November 14, 2007

Update on my jQuery bug

Last month I posted about my problems with the jQuery UI shadow plugin where it wasn't working with absolute positioned divs.

I was looking at the Development jQuery UI forum this morning and came across this post by Brandon Aaron detailing how he cleaned up the shadow plugin.

I politely mentioned my bug I submitted and he politely told me that the latest version in SVN will now solve my problem.

And it does:



Yay, open source!

Interesting fact, when they release the next version there will now be a UI branch and a FX branch. Shadow was moved and will be in the FX branch.

Monday, November 05, 2007

VS.NET IDE Issue - ASPX gets separated from codebehind

Sometimes in VS.NET 2005 the codebehind for the aspx file show up in the solution explorer not connected.

To Solve this problem:

  1. Close Visual Studio
  2. Open up the proj file with a text/XML editor.
  3. Scroll down till you find the <EmbeddedResource> section.
  4. Find around where you need to enter in a new resource in relation to the file you're having issues with.
  5. add this for each file except the aspx file:
    <EmbeddedResource Include="Admin\Author\MassUpload\upload.aspx.cs">
<DependentUpon>upload.aspx</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Admin\Author\MassUpload\upload.aspx.resx">
<DependentUpon>upload.aspx.cs</DependentUpon>
</EmbeddedResource>

Related Links

Form & Designer File Becoming Separated


Saturday, October 27, 2007

Installing Rails on Ubuntu using VMWare Server

I installed Ruby on Rails,I think ;), on a VMWare Server installation of Ubuntu 7.10 using the following tutorials.

To install VMWare Server and Ubuntu: http://cmsproducer.com/Ubuntu-Linux-Windows-VMware-Server

To install Ruby on Rails on Ubuntu: http://paulgoscicki.com/archives/2005/09/ruby-on-rails-on-ubuntu/

Total installation time took me about two hours from the start of downloading Ubuntu to finishing the last step.

Now let's see if I can figure out how to program Ruby on Rails.

My first jQuery bug

Update: Bug has been fixed/closed.

I submitted my first jQuery bug today,  I am pretty sure that it's a bug and not something I am doing wrong, but hey it wouldn't be the first time.

I was trying to use the new jQuery UI to add a drop shadow to a floating DIV. Unfortunately, I was not getting the results I was expecting.

Here is the test HTML I was using to recreate the bug:


<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Shadow Page Test</title>
<script src="jquery.js" type="text/javascript" language="javascript"></script>
<script src="jquery.dimensions.js" type="text/javascript" language="javascript"></script>
<script src="ui.shadow.js" type="text/javascript" language="javascript"></script>
<style type="text/css">
#Alert
{
position: absolute;
top: 200px;
left: 200px;
background-color: #ffffff;
width: 200px;
height: 200px;
padding: 10px;
font-weight: bold;
border: 2px solid #ff0000;
}
</style>
<script type="text/javascript" language="javascript">
$(document).ready(function () {
$(
"#Alert").shadow({ offset: 5, color: "#000000" });

});
</script>
</head>
<body>

<div id="Alert">
This is some Alert text!
</div>

</body>
</html>
Again I was using the Shadow pluggin from http://ui.jQuery.com but this is what I was getting:



Notice how the three different colored shadow layers line up under the div instead of stacked so it looks like a shadow?

Anyway I sent it into the bug tracker in jQuery, I am ticket number 1853.

Here are the files to recreate this bug. ui.shadow_bug.zip (17.71 KB)

Friday, October 12, 2007

A Visual Explaination of SQL Joins

Jeff Atwood over at Coding Horror explains with visual Venn diagrams how joins work.  Even if you know how joins work it is still nice to see it in visual form.

Click here to see the joins.

Thursday, October 11, 2007

Click on your own Google Adsense links without breaking policy

Laurent Kempé writes:

If you are developing a site containing Google Adsense you might know that clicking on your own ad is not allowed.

To be able to test and click on your own ad and still follow Google AdSense Program Policies, just add following to your pages:

<script type="text/javascript">google_adtest = 'on';</script>

Don't forget to remove it on your production server! ;)

That's cool! The biggest worry of any Google Adsense participant is getting dropped from the program for clicking on your own links.

Wednesday, October 03, 2007

Ze Frank

Not sure if you know who Ze Frank is but he is a pretty big internet celebrity (at least in my eyes) ... recently doing a year of video podcasts called the Show with Ze Frank.

http://www.zefrank.com

http://www.zefrank.com/theshow

Well anyways he was giving a speech at Rochester Institute of Technology tonight and I have been planning on attending since last month.

He's spoken at many TED Talks the one in 2003 is posted on Google Video and he actually gave a similar talk for part of his talk tonight.

http://video.google.com/videoplay?docid=1895918195820925057

As I was walking into the building he was walking out to which I introduced myself, shook his hand...really cool.

After the talk I went down and got into a discussion about online communities and how communities take off into the direction of their choosing ... all very interesting.

But I think what struck me the most was how approachable he was and easy to talk to.  I am sure he is quite used to it by now but I found that he was very easy to talk to and to ask questions.

Tuesday, July 10, 2007

Uninstalling Cisco VPN client kills internet access

Symptoms

On starting the computer the computers internet access will work normally for a short period of time. Then access to normal websites will be down. Access to https sites, internet application such as instant messaging and e-mail are still accessible.

Cause

Uninstalling Cisco VPN 4.0 client doesn't fully uninstall hidden Zone Alarm Firewall which causes a block in port 80 on the computer.

Resolution

Cisco VPN client version 4.0 includes firewall functionality from Zone Labs Inc. It is possible that a failed Zone Labs uninstall left an incorrect value in the systems registry and must be changed. To resolve the problem follow these steps.

Caution This procedure contains information about editing the registry. Before you edit the registry, make sure you understand how to restore it if a problem occurs.

Step 1 Restart the computer and when your computer screen displays the startup message like "Starting Windows..." and a progress bar at the bottom of the screen, press the F8 key on the keyboard. This should display an advanced options screen.

Step 2 At the advanced options screen select "Safe Mode" as a startup method.

Step 3 If prompted, login to the PC once it is booted (you must have Administrator rights to login in Safe Mode).

Step 4 Click Start > Run and type "regedit" in the Open: box (without the quotes) and click OK. This launches the Windows registry editor.

Step 5 In the registry editor, browse to the following path: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\vsdatant and select the Start parameter in the right pane.

Step 6 Right-click Start and select Modify. In the Value data: field enter the number 3.

Step 7 Click OK and exit the registry editor.

Step 8 Restart the computer and boot normally; the problem should be resolved.

Related Links

Release Notes for VPN Client, Release 4.0.1

Author notes


I spent a considerate amount of time looking for a resolution to this problem..I post it up here in hopes that it helps someone else a little easier.  If it helps you please post a comment to let me know.

Sunday, May 27, 2007

Brakes and Rotors

My brakes started grinding this week so I needed to get that fixed...I bought the parts Brake pads and rotors and went over to my cousins house and he helped my put them on....I swear to god it was so easy...I am going to do it myself next time.

I found instructions online for my type of brakes so I can do it next time.

http://www.2carpros.com/how_to/how_to_replace_brakes.htm

tools I'll need to get the job done:

14 mm socket
18 mm socket
C-Clamp
Mallet or hammer (in case the bolts are tight)
Jack
Brake pads
Rotors (if worn)

Tuesday, April 10, 2007

Service Unavailable? Site.Config permission denied?

Well my site(s) have been bouncing up and down more then girls at a porn convention this past week and a half.  I have been battling my host for some kind of control to the madness.  I think I might have finally got it under control.  There fix they did tonight is in line with what I would have done if it were my server or at least had control of it.  Basically they moved my sites onto their own Application Pool and I think that will help. 

But we'll see, I am probably jinxing it.  Hopefully I can keep a reliable blog up and running from this point forward.

Tuesday, February 27, 2007

Monroe County to get Wireless Internet

This is exciting although details are light, it's just exciting that we are talking about it here in our home county.  Maggy Brooks announced last night during her State of the County address that there was a partnership with Frontier to provide a wireless network for the county.

That is why I am pleased to announce that Monroe County is working with Frontier to develop a wireless internet network that will serve significant portions of Greece, Pittsford and the City of Rochester…as well as portions of the surrounding towns by the end of the year.

In addition, Frontier has also agreed to develop free wireless internet zones within this network…a critical step in our County’s efforts to bridge the digital divide.

We anticipate this wireless network will continue to expand throughout other parts of the County...and eventually become a full-scale, wireless network to serve all County residents.

Our new partnership with Frontier is a win for our taxpayers, and a win for our community. The new network will be created at no cost to taxpayers, and will soon allow our community to reap the benefits of wireless access to the information superhighway.

Tuesday, February 06, 2007

The loss of Jim Gray is Amazon's gain

Last weekend we learned of the disappearance of Jim Gray, a well respected database architect for Microsoft.  The news was taken pretty hard around the blogosphere.  We learned that the Coast Guard called off the search on Thursday.

I am not sure who took the satellite imagery but satellite imagery was uploaded to Amazon's Mechanical Turk for it's member to analyze.  This was/is an absolutely great idea.  Let the community that cares poor over the imagery and help in the search.

My wife and I spent and hour on Saturday going through about a hundred or so images...we flagged about a dozen or so as needs further review.  I spent another half an hour going through another few dozen last night.

But each time I went I also looked at some of the other paying Turks.  Then I got to wondering how much of Amazon's generousity of hosting and using Mechanical Turk was for the moral good and how much of it was a easy way to get some easy viral marketing of their system again.  Cause let's be honest Mechanical Turk hasn't been talked about much since it came out a couple of years ago.  But since they started this Mechanical Turk links are all I see on everyone's blog.

I know I probably sound morbid in bringing this up, but my curiosity got the better of me and I want to know how much of this is marketing and how much of it is pure heart felt generosity.

I don't think any less of Amazon, I actually have more respect for them for stepping up to the plate and helping out.  But I am sure at the end of the day their return for helping out was worth all the trouble.  But in the end maybe, just maybe the real good will be we find Jim alive and well on adrift boat out at sea.

What are your thoughts?

Thursday, February 01, 2007

Case sensitivity, SVN and Windows is a recipe for disaster

We are working on a project at work that has four developers working against the SVN repository in Visual Studio.NET 2005.  The other day I had to create a new project in the solution.  I got it all set up and committed the project into the repository using Ankh, great.  I started to close down for the day and in explorer I noticed that there were still files that were flagged that they needed to be committed.  Looking at it, it was the project file that needed to be committed. So I right clicked and committed it with Tortoise.

Yesterday another developer was trying to checkout the repository to his computer and they ran into an error trying to load the project I had committed.  I was roughly told that it was my project file was missing.  They were able to work around it because the project I committed wasn't needed to work on what they needed.  So I took note of it and would look into it when I had a chance.

Fast forward to this morning.  Based on the feedback I had been given I went into explorer to see if the project file was indeed the one that needed to be added to the repository.  But it showed that it was already committed.  Hmm...so I went to the developer and asked him to forward me the error messages he was getting when updating.

Here was ankh's message:
NSvn.Core.SvnClientException:
Failed to add file '[Path to file]\Web.config': object of the same name already exists
at NSvn.Core.Client.Update(String[] paths, Revision revision, Recurse recurse, Boolean ignoreExternals) in d:\tmp\build-2\src\nsvn.core\client.cpp:line 356
at Ankh.Commands.UpdateItem.UpdateRunner.Work(IContext context) in D:\tmp\build-2\src\Ankh\Commands\UpdateItemCommand.cs:line 131
at Ankh.ProgressRunner.Run() in D:\tmp\build-2\src\Ankh\ProgressRunner.cs:line 95
Same file conflict?  That didn't make any sense.  We started speculating.  I run different a different version of Tortoise on my machine then everyone else and thus my client version of Subversion is newer then the server and everyone else.  But I've been running like this for weeks with no problems up to this point.

I have the developer try checking out a project that only I worked on for another client in the past couple of days.  He said he had no problems getting those files.

He then went back and tried to update the original problem project from Tortoise and pasted the errors he got:
Error: In directory '[Directory Path Specified]'
Error: Can't copy '[Path Specified]\.svn\tmp\text-base\web.config.svn-base' to '[Path specified]\web.config.tmp': The system cannot find the file specified.
I went and googled for "Can't copy '': The system cannot find the file specified." the results led me to this explaination.
There are actually 2 different files in the repository whose names differ only in case. This cannot work on a Windows checkout, because the Windows file system is not case-sensitive. It is likely that one of the files got added by mistake, so you need to find out which one, make sure there are no changes committed to the wrong file, then delete it.
I went to our Trac site and looked at the source files and sure enough there was web.config and Web.config files listed.  Going back to Visual Studio.Net and Explorer I noticed that Visual Studio.NET had the Web.config and Explorer had the web.config. 

Here is the solution I came up with, there's probably a better way of doing this and I'd love to hear about them in the comments but this solution did work.  I made a backup of the Web.config file and then I deleted the Web.config in VS.NET and committed my changes. Looking in Trac again I see that I am down to just web.config in the repository.  I figure at this point I can just update and use that single version of web.config but I got the same error as above.

I close Visual Studio and open up Tortoises Repository Browser and I delete web.config. I then delete the whole project folder out of explorer (you have to do this because the svn folders have the web.config still listed in it's cache and you'll get the same errors). 

After the folder had been deleted I reopened Visual Studio.NET and opened the solution.  After I updated the solution from the repository I added my backed up copy of web.config (with the proper case that I am looking for) into the project and committed it.  Everything now had the right case, Visual Studio, Explorer and trac (which is the SVN Repository version). 

I went to the other developers and after they committed all the work they were doing they closed out of Visual Studio. Deleted the problem project folder in Explorer.  Reopened the solution in VS and updated and refreshed the project with a now working copy.

So make sure if you're working with a SVN client in Windows against a Linux based SVN repository that you have the same case throughout or you'll need to fix it.  And so far the only way to fix it is a manual process.

Saturday, January 27, 2007

Redesigned BrandLogic.com Launches

We've spent quite sometime recently getting BrandLogic.com ported over to our BrandEnsemble product.  It's pretty exciting to actually have our website using our product.  Before we did it in JSP because it was a great selling feature for some companies that we were multi talented (which we are by the way). 

I think though that we were never really proud of our site before.  But now, I think this is the best version of our website, and we are really proud of going live with it.

It runs on ASP.NET 1.1 and SQL Server 2000.  It runs on our BrandLogic BrandEnsemble Content Management System. 

Here are some screen shots of the site (click to enlarge).

  

And some of our admin tools which our CEO states are "the best admin tools I have ever seen."

     

These shots show how our pages can be edited inline so you get a feel for what the page will look like before you're ready to publish, version control history of a page with the ability to revert a page back to a previous version and how a typical view of a group (our terminology of a directory) looks within the system.

BrandEnsemble has been used in many of our clients sites as well:
Of course BrandEnsemble is only a piece of the overall branding puzzle that BrandLogic services offer to clients.  BrandEnsemble is what I am close to as I have contributed to it's development over these past eight years.

Here are some of BrandLogics other services we offer:
And who we did it for.

Feel free to contact BrandLogic for your branding needs.

Friday, January 19, 2007

What does the future hold?

Where is the future heading with web programming/technologies?  I have considered myself Microsoft programmer since I graduated college.  I learned Classic ASP on the job, eventually I learned ASP.NET with VB.NET first then realized the power of C#.  I love C# I really do.  It makes programming a complex web site simple and straight forward.

We at BrandLogic would of never been able to program a complete CMS system for St. John's University in 3 weeks if it had not been for the robust framework that .NET offers.  Hell I am still to this day maintaining that code.

We've taken that code base and improved upon it and created the BrandEnsemble suite out of it.  Many clients are enjoying the benefits of the ease of programming C# provided us to be able to make a robust versioned CMS system.

So why do I feel uneasy?  Why do I feel like I am going down the wrong path?

It might be because ASP.NET 2.0 and Visual Studio.NET 2005 doesn't excite me like VS.NET 2003 did.  It doesn't excite me like the promise of what Ruby on Rails can provide.

But I think the most important part is it doesn't wow me in the wallet.  As a freelance web developer paying $1000 for a copy of Visual Studio.NET is a huge chunk of my annual freelance salary.  So upgrading to the next release isn't on the top of my lists of things to do right away.  Plus there is the cost of SQL Server, Windows, etc. etc. Basically I need a MSDN subscription.  What are they up to now?  $3000?  I stopped caring, I guess, the last time I looked at the new MSDN offerings and I thought I needed a lawyer to explain it to me.

So that brings me back to my original question: Where is the future?  Lately, I have been seriously thinking that the future, as is the present, is in open source software and the technologies that support it, programming languages like PHP and Ruby on Rails (there is a reason why they are so popular now).  If you own a PC (and if you don't save a paycheck and go out and get a barebones computer) everything else is free, free as in beer. 

So you got an idea for a cool web site? Get a computer, download a linux distro for your operating system, install the packages you need, get programming IDE's for PHP or Ruby free off of sites like SourceForge.  Get a Enterprise level database like MySql or Postgres free again by downloading it off the internet.  Download TheGimp for image processing.  Bam! You're up and running on the simple cost of the hardware.  And best of all your legal too!  Plus there is a community of starving programmer that are on the web willing to help you out.

But PHP is Old

Yeah, PHP has been around a long long time, but it's robust and again it's free.  And as I've highlighted before, Chris Prillio nailed it on the head once when he was stating the reasons why he was using PHP on his CMS Publishing project: PHP is prevailant on most if not all hosts that are out there right now.  So make a PHP site and chances are the majority of webmasters can install your software on their site.   Try to do that with an ASP.NET site with a SQL Server 2000 backend.

If you look around Silicon Valley now most Web 2.0 companies are using LAMP  (Linux + Apache + MySQL + PHP) partly due to the low cost in a market where the revenue stream is still up in the air for most.  But they need the appeal of the masses to get the word out.

Scoble said something tonight that got me to write this post tonight, even though I been thinking it for the past couple of weeks.  He said, "
LAMP is sure getting traction — I’ve stopped asking entrepreneurs what infrastructure they are using since the answer was so consistently LAMP."

A couple of days ago I saw a sponsor on TechCrunch post job listings for web developers/designers and it got me thinking if I all of a sudden found myself out in the mix again fighting for a job, I think my resume would fall to the bottom of the pile for most places that I think I would find fun to work at (although I have a family, which means the fun places are too risky for me).  My resume is very impressive I think.  My strengths are meeting the needs of our clients in a productive and efficient manner, providing the best customer service and experience with our clients, maintaining a long lasting and trusting relationship with our clients (in the 8 years I've worked at BrandLogic I can probably count the number of clients I've worked with on my one hand, not because we don't get clients but because I help maintain the longest lasting clients.  Which I think is a testiment of the quality of service I as well as the rest of the team provide.)  And last but not least are my Microsoft skills.  Which in my opinion is a technology that is becoming more and more obsolete.

I guess I'll add a new resolution to the New Year.  Learn Web 2.0 technologies!

Tuesday, January 09, 2007

MacWorld Keynote HUGE DISAPPOINTMENT for me

Sorry but I knew going into it that a iPhone no matter how awesome just wouldn't be up my ally.  I was watching for the sole intent of awaiting the news of a new iPod Video that played widescreen.

I feel that we are step closer as the iPhone plays video widescreen.  But the drawbacks are it's integrated with the phone, it only has 8GB tops for storage space and it's $500 starting price with two year contract with Cingular (an AT&T company whom which I'll never do business again).

I'll admit though the phone features are nice...but I am not interested.  In Rochester, NY we are not that dependant on mobile technologies.  I don't depend on a mobile phone 98% of the time.  I live by e-mail and IM and I am always close to it.

For me the thrill of having a Widescreen iPod video was intense.  After getting a Shuffle for Christmas I was getting even more excited to get a full iPod so I can watch my video podcasts and shows.  MacRumorsLive.com totally set me up for a depressing day by literally saying in one line "Widescreen iPod".  I flipped out.  Then I learned later that it was integrated into the phone.  Total let down.

Paul Thurrot bashed Apple for not even mentioning the Macs or Leopard. He said "Why not call it iPodWorld?"

I agree Paul especially with no new iPod announcement, heh. 

But what is with the totally irrelavent Microsoft digs.  One being a three year old quote from Paul Alchine about how he would buy a mac...but failed to stated the context it was in.  It was an e-mail to Steve Balmer and Bill Gates about how they needed to go in a new direction in Vista because they weren't being innovative enough.  They listened and started rebuilding Vista from the ground up.

Also, what was the deal with the graphic of how the sales of Zune were doing?  Just to rub it in.  Then I wonder were Apple fanboys get the pretentious attitudes from.  They have a great role model.

On a final note Apple annouced Apple TV, basically a dumb terminal to your iTunes collection so that you can STREAM it to your TV.  $299. Eh...uninspired...I'll get an Xbox 360 that similarly does all that and is coming out with IPTV.

Sunday, January 07, 2007

My Opinions of CES Keynote 2007

Just finished watching the CES keynote...this was what was covered.

  • Couple of cool Vista features shown.
    • Animated Desktops...so instead of pictures for a desktop you can have movies.
    • Version control of files just like Time Machine
    • Play XBox Live games on Vista
  • IPTV to be integrated into Xbox (Holiday's 2007) - the guy that showed it did a terrible job explaining anything about it.
  • They showed Windows Home Server but blackout the broadcast for it for some reason.
  • Partnership with Ford to integrate Microsoft Auto to sync with your phone, media device including iPods to seemlessly work in your Ford car (12 models this year)

My overall impressions of the keynote was eh...I was excited to see and hear about IPTV but like I said they did a terrible job explaining anything about it and there are more questions now then before the start of the keynote.

The Vista features were cool but nothing to get me to go out and buy Vista...I'll stick with XP for a while.

The funniest quote was from some guy claiming that Zune was the number 2 portable music player...I almost lost it. I just read an article this weekend that said they weren't in the top 10.

There was a Halo 3 Cinematic that looked awesome and I think that will be the driving force for me to purchase a 360 this summer. But that's only if the Widescreen iPod doesn't cost a second mortgage when announced on Tuesday.

Lastly, they showed off an HP TouchSmart PC which looks awesome.  HP is coming out with some nice looking products.  Which in my opinion look better then Apple's designs.

Related Links

Paul Thurotts Behind the scenes review

Thursday, January 04, 2007

Secure your sites while surfing on the public wifi

Lifehacker had an interesting article about how easy it is to packet sniff in open WiFi hotspots with a free Mac application.  One way to secure your surfing is to use https when you are viewing sites, if it's available.  Certain sites like web e-mail should only be viewed with https when using a wireless hotspot.

I found that GMail is accessible via https. Google Reader and Google Calendar are also accessible although none of the web applications that are linked at the top of GMail go to https so you have to actually type the address back in.

I set up my FireFox bookmarks to go to my Google Apps with https so that way I don't have to think about.

But then I tried for giggles what would happen if I typed in https://www.damnralph.com, you get a completely different site.  I think it's because I am on a shared hosting environment and that maybe the only site that has a secure site on our IP.  Anyone have an explaination as to why/how that would happen?

Related Links

What wifi sniffers can find out about you


Tuesday, December 26, 2006

Feature Request for Google Reader

Google is a great company and has some great online applications that are really well done.

Google Reader is one of them and is my default reader for my rss feeds.

But why does it not have a simple search function for searching through read posts in your feeds?  I hate having to try to find a particular post and have to hunt for it.

Does Google not know how to do search?

Update:  Here's a hack to search your feeds using Google Co-op.

Monday, December 25, 2006

Solution: Podcasts won't play on iPod Shuffle

So my mom got me a iPod Shuffle for Christmas.  It's perfect for me to listen to my podcasts while I am doing work around the house.  So I hook it up and do the AutoFill of music and it takes 5 minutes to load the thing up.. that's cool.  Works perfect.

I hook it back up and try to load a podcast up (TWiT) and take it out and nothing.  The light on the power blinks green and orange for two seconds.  I look on the little light indicator cheat sheet it came with and that means there are no songs loaded onto the iPod Shuffle.  This made absolutely no sense to me...I tried everything re-encoding it.  Loading it onto the shuffle as a data item but it still wouldn't work.

After looking around the internet I found a few people are having a problem with regular iPods playing podcasts in playlists where they had to manually start the podcasts.  They found that each podcast is by default flagged with the do not shuffle flag.  This meant that the podcast file wouldn't come up when you were playing songs in shuffle mode.

Ah, now it makes perfect sense why this isn't working.  The iPod Shuffle works exclusively in shuffle mode so that's why it looks like there is no music on it after updating.

To get around this...select the Podcasts you want to load and right-click (yeah I am on a Windows machine) and check the check box that says shuffle and select yes. If you want to load just one file click on the options tab and click to uncheck the skip when shuffle option.  Now add the Podcasts to your iPod's playlist, right-click and select Add to Playlist and then select the Playlist of your iPod shuffle.  After the shuffle updates and you disconnect you can revert the shuffle option back to no (if not they will play when you have it set to random in iTunes) or just delete the podcast altogether.

I hope this helps someone that might have the same problem I ran into.

Saturday, December 09, 2006

Monday, November 13, 2006

Today's Big News: Sun to release Java under the GPLv2

The internet is abuzz today about Sun's announcement to release Java to the open source community.  So what does this mean?  Is it an admission from Sun that Java is a dying technology and this is a ploy to get developers re-enthused about working with Java again?

"Sun is hoping that this step will attract more developers, as well as extend the lifespan of Java." -Slashdot.

It'll be interesting to see how this works out for them as this may force other companies like Microsoft to open up more of their source in an attempt to drive participation from the developer community.  Isn't that why Ruby on Rails is the hot language?  Will we see Java on Rails in the near future? 

Related Links:


Sun Open Sources Java Under GPL (Slashdot)
Sun to Opensource Java and GPL it (Scoble)
Sun to Open-Source Java Under GPL v2 (digg)

Wednesday, November 01, 2006

Review of Microsoft Office Accounting 2007

Last night I posted about Microsoft Office Accounting 2007 and I gave it a look over last night.

It's Free that's about the only thing I found to be nice about it.

I was a little surprised (although I shouldn't have been) to see that it needed the .NET 2.0 framework.  It also needed SQL Server Express 2005.  The installer installed these automatically and I was a little miffed that it even installed.  This made the installer take forever.  I actually forgot I was installing it till it was done and came back into focus.

OK so I start it up.  This took forever as well.  I imagine that it was setting up the SQL Server database and initializing the application.  After this was done I had an interface that resembled the Office Suit particularly Outlook 2003.  Then the product activation screen came up :(

Of course you can spend a majority of your time setting this up for your business.  I just went with some basics things so I could see what it had to offer.

It's pretty robust to be honest, probably too much as it is in my case.  I was more interested in the Time Sheets, Quotes and Invoices.

I wasn't happy with the Time Entry Form...it was really complicated and it would require way to much work to get to that screen everyday...you would literally need to have that application open all day to be using it.

Thinking that I might be able to work around it if Invoicing was a breeze...then I realized why it's given away...it is TIGHTLY integrated with Microsoft Office and Invoices require Microsoft Word.

And as I looked around the application I found the many of the features required Word or Excel or Outlook.

And since I went Open Source on my Office Suite, Open Office and GMail this became just about useless for me.

Related Links:

Microsoft Office Accounting 2007
My Post about Microsoft Office Accounting 2007
OpenOffice.org
GMail

Tuesday, October 24, 2006

Firefox 2 Launches Officially



Mozilla, this evening, officially releases Firefox 2.  After some controversy yesterday when the exe was found and a link of the exe that was on a mirror FTP server spread around and many people started downloading before the release not knowing what exactly they were getting. 

Mozilla officials were extremely upset with the early spreading of the bits and spouted off why this was a bad thing to do.

But after a day of waiting it has been finally released and I am downloading now. 

Enjoy!!

Related Links:

The Anti-Release

Mozilla Releases Major Update to Firefox and Raises the Bar for Online Experience
Firefox

Friday, October 20, 2006

My IE7 Experience

Microsoft released IE7 on Wednesday.  I went ahead and installed it on my laptop.  Let me tell you that I did not enjoy that installation.  After I download and run the file I a prompted that I need to install security updated for IE before I even install the browser. Well not wanting to get hacked with this security hole I go ahead and install it.  Five minutes later it says it needs to reboot.  Ugh!

Ok so I say yes reboot.  But the installer hangs and needs to be forced to end. That’s intuitive for novice users to do.

Once the system came back up the installer didn’t run and start where I left off. I had to restart the installer and it again asked me if I wanted to install security updates.  I again said yes thinking there might be more, as dumb as that sounds.  It checked for installs and ran the Malicious Software Removal tool again.  Then it went right into installing the browser finally.

It took about another five minutes.  After it completed it required ANOTHER REBOOT!!!  Holy crap two reboots to install a web browser.  Once the system came back I launched IE.  It has some nice UI features to the browser but I found some weird UI choices as well. For instance to set any options in the browser now has to be done in a control panel or something cause there is no more menu items across the top.

No File, Edit, BOOKMARKS.  How can you leave bookmarks off a browser?  

Anyway I went and checked out some of my sites.  Some are just not right at all.  Travis said that IE7 is interpreting display: block; in some cases as display: crazy; he had to do some conditional statements to get a work around working, another crappy work around for IE.

So far as a web developer not to happy that I know have to deal with another crappy browser from Microsoft.  The best part is now I need a virtual machine because I can not have both IE6 and IE7 on the same machine for testing.

Excuse me while I go rip my hair out.

If you’re not using Firefox yet, thugs are going to come to your house and beat up your first born.

Related Links:

Microsoft IE 7
IE7 vs Firefox 2: The memory usage showdown
Robert Scoble: Firefox vs. IE 7 (IE7 having trouble with Google sites?)
Firefox

Sunday, October 08, 2006

A Slick CSS Solution to Image Rollovers

Here is a simple and elegant solution to doing image rollovers using one image and css to position the image to the rollover state.

Tuesday, September 12, 2006

No Widescreen iPod Announced today

Man am I bummed...I thought for sure we would see a widescreen iPod today...especially with the announcement of movies (Disney) now being available in iTunes (widescreen format btw).

They even upgraded the resolution of TV shows to 640x480 up from 320x240...almost to DVD quality (720x480).

But they did improve on the iPod to make it easier to watch video by increasing the brightness that one can allow... a bigger choice 80 GB instead of 60GB ... a 24 hour battery...Games available for 5G iPods.

But still they foregone with the widescreen feature...I've been holding out and will continue to hold out.

I thought the Zune, Microsofts new portable entertainment system would be my new system...but it won't do video so it's not even a choice now.  But they have a widescreen! wtf?

Oh well...when the next major annoucement?  January? MacWorld?

New Dialog box in VS.NET 2003

When I load up a web project in VS.NET now that I have Subversion installed I get this dialog box that says:
Refreshing the project failed. Unable to retrieve folder information from the server.
Thankfully this isn't a real problem just a nuisance as after you click ok (the only choice given) the project loads just fine.

So what's going on?

Well a bug is happening.  VS.NET refuses to read/load directory names that start with a "." and guess what new directory in my web project now starts with a "."?  .svn

I do not have VS.NET SP1 installed yet...I'll install that tomorrow and let you know if it contains a fix for this particular issue.  But digging around the net Microsoft has known about this issue back in 2003 when people first started to complain about it.

Update (1/30/2007): I see alot of people finding this post via google having the same error above.  I found a better way around this.  So instead of starting a new post I'll just add it here.

You can set up Subversion to use _svn instrad of .svn here's how, if you set an environment path variable SVN_ASP_DOT_NET_HACK to true and then restart your computer (you must restart to have tools like Tortoise and Ankh recognize the _svn folder).  You will need to recheck out your repository and then VS.NET 2003 will work as expected with no error messages.   The problem lies in VS.NET 2003 only 2005 will read .svn folders fine.  But the good thing is 2005 will also run _svn folders with no problems. 

So rule of thumb if your on windows and using Subversion with any version of VS.NET just add the path variable.  Also very important...make sure you commit everything before you do the variable cause you won't be able to after it's added, you'll have to undo the variable and commit and then add the variable back.

Monday, August 21, 2006

SVN Source Control in Windows

At work we started exploring using SVN for source control with Visual Studio as Visual Source Safe is still living in 1999 and Visual Studio 2005 doesn't seem to be anymore promising (Jeff Atwood recommends "Anything but SourceSafe").  AnkhSVN was made to integrate with Visual Studio but wasn't the easiest to set-up...Scott Hanselman says there is a new version out but it's still in Release Candidate and requires you to upgrade to a release candidate version of subversion too.

Anyway with SVN being open source I was looking at setting up a version control solution for my personal projects.

Lifehacker recently ran a two part series (part 1, part 2) in it's weekly Hack Attack column about setting up Subversion and TortoiseSVN for Windows.  It also includes an optional Apache install to access files from other computers.

I followed the Lifehacker articles and installed Subversion and TortoiseSVN and created a couple of repositories for projects I am working on. I elected to skip the Apache install on my machine as I only develop from my laptop.

I'll tell you that it already saved my butt once this weekend...in a rare act of stupidity (OK it really wasn't that rare) I copied files into the wrong directory...it only overwrote one file.  But with version control I just right clicked on the file and hit revert and pulled up the original file I overwrote...without source control I would of had to recreate that file.

I still need to figure out a backup solution that is easy and unobtrusive.  I am thinking about one of those one-click backup external hard-drives.  Maybe for my birthday ;)


Thursday, August 03, 2006

Suckerfish Menu with jQuery

Me on jQuery's blog

I think we all have heard of or used Suckerfish CSS Menu's before, written by Pattrick Griffiths and Dan Webb for A List Apart. If not, it's a cool way to make drop down menu's using standards based semantic HTML and CSS. Unfortunately, with IE still dominating the browser marketplace we still need a way to handle the hover state in IE. To do that we need a little bit of JavaScript to attach mouseover and mouseout events to HTML elements.

Myles Angell decided to rewrite Suckerfish's JavaScript with jQuery. Myles uses jQuery's Basic Effects to show and hide the submenus and jQuery's BaseStyle Base module methods to highlight the current moused over menu item. Pretty slick.

Check out some of Myles other experiments with jQuery. For the jQuery beginner these are good examples to start out with. The treeview is another experiment that caught my eye.

Sunday, July 30, 2006

How to run Ubuntu and Kbuntu in VMware Player

I had an itch today to run Ubuntu.  I actually wanted to see how Konqueror compared to Safari in rendering as I needed a way to test since I don't own a Mac. Since Safari is a descendent of Konqueror it makes sense that they render the same for the most part.

I started by downloading and installing the free VMware Player.


I then downloaded the Ubuntu iso (disk image) from Ubuntu's site.  I had the best luck with the torrent files.  I was able to download the 696mb iso in 20 minutes.  Since I'll be touching on it later you can also get the Kbuntu iso from the Kbuntu site.

Now that I have VMware and the iso's I need to make a Virtual Hard Disk.  I found directions online here

First I needed to download and install QEMU because you need the qemu-image.exe to emulate/create the virtual hard disk.

After you installed QEMU open a command window and change directories to c:\program files\QEMU or whatever the directory name you put the files.  Once you are in the directory run the following command which will allowcate 3GB for a Ubuntu virtual hard drive.

qemu-img.exe create -f vmdk Ubuntu.vmdk 3G Formating 'Ubuntu.vmdk', fmt=vmdk, size=3097152 kB

For Kbuntu:

qemu-img.exe create -f vmdk Kbuntu.vmdk 3G Formating 'Kbuntu.vmdk', fmt=vmdk, size=3097152 kB

This will create a file Ubuntu.vmdk or Kbuntu.vmdk in the QEMU folder.

Create a folder called Ubuntu or Kbuntu in My Documents > My Virtual Machines and move the vmdk file you just created in there. Also copy the iso file to this folder. Finally, create a blank text file and name it either Ubuntu.vmx or Kbuntu.vmx which are VMware Configuration files.

In the Ubunti.vmx files paste this:

config.version = "8"
virtualHW.version = "3"
ide0:0.present = "TRUE"
ide0:0.filename = "Ubuntu.vmdk"
memsize = "256"
MemAllowAutoScaleDown = "FALSE"
ide1:0.present = "TRUE"

#ide1:0.fileName = "auto detect"
#ide1:0.deviceType = "cdrom-raw"

ide1:0.fileName = "ubuntu-6.06-desktop-i386.iso"
ide1:0.deviceType = "cdrom-image"

ide1:0.autodetect = "TRUE"
floppy0.present = "FALSE"
ethernet0.present = "TRUE"
usb.present = "TRUE"
sound.present = "TRUE"
sound.virtualDev = "es1371"
displayName = "Ubuntu"
guestOS = "Ubuntu"
nvram = "Ubuntu.nvram"
MemTrimRate = "-1"

ide0:0.redo = ""
ethernet0.addressType = "generated"
uuid.location = "56 4d 5c cc 3d 4a 43 29-55 89 5c 28 1e 7e 06 58"
uuid.bios = "56 4d 5c cc 3d 4a 43 29-55 89 5c 28 1e 7e 06 58"
ethernet0.generatedAddress = "00:0c:29:7e:06:58"
ethernet0.generatedAddressOffset = "0"

tools.syncTime = "TRUE"
ide1:0.startConnected = "TRUE"

uuid.action = "create"

checkpoint.vmState = ""

For Kbuntu.vmx paste this:

config.version = "8"
virtualHW.version = "3"
ide0:0.present = "TRUE"
ide0:0.filename = "Kbuntu.vmdk"
memsize = "256"
MemAllowAutoScaleDown = "FALSE"
ide1:0.present = "TRUE"

#ide1:0.fileName = "auto detect"
#ide1:0.deviceType = "cdrom-raw"

ide1:0.fileName = "kubuntu-6.06-desktop-i386.iso"
ide1:0.deviceType = "cdrom-image"

ide1:0.autodetect = "TRUE"
floppy0.present = "FALSE"
ethernet0.present = "TRUE"
usb.present = "TRUE"
sound.present = "TRUE"
sound.virtualDev = "es1371"
displayName = "Kbuntu"
guestOS = "ubuntu"
nvram = "Kbuntu.nvram"
MemTrimRate = "-1"

ide0:0.redo = ""
ethernet0.addressType = "generated"
uuid.location = "56 4d cf a0 97 ef 95 ad-c2 6a 6e 62 5b f2 78 ff"
uuid.bios = "56 4d cf a0 97 ef 95 ad-c2 6a 6e 62 5b f2 78 ff"
ethernet0.generatedAddress = "00:0c:29:f2:78:ff"
ethernet0.generatedAddressOffset = "0"

tools.syncTime = "TRUE"
ide1:0.startConnected = "TRUE"

uuid.action = "create"

checkpoint.vmState = ""
Save the file and close it.  All you have to do now is double-click the vmx file and it will launch VMware Player and boot with the iso image as the Boot CD (you don't need to even burn a CD).

If you decide to install Ubuntu, at the end of the installation you will be prompted to reboot, before the system starts up go in and modify the vmx configuration file so that it boots off the virtual drive instead of the iso by modifying these four lines

Find:
#ide1:0.fileName = "auto detect"
#ide1:0.deviceType = "cdrom-raw"

ide1:0.fileName = "ubuntu-6.06-desktop-i386.iso"
ide1:0.deviceType = "cdrom-image"
Replace with:
ide1:0.fileName = "auto detect"
ide1:0.deviceType = "cdrom-raw"

#ide1:0.fileName = "ubuntu-6.06-desktop-i386.iso"
#ide1:0.deviceType = "cdrom-image"
The great thing about Ubuntu is that it runs live right off the CD you don't even need to install it if you don't want to.  The differences between Ubuntu and Kbuntu is Ubuntu uses Gnome as it's Desktop and Kbuntu uses KDE.  Like I said at the beginning I wanted to test sites against Konqueror and with Konqueror being a KDE application it was installed by default in Kbuntu and ran perfectly right off the live CD without installation.  It can run off Ubuntu but you'll need to install Ubuntu then install Konqueror from the Synaptics Package Manager.

Wednesday, July 19, 2006

My review of Google Spreadsheets

I needed to do a quick data grid in a spreadsheet and I decided to use Google's Spreadsheet Web Application to do the job for me.

First I copied some data from another web application and pasted it into here.  No issues.

I needed to then resize the columns to make the text fit.  That seemed to expand all the columns but that was easily fixed.

Deleted a couple of unneeded columns and added another.  In the new column I needed to multiple the column to the left by 60 and put the results in my new column.  Using the formulas I learned in Excel. =B2 * 60 did the trick.

Copied and pasted that all the way down the column and it calculated the the rows the way I wanted.  So far so good.

Now for cosmetic adjustment.  This is were I think Google Spreadsheets has the most room for improvement.  One of the nice features in Excel and in OpenOffice.org Calc is the Auto Format feature where you highlight your spreadsheet and give it a theme.  I couldn't find anything like that in Google Spreadsheets.  Oh well, it wasn't that many rows and column. I went ahead and made alternating row colors and a header color with the formatting tool.  Not to hard at all just some busy work.

Now usually in this step of making the document I would copy all the cells and paste it right into Word or OpenOffice.org Write...but when I pasted it all I got was the data, no formatting!  I was able to export the spreadsheet out to xls and I opened it in OpenOffice.org Calc.  I had to only adjust the column widths and heights and then I was able to copy and paste into Write.

So Google Spreadsheets is a great online web application but still lacking, for me anyways, the importing of data from a spreadsheet to a word processing application...maybe they will read this and find a way.

Sunday, July 16, 2006

Ruby on Rails Tutorials

After I asked about tutorials on Ruby on Rails I went searching for a few. Here are about 30 tutorials on Ruby on Rails.


Whose blogging about BarCampRochester?

Well of course besides me.

Well obviously the organizers are blogging about it.

  • Justin Thorp - gave a presentation on Web Accessibility Standards for Content Authoring tools as well as help moderate the event. Justin showed his presentation on slides he created with S5, which I thought was a cool online app.
  • Erica O'Grady - who also moderated the event gave a great presentation on Web 2.0 Web Applications that are underused.  I wrote about the ones I haven't heard about before here or you can see all of them from her delicious group. Erica also provided us with a Flickr feed of the event.  Hey where are the pictures of the BrandLogic crew?  My wife doesn't believe I attended please upload them for the sake of my marriage!
  • SeenCreative - The final moderator/organizer.  They gave an awesome presentation about their company and their experiences and showed off their Ruby on Rails project that has been getting noticed in the online community called myBillq.com
  • Larry Roth - Part of the infamous BrandLogic group that stormed into the event late and took over.  Not really, but I think you could call our entrance a classic entrance of "shock and awe".  Anyways, Larry presented some of our client work and discussed our experiences...I helped were I could but we came not really prepared. 
Some other presentations that are now online:
You can keep an eye on future blog posts by watching Technorati for BarCampRochester.

Saturday, July 15, 2006

Smart Cars might be a short term solution

However, I think this Hydrogen car from GM is the car of the future that is our long term solution to our dependence on oil.

(video)


digg this

Friday, July 14, 2006

What's hot now?

Obviously Web 2.0 apps are hot and all the rage.  I posted some examples of popular and up and coming apps.

But what I think is surprising to me is that Ruby and Ruby on Rails is the hottest programming language out there right now.

myBillq.com was done in Ruby on Rails.  It was done for two reasons. One, it gave the developers and the company something to program to show off their talents plus gave them experience with writing an application in Ruby on Rails.

OK it seems like it might make web 2.0 easier to program? Is that a fair statement?  What's a good resource to start understanding Ruby?

Web Based Presentation Slide Show Creator

S5 - A Simple Standards-Based Slide Show System

Web Applications

Listening to a presentation now about web applications.  Here's some of the interesting ones that I haven't heard before:

Crazy Egg - Coming soon app that will analyze your click throughs on your site with a heatmap metaphor.

Writely - online word processor

Shopify - online e-commerce solution


gliffy - online visio app

Jambo - proximity chat

Dabble DB - Online Spreedsheet (subscription based)




Bliki

Blog + wiki = bliki


Sitting at BarCampRochester



Just watched a presentation from SeenCreative couple of RIT grads that started a web consulting firm here in town.

They presented their Ruby on Rails site they did called MyBillq all Web 2.0 and really slick.


Wednesday, July 12, 2006

jQuery

I used to work with John Resig and Julia West before they moved on to become big wigs on their own.  They are on their way too, making waves in the JavaScript community with a new way to work with Javascript.  They are in the mist of developing a javascript API called jQuery that makes a developers life easier once you understand how it works. 

What is jQuery?

jQuery is a Javascript library that takes this motto to heart: Writing Javascript code should be fun. jQuery acheives this goal by taking common, repetitive, tasks, stripping out all the unnecessary markup, and leaving them short, smart and understandable.

I finally used jQuery last night because I needed to make rounded corners on a div. all I needed to do was include the jquery.js file, include the rounded corners jQuery plugin js file then I included these three lines of code:

$(document).ready(function(){
     $("#learn-more-container").corner("round bottom 15px");
});

which finds the div with id learn-more-container and sets the bottom corners to round with a radius of 15px.

Just that easy.  Definitely check out jQuery and see how easy it is for yourself.

Sunday, June 25, 2006

Interesting the people you meet at the most unusual times

Yesterday was my nephews high school graduation party.  Yep my nephew graduated and my oldest son is going into middle school...I am getting old.

At the party my dad said I had to meet my nephews uncle that runs his own business doing what I do...I ask "oh what's that?" "COMPUTERS" I always get a kick out of that.  They never realize that that could mean anything.

A couple hours later after my wife had handed me my 8th Crown Royal and coke my nephews grandfather bring him over to meet me.

Turns out he runs pokerdream.com a for pay online poker site.  He told me the site was written in VB.NET and the poker rooms were written in C++.

I visited the site this morning and was really impressed with the design and layout of the site...very professional looking.

He's looking for someone to build an affiliate program for the site.  I told him about my experience with building banner ads tracker on MediaGab and how I thought that should work...now that I think about it I should of told him about RedStorm Sports and the Ad system we build for that as well...I guess I can thank my wife and the 8 cups of Crown Royal and coke for that.

We exchanged cards and talked about our nephew and his choice of college and his decision to go into Computer Science.  I was telling him I think he'll switch to IT eventually because I don't see him have the geekiness to like Computer Science once you get into the Science of it...I know I couldn't handle it and switched to IT in my third year....it's just more satisfying to make things work from existing software and applications then it is to build it from scratch.

MySpace hiring ASP.NET Developers

Speaking of MySpace.  I got a bulletin today from Tom (the founder) looking to hire more MySpace Developers.

i want to hire some more .net developers to work on myspace. do you have experience? here's what i need:

Required Skills/Experience:
- 3+ years of solid C Sharp experience
- 3+ years of ASP.NET (and the .NET 1.1 Framework) experience
- 4+ years of experience developing with SQL Server 2000 (including stored procedures)
- Strong knowledge of several protocols (including HTTP, TCP/IP, and UDP)
- a solid foundation in n-tier, Business Objects, Design Patterns, and general OOP
- Strong knowledge (and wisdom) of IIS6 and its internals
- Experience on sites under heavy loads that require meticulous attention to coding practices as they relate to performance and scalability

go here to upload a resume:
myspace developers

please dont upload anything about any other job at myspace. i'm only posting this to find .NET developers!

oh yah, you've got to live in, or move to LOS ANGELES, CALIFORNIA! yeehaw!


If I was single and didn't have a family and a house I would totally have jumped all over this.  Not because I like MySpace and want to make it better.  I would do it for the experience and jump into another company in the "Valley" that would be impressed to see a big name like MySpace on my resume.

But I have a great job here in Rochester, NY.  Even if I am stuck in Maintenance Programming....thank God Coding Horror says it's pretty complex and challenging stuff. Thank god since I am challenged everyday with it.

Friday, June 23, 2006

Digg v3 coming

Digg is launching a new look and feel on Monday June 26th.  You can take a look at screenshots and listen to a Podcast interview of the Digg founders.

Last night was the Digg Launch party that was held in San Francisco Laughing Squid has some photos of the event.

Looks good can't wait to see it live.

Thursday, June 22, 2006

Google Bans 7 BILLION Pages for Spamming

Five domains were caught trying to cheat Googles rankings for spamming purposes and were banned by Google with a total result of 7 Billion pages not indexed anymore.


Tuesday, June 06, 2006

LinkButton doesn't print out a name attribute

When you use a LinkButton Control in ASP.NET 1.1 there is one difference compared to a Button Control.  A LinkButton does not print out a name attribute in the Generated HTML.

I was trying to write some javascript from a textbox to press the LinkButton if the enter key is pressed as this is not done automatically in .NET.

I was having the worst time debugging this stipping it all down to bare javascript calls. But I kept coming up with this.form.elements.somenameattibute has no properties.  Obviously I was getting at the LinkButton control but for some reason could not figure out why.  I switched over to document.getElementById("someIDattribute").click() and this worked great in IE but did not work in Firefox.  So back to debugging I went.

After looking at the code and the example code that I lifted this with I noticed that the code had a name attibute and my code did not.  I switch my Link button over to a button control and everything worked fine.

So in case you need to know this information at a later time a LinkButton control does not print out a name attribute, at least by default.

Monday, June 05, 2006

How to create Firefox extensions

Here's a great article on creating Firefox extensions.

I have a couple in mind for administrating MediaGab a little easier.

Sunday, June 04, 2006

curvycorners - Rounded Corners Simplified

curvyCorners

curvyCorners is a free JavaScript program that will create on-the-fly rounded corners for any HTML DIV element, that look as good as any graphically created corners.

I downloaded it and tried it out and it works great. 

Update:  I was looking through jQuery and noticed there is a Rounded Corner Plugin that works very similarly to curvyCorners but uses less code as promised by jQuery.

Wednesday, May 03, 2006

ASP.NET 1.1 Web.configs Inheritance Feature but to me it's a Bug

I was working on a project on Saturday when I ran into a problem. I spent a good four hours trying to find a solution for it. When I finally did I still am not sure why it works but works it does.

I was working on this web site that was written in .NET. I needed to dupe that site and make a new site in a sub directory. I made the subdirectory a virtual directory as I didn't want to make the new application conflict with the root site.

Well that didn't happen. Conflict it did. I was getting an error (similar to this) that one of my declarations in my web.config was already declared. The declaration was in the Configuration part of the config file.

I went and did a little research and found many other programmers just as frustrated that they were having the same issues. On their development machine it worked fine but when they put it onto the site it would throw this same sort of error. Turns out they develop the way they are advised too by creating a subdirectory for each project so they don't inherit from each other. But when they tried to put the files on the server one project was the root and one was the Virtual Directory. Bam!

I was able to recreate this error on my machine by setting the project that was the root on the site as the root on my development machine. I could at least try and debug it.

In my research I found that even though the app is in a virtual directory it STILL inherits from the root on up.

Basically the hierarchy starts with the machine.config -> machine web.config -> app web.config -> subdirectory web.config and so on.

Technically a virtual directory is a subdirectory but the point of making it a virtual directory is to separate the app from other apps in your site. This works for everything except web.config files. Why? Microsoft says this is a feature and not a bug...I on the other hand beg to differ.  Here are some configuration scenarios Microsoft details they get into the virtual directory configuration at the bottom.

I finally got around the problem but it took some work. One of my class libraries in the project I created as a IConfigurationHandler and has set it up in the web.config but because both projects used different name spaced the declaration line was slightly different. I tried everything to try to override it. I read you could override the web.config by using <clear> or <remove> tags but then I found that the web.config schema doesn't allow those tags in the configuration element.

In the end I took the class file and made into it's own DLL and referenced it in both projects and the configuration element became identical in both projects allowing me to see the virtual directory without an error.

So does this “feature” still work like this in ASP.NET 2.0? I am told that Microsoft fixed this. But frankly I am not sure if it truly does or not. I do know there are more tags in the web.config to allow you to lock or override elements in the web.config. So until I see it for my own eyes it's a hope that it is fixed.

I haven't even touched how ASP.NET 2.0 and a ASP.NET 1.1 web.config files don't like each other...but I haven't gotten to that point yet.

Saturday, April 08, 2006

Some interesting links from the week

I have been so busy at work this past week I havn't had a chance to even think about my blog.  But it hasn't stopped me from finding some cool and/or interesting links on the web.

I have been looking into resources for AJAX.  I went to Borders yesterday and was looking through "Professional AJAX" from WROX.  It looked good but I found better resource from Rushi Vishavadia, AJAX Resources for Beginners.

Getting Started with AJAX - Author Aaron Gustafson takes you through writing a basic AJAX application (An address book). Lots of code there.

Mastering AJAX - This is a pretty good tutorial which gives you the nitty gritty basics, talks about cross browser compatibility which is really important with XmlHTTPRequest object in IE (stupid MSFT :-p) What I like about this tutorial is that it explains info in a very easy to understand manner and it also says why you need it. (Part 1 (introduction) of the tutorial is here)

Using AJAX with PHP and mySQL - Being a PHP Developer myself, this tutorial is really well written and very complete. Step by step instructions on how to go about working with the XMLHttpRequest object too.

XAJAX - Xajax is an open source PHP Library for building ajax based applications. xajax is very easy to use and damn powerful, allowing you to use php where you wouldnt unneccesarily use JavaScript. They have a very good tutorial here called Learn Xajax in 10 Minutes.

Another good tutorial by John Wiseman on Creating a mySQL connection with PHP and Ajax.(If the code seems too small copy and paste it intoyour favorite editor, or hit Ctrl + '+' on Firefox to increase font size)

Ajax Loading Indicators & Icons - You can make up your own indicator icons, but the ones provided are really nice and fancy.

Lastly, Max Keisler has a very comprehensive list Ajax tutorials, resources - from beginner to advanced.

Scott Hanselman had a couple of interesting articles about debugging/troubleshooting.

To go along with the interesting links category Travis sent me this link the other day to a LASIK @ Home Kit.  I posted it on my forum with some "observations."

Remember that How to be a Rockstar Programmer post?  Well apparently there is some difference of opinion that is going around.

Lastly, and certainly not least Apple announced that they will ship a program called Boot Camp in their next release, Leopard, but a beta was pushed out earlier this week.  This really has alot of people excited.  Apple listened to "Bloggers" and provided them a way to dual-boot Windows and OSX on a Intel Mac.

Paul Thurrot has many many posts detailing his thoughts and experiences with Boot Camp.  I do agree with him that they should of made a boot loader menu show up on default rather then having to push and hold a option key to bring up the menu.

Still though didn't someone already do this with a IBM Laptop?

Wednesday, March 22, 2006

Top Ten Tips to become a Rock Star Programmer

On Digg they had this article about the top ten tips to become a Rock Star Programmer:

Here are some of the tips I liked or related the most to me and what I should work towards.

#7 Go back and enhance your old code

Not that it is sound from an economical point of view but because you learn oodles of things reading you own crap, which old code always is. Code gets rotten after a couple of years, it really does, since you evolve. If you can't find bad things in your old code you either already are a rock star programmer, or maybe more probable, hasn't evolved much lately.

This is good advice and something I never do.  I am of the mindset if it ain't broke don't fix it.  But then like he says it'll never evolve.

#9 Don't ask people for advice

Learn how to get that answer yourself instead, it is way more useful. Finding out how to get information about something is a value in itself and may pay you back more than the solution to the problem in the first place. Ask only if you must or if the question in itself is more a discussion and you are actually spreading information. Of course you shouldn't take this too literally, but I see lots of people asking pointless questions they could have found out faster by ten seconds of googling.

I am so guilty of this.  I am always going to my co-workers for questions.  Mostly though it's because I don't know what to search for.  But if I would follow this tip:

#6 Read books

You might be good at what you do, but knowing only that, whatever it may be, is seldom enough to really shine. Knowing enough about more fields than the field you are about to shine in is golden. Take for instance a GUI coder that knows nothing about databases. He might be almost useless since he can't interact with the guy doing the backing store, and so on. It takes as much effort to be 90% good in five fields than to be 99% good one one.
Maybe I would know more about what I need to know.

Anyways there are some good tips in the article...some common sense tips and others that should make you reevaluate yourself.

Windows Vista slips to January 2007

Microsoft Press:

Microsoft is on track to complete the product this year, with business availability in November 2006 and broad consumer availability in January 2007.

This is dissappointing.  Work late guys and make the deadline for pete's sake.

Tuesday, March 21, 2006

French pushing free choice of music downloads

Reuters:
The French parliament is set to vote early this week on a new law that would allow consumers to legally circumvent existing software that protects copyrighted material.

This could be bad news for Apple Computer Inc. and Microsoft Corp., which have for the most part locked consumers into their own downloading systems with proprietary anti-piracy software.

Analysts say that the French are on to something that the rest of the world has yet to figure out: It needs to set rules for this new market now or risk one or two U.S. companies taking control of online access to music, video and TV.

Paul Thurrott originally blogged about this.  I have to agree this is the way to go.  Being locked in isn't very consumer friendly.

Wednesday, March 08, 2006

Quick links for the hump day

Just a couple quick links to start off the day.

Friday, January 13, 2006

Thunderbird 1.5 RSS Engine has taken a step back

I am really disappointed in Mozilla Thunderbirds latest release 1.5 and it's built in RSS Reader.  It has basically taken steps back in terms of progress.

Let's take Robert Scoble's blog for example.  In 1.0.7 I could read the whole story within Thunderbird now I only get a description and have to read the whole story on Scobles site.  This defeats the purpose of RSS.  I originally thought Scoble changed his feed but looking at the raw RSS XML I see there is a description element and a content element description is before content and description holds the summary lines that I am getting.  There is no way to change the feed (that I know of) in Thunderbird to say display content in the body and not description.  Again this is something that has changed in 1.5 and it made the RSS engine worse.

Let's look at BrandLogic's Internal Blogs I use at the office.  I post daily on my blog what it is I do during the day simple list multiple lines.  I don't add any html or anything just drop in line item after line item.  In 1.0.7 they would show up as I typed them. In 1.5 they show up as one line.  Talk about a step back in progress.

Other bugs I have found:
  • Editing a feed is not possible the text box does not allow you to type in it.
  • When you create a new feed and you right click you only get "Copy this Link" as an option not the desired "Paste."
  • When I lose my connection on my laptop (put it in hybernate or go out of the hotspot area) RSS feeds won't update without restarting Thunderbird.
These issues have made me think about switching back to 1.0.7 until 1.5 is fixed in 1.5.1.  I am not the only one who thinks this Travis Hardiman (coworker/friend [I did make this months payment right?]) tried installing yesterday and the application wouldn't open for him.  He is currently back on 1.0.7.  At the time I thought he was full of shit when he was blaming Mozilla and talking trash about how bad this version of Thunderbird is.  Well I now agree with him.  I am downgrading.

But Thunderbird 1.0.7/1.5 is still better and less bloated then Outlook, IMO.

My Experiment with Mobile Web

So after I wrote last week asking who really browses on their phone anyways I decided to pony up the dough and see what all the fuss is about.  Many people said they read News Items and/or RSS feeds.  OK!  I'll try setting that up on my phone.  I have a Samsung A850 through Verizon (Yes I can hear you now!).  I went in and purchased the internet plan.  $5.95/month.  OK I try it. It's loading......

Loading....


Loading....

After like two minutes it finally comes up to a menu screen of other menu's...this is obviously a failure in UI on Verizons part as thier AOL styled portal is just terrible. If I want to navigate to a separate URL I have to go to search then there is a sub menu for go to url.

I decided after like 5 minutes of waiting for a crappy page to load that this wasn't for me.  I was planning on going into verizon and cancelling the service.  Then I stumbled apon Googles Personalize Page for mobile phones.  I tried this out.  And I'll say this is what I would want as my home page. RSS Feeds, News Feeds whatever you can put in the online version of Google Personalization. 

Now all I need to do is find a quick way to access it from my phone.  This might make it so that I like checking my phone for RSS feeds.  But it's still slow as hell and totally unusable.  I'll keep you posted on my progress.

Thursday, January 12, 2006

Mozilla Thunderbird 1.5 Released

Get it now

Here's what's new in Thunderbird 1.5:

  •  Automated update to streamline product upgrades. Notification of an update is more prominent, and updates to Thunderbird may now be half a megabyte or smaller. Updating extensions has also improved.
  • Sort address autocomplete results by how often you send e-mail to each recipient.
  • Spell check as you type.
  • Saved Search Folders can now search across multiple accounts.
  • Built in phishing detector to help protect users against email scams.
  • Podcasting and other RSS Improvements.
  • Deleting attachments from messages.
  • Integration with server side spam filtering.
  • Reply and forward actions for message filters.
  • Kerberos Authentication.
  • Auto save as draft for mail composition.
  • Message aging.
  • Filters for Global Inbox.
  • Improvements to product usability including redesigned options interface, and SMTP server management.
  • Many security enhancements.

Wednesday, January 11, 2006

Interesting Remote Desktop Error

I got this error when my laptop lost it's connection to the wireless router here in the office.  Remote Desktop crashed and provided this error.



Flickr

Blog Posts by:

Currently Viewable:

Using jQuery and Templating to Pull and Display Yo...
Getting "Up-to-speed"
403 Permissions Denied on your users Site in OSX
Selecting the fastest selector for jQuery using Fi...
Hidden C# Feature: Using Alias Directive
New Features of .NET 4.0
Kids can do amazing things with Social Networks
O3D: Google releases 3D API in a Browser Plugin
What Was Apple Thinking?
The Future of Programming Languages is Now
Promotional Video of BarCamp Buffalo
My BarCamp Buffalo Slides - Intro to jQuery
CPU statistics on yesterday's post
In case you Missed it: #jQuery Twitter posts
Selecting a ASP.NET Generated ID with jQuery
Building a jQuery-Powered Tag-Cloud with an ASP.NE...
ASP.NET MVC Release Candidate - No Codebehinds on ...
In case you missed it: #jQuery Twitter posts
BarCamp Rochester 4
jQuery vs Prototype and jQuery.noConflict()
Apple comments on "netbooks"
In Case you Missed it: #jQuery Twitter posts
Database Mirroring with SQL Server 2005
Gaining Exclusive Access to database in SQL Server...
jQuery Plugin - Simple Shadow
Adding link separators to a unordered list using j...
How to target="_blank" a link while keeping it XHT...
Book Review: "Smart & Gets Things Done" by Joel Sp...
My first JSON Implementation
Google I/O 2008 - Day 1
Kings of Code 2008
VMWare Fusion 2.0 Beta 1 is released
Observations of MacWorld Blogging
Update on my jQuery bug
VS.NET IDE Issue - ASPX gets separated from codebe...
Installing Rails on Ubuntu using VMWare Server
My first jQuery bug
A Visual Explaination of SQL Joins
Click on your own Google Adsense links without bre...
Ze Frank
Uninstalling Cisco VPN client kills internet acces...
Brakes and Rotors
Service Unavailable? Site.Config permission denied...
Monroe County to get Wireless Internet
The loss of Jim Gray is Amazon's gain
Case sensitivity, SVN and Windows is a recipe for ...
Redesigned BrandLogic.com Launches
What does the future hold?
MacWorld Keynote HUGE DISAPPOINTMENT for me
My Opinions of CES Keynote 2007
Secure your sites while surfing on the public wifi...
Feature Request for Google Reader
Solution: Podcasts won't play on iPod Shuffle
Development Branch of Firefox passes Acis 2 test
Today's Big News: Sun to release Java under the GP...
Review of Microsoft Office Accounting 2007
Firefox 2 Launches Officially
My IE7 Experience
A Slick CSS Solution to Image Rollovers
No Widescreen iPod Announced today
New Dialog box in VS.NET 2003
SVN Source Control in Windows
Suckerfish Menu with jQuery
How to run Ubuntu and Kbuntu in VMware Player
My review of Google Spreadsheets
Ruby on Rails Tutorials
Whose blogging about BarCampRochester?
Smart Cars might be a short term solution
What's hot now?
Web Based Presentation Slide Show Creator
Web Applications
Bliki
Sitting at BarCampRochester
jQuery
Interesting the people you meet at the most unusua...
MySpace hiring ASP.NET Developers
Digg v3 coming
Google Bans 7 BILLION Pages for Spamming
LinkButton doesn't print out a name attribute
How to create Firefox extensions
curvycorners - Rounded Corners Simplified
ASP.NET 1.1 Web.configs Inheritance Feature but to...
Some interesting links from the week
Top Ten Tips to become a Rock Star Programmer
Windows Vista slips to January 2007
French pushing free choice of music downloads
Quick links for the hump day
Thunderbird 1.5 RSS Engine has taken a step back
My Experiment with Mobile Web
Mozilla Thunderbird 1.5 Released
Interesting Remote Desktop Error

The Official jQuery Podcast

with Ralph Whitbeck & Rey Bango

You can subscribe to the show in iTunes or via the raw RSS feed

My Twitter Updates

View Twitter Page