Monday, December 01, 2008

Export to CSV with Coldfusion

I am trying to finally get a good export to CSV working, using coldfusion. There are alot of posts, many of them by Ben Nadel.

Ended up using the example from: Converting A ColdFusion Query To CSV Using QueryToCSV()

This worked great except there were lots of blank rows at the top of the file and at the bottom. The fix was found here: Extra white-space after page proccess

<cfcontent reset="yes"><cfoutput>#Trim (yourvar)#</cfoutput><cfabort>

It was important to put it on one line to, otherwise there was an extra line for each line return.

Thursday, November 27, 2008

CF 8 - "ColdFusion is not defined" JavaScript Error

I am trying to get ajax select dropdowns to work in coldfusion 8. I eventually want them to be related also. That is, the results of the second are based on the choice in the first. Well hit a wall and couldn't get the data to show up. using a test page I was able to return the correct results with a cfinvoke of the .cfc, but no data in the selects.

I didn't have firebug installed on this computer, so I went and got it and looking at the javascript error's I saw the error: CF 8 - "ColdFusion is not defined" JavaScript Error. Google that and I found the following that explained the cause:

CF 8 - "ColdFusion is not defined" JavaScript Error

The solution was to not only have a cf mapping to the cfide directory (which I already had) but also a web server virtual directory (which I didn't have). I added the virtual directory and it works.

Wednesday, November 26, 2008

How to restart Apache on the Mac

Made a change in the httpd.conf file and wanted to restart the Apache server to pick up the changes. How did I do that?

Open up the terminal window (/applications/utilities/terminal)
Then Type: sudo apachectl restart

Seems to have worked for me.
Location of httpd.conf for Apache on the mac

It is hard for me to find things on this mac still. Some of the stuff is hidden and it always takes me a while to get around. The last thing I was looking for was the httpd.conf file for the apache web server configuration. I wanted to see where the webroot was. Then maybe change it.

Anyway, it was at /private/etc/apache2/httpd.conf.

Amazing how many posts I saw asking this same questions.

Monday, November 24, 2008

Start and Stop ColdFusion and othe services.

One of those little nuggets that I picked up at the adobe conference was leaving services you don't always use stopped until you need them. Like coldfusion for instance. I will get developing and use coldfusion locally for development for days at a time. But, I don't always use it, so there is no need for it to be running if I am not using it.

Quick search and I found this: Batch files for Starting and Stopping ColdFusion.

In Vista I had to use "Run as Administrator" for those to work, but they did work like a charm. Took a long time on the main CF service the first time, but it did eventually work.
Dreamforce, Adobe MAX, and BIS in Long Beach

I have been out of town 4 days each of the last 3 weeks attending one show and 2 conferences.

First was Dreamforce. Salesforce.com's annual big event. This was fantastic. I am amazed at what salesforce.com has been able to do with their platform. We have been using salesforce.com since April and I can't imagine being without it. They really have a fantastic vision and have been able to grow their business and keep most of their customers happy.

One of the Big announcements was salesforce sites. Public facing web pages that your customers can access without loggin in. Before, any access to salesforce was via controlled login access. Now you will be able to design pages for the public based on your salesforce data. This does have tremendous possibilities, especially if I was to ever move my data entry app into salesforce. We will see. But all the other stuff was cool. I learned alot and they treated us like royalty. Tons of food all the time. Free shirts, books and more. I have never before been treated so good as we were treated at Dreamforce. They seem to really care about their customers.

The second week I was at BIS in Long Beach. This is a builders show where we buy a booth and market our magazine. We also walk around and speak with other booths. This show is a good place for us to get our name out and we had pretty good success with it last year.

The 3rd week (last week) was the Adobe MAX user conference. I went to this one when it was in Salt Lake about 4 or 5 years ago. This conference was great also. They had decent food, although not as good as dreamforce and the content was above average. I learned alot and got to shake hands with and meet some of the top coldfusion guys. I am sure there a great minds in everywhere, but I feel we have some great ones in the coldfusion community.

Both these conferences where held at the Mascone Center in San Francisco. This made it easy for me because I was a little familiar with the area since I went there in late Sept for a salesforce.com administrator test.
Mac drives me crazy 1/2 the time and I love it 1/2 the time.

I have not posted forever. Probably because this macbook pro drives me absolutely nuts sometimes. After slowly getting use to the different key combinations I can actually get around ok, although I still have alot to learn.

The battery lasts for about 3 hours, maybe slightly more, depending on what I am doing. This is great. It does run fast. But to be fair a new pc laptop with the same config would probably do the same. It wakes up from sleep mode faster than I think a pc with windows ever could. And it is sleek and cool.

But, I can't beleive how hard it is to use some of the dvd/movie features. I have tried to create dvd's from a panasonic mini-dv camera and it has been a frustrating nightmare. Even once you learn how to do it there are quirks that drive me nuts. If you don't catch some of the subtle things, it just fails and you don't know why. Thank goodness for my daughter's basketball coach, she figures it out, even thought it sometimes takes her a while too.

Anyway, my macbook pro isn't going away. But it won't be my main machine anytime soon.

Oh, one huge plus is the touchpad. Dragging 2 fingers scrolls. 2 Finger touch is like a double click (Although Steve Jobs is crazy for not just putting 2 stupid buttons on there in the first place). With the pc I ALWAYS pull out the wireless notebook mouse. With the macbook pro I am more comfortable with the trackpad because it is so responsive and nice. I catch myself trying to 2 finger drag back on the pc and it doesn't work.

Thursday, August 28, 2008

Installing mySql on Mac OSX Leopard

Just got done installing mysql on my macbook pro. Installation went just fine. Followed the same document that also had php installation instructions. Click here to view that document again.

I accepted all the defaults and have not yet gone through the instructions for connecting to php. A couple of places I stumbled only briefly. As mentioned in the article I downloaded the MySQL GUI Tools. This gives a visual interface and will definately work better for me as I still have no clue to all the command line stuff on this mac. After installing the gui and clicking on the MySql Administrator app in the applications folder I was given the option for a server and username and password. Server Hostname can be set to "localhost" and username to "root". Then you can change the password when you get in there.

Very simple. Now I gotta learn the interface.
Installing Coldfusion 8 on Mac OSX Leopard

I just installed coldfusion 8 on my macbook pro and didn't have any problems. I read through this post first and it had instructions, but all the settings in that article were the defaults so I just clicked through and it installed no problem.

I am, once again, not sure about the directory structure. Not sure if the default /library/documents/webserver is the best place but it does work, at least the CF administrator does.

I installed the 64 bit version. The way I understand it is that with the core 2 duo processors you can get the 64 bit versions of the files

Now on to mySql.
Viewing Hidden Files

I Figured out how to view hidden files, but it wasn't easy and I am still not 100% comfortable with it. I followed the instructions here: http://guides.macrumors.com/Viewing_hidden_files_on_a_Mac but that did not seem to work. I wanted to just use finder to see the hidden files. When I typed in the suggested commands, I didn't get an error but it is definitely not working. So I resorted to downloading a couple of additional programs. Textwrangler and Coda.

I actually downloaded Textwrangler first and struggled a little so I began to download coda. Before it finished I had figured out Textwrangler so that is what I ended up using. From the textwrangler menu you choose "File/Open Hidden". After that it still isn't easy as I still am learning to understand directory navigation on the mac. I was able to find the private directory by clicking on the "Macintosh HD" in finder. It would be more intuitive at this point if it would have been under Desktop, Home, Applications or Documents which is where most stuff seems to be.

I haven't got back to using this (modifying hidden files) yet, but I will and I think I will be alright now. I still need to install mysql and coldfusion.

I did get php working by just modifying one line as instructed here: http://reverbisnotalie.com/code/php-mysql-apache-mac-osx-leopard

Sunday, August 24, 2008

Apache, ColdFusion 8

I want to install apache and coldfusion 8 on my mac so that I have a complete development environment on this machine. I enabled web sharing which I think is apache and It works. But I can't find the apache directories. It looks like you have to make hidden directories and files viewable and I did that as instructed here:

Viewing hidden files on a Mac

But I still can't figure out where the http.conf apache file is. This is not easy so far, unless I am just missing it.

Thursday, August 21, 2008

Gmail on a Mac

This one is going to drive me nuts. On a pc using gmail you can type an email, press tab and then enter and it sends the email. When you press tab it moves focus to the send button. On this mac that doesn't happen. Tab never performs like I expect, at least on web pages. Driving me nuts. Funny how such a little thing can make such a difference. But I at least need a comparable key combination so I don't have to touch my mouse in gmail.

----------------
Just found the answer to this. System Preferences/Keyboard & Mouse/Keyboard Shortcuts then at the bottom you see "Full Keyboard Access". Make sure you choose the "All Controls" option and it works like a charm. Wahoooo!

Wednesday, August 20, 2008

Touchpad greatness

Just reading through the little white booklet that was the only documentation that came with the macbook pro. The info from that booklet that I liked the most was the info on the touchpad. Two fingers sliding will scroll up and down or side to side. Two fingers and click is like a right mouse click. I also enabled touch click in system preferences because I prefer to just tap the touchpad instead of having to use the button, which can be awkward for my thumb. Three fingers does something too, but I can't remember what.
Mac Spaces

Just started using spaces. This is a cool feature where essentially you have 4 desktops and can easily switch between them. I will probably use this more as I get use to it. I might have email in one, eclipse for coding in another etc...

Even with this 15" screen there is not alot of screen real estate available with the dock and a few desktop icons you don't want to cover up. Spaces will make this easier to deal with.
Lighted keyboard

The macbook pro's lighted keyboard is sweet. With my dell I always had to angle the monitor down to be able to see the keyboard in the dark. Not with my mac.
Save pdf to web receipts folder

My Macbook pro has a cool feature. When you print a web page you can click on the pdf button and there are several cool choices. The one I just used "Save pdf to web receipts folder" is a great time saver and very convenient. How many times do you just want to do that. In windows there are a few extra steps and I think you have to have adobe acrobat pro in at least some cases.

Tuesday, August 19, 2008

unable to load default svn client

Installed Eclipse no problem. Although I did install the latest version, Ganymede first. But I installed the latest Europa (3.3) once I found out that CFEclipse doesn't yet work with Ganymede (3.4). I then installed the SVN client and it seemed to go well. But I was getting an error "unable to load default svn client" error.

Found a little help here: http://subclipse.tigris.org/servlets/ReadMsg?listName=users&msgNo=12087

But I already had installed JavaHL and still I was getting the error. But after installing SVNKit (there were 2 and I chose both, a client and something else) it worked. Another problem solved.
No Docking Station

It looks to me like there is not a docking station available for this macbook pro. That is a shame. Apple seems to have it all going on and then they don't have docking stations. I currently use my dell latitude laptop primarily between 2 different offices. At each of these offices I have docking stations with external monitors, power, network and other accessories hooked up. It is VERY simple to just drop the laptop onto the docking station and I am off and running. This is a big minus for the mac.
Cool Power Adapter Connector

This is one of those little things that don't matter much, but I notice. The way the power cord hooks into my mac is pretty cool. It is magnetic so once you get close it kind of grabs it and inserts right to where it needs to be. Makes it easy to plug it in.

That's lost a little in the enormity of the whole power aparatus itself. I am use to the dell power adapters that have a nice way to wrap both sides of the cord around itself.

Monday, August 18, 2008

Mac Crash

So, I am a little confused about if I can just shut the lid and this mac will go into sleep mode, or what. I have no idea how to tell what it is doing. So far, this is one big deficiency. I have no insight into the workings of this machine. I even find myself missing the disk actvity light, even though it doesn't mean much, at least I know something is going on.

Anyway, I left my house to go over to the in-laws and chose sleep from the apple menu. When I opened it back up at the in-laws it just froze. Wouldn't do anything for 3-5 minutes. Finally just held the power button down until it restarted.

So I had a mac crash in my first day owning my first mac. I am loving the experience so far, but I think that is mostly the newness of the whole thing.
Copy a DVD

I had to copy a DVD today, something I rarely do. I had no clue how to do that on the Mac. A quick google search found: http://www.kenstone.net/fcp_homepage/making_dvd_copies.html.

That article gave me enough info to copy the DVD. I actually got it going and forgot it was running. The mac is much better at copying a DVD and allowing my to work unhindered while that is happening.
VMWare Fusion

Ok, now this is cool. I bought VMWare Fusion at the same time I bought the macbook pro. I just got done installing Windows Vista as a virtual appliance. So essentially now, I can switch over to windows vista at any time. Very cool. I plan to install Windows XP and Ubuntu also. Windows XP just to support my clients, and Ubuntu for fun.

I think I can take a snapshot of my pc and install a virtual machine that is just like my pc, with all programs and everything, but this time I did a fresh vista install for testing. It was slick.
CTRL-End and CTRL-Home

I didn't realize how much I use these two quick key combinations until they weren't there on the mac. The mac version of these is cmd-LeftArrow and cmd-RightArrow. Cmd stands for the key labeled "command" on my macbook pro. I think this is also referred to as the apple key. cmd-uparrow and cmd-down arrow seem to move you to the top and bottom of a document.

Good to have these committed to memory. They are very useful. Now if I could just figure out the tab key in gmail. That is a big one for me.
Performance Monitor for Mac

What started this was my desire to make sure they really gave me the 4gig memory that I paid for. I was trying to find out the easiest way to get that information on the Mac. In windows you simply right click "My Computer" and get alot of that information right there. Ctrl-Alt-Del / Task Manager also gives you that stuff.

Google lead me to this: http://www.mac-forums.com/forums/showthread.php?t=120126. Which essentially mentions the activity monitor in Applications/Utilities and also the free download from apple.com called istat: http://www.apple.com/downloads/dashboard/status/istatpro.html.

This little app was free, installed very easily and is accessed by clicking on the dashboard icon 2nd from the left on the dock, or whatever that line of apps is called.

I still struggle getting around on the Mac. I installed VMWare and was confused, although I can tell it will be fine after a couple shots at it.

I got a message from VMWare that there was a newer version, but I clicked away the error and for the life of me I cannot find the mac version of Help/About. I just want to see specific versions so that I can identify upgrades.
I bought a MAC!

For years I have been considering purchasing a Mac computer. I am a laptop guy, so usually my thoughts have been for a macbook pro. I finally did it. Today, it arrived and I am already using it. I type this blog entry from that new laptop.

I am going to try and document stuff as I learn. I don't plan on completely switching to mac, but I do want to make sure that I have personal experience with both types of computers. But if I love it, who knows!

The first problem was that I wanted to highlight the whole URL in the browser window. In Windows I click the end of the URL and then I could press ctrl-home. I searched for ctrl-home for mac, but came up with cmd-L. This will jump to the URL and highlight the whole thing.

I still need to figure out the equivalent of ctrl-end and ctrl-home. Plus the tab key doesn't seem to work the same, especially in gmail.

Tuesday, June 24, 2008

Even My Wife has a blog.

My wife said that her Sister set her up with a blog today. We will see. She even acted like she was going to post. We will see. If she starts posting then I will have to be better about posting to my own blog.