Search

Friday, June 15, 2007

Frodo Failed...

I saw this great bumper sticker today. It said "Frodo Failed...Bush has the ring". I don't care who you are, that's funny :-)

Using Reactor vs. T-SQL

Here is how you would query a SQL table to return distinct user names. The order by is not needed but it's there to illustrate how to use it in reactor.
<cfquery datasource="UserDSN" name="userQuery">
select   distinct username
from     users
order by username asc
</cfquery>
Here is how to do the same with Reactor 1. Create reactor.xml file:
<reactor>
<config>
  <project value="wine">
  <dsn value="UserDSN">
  <type value="mssql">
  <mapping value="/UserSample">
  <mode value="development">
</mode>

<objects>
</objects>
2. Create the reactor object with the path to the reactor.xml config file:
<cfset reactor = CreateObject("Component", "reactor.reactorFactory").init(expandPath("reactor.xml")) />
3. Create and execute the query:
<!--- Create a gateway to the table you want to access --->
<cfset usersGateway=Reactor.createGateway("users")>
<!--- Create a query --->
<cfset q=usersGateway.createQuery() />
<!--- Set the table fields to be returned --->
<cfset q.returnObjectField("users", "username") />
<!--- Set the order by (setAsc or setDesc) --->
<cfset q.getOrder().setAsc("users", "username") />
<!--- Specify that only distinct user names should be returned --->
<cfset q.setDistinct(true) />
<!--- Execute the query --->
<cfset userquery=usersGateway.getByQuery(q) />
I realize that the above is a lot of code for a simple query but this is just an example on how to get started.

Monday, June 11, 2007

cfMovieLibrary Initial Release

Features:

- Capture movie information such as name, number or discs, date added, format and location

- Filtering movie display by movie name

- Sorting movie display by name, number or discs, date added, format and location

- Tracking of duplicate movies by format (PC or DVD)

- Automagic linking to IMDB



Url: http://cfmovielibrary.riaforge.com



Screenshots: http://www.flickr.com/photos/boyank/540771762/in/set-72157600339751574/

Friday, June 08, 2007

Trip to Americade

Here is a great picture from our trip to Americade







The whole set of pictures that I took from the trip (including some of the passed out cat) can be found at

http://www.flickr.com/photos/boyank/sets/72157600328010740/
// //]]>