Order cheap dedicated servers in USA.

Adjust font size: [-] [+]

PHP Needs a Foundation

October 28th, 2009

PHP-ZendOver the years I have moved from technology to technology based on the popularity of a new language or platform because that how you keep finding work. In high school and college I was taught Basic, Turbo Pascal, COBOL and a little C. In college I taught myself Perl and Java which is what I actually used when I got my first internship and my first couple of jobs after college. For a short time I got into Java and I really liked JSP, servlets and the maturing taglib system. Unfortunately Sun started to propose JSF but did not really put much energy behind it and it still has yet to make an impact. Other web frameworks for Java like Struts, Tapestry and so many others dominated over JSF because people were using them and they worked. As a consultant at that time I found it very difficult to know all of the available frameworks to any reasonable depth to confidently call myself an expert on the Java platform as web developer. It did not help that Sun did not really put much energy behind Netbeans, their IDE which was being developed by a team of developers who built it using Emacs. So IBM and their contribution to the Java landscape, Eclipse, took an leadership role in the community where Sun left a massive vacuum.

Why am I recalling this history about Java when the post is supposed to be about PHP? Well, I really liked Java and thought I was going to build my career on it, but it turned out that there was not a sufficient force behind it to keep it moving forward. And while I see PHP as a dominant player among web site development, I do not see the sorts of efforts underway that are necessary to advance the platform.

Read the rest of this entry »

iMade – Mobile Application Development Event – iPhone

October 6th, 2009
iMade

On October 24 you will want to attend iMade if you are interested in learning about designing or developing for the iPhone. Prior to the event developers can work with each other on various coding tasks and discuss any issues that come up during development. As all the tasks are completed the pieces to build the final application on the day of the iMade event will be ready.

On the day of the event we will cover three areas: User Experience Design, Graphic Design and Objective-C Coding for the iPhone. The rules of User Experience Design (UXD) for the desktop is not the same for a mobile device or even across different mobile devices, so we will cover the guidelines provided by Apple for the iPhone and developer the UXD and workflow for the demo application.

Read the rest of this entry »

Parsing CSV Data, the Easy Way

September 17th, 2009

I am always surprised how there is no direct support for parsing CSV data in .NET even though Microsoft Excel can export data to CSV and it is infinitely easier to parse a CSV file than an Excel document. (correct me if I am wrong) I rarely deal with files anymore and when I do they are typically XML formatted, so when it came time to parse some CSV files I browsed CodePlex for a project which would handle this task for me. There are several options there but nothing looked right for me so I searched Code Project and found CsvReader which is designed for reading large CSV documents quickly. Great, it had unit tests and all but 1 of the many tests passed so I got to using right away.

I finished my work on this particular project and today my client sends me an updated input file which does not include header lines and actually starts out with a few blank lines. I also found that the last field in some rows were blank and these differences were enough to break all of my code which was using CsvReader. I tried to dig through the code and recompile an updated version that would safely handle my new requirements but it was too much work. This particular document has 3 types of rows: batch, header, and detail. Each of these line types has a different number of fields and CsvReader seems to assume all lines with have the same number of fields and throws exceptions if it does not like what it reads. It is very inflexible and unforgiving. And if the last column has no value it also throws an exception. It was not helpful in the slightest.

Read the rest of this entry »

Twitter Bookmarklet: I Just Read (IJR)

April 29th, 2009

There are lots of social networking sites like Digg that let you tell others about what is a good read. But you can bypass these sites and directly tell everyone about good reads using Twitter. So I created a simple bookmarklet that you can click to send set the title and link to the page you are currently on to Twitter where you can submit your new post.

Bookmarklet: IJR

IJR Bookmarklet

I have this bookmarklet on my links toolbar in Firefox and Chrome along with other bookmarklets I have created. Feel free to drag this bookmarklet to your bookmarks bar and start sharing your IJR posts on Twitter.

Modern JavaScript Techniques

April 21st, 2009

In my interview with The Thirsty Developer podcast I mentioned some modern JavaScript techniques. It is hard to explain these techniques in a podcast so I wanted to post them here.

Learn more about JavaScript and jQuery at BootWorks, Wednesday, April 22. [ Details ]

The biggest problem area I work to avoid when working with JavaScript is the scoping issue. It has been very common to simply create a series of functions and call them however you see fit from event handlers in your HTML. This was all fine when you had 300 lines of JavaScript for your entire site because it was just used for a slight site enhancement. Now if you are building a much more complex site with lots of interaction, you will have several thousand lines of code. Every one of these functions and variables that you define are all placed in the global scope, which is the window object. Consider the following code.

This code is equivalent to the following code, assuming this code is in the global scope and not within a function block.

Why is this useful? Well, if you are within a function block and declare a variable the scope of that variable is limited to that function block. If you want to declare a variable and put it into the global scope you can use the window object in this way to do so. (Hint: window is the container for the global scope.)

Read the rest of this entry »

Embracing jQuery and Learning JavaScript All Over Again

April 13th, 2009

Now that ASP.NET MVC has been released and jQuery is included it is time for every ASP.NET developer to start embracing jQuery. I personally have been using jQuery and other JavaScript libraries for the past few years. Ever since JavaScript became popular again thanks to the likes of the Google Mail interface in 2004 and the naming of AJAX by Jesse James Garrett in 2005.

With JavaScript becoming a central piece of a modern web application, I decided that I had to start taking it seriously. For years I only used JavaScript to enhance a page and ensured that if the user had JavaScript disabled the page would still work as required. It was time consuming to add a lot of JavaScript and it was often not worthwhile. Starting in 2004 I started seeing more and more sites start building sites which simply would not work without JavaScript. I decided that since I plan to do web development for many more years to come that I had to learn how this was all done, and I found that these modern sites were leveraging JavaScript libraries that would abstract away browser differences and reduce the effort necessary to implement a rich experience.

Read the rest of this entry »

Packer for .NET 4.1 Released

March 1st, 2009

Packer for .NET has been updated to version 4.1. A major new addition is a new MSBuild task called UpdateWebConfig which makes it easier to prepared your web.config file during deployment. There is also the new Combine mode.

Note: Version 4.1.1 has been released with a fix to the targets file.

Breaking Change

With this release the Utility class has been renamed FileProcessor. If you are coding against the assembly you will need to change Utility to FileProcessor.

Combine Mode

Sometimes you may want to simply combine multiple files together without running the JSMin or CSSMin modes. You may like to spread our CSS across multiple files so they are easier to organize and allow multiple developers to access concurrently. The Combine mode will allow you to combine these files into one either during the build and deployment process or even at runtime if you choose. In the 4.0.3 release I added features to make it possible to push out your files in this way.

UpdateWebConfig

I automate as much as I can on a project. One of the most critical changes during deployment is updating the configuration file. To do this I make use of web site projects along with the web deployment project. This process creates a pre-compiled web site which is ready for deployment and while it does have a feature to replace sections of the configuration file, it needs to be more targeted.

Read the rest of this entry »

Browser Upgrades, IE6 and ESPN

February 25th, 2009

Back in 2004 I wrote A Great Example of CSS and Javascript in Action which explained how to use CSS and JavaScript carefully due to the varying browser experiences at the time. The situation has changed quite a bit since then. We no longer have to support Netscape 4 or Internet Explorer 5. Now there is a push spreading widely to end support for IE6. (Read The End of IE6) And this time there is a significant amount of resistance. IE6 seems entrenched and there has been push back on not supporting this old browser.

Consider if I were to loan you my laptop that I bought in 2001. It is very slow and cannot run many of the applications that you use today and has a 10GB hard drive. Most iPods have more storage space. You would not want to use that laptop. You may refuse to use it because it is just not worth your time to deal with the headaches of finding old ways to do what takes so much less effort with a computer purchased in the last 3 years.

Read the rest of this entry »

The End of IE6

February 20th, 2009

Pushup
Internet Explorer 6 was released in August of 2001. Since then Microsoft delayed any new releases after achieving dominance in the browser market which effectively ended the browser wars of the late 90's. In a previous post I suggested the dominance of IE6 and lack of releases over several years was bad, but also good because it offered a "stable" base that we could build on. In the late 90's there were frequent releases of Netscape and Internet Explorer with amazing new features and it was hard to keep up. At least with no releases for the browser with 90% of the market share you could stick with what you had. But now it is time to move forward.

Starting with Google Mail everything changed. Suddenly you could build rich applications than run on web sites. And thanks to the rising popularity of AJAX many more sites jumped forward into what became known at Web 2.0. Now it is common for a site like Facebook to act more like an application than a collection of pages. You have a task bar at the bottom to show notifications and keep active chats going with friends even as you browse to different areas to look at photos and post comments on your friend's walls. In order to run as an application a web site requires more resources, and Internet Explorer 6 is just not capable of providing the experience that people want.

Read the rest of this entry »

Packer for .NET 4.0.3 Released

February 8th, 2009

Packer for .NET has been updated to provide an easy way to return the minified content directly for a web request. Until now the process of "minifying" content was done either on the command-line or with with MSBuild.

The task of creating the compacted content can easily be forgotten during a deployment. And when the source control system locks the output files which are updated with the build script there can be trouble in both writing out the files as well as keeping the files current in source control. So instead of referencing the generate file it would be useful to reference the source files dynamically. Read on for an example.

Read the rest of this entry »