Browse > Home / Archive: November 2006

| Subcribe via RSS

Vista Licensing

November 27th, 2006 | No Comments | Posted in Technology, Work

Wasn't one of the original supposed advantages of the PC it's component flexibility? You could replace any piece, upgrade as you saw fit, etc. This was a touted advantage over Macintosh and other “closed box” architectures that didn't allow component swap, or didn't have third-party options. I guess it's no secret that Microsoft wishes it had that kind of control now. Ironically, the Mac is much easier to upgrade now than ever before.

The more I learn about Vista licensing, the more I am convinced that Microsoft is making this stuff up as it goes along. Some of it seems reasonable, much of it seems really half-assed. At least it's not as completely brain-dead as the Adobe scheme. I wonder what it's going to take to show the big vendors that not all organizations are neat vertical org. charts with locked-down networks and central IT groups? You would think they have never dealt with large educational institutions.

Commodore 64 -> Amiga 2000 -> Macintosh G3 and now Intel systems. I learned Windows out of necessity (and morbid curiosity), Linux because it seemed cool and really useful. I wonder how long it will take these new licensing systems to drive folks to the Mac and Linux in droves? Those of us who have been around a while should accept the refugees with open arms and a minimum of pity. Maybe a little.


Edit After activating a Vista install on Parallels, I think I “get” the volume licensing requirement now, and it’s not so bad. I certainly limits abuse of the keys.

  Last modified: December 2, 2006 @ 8:40 am

Frameworks and Languages

November 27th, 2006 | No Comments | Posted in ColdFusion, Technology, Work

I’ve been keeping an eye on Model Glue: Unity as a CF framework for projects at work. I’m getting sick of caching a thousand form variables and passing states by URL alone. My CFCs are getting out of hand and I shudder when I look at some of the structs I’ve built to do what the big frameworks seem to handle automagically.

I’ve read through the docs for MG2, and though it’s often claimed that frameworks are worth the effort and MG is very easy to learn, it’s still learning a pattern, a syntax and another person’s method for solving the problem. I guess I just have to dig in and figure out where the break-even point is between time spent learning a framework and time saved by that framework. When you add in Coldspring and Reactor I start to become very skeptical about the distance to that break-even. I understand though that they’re optional, so I’ll probably just start with MG and maybe Coldspring and still write my SQL by hand for now.

I’m also always checking out languages and databases. I’m intrigued right now by the recommendations of some folks in the CF community to check out functional languages like Haskell. I’m going to look into Scala I think, and of course keep up my dabbling in Python. I like Python so far. I’m wondering how I can integrate it with the speed and utility of CF.

 

Screwtape Quote

November 27th, 2006 | No Comments | Posted in Asides, Christian Apologetics, Personal

“Do not be deceived, Wormwood. Our cause is never more in danger than when a human, no longer desiring, but still intending, to do our Enemy’s will, looks round upon a universe from which every trace of Him seems to have vanished, and asks why he has been forsaken, and still obeys.”

 

Adding page numbers to merged PDF

November 21st, 2006 | 4 Comments | Posted in ColdFusion, Technology

I had a project that required combining multiple one-page PDFs into a single PDF, and then adding “Page x of y” to each page. ColdFusion can’t currently do this, so I looked at iText. There was some excellent example code and many other better coders have written CF extensions to use iText, but I couldn’t find one to solve my problem exactly. I ended up using javaloader.cfc to call iText without adding it to the CF classpath, and then turning some of the example Java code into CF by object and method calls. It worked out well.

[cfm]
// add page numbers

reader = loader.create(”com.lowagie.text.pdf.PdfReader”).init(concatArgs[1]);
output = loader.create(”java.io.FileOutputStream”).init(replace(concatArgs[1],”temp.pdf”,”combined.pdf”));
stamp = loader.create(”com.lowagie.text.pdf.PdfStamper”).init(reader, output);
bf = loader.create(”com.lowagie.text.pdf.BaseFont”).createFont(”Helvetica”, “UTF-8″, “True”);
over = loader.create(”com.lowagie.text.pdf.PdfContentByte”);

pages = reader.getNumberOfPages();

for ( i = 1; i LTE pages; i = i + 1 ) {
over = stamp.getOverContent(javacast(”int”,i));
over.beginText();
over.setFontAndSize(bf, 12);
over.setTextMatrix(30, 30);
over.showText(”page ” & i & ” of ” & pages);
over.endText();
}
stamp.close();
[/cfm]

 

SQLite with Coldfusion via JDBC

November 21st, 2006 | 1 Comment | Posted in ColdFusion, Technology

I used the drivers here: Precompiled JDBC SQLite drivers

The source is here, though it may not be the same: Source

I dropped the Linux JDBC and .so files into [cfmx7root]/lib/ and restarted coldfusion. Then I created a database using SQLiteQuery on my Mac and added a table, column and single value. Then I copied the db file to a test folder on my server and just ran a select * from table.

My datasource setting is as follows:

JDBC URL: jdbc:sqlite:\var\www\html\sqlite_test\cfmltest
Driver Class: org.sqlite.JDBC
Driver Name: sqlitejdbc.jar

At that point, running the code threw an error that the table didn’t exist. Permissions were all okay, so I executed a CREATE TABLE via the .cfm file with a different name, column and value. That table showed up. Turns out that the table I created on the Mac only shows up on the Mac via the GUI tool, and the table I created via CF only shows up for CF, even if I query the master table to get a table listing. I’m thinking that has to be something to do with driver versions.

If I get a chance to test further, I’ll run some speed tests versus reading and writing files, XML, etc. to see what the speed is like. This is also obviously insecure, you don’t want your db file to be readable by the web server.

UPDATE: now that CF8 includes the Derby java database, this is somewhat moot. Though it does give a way to interact with existing sqlite databases. I still don’t know why some tables don’t show up, again probably a version/driver issue.

  Last modified: August 24, 2007 @ 8:02 am