Tuesday, July 24, 2007

Dial Up North

Dialup sucks, everyone knows it, but it is cheap, free in most cases. Recently MichNet cut all its subscribers off of their dial up internet service which Wayne State was part of so we were in the market for a dial up service to connect to the net upnorth. I decided on NetZero mainly because it was free. My review of the software is that it Sucks. I have used dialup for a while now upnorth but this service is the pits, the free one installs a toolbar on IE, for a while I could not get any other application to connect to the net besides IE which is a real bummer if you need to use SSH or an IM client. But eventually like magic applications began to come online, I cannot explain it but it made me happy.

It really put things into perspective for me again on how a lot of people still view the net. It was so slow at some times that I eventually disabled images and then things were flying quite well, but it really showed off which developers have the skill to accommodate this slow pace world. Some things I noticed that really helped were:
  • Using a background-color approximately the same color as an image background. This way if the image background does not load then the text on top still have a background color to contrast against.
  • Combining images and use background positioning to put them in place. This dramatically reduces the number of images to load. Like I mentioned before images were the real killer of speed when using dial up. Better yet if you can use background colors instead of images it really speeds things up without loosing design points.
  • Combining Javascript files and using a compressor. This is a no brainier it take almost no effort and helps with slow and fast connections. JS files can get large and they don't have to be, I recommend using an automated compression tool called Minify. Really easy to use and
  • AJAX. It is odd but it really kept me on sites with AJAX for a longer period of time because the site seemed snappier and I didn't have to wait for the whole page to load over and over again.
  • If you have image/flash ads on your site really sit back and think if slowing down the information on your site to a portion of internet users is really worth the few cents you may get from them clicking on the ads. Content is king, if a dial up user cannot get to your content because of a large flash or image ad on your site they will more than likely go someplace else that is dial up friendly.
Slowing things down really puts the little things into perspective. And it is the little things that matter in life.

Tuesday, July 17, 2007

IP Changed :-?

So we have had cable internet for probably 12 years now, it first started out with Excite@Home and which got bought out by Comcast. Well in those 12 years I have only had two IP's, one for Excite which was pretty much static 24.*.*.* Those were the good old days when there were no limits and they did not try to control everything. And one for Comcast which is essentially dynamic but i have had to reset my router a few times and it has always come up with the same IP 68.*.*.* Well all of a sudden yesterday of all days they decide to change my IP randomly, without me even renewing it from the router. They changed the whole IP even, doesn't even start with the same A class 69.*.*.*! Now it is more complicated and I have to change all my hosts files on my machines to match :-/ What a hassle, im done venting...

Blogged with Flock

Monday, July 16, 2007

PHPSimpl 0.8.2 Feature Update

Just keep adding features
So after some time working with the current release we noticed some areas where improvement was needed. So what did we do? We improved in all the wonderful ways below:
  • Added a debug.log file to debug a live site in real time, best used with "tail -f"
  • Added the ErrorMessages() function to summarize a forms errors, similar to Rails.
  • Added the SetConditions() function so querying for >, <, <=, LIKE and OR's are all possible now.
  • Added a Get and Set Folder name functions in the Folder Class.
  • DisplayList() now uses the options of a field to display in the list.
  • RowsAffected() now works like it should.
  • Fixed the Debug Query to work again.
Its a Recommended Update
Questions or Comments? Feel free to leave them in the PHPSimpl Group. There is always someone to help available. By the way we love feature requests, keep them coming.

Sunday, July 15, 2007

Getting Things Done.

Time has been flying. We have under a year now till the wedding and I have really been trying to get alot of things out of the way and on the right track.

First is getting rid of a ton of junk that has been collecting over the years. I threw away all my old computer stuff, just left a few parts which were actually worth some money. And am down to two computers and a laptop.

I have been putting things up on eBay randomly. Right now I have two old phones and a bluetooth adapter. My mindset is if i have not used something in three months to get rid of it. I have really been trying to minimize the clutter in my life.

I have been using Ruby on Rails more and more and it has grown on me, it is simple, straight to the point and a real enjoyable experience.

I have also started jogging every day. I got to a point where my appearance really started to bother me and I needed to do something about it. I really have been enjoying jogging and it actually has given me alot more energy.

I recommend for anyone else who really needs a push into productivity to read both Getting Real and Bit Literacy.

Blogged with Flock

Monday, July 09, 2007

Understanding Rails Partial's

Partial's are great, i really wish there was something as straight forward in Smarty. With Smarty it would require a loop and an include, but partials roll that all into one. It great when you are displaying a list of items, especially if that list can be used in multiple pages in many contexts.

With PHP you would have to:
{include file='links.tpl' title='Newest links' links=$link_array}
Then in links.tpl do the loop:
<div id="box">
<h3>{$title}{/h3>
<ul>
{foreach from=$links item=l}
.. do stuff ...
</foreach}
</ul>
</div>
But Rails on the other hand if you pass a collection to a partial it automatically treats each item in the collection as an individual item and there is no need to create a loop it is done inheritly.

Rails:
<%= render :partial => 'list_item', :collection => @customers %>
_list_item.rhtml:
<tr class="<%= cycle('odd','even') %>">
  <td><%= link_to list_item.last_name,
  :controller => 'customer',
  :action => 'show',
  :id => list_item.id %></td>
  <td><%= list_item.first_name %></td>
  <td><%= list_item.city %>, <%= list_item.state %></td>
</tr>
You may be thinking that it is really not much less work but writing loops all day long can get tiring especially when they are look the same and do the same thing. Partials take it to the next level and add a real intuitiveness to the loop because it is not just an array of items you are looping through it is actual objects a template is being rendered with.

Partials can also be used without the collection in just a basic include of a sub template the syntax is below. Useful but I have not found it as much fun.
<%= render :partial => "account", :locals => { :account => @buyer } %>

Blogged with Flock

Sunday, July 08, 2007

Starting a Rails Life

My rails life seems to be starting out similar to my php life. It all began with an internal application for my dad. He has a music instrument sales, rental and repair business and he initially did everything on paper to keep track of customers, instruments and billing. I took it upon myself to create a web based application for him to keep track of all of it. It was my first php application written in php3 and run on a small server here in the house. It is amazing that it is still running and he still uses it.

That was 7 years ago and looking back at the code now I cringe. Sometime in between there and now it was upgraded to php4 and it looks like that was a hack of a job. But since then my php life has expanded to the point of it no longer being a challenge. So what else would be a better way to start my Rails life than to revisit my dads billing application and recreate it with rails. Of course fixing all the issues with the current billing process and adding some additional features to make life easier.

To the right is a screen shot of the current functionality and design. I am currently just working on getting the layout squared away so functionality can be added without having to stop and think how it should look.  So far only 56 lines of code have been written and about 4 hours have been spent on the project, 2.5 being spent coming up with a design and 1 hour spent implementing and tweaking it. So far rails has been a dream come true.

Coming from php which is mainly mirrored from C++ I have always been use to the long hand conditionals. One thing that rails offers is the "unless" command. Compacting an if statement into one line that can be read without much difficulty. Here is an example of its use, probably not the most efficient but I am sure it will get tweaked once more come into play.
<%= ' class="selected"' unless controller.controller_name != 'customer' %>

Blogged with Flock

Friday, July 06, 2007

Making web development fun again

Web Development is a passion and like all passions they can become stale after a while unless you continuously look for a new technique to keep it fresh. I have become officially bored with PHP, dont get me wrong it is a great language but after developing in it for over 8 years you start to look for something new and exciting to get that same rush that you get when you learn and implement some new functionality.

Of course PHPSimpl has been a good release for me, it has really given me an outlet to expand my knowledge and take pride in building something that benefits more than just my development life. I am not stopping development on PHPSimpl, actually I think my additions and bug fixes will get increasingly quicker and better. I cannot leave PHP behind because the web is currently pretty much glued together with it.

I have fallen in love with Rails. After using a ton of PHP frameworks none of them really seamed to be straightforward and seamless. Rails on the other hand is not as get up and go as php it has all the requirements I have been looking for in a framework. Some of the excitement is from getting to learn a new language and the structure of a Rails app just make sense.

My dream has come true, No More Slop! PHP is like a blank piece of paper and a pencil, the graphite stays on the paper but it can go in any direction at any time. Its great for when you are feeling creative but horrible when you have to read someone else's paper, it might as well be in a different language. I have always tried to create some structure from PHPSimpl since I lead a team of three developers and we maintain 160+ sites.

I played around with Rails about 9 months ago while reading Agile Development with Rails and it really got me thinking about what else is out there. At that time I didn't take it too serious since I was already deep in a redevelopment which needed it badly. After a few months of PHP development on a large application that was not mine initially I was burned out. This past week I picked up Build Your Own Ruby on Rails Web Applications and read the whole thing, wow 400 pages I know... but the book was well written and went through the basics all the way to deployment. I recommend it for any developer looking for a change, even if you don't start developing in Rails it gives great insite on how the web should be and can be applied to any language. Agile Development with Rails is a little more intence and is a definite follow up read.

My Current Rails Envy:
  • MVC with a real structured generator
  • Database Migrations
  • Templating engine built in
  • Testing built in
  • Plugins
  • One line Scaffold for those quick apps
  • Fixtures
  • Simplicity of WEBrick
  • Logging like a mad man
I am in the process of changing to a more Rails friendly host and I will most certainly be writing my Rails entries. Its like starting my web development life all over again, its refreshing.

Blogged with Flock