Programming


We’ve been waiting on this for quite some time.  Skype for linux is now available with video! Check it out!

The plugin everyone has been waiting for: Impromtu 1.3!!! Sorry for dragging around for so long on this but its here a long with some awesome additions and bug fixes!! Whats different you ask?

  • An option to focus a button by default
  • An option for zIndex if you need to change it from the default
  • If you click outside the prompt you will get a nice blinking effect on the prompt
  • Escape key should now close the prompt without submitting the form
  • $.prompt now returns a container with the fade and the prompt created
  • Fixed a bug if the body was shorter than the window so was the fade

So all of these additions what did you take out? Just the container option. This option in my opinion was too buggy and not all that useful, so away it went. So there we have it, please give it a shot and remember, it doesn’t have any bugs, just undocumented “features”. Enjoy!

Get It Here!

As of late I’ve been swamped with web work on the side(not to mention my 8-5 job). I’ve tried a couple times to get to know some common frameworks, specifically Django and Ruby on Rails. I love their concept and its hard to rank one better than the other because they both have their selling points. However, a few time’s I’ve found myself going back to regular old php because of the limitations.

What limitations you say?? They’re open source frameworks, change them!

Well quite frankly as most developers will tell you they just don’t have the time to sit down and figure out the source code just to add one little tweak. From my experience the part that gets me is for really light weight sites ROR seems a bit over kill, and Django is almost perfect for these little sites except that one thing you want the admin to treat differently(by the way if you haven’t tried Django’s admin it builds for you automatically you have to give it a shot, its breathtaking).

So what do I always end up doing? Going back to my old trusty aedCFC and aedPHP. No this isn’t a promotional post. These two projects I consider a middle step between a framework and manually coding it all yourself as they create a finished user admin for you with a little configuration. So here are my Pro’s and Con’s:

Framework Pro’s

  • They handle most of your sql for you
  • They provide a templating system to separate your presentation from your logic
  • They provide consistency, so if you need to add something down the road you have no trouble
  • Some provide an automatic Administration site to manage your models
  • Automatically provide clean urls
  • Ability to change database engines at any time
  • Caching built in

Framework Con’s

  • Hosting configuration for your framework(unless you have hosting preconfigured)
  • Overkill on the amount of files needed for smaller sites
  • Lack of flexibility without changing the framework itself(I need to create thumbnails on the fly when I upload images in the admin, now what?). I think this is a major drawback.
  • Too much configuration for smaller sites
  • If the framework doesn’t provide an admin solution then you must design one as well, what has the framework accomplished?

So there are quality points coming from both sides of the table, but how do I know if I’m waisting my time with Frameworks. I think it all boils down to a few things. Of course if you already know the framework inside and out and you have no issues setting up a new site with your framework you should stick with that. But for a newbie who has little framework experience its a tough decision. You really need something in the middle. Almost every client these days needs an Administration site, and I think this is more time consuming than the front end many times. What would I be looking for in a framework? Here are a few things that come to mind, most already use these but some don’t:

  • MVC.  Most frameworks use this.
  • Does not mix client side with server side. (.Net) With the exception of an Administration site, everything else should be left up to the developer to make the site look and operate the way I want, not the framework.
  • Administration, but highly configurable(more so than Django). Maybe I can assign an events class with methods onAdd(), onEdit(), onDelete() to each Model. Also more media options like creating duplicate images and resizing when I upload a photo.
  • Fewer files and directories for the framework. Some frameworks I get lost in. ROR in my opinion has too much to forge through. Maybe store all this in the server installation? I do realize some of this is for portability.
  • Plenty of Hosting providers

Ok OK, maybe I’m nit-picking a little, but what is out there? I’ve been on the search lately. Anyone have a framework that works well? I don’t mind if you’re promoting your own projects here, we’re all in the same boat I’m sure. So lets hear it. Which framework is worth while?

Creating the Cron Job

We’ve now created all the parts to our MLS system, but we often need one more finishing touch, a scheduled job to keep our listings up to date. To do so we first need to uncomment a couple lines in each batch file we created. Uncomment “UPDATE_BCF” and “UPDATE_ONLY” so it looks like the following:

RETS Batch Update

Now we have two options. You can create a cron job for each individual batch, or we can create a very simple shell script to kick them all off one after another. Then we only need to create one cron job to execute that shell script. Here’s what your shell script(or bat for Windows) should resemble(just create a file name retscronjob.sh):

#!/bin/sh
#
# execute this to update all feeds to database with cron job
#

cd /PathToVieleRETS/vieleRETS

php -q ./run_interactive_job.php batch_control_files/MyBatch
echo Updated MyBatch

php -q ./run_interactive_job.php batch_control_files/AnotherBatch
echo Updated AnotherBatch

Be sure to replace PathToVieleRETS and MyBatch respectively. Now our only cron job will be to execute this script: /pathToCronJob/retscronjob.sh. There you have it, a 6 step tutorial to completely handle all of your RETS MLS needs from retrieving the feed to creating a scheduled download!

Please pardon the mess of the site here lately.  Over the next week or so I will be doing a little makeover to the site.  I will do my best not to break anything in the process!  Any suggestions or logo designs are happily accepted although please don’t be offended if I don’t use it :).

Being a curious mind kills a developer with a timeline.  This is half of my everyday battle.  The other half is the financial situation to afford many tools we all love(Photoshop, ColdFusion, Apple).  So we’re stuck with a small budget but need to perform at our best.  This is why I love Open Source software.  My question to other developers is this: What low budget solutions get you through the day creating a website from design to database and everywhere in between?

First off I have to say my current development computer is running Ubuntu and couldn’t be happier with that.  My editors are Komodo Edit and gEdit.  I will use CFeclipse when doing ColdFusion, but thats normally my 8-5 job.  Since I’m not a stand out designer I use strong CSS and fewer images, but Gimp does most of my image work.  I look to possibly buy Fireworks though as soon as I’m able.(I want to learn Photoshop, but I’m more comfortable with Fireworks).  For databases I depend on MySQL, but since they were recently purchased by Sun, I am now exploring Postgres since I’ve always heard great things about them and I’ve been learning Django which also recommends Postgres.

Programming languages is never set in stone.  Although very fluent in ColdFusion, I can’t afford a license, and no Open Source CF solution is up to par just yet so I have been doing most of my work with PHP.  Django looks promising with the exception that a lot of their framework is changing(new forms), and server set up can be a booger.  For javascript I like them all!  jQuery, Mootools, Prototype, etc.. they all have their uses.

So a quick recap:

  • Ubuntu
  • Komoto Edit/Gedit
  • Gimp
  • MySQL/Postgres 
  • PHP/Django

Again these are my “at home” tools on a limited budget.  What tools get you through the day?

With Sun’s recent purchase of MySQL, is it to one’s best interest to move to one of the other leaders of open source databases? It could be too early to tell. With so many people dependent on MySQL its hard to believe anything will change, after all Java still is a pretty cheap commodity. I have already begun exploring other options, not saying I would abandon them but I’ve always had a good feeling about Postgres, and now might be a time to give it a spin. I’ve also used SQLite recently and that is a nice portable solution for light weight tasks(especially if you will be developing on one server and moving to another server). As of now I am keeping my eyes open but being a curious mind I am always trying new things. Only time will tell!

I rarely use sqlite, but I have to say it is a pretty handy database that in my opinion works very well.  Last time I used it I was on windows, but this go ’round I was using Ubuntu.  I was searching for a nice admin tool and none seemed to suite me as I needed to edit an SQLite 2 file but its always nice to be up to date and administer SQLite 3.  I found none better than to use the same windows program with Wine.  SQLite Administrator seems to me to be a pretty complete tool.  Here’s a screenshot of it running through Wine:

SQLite Administrator

Of course this isn’t as pretty as on Windows, but hey, I’m not going for looks here!  I do realize there are SQLite tools out there like this for Linux,  but there were requirements to compile and install them, and well, I think we’re getting a little too old for requirements with Linux.  Its almost easier to install Windows applications with Wine.  I guess this is the one place proprietary software has a slight advantage…  Any one aware of any other database administration tools out there for Linux/Ubuntu for various databases that exceed the standard tools(other than MySQL Query Browser and PGAdmin)?

Many may not know(I just recently learned) about using regular expressions within SQL statements. Instead of using substring functions and such, we can create a clean little regular expression(Oracle):

SELECT zip FROM zipcode WHERE REGEXP_LIKE(zip, '[^[:digit:]]’)

Keep in mind however that just like SQL syntax varies for each database(MySQL, Oracle, Postgres, etc.) so does the regular expression techniques. The following are a couple links to help you get started.

Unfortunately a little research shows SQLite does not natively support this. It sounds like dangerous waters to begin with, but if you know you won’t be switching database engines often the benefits can be rewarding!

I was waiting on the day when jQuery would have a plotting plugin. Wait no longer! Flot is now on the scene. With the easy jQuery syntax I’m sure it will win the hearts of plotting programmers everywhere:

$.plot($("#placeholder"), data, options);

Now I just need to find somewhere to use it!

« Previous PageNext Page »