cftopper.com

Windows Vista Speech

Check out this demo of the speech recognition in Windows Vista (actually working for the most part).

That's pretty cool if you ask me, will be very handy when feeling lazy. See the mouse grid system and number systems - utterly brilliant.

Tags: Online

MySQL error on rename 150

If you ever run into the error message "MySQL error on rename 150" when making changes to your MySQL table, the easiest thing to do to fix this is:

  1. Backup the database
  2. Delete it
  3. Recreate it
  4. Restore it

Basically MySQL has temporary files interfering with the ALTER TABLE process. I has done a load of googling and found comments but no solution - this is posted here to save others some stress.

Update

Be careful with the above advise - you could be getting this error just because you are doing something like trying to link an unsigned int to a signed int. Use the advise above only after you have carefully determined that MySQL is acting the maggot.

Tags: MySQL | Tips | WebDev

Tip: Use Local Variables for Queries in Recursive Functions

Groan, it's 1.06am and my ass is sore from sitting in this position. I've been trying to figure out what the hell is wrong with my recursive ColdFusion function that copies the structure of a site into a ColdFusion structure...

I was convinced that something was wrong with ColdFusion, hell I even went as far as downloading the updater for 7.01.

Then it struck me - maybe I also have to define the variable used with <cfquery> as a local within the function. I somehow assumed that a <cfquery> would automatically be local. One <cfset Var getSubPages2 = ""> near the rest of the local variables and it was fixed. Hours later. Sore Ass. Lesson learnt.

I think I'm a ColdFusion master Messing but this was a neat blow to my ego - I should have known that. Goodnight world.

Tags: ColdFusion | Tips

..Not the best 'Pages' Design in the World...

..oh no, this is just a tribute! This is the latest Digital Crew database design for storing website pages.

I have evolved this design over the years and I'm pretty happy with this result - this design supports multiple sites, page redirection, page short name (for navigation) and page long name, page HTML (for basic pages or intro text on complex pages), meta information, visibility, security, published status, alternative URLs, alternative files, making page for special (dynamic) processing and the ability to open the page in a new window.

Use it, if you like.

Design view of MySQL 'Pages' table

CREATE TABLE `pages` (
  `pageid` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  `siteId` int(11) UNSIGNED NOT NULL DEFAULT '1',
  `pageparentid` int(10) UNSIGNED DEFAULT '0',
  `pageCode` varchar(50) character SET latin1 NOT NULL,
  `pageNavName` varchar(100) character SET latin1 NOT NULL DEFAULT '',
  `pageName` varchar(150) character SET latin1 NOT NULL DEFAULT '',
  `pageHTML` text character SET latin1 NOT NULL,
  `pageDisplayOrder` smallint(5) UNSIGNED NOT NULL DEFAULT '2000',
  `pageIsPublished` tinyint(1) NOT NULL DEFAULT '1',
  `pageDescription` varchar(255) character SET latin1 DEFAULT NULL,
  `pageKeywords` varchar(255) character SET latin1 DEFAULT NULL,
  `pageIsFolder` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
  `pageIsDynamic` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
  `pageIsVisible` tinyint(3) UNSIGNED NOT NULL DEFAULT '1',
  `pageIsLocked` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
  `pageAccess` enum('O','I','A') character SET latin1 NOT NULL DEFAULT 'A' COMMENT 'A=All, I=Logged In, O = Logged Out',
  `pageRedirectPage` varchar(50) character SET latin1 DEFAULT NULL,
  `pageAltFile` varchar(255) character SET latin1 DEFAULT NULL,
  `pageAltURL` varchar(255) character SET latin1 DEFAULT NULL,
  `pageOpenNewWin` tinyint(3) UNSIGNED DEFAULT '0',
  `pageShowOnInPageNav` tinyint(3) UNSIGNED DEFAULT '1'
  PRIMARY KEY  (`pageid`),
  KEY `pageparendId-pageId` (`pageparentid`),
  CONSTRAINT `pageparendId-pageId` FOREIGN KEY (`pageparentid`) REFERENCES `pages` (`pageid`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Tracking RSS Feeds

I was thinking that I'd love to have some sort of idea how many people are subscribed to this site.

The Solution

Solution 1: Some people suggest using a HTTP 301 Moved Permanently header to redirect RSS Readers to a unique URL that you can use to track the feed.

Solution 2: Others recommend that you display/make-available a unique RSS feed URL every time you display your blog.

The Problem

The problem with solution 1 is that RSS readers *should* remember that the page is permanently redirected - if they don't you'll get users always being redirected to unique URLs looking like unique subscribers all-the-time.

The problem with solution 2 is that it doesn't track your existing subscribers.

What I Decided to Do

I decided to combine both solutions and hope that there aren't too many stupid RSS readers out there. Now, If you browse to to rss/ you will be redirected to a unique URL.

Also when you view this page, both the RSS feed in the header and the feed displayed on the right hand side are unique.

The Code (in Brief)

For the redirect if URL.ref isn't defined, I used:

<CFHEADER statuscode="301" statustext="Moved Permanently">
<CFHEADER name="Location" value="#UniqueRSSURL#">

For the unique Id in the RSS URL I simply used:

replace(CreateUUID(),"-","","ALL"Wink

For logging to the MySQL RSSHits table I used:

<cfquery name="updateBlogHitCounter" ...>
INSERT INTO RSSHits(ref,blogId,hits)
VALUES (<cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#ref#">,
<cfqueryparam cfsqltype="CF_SQL_INTEGER" value="#URL.blogId#">,1)
ON DUPLICATE KEY UPDATE hits = hits + 1;
</cfquery>
Tags: ColdFusion | Tips

Source Control - 3 months later

For years we knew that we should be using source control. But we weren't. We didn't want the hassle of using source control.

But here's the thing: We make software components for ColdFusion. Some of these components are the cornerstones of our content management solutions which are in turn the cornerstone of our successful website and Intranet development business. In the past, when I made a change to UDI, a component for managing database content, I'd manually copy the code back to a central location. Then I would get the code again when starting a new project. The current version and change log were stored within the main.cfm file of each component. Painful.

What were we thinking?! About 3 months ago, I decided to take the bull by the horns and investigate the incredible complex, tedium world of source control. I got some manuals on Subversion and read a lot about CVS and source control systems. All pretty scary stuff to begin with.

But in truth, with the most excellent amazing fantastically brilliant TortoiseSNV extension for windows, source control is absolutely painless. Made changes? Just right click on the directory and select check-in, provide a short message and your done. Need the latest version, just right click and choose SVN Update. Wow, painless and simple.

And here is the thing I've come to notice, and it's a compelling reason to use source control - and not just because you should. You will be one hundred times more productive. How? You see, with the hassle of maintenance gone, I find myself making hundreds of little fixes and improvements all-the-time now.

If you make software and your not using some sort of proper source control, your officially living in the dark ages.

Tags: ColdFusion | Tips | Tools | WebDev

Chaos Blog Entry #1

OK, it's 12.16am on 4th September 2006.

I changed how projects work - I have removed most project tasks functionality from the dashboard - the logic being that somebody should really have a single project selected before things get more complex.

I updated the navigation with the list of projects. I succumbed to the argument with Dan and put the New Project link in the project list also. I'm thinking that only starred ie. active projects will appear in the main nav. To access long term projects and such, a "view other projects" link will be provided off the dashboard... or maybe in the navigation - yeah that'd make more sence... "more projects".

The goal is to keep this lightning speed like GMail - what I'm calling GSpeed. I've been analysing how GMail works and they have some pretty clever shit going on. They load an almost blank page when you click an email to open it - this makes it seem to the user that the browser is doing the usual loading thing with proper loading message and I imagine that it allows the app to track the user moving backwards and forwards in the app.

But I won't have GSpeed initially - Only the header and footer are being spat out from javascript at the moment. I want to get the functionality and tweaking and changing done right before I convert all the forms to script-based template loading - basically only raw data should ever be outputted for the main screens of the app.

I'm thinking that a top frame will hold the app keeping the URL constant. A middle frame will hold the primary data and the javascript files - preventing nasty updates-since server hits. The data frame will then load a current view data screen.

When adding a new task, I am fading out the background with a 50% transparent black "cover" div then displaying an absolutely positioned div with a higher z-index on top of it. It all works great except that the bloody cursor on the input text box ceases to work. Where I am at the moment, I don't have access to the Internet so I'll have to leave this for tomorrow nights work.

I would like to have absolutely no real hyperlinks in the application - i don't want users right clicking. At the moment, when a user hovers over a project, they get extra options appear - it allows for a nice, clean interface. At every turn I'm pausing and spending ages thinking about the design - should I remove the background color - should the star option be kept in the same place, what is the best way to list this, should this option be in a 'pop-up window' or inline? If it seems like a really simple application when I'm done, then I've achieved my goal. Definitely going to get different people to use it while I watch them and fix any issues before the first release.

For the first release, I plan to get the bare bones working - none of the niceties that Dan and Myself would love. For example there will be no sub-tasks in V1. Definitely something I want. But something we can live without for now. Also I would like to able to say, hey, "use this project as a template called X" and then users could select that template when creating a new project.

I think our app will be significantly easier to use and must faster that all the other pm apps out there. I really hope this is received well! Shit we still need a good name.

Progress has been slow. It's just me working on this so far and I have to fit this side-project in around my real job developing websites, maintaining and supporting our sites, tags and components.

Tags: ColdFusion

About Topper on ColdFusion

Peter Coppinger aka Topper is a neurotic web monster who spends most of his chaotic life developing ColdFusion web applications when not drinking himself into a stupor and scheming his plans for world dominance.

Peter founded Digital Crew way back in 1999. Digital Crew run CFTagStore.com and have also produced lots of powerful ColdFusion tools like ProFlashUpload and CFMyAdmin.

I made this site to share my thoughts, tips and tools with fellow ColdFusion developers.

If your a ColdFusion developer, go ahead and subscribe to this site and in exchange i'll try to provide quality content to make it worth your while.
RSS Feed for Topper on ColdFusion

I'm speaking at CF-United Europe!

CFDevCon I'm going to be speaking at CFDevCon08! It's my second time speaking in front of more than 10 people so please lend your support.

The topic is:
Introducting TeamworkCMS and Site Engine - Building better websites in half the time or something like that..

Digging

My Work - Just Finished

  • modules.cit.ie
    Web-=based modules/programmes designer tool and database system for Cork institute of technology.
  • Teamwork Project Manager
    The top secret project is finally released. The project management app will rock your world - give it a go.
  • PMG
    New website for Project Management Group website.
  • Digital Warehouse Wholesale
    Added wholesale products to existing client website.
  • New Digital Crew documentation website
    New version of documentation.digital-crew.com using new InfinityCMS site engine. It's done now. Just add content.
  • PFH Company Webite
    New website/CMS/Newsletter System for prestigious Irish IT company.
  • Module Manager for CIT
    CIT is switching to module based courses. We are making an application for managing/submitting these modules. Gettig there.
  • Bons Secours Cork Hospital Intranet
    New Intranet for Bons Secours hospital in Cork. Considering turning this Intranet system into stand-alone product.
  • Revamping InfinityCMS
    I'm making major improvements to our content management solution, InfinityCMS. Making it faster, more powerful and easier to check into/out-of source control. Done but it's always going to be evolving.
  • BPC Update
    Minor functionality update for internal Pfizer Best Process Chemistry project.