I wiped my Old(ish) Macbook and upgraded to Snow Leopard this gave my Core Duo 1.8ghz 2g ram macbook a lease of new life. I needed to re-setup my local dev enviroment and noticed a few people where unsure how to setup vhosts with apache default install with OSX 10.6/10.5/10.4 so here it is step by step.

Edit the hosts file to add a local DNS entry.


Add the domain name you wish to use 127.0.0.1 is the loopback IP do not change this IP.


Create the folders and files for the local website. I chose to place the log files for apache in the site folder and the website content under a sub folder www.


Edit httpd.conf I used path finder here to show the locations.


You can also use VI or any text editor


On line 465 uncomment: Include /private/etc/apache2/extra/httpd-vhosts.conf and save the file.


Edit: /etc/apache2/extra/httpd-vhosts.conf


Add in the details of the new virtual host and save:
( I'm running Railo on Tomcat locally so I have so additional parameters )

I also set my logging levels to log as much as possible.

Notice the location of the logs files matched the access.log and error.log files created earlier



Run: apachectl -t
to confirm there are no syntax errors.
I choose to leave the example sites, they cause a warning but it wont stop apache.
Then restart apache: sudo apachectl restart


Create a test file in the new folder for the virtual host ( /Users/Paul/Sites/paulsDev/www )


Confirm the new virtual host works:


If you'd like to watch the logs in a terminal you can use tail:
tail -f /the/Path/to/the/log/file


BTW Dave made a great How-to on setting up Tomcat and Railo on OSX which you can view here.
We recently upgraded a few SQL server boxes to MS SQL Server 2008. I also installed the new Enterprise Admin tools and after working on a new project I hit a slight brick wall.

"Saving changes not permitted" 

This kept coming up when I tried to change column attributes and re-arrange column orders for a table that existed.



It was odd I could make schema changes like this with SQL 2005 why not 2008?

Turns out its a simple setting that's on by default in the SQL 2008 Enterprise manager ( Express and Full ) and JoĂŁo Fernandes gave me the solution over twitter only a few mintues after I asked.

Here are the exact steps:

Click "Tools" , Select "Options", Expand "Designers", select "Table and Database Designers" then deselect "Prevent saving changes that require table re-creation"


 
  
 
Java and ColdFusion ( well CFML including OpenBD and Railo ) work really well together as you would expect. However there is not a lot of information out there about exactly how to create (or use) existing Java within ColdFusion, which is whyy I decide to make a simple example and a step by step post of how to create java code and execute it from ColdFusion.

All the files use are available for download at the bottom of the post.

You don't need alot of tools. Initially I created the whole demo with notepad++ and compiled the .java files from the CLI but its easier to manager if you use eclipse. The only real component you need is a jdk you can confirm you have this installed by running the following:
javac -version

notice its javac not java as we need to be able to compile .java code. I completed the example on Windows but it will be the same on any operating system.

javaVersion

If you do not have a JDK installed you can download it here Sun JDK

Launch Eclipse, create a project and right click src and select “new” and then “package”. Create com.transport

This is the package structure for this example. In transport you then make 3 new class's Vehicle.java, Car.java and Bicycle.java

eclipse

Vehicle.java:

javaVehicle

Car.java:

javaCar

Bicycle.java:

javaBicycle

I also made a Demo.java to test the code:

javaDemo

You can run the Demo.java from withing eclipse to see if you made any errors, the result will be displayed in the console:

javaConsoleOutput

You can now export the code as a jar.

To extract to a jar to use with ColdFusion, Railo or OpenBD:

Select the .java files you want ( Vehicle, Car, Bicycle ) right click and select “Export” , expand “Java” and select “Jar file” you can export this to any location and jar name. As I have ColdFusion running locally I exported directly to c:\ColdFusion8\lib as paul.jar

( on railo this location is: /var/www/virtual/sitename.com/WEB-INF/railo/lib/ basically the /WEB-INF/railo/lib/ under your webcontext you want access to the jar )

You need to restart ColdFusion to pick up the file.

One CF restarts it should have access to the java class’s we just made:

Create a new .cfm page and we can now create java objects of the classes we just made directly from ColdFusion:

cftojavamethods

The output:

cftojavamethodsresults

I wrote the same code as a cfc to show the comparison:
( I used CF8 so I write the components in tags )

Vehicle.cfc:

cfVehicle


Car.cfc:


cfCar

I then made a page to create a few of each object type ( cf and java ) and show how the code is almost identical.

javacfspeed

I then increased the loops to 10k to see the results:

cfVJavaObjects

Yes java objects are much faster then ColdFusion.

The point of the post is to show how easy it is to jump between java and CF and if you have algorithms, class's or any code that's already built in java you can easily leverage this in ColdFusion.

Also note that I compiled the code on Windows 7 64 bit and tested on ColdFusion 8 I then dropped the jar onto my linux VPS running Railo without a single change in code or recompiling the java code.

Here is the speed test running on ColdFusion9 under Ubuntu: http://demo.kukiel.net/java

Here are the files: DemoFiles.Zip
I have said it before and I'll say it again. If you're not using some type of source control you should be.

SVN makes life easy. I'm the type of person that likes to run the latest Betas (Win7 for one) and that often means I reformat and reinstall my Operating System regularly. I also jump between Linux, Windows and OSX.

One of the hardest things to move between machines is my development environment and making sure I have my code and don't lose anything. We use SVN at work and I use SVN for all my personal projects its just easy to check out my code and continue working.

I have recently moved my projects to Project Locker as they have free accounts with up to 500mb storage, SSL plus more.

If you're not using SVN then you should really check this out and start.

I still get asked about installing ColdFusion 8 on Windows 7 and Vista from time to time I remember when Vista SP1 came out and ColdFusion would no longer just "install" like it should and it took a bit of tinkering to come up with the solution. Dale Fraser worked this out for us and it works perfectly on Vista and Windows 7 and Windows Server 2008. This is also the same process for ColdFusion 9.

A little while ago I also created a step by step walk through and here it is: Installing ColdFusion on Windows 7 </ a>

Once that is setup you might like to create addition HOST entries so you access your sites locally via host name rather then http://localhost/site1
Steve Withington has a walkthrough on the process here.

There is sound to this as I step through the process.

If you are interested in Windows Server 2008 and ColdFusion 9 install here is a walk through: http://vc.kukiel.net/cf9win2k8