Entries Tagged as 'What I Learned Today'

What I Learned Today - Data loss sucks.

Viviotech , What I Learned Today No Comments »

Over the long weekend, Viviotech had a major outage due to a failed upgrade. I am one of the servers that had failures on the Viviotech backup process as well, which means my most recent server backup was mid-June. Not a very good weekend for me (but better than the one the Viviotech guys had to endure).

I do weekly backups every Monday of my databases, and all my web files are saved in a local CVS repository that I have backed up on my own. Unfortunately, the outage happened before I could do my latest rounds of backup, so my database backups are more than one week old. 

I've lost two blog posts that were done last week, and I know of at least two comments that got lost as well. My apologies to those people.

Comments are moderated for spam-prevention purposes.

What I Learned Today - MAMP Pro and SSL

What I Learned Today , SSL , Web Development No Comments »

A couple of projects I work in involve using SSL in some places. For the longest time I could never get SSL to work right with MAMP PRO (I have v1.84). Today I ran across a blog post that finally got it working for me.

http://www.rockettheme.com/blog/coding/310-getting-ssl-to-work-with-mamp-pro

What I Learned Today - Have your ColdFusion on OS X and your Verity too.

Verity , What I Learned Today , ColdFusion , OS X No Comments »

This is a followup to my previous post on this topic, and a solution found.

Thanks to comments here and from House of Fusion, I learned that Verity does not work on Macintosh OS X. An alternate solution must be found. Thanks in part to Dave Watts of Figleaf, I found it.

Setting Up Verity

From Dave's suggestion, I installed CF9 on an OS that has Verity - Windows in my case.I have an instance of WinXP SP3 running via VMware Fusion. I have the network adapter set up for NAT, so it gets it's own internal IP address.

I installed it as a standalone edition with the local web server on port 8500. After installation I ran the web-based config to get it all up and running. At that point, I disabled all the CF services except for the ColdFusion Search Services, which is set to Automatic. I went into Windows Firewall and opened up the three ports Verity uses.

I went back into my OS X CF admin, and changed the Verity K2 host to the IP address of my Windows instance. Tried to connect to the service and.... nothing. At this point it was 1700 on Friday so I shut down and took the weekend off from this.

I returned to this task this morning with a fresh head, and found some documentation on CF's instance of Verity. It only allows connections from one machine, and by default it is set up to be 127.0.0.1. A search found this address in two XML files in my C:\ColdFusion9\verity\Data\host directory, as well as the C:\ColdFusion9\verity\verity-install.cfg file. I went into all three files, and changed the IP address and mask from 127.0.0.1 and 255.255.255.255 to my OS X internal IP address and a mask of 255.255.255.0. I restarted the ColdFusion Search service on Windows. I cannot tell you for certain which change was the difference maker, but when I refreshed the ColdFusion Collections link on my OS X CF9 admin server, it was connected to the Windows verity!

Fun with soft links

The next task was to set up the collection that I was going to use. The function to do the indexing is set up to create the collection first if it does not exist.

As a reminder, my QA and production environment are Unix boxes, which does have Verity support from CF. On it, CF is set up in the /opt/coldfusion directory. Therefore the verity collections are in /opt/coldfusion/verity/collections/. I have been very strict in making sure that my local development environment on OS X mimics the directory structures used on QA and production, using soft links where needed. So on OS X, I created /opt, and inside /opt created a soft link for "coldfusion" to link to my /Applications/ColdFusion9/ directory.

The path to the verity folder is /opt/coldfusion/verity/collections/. My first instict was that CF would create the directories as needed. I ran my indexing template, and got back the following:

The collection was reindexed. 0 records have been inserted. 0 records have been updated.


Not what I was expecting. I looked in my /Applications/ColdFusion9 directory, and saw no new "verity" directory created. So where was it? I looked on my WinXP instance in C:\ColdFusion9\verity\collections, and saw no new collections created there. I was stumped until I looked at the C:\ drive, and found an "opt" directory there. Expanding it, I found C:\opt\coldfusion\verity\collections\ and my collection inside there!

Now knowing what had happened, I needed to link OS X to that verity folder. I shared the C:\opt\coldfusion\verity folder on Windows, and mounted it in OS X. I then went into /Applications/ColdFusion9, and made a soft link to the mount point for the verity shared folder at /Volumes/verity. So now /opt/coldfusion/verity links properly to the C:\opt\coldfusion\verity on Windows. I think I've got it all, so I run the index again.

The collection was reindexed. 0 records have been inserted. 0 records have been updated.


Huh?

The Final Hurdle - proper location of the documents

Looking in the CF9 admin, I read this:

Because you have a remote K2 server configured, you must ensure that the documents to be indexed are accessible from the ColdFusion server machine as well as the computer on which the K2 search services run.

And that's when I realized that the documents to be indexed couldn't be on OS X, they had to be on windows. I created an uploads directory on Windows, and shared it. I mounted the share on OS X. Then, again mimicing our QA and production structure, I soft linked the root uploads directory to the mount point (/Volumes/uploads).

A final running of the indexing returned this:

The collection was reindexed. 106 records have been inserted. 0 records have been updated.


Wahoo! And a test of the search returned results as expected!

Comments are moderated solely for spam-prevention purposes only.

What I Learned Today - I blame Ben Nadel for this post...

What I Learned Today , ColdFusion 6 Comments »

Okay, the title is meant to be facetious, and attention grabbing. Just so we're all on the same page. But it's not untrue.

Through Ben Nadel's fantastic blog, I learned the practice of creating and scoping a LOCAL struct in a CF function (CFMX7 and CF8), and assigning any other local variable created in the function into that struct. That way I did not need to manage multiple variables, trying to make sure they were all locally scoped. It seemed more efficient.

Well, with the migration of my VPS to CF9 (and the impending upgrade of my work's servers to CF9), I found blog posts talking about how others that had used this practice were finding oddities with their code upon upgrading. It seems that this practice was somehow colliding with the new protected "local" scope within functions in CF9. The new scope allows coders to do exactly what I was doing, only without having to scope that local struct first.

In trying to figure out what changes I needed to make, I went asking around trying to find out if this meant that we no longer had to scope local variables anymore inside of functions, if unscoped variables would automatically get put in the new local scope. To hear and read the documentation, you certainly could come to that conclusion.

Thanks to Ray Camden, I have been straightened out. It turns out this is not the case, and I am not the first to ask him this. He was kind enough to make this topic an entry in his just as fantastic blog.

Bottom line, you don't have to scope things put in the local scope, but you must explicity call the variable in the local scope (local.myVariable). And all other variables must still be scoped for protection.

What I Learned Today - Flex Training Follow-up

Flex , What I Learned Today , ColdFusion 2 Comments »

I wanted to pass along my experiences from my Flex Training for ColdFusion Developers that I took yesterday in Chicago.
 
This was a course from Adobe that was along the lines of an "intro to..." kind of course regarding Flex. Flex is the bridge that connects Flash to a backend (in this case CF9 but it can connect to any backend). It was aimed at people with my skill sets, but it was clear within the first hour that if you had some Flash and Actionscript background you were going to get a lot more out of it. I had neither, but I was able to follow along well enough.
 
Our trainer was Jeff Tapper, a senior Flex developer who has worked on some high profile projects, most recently working with Major League Baseball on their MLB.tv video feeds (I hope I got that right). He took a good amount of time in trying to make sure that we did not fall behind much.
 
On the Flex/Flash end they laid out some interesting (albeit very basic) usages. A lot of using Flash as a front end for basic forms and having it call CF9 to do some processing and returning data to the front end without a page reload. They did show that Flex can do form validation natively, and since it is not tied to a feature that can be disabled like JavaScript, it lessens the need for writing both front end and back end code for data input validation to a nice-to-have instead of a must-have. With a standard HTML front-end, if a user disabled JavaScript they could still submit the form and therefore having server side backend validation is an absolute must. Here, they either have Flash enabled and get it all, or they don't and don't see the form. There is no in-between.
 
Using Flash Builder you could set the Flash compiler to make the flash application accessible with a single checkbox in the options. I would be curious to see what our 508 team would think after taking a look at some of the demos we did, to determine if it truly is 508-compatible or not.
 
I did like the Flash Builder tool a lot, it has a nice GUI interface for creating the Flash front-ends and allowed you to manage some of the actions for the form objects as well. If I was going to build a Flex application, I would choose to use Flash Builder (which is built on the Eclipse IDE). But it costs at least $250 for the standard copy, and can get up to $700 for the Premium (which includes network monitoring to test the efficiency of your Flex application).
 
What I would need though is a lot more training on the Flex language itself. This I can self-teach given time I believe, but there's a lot still to be learned on that front.
 
What I ended up walking away most impressed with though was the new CF9 server and the ColdFusion Builder application. CF Builder is currently in Beta 2 phase, and is also an Eclipse-based IDE. It did have a couple of bugs but nothing major, and I really liked how it could be integrated with your CF server, either a local one or a remote one, to give you some control over the server, and through RDS get a lot of quick access to the database.
 
As far as CF9, the single biggest thing I walked away from this was the introduction I got to CF9's ORM (Object Relational Mapping) feature. After a first introduction to it, and watching a couple of other presentations on it since, this could be a tool that changes how we interact with databases. It enables you to write fairly generic code, and use functions instead of queries for accessing the database (and supports all parts of a CRUD interaction). Because of this, you could write CF code that would work the same with a database no matter what server it's on - be it MSSQL, MySQL, or Oracle (to name the three most common ones). It also takes a lot less code to interact with the database, which will save us time in coding. ColdFusion Builder has extensions that can speed this up even more, by connecting to your database via RDS, reading the configuration of a table, and auto-generating the components needed for you. CF9 also natively handles a lot of this communication as well. If you couldn't tell, I'm pretty excited about trying this out.

Powered by Mango Blog. Design and Icons by N.Design Studio
RSS Feeds