msgbartop
msgbarbottom

31 Dec 08 Another Rails vs Django?

I just want to start by saying this is not going to a be a “bash” series on Rails vs Django but rather real examples of how applications can be built with both frameworks.  With each application I will do a write up on design concepts, story boarding, development and then deployment.  I do all my development with the NetBeans 6.5 IDE with plugins that are currently available for both Ruby and Python development.

Along with developing the applications in the standard HTML, CSS, and JavaScript (with Ajax) technologies I will also be developing interfaces with Adobe Flex 3/AS3.  The purpose?  To show how Flex interfaces can spice up some of the more mundane interaces and make the user experience a little more exciting.  Plus if the user interface is built completely with Flex then it can be also be deployed as a desktop application using Adobe AIR.

So lets first dive in with an application we have all grown to love with the 15 to 20 min examples, a web blog.  But lets take a little different approach to this by doing some reverse engineering on an existing blog application called Wordpress.  Why you might ask?  Because in my opinion Wordpress is one of the better engineered applications which is readily available for anyone to download and deploy on their own personal web server instance.  Wordpress is very solid and what I would like to do is just review the basics of the application and explain some of the purposes behind some of the architecture of the app.  Then once we are done we can move forward with developing our own version of the application using both Python and Ruby with the Administrator being built in Adobe Flex.  Sound fun?  Well it does to me.

In my next article I will be doing a review of Wordpress and some of the principles behind the data structure (models) as well as services that will need to be provided in creating our own version of Wordpress.

See you next time!

Tags: , , , , ,

08 Dec 08 Wubi - Ubuntu Installer for Windows

For anyone still toying with the idea of moving to a Linux distribution this is exactly what you need.  I currently have two machines, Windows XP SP2 (i386) and Windows Vista Home (x64), that have Wubi (Ubuntu 8.10) installed for when I need a true development environment for Python, Ruby or Java.  After years of developing on the Windows platform(s) just to have my work moved to Linux servers, this setup is perfect for pure Linux to Linux development.

Wubi - Ubuntu Installer for Windows

NOTE:  You need to take baby steps when moving from a long relationship with Windows to a Linux distribution.  If you decide to go with a more permanent install of Ubuntu (the next step to freedom) then I would highly suggest following the instruction provided here:

Graduate From A Wubi Install To A Dedicated Partition

Most of all have fun and explore your new Ubuntu setup.  I have found that if you get stuck on something just Google it with the words (without quotes) “Ubuntu” then version number and then words pertaining to the issue.

Example: Ubuntu 8.10 setup lamp server

Enjoy!

Tags: , , , , , ,

24 Sep 08 Review: Quick Start Guide with Amazon Elastic Compute Cloud (EC2) on Windows

Quick Start Guide with Amazon Elastic Compute Cloud (EC2) on Windows

This is a great tutorial on getting setup with the Elasticfox Firefox plugin in order to start working with the Amazon Web Service (EC2).  I highly recommend the read if you want to make your life easier with utilizing the services.

Tags: , ,

22 Sep 08 Converting Date Stamp Formatted Strings into Date Objects

There are lots of examples of how to parse date strings and then convert them into Date objects.  The function that was created was as follows:

NOTE: Made some changes to the code so I wanted to pass along an update to everyone.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package com.wezbiz.sample.util
{
	import flexlib.scheduling.util.DateUtil;
 
	import mx.utils.StringUtil;	
 
	public class DateUtils extends DateUtil
	{
		/**
		 * Converts a string value into a Date object
		 *
		 * @description
		 * Takes a date formated string and converts it into a Date object
		 *
		 * @param	str String "YYYY-MM-DD 00:00:00.0"
		 *
		 * @return	Date
		 */
		public static function incodeDateStringToDateObject(str:String):Date
		{
			var retval:Date;
 
			// convert string into date and time.
			if(str != ""){
				var a:Array = StringUtil.trim(str).split(" ");
				var dateArr:Array = a[0].toString().split("-");
				var timeArr:Array = a[1].toString().split(":");
 
				retval = new Date(
					dateArr[0],
					(dateArr[1]) - 1,
					dateArr[2],
					timeArr[0],
					timeArr[1],
					timeArr[2]
				);
			}
			return retval;
		}
 
		public function DateUtils()
		{
			super();
		}
	}
}

Tags: ,

05 Sep 08 Setting Up a Flex Development Environment with Ruby on Rails

I have been asked a few times here lately on how I setup my Flex development environment.  The following is just my preferred method of setting up as I develop my Flex applications that are hosted with Ruby on Rails applications.

Here is a list of software and links that I use for my setup:

  1. Flex Developer IDE - http://www.adobe.com/products/flex/
  2. Bitnami’s RubyStack - http://bitnami.org/stack/rubystack

 Setup of RubyStack

This is pretty straight forward as the setup comes with an installer.  Just follow the directions as the installer and you should have no troubles.  Since I use a Windows XP distrobution I prefer to setup the RubyStack server on the root of a drive (ex: c:\RubyStack).

Once the install is complete it will launch the Apache server and provide a link to the demo Rails application that was created during the installation process.  Just ensure that you are able to view the Rails application and that everything is working correctly.  If you run into any problems, I recommend posting on the support forums on the Bitnami site.

NOTE:  If you are planning to use RubyStack for Ruby on Rails development I recommend that you download E-TextEditor and CYGWIN (E-TextEditor sets CYGWIN up for you on first launch).  Once you have these installed you will want to setup your PATH configuration using the Windows Environment Variables screen.  I personally setup all the direct paths to all the bin directories and path to E-TextEditor in order to not have to type paths in when I am calling an executable.  For instance:

PATH = C:\RubyStack\ruby\bin;C:\cygwin\bin

There are lots of resources available on the web on what the benefits are for doing this and other methods of setting this up. The screen can be obtained from right-clicking on My Computer and going to Properties.  With the new window that opens go to Advance Tab and click the Environment Variables button.  The window should look like as follows:

Windows XP Environment Variables Screen

Windows XP Environment Variables Screen

Setup of Eclipse Developer

Again this is also pretty straight forward with the installation.  If you download the installer just follow the directions provided during the installation.  When you visit the Adobe site to download the Flex Developer IDE there is an option to download the Eclipse plugin.  I have run into a few issues with the Eclipse plugin so I would just recommend installing a stand alone version of the IDE.  The following are examples of my default directories of where I install the IDE and setup the workspace for development:

Installation: C:\flex_developer
Workspace: C:\projects\flex_workspace

The projects folder allows me to have a location where I can develop standard Ruby on Rails applications as well as have my workspace for Eclipse with Aptana set to.

Project Creation and Setup

Flex & Ruby on Rails

Okay now we are getting to the purpose of this post.  When I create a new project I first create a Flex project and use the defaults for the creation.  Once the project is created you will want to change where the project gets compiled too.  You do this by creating a Rails application (instructions on how to create a new Rails application can be obtained from RubyOnRails.org) and then changing the Output Folder to the location of the public folder in the Rails application structure.  Your assets directory should be located within the source directory of the Flex application.  I have run into problems with deployment of the assets if it sits outside the source directory.

Flex & Apache HTTP server

So say you don’t want to use a Rails application to host your Flex project and you would like to just host is on the Apache HTTP server.  Just set the output folder to the location of with in your htdocs section of the Apache setup or create an Alias in the httpd.conf file.  The httpd.conf is outside the scope of these instructions so I will not be explaining this process.

Once you have decided which way your want to host the Flex application you will want to also change the Output folder’s URL field to the local address to the application.  Here are a couple of examples:

Rails App: http://localhost:3000/
HTTP App: http://localhost/folder/to/app/

Flex Build Path Screen

Flex Build Path Screen

The reason I like doing my development through an HTTP request for debugging is because eventually the app will be hosted this way.  So instead of launching from the desktop I prefer to launch it from a hosted environment to ensure that there is nothing missed when it comes to deployment.

Tags: , , ,