Click to search Andy Jarrett.co.uk RSS feed

Loading Twitter

Save Google Wave!

Google Wave is a great tool and it seem there are more people out there who think this too. If you want Google to hang on to this mis-understood service check out; SaveGoogleWave.com and join the cause.

Comments Comments (0) | Print Print | Send Send | 1265 Views

Framework One and .cfm requests

If you have used FW/1 you'll probably know that it takes over all .cfm requests. So for example if you add the file "rss.cfm" to your web root before the template is called FW/1 will run and the .cfm template will never actually be processed.

[More]

Comments Comments (0) | Print Print | Send Send | 1106 Views

CSS Compatibility and Internet Explorer

IE over the versions is getting better with supporting CSS but it always seems to fall short or at very least doesn't try to push itself too much.

With that Microsoft have released a document stating which version of Internet Explorer (back to IE5) supports which rules, combinators, selectors, etc.
http://msdn.microsoft.com/en-us/library/cc351024(VS.85).aspx

Comments Comments (0) | Print Print | Send Send | 1251 Views

Detect IE8 Compatibility Mode

I have recently had a client who complained to me that the site was broken in IE8 even though I had already checked it out. It turns out the issue was M$'s great "Compatibility Mode"

I know my way around CSS well enough but it felt wrong making any changes to keep this IE only mode happy when all other browsers were not complaining. Bing! I had an idea and went to Google and found this document on Defining Document Compatibility.

Turns out I can force the users browser to IE8 mode with the following

view plain print about
1<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" >

Hopefully this will help some other developer with their designing woes.

Comments Comments (1) | Print Print | Send Send | 1381 Views

Realisation

After all my years with computers this is still true
AndyJ: Created @ stripcreator.com

Created @ stripcreator.com

Comments Comments (0) | Print Print | Send Send | 1359 Views

Gmail now has rich text signatures

From within the settings page of Gmail you can now create rich text signatures including changing font site, text align, style, colour, add images and links etc

Though this has been one (simple) feature missing from the product for a long time its not something I have missed. I know too many companies that abuse this feature and include un-needed images and just streams of multi-coloured text and links. Don't get me wrong, I am happy to see it, I am going to use it, but I am scared to see how some people will implement it.

Comments Comments (0) | Print Print | Send Send | 1489 Views

Pure CSS3 post it note

I've been ill the last couple of days which meant I couldn't really focus on anything too heavy. So with being awake half the night I thought I should just play around CSS3 and it didn't take long till I came up with a pure CSS3 Post-it note made with no images. The only extra library I have used in this demo is Google Fonts for the script text. Code after the note:

Back soon!


view plain print about
1<link href=' http://fonts.googleapis.com/css?family=Reenie+Beanie' rel='stylesheet' type='text/css'>
2<style>
3p.postit a{
4    color: black;
5    font-family: 'Reenie Beanie', arial, serif;
6    font-size:50px;
7    text-decoration:none;
8    text-shadow: 3px 3px 3px #AAA; }
9
10p.postit {
11    margin:100px auto;
12    text-align:center;
13    width:750px; }
14
15p.postit{
16    border:1px solid yellow;
17    height:300px;
18    line-height:300px;
19    width:400px;
20    background-color: rgba(60, 132, 198, 0.8);
21    background-image: -webkit-gradient(linear, 0% 0%, 0% 90%, from(#FFFAAE), to(#FFF057));
22    background-image: -moz-linear-gradient(#FFFAAE 0%, #FFF057 90%);
23    border-top-color: #FFF057;
24    border-right-color: #FFF057;
25    border-bottom-color: #FFF057;
26    border-left-color: #FFF057;
27    -webkit-box-shadow: #AAA 0px 10px 16px;
28    -moz-box-shadow: #AAA 0px 10px 16px; /* FF 3.5+ */}
29</style>
30<p class="postit">
31<a href="http://www.andyjarrett.com/blog" title="Andy Jarretts Blog">Back soon!</a>
32</p>

Quick discaimer - I have no ideas which browsers this works in. All I can tell you is that it looks good in Chrome and Safari!

Comments Comments (3) | Print Print | Send Send | 2105 Views

Friday Joke: The wish

A thanks for @bigmadkev for this little on topic gem!

Man walking along kicks a tin can and out pops a genie.

"I will grant you one wish" says the genie.

"I want to live forever" says the man.

[More]

Comments Comments (0) | Print Print | Send Send | 2098 Views

Fridays Joke: The winning toast

I thought I had posted this one already, but I can't reference to it though that might be because I've been up since 4:20am with my brain ticking over like mad? Enjoy!

Patrick O'Malley hoisted his beer and said: "Here's to spending the rest of me life between the legs of me wife!" - and he took home the top prize for the best toast of the night.

In bed later that night, he told his wife: "Mary, I won the prize for the best toast of the night." She said, "Aye, Paddy, what was your toast?"

So he told her: "Here's to spending the rest of me life sitting in church beside me wife."

[More]

Comments Comments (0) | Print Print | Send Send | 1652 Views

Scoth On The Rock 2011 Tickets on sale

Get 'em while they are Super Cheap, Fairly Cheap, or Kinda Cheap ... but just get 'em! Scotch on the Rocks is Europe's Longest Running ColdFusion Conference and in 2011 its gone back home to Edinburgh for 2011!

Register now at: http://sotr2011.eventbrite.com/

Comments Comments (0) | Print Print | Send Send | 1305 Views

Query scripting bug in Coldfusion 9

I had a weird error this morning.

Named Sql parameter 'state ORDER' used in the query not found in the queryparams

Below is the code I had and it look fine to me:

view plain print about
1<cfscript>
2queryService = new query();
3queryService.setDatasource("cfdocexamples");
4queryService.setName("GetParks");
5queryService.addParam(name="state",value="MD",cfsqltype="VARCHAR");
6queryService.setSQL(
7"SELECT PARKNAME, REGION, STATE
8FROM Parks WHERE STATE = :state
9ORDER BY ParkName, State "
);
10result = queryService.execute();
11writeDump( result.getResult() );
12
</cfscript>
After staring at my code for a while and realising that doing that wouldn't fix anything I butchered played around with the syntax and found that after the WHERE clause you need to keep your SQL on one line. Making the following change to setSQL() fixed the problem:
view plain print about
1queryService.setSQL(
2"SELECT PARKNAME, REGION, STATE
3FROM Parks WHERE STATE = :state ORDER BY ParkName, State ");

I can't seem to find a reference as to how your SQL should be formatted but it seems the new line plays around with the deliminators and the way the named params are found.

I'm posting this now but will hopefully later find time to look in on query.cfc in the com/adobe/coldfusion folder under customtags to find the actual reason

Comments Comments (1) | Print Print | Send Send | 1730 Views

Blocking recent comment spam

There are a ton of ways to stop spam on blogs. This is my dirty (and not pretty) solution that I am adding to stop the recent wave of crap that is getting through the front end checks.

The long term plan is to put a back-end on this but for now here is v.00001

view plain print about
1<!--- Seperate with a pipe "|" as this is a regex list --->
2<cfset commentBlacklist = "coachoutletmall|wowgold" />
3<!---
4All the fields that we are going to check.
5Don't really need to check the email field as its not displayed.
6--->

7<cfset checkFields =trim(form.name) & trim(form.email) & trim(form.website) & trim(form.comments) />
8<!--- reFind to check the fields as they are past the other rules i.e. captcha --->
9<cfif reFindNoCase("#commentBlacklist#", checkFields, 1) >
10<cfoutput>Sorry deadbeat, I don't allow comment spam. If you feel you were wrongly blacklisted
11<a href="http://www.andyjarrett.com/blog/page.cfm/Contact-Me">Contact Me</a>
12</cfoutput>
13<cfabort>
14</cfif>

n.b. If you are on BlogCFC then this is for addcomment.cfm

Comments Comments (8) | Print Print | Send Send | 2269 Views

unix epoch with coldfusion

I never seem to remember that GetTickCount() gets the unix epoch time which is the number of seconds elapsed since midnight proleptic Coordinated Universal Time (UTC) of January 1, 1970 (from wiki

Comments Comments (0) | Print Print | Send Send | 1529 Views

Fridays Joke: Second Opinion

A man runs into the vet's office carrying his dog, screaming for help. The vet rushes him back to an examination room and has him put his dog down on the examination table. The vet examines the still, limp body and after a few moments, tells the man that his dog, regrettably, is dead. The man, clearly agitated and not willing to accept this, demands a second opinion.

[More]

Comments Comments (0) | Print Print | Send Send | 1873 Views

Don't sell me 500mb/month limit and tell me its good

O2 are putting in a low, 500mb a month (thats around 16mb a day, don't forget that!), limit for mobile data and their excuse reason is:

"We don't think it's fair that the many should subsidise the behaviour of the few, and we think that we have a responsility to our customers to address this kind of imbalance." ... "97% of our smartphone customers currently use less than 500MB of data every month"

To me that actually says "3% of our users are causing such a strain on our network everyone needs to pay the price"

You can argue that some people might only use 200mb/month and thats fine, but thats what they are using today! As core functionality like "facetime" (which Nokia and a lot of other phones had before it was "new") and HD video become the norm this is going to go up, quickly!

Lets put 16mb per day in to context. Using typical examples from O2 this is how it breaks down:

Usage per day!
YouTube video (4.5 mins) 2 videos
Music track download low quality) 1.6 trakcs! If you use spotify premium or last.fm. BOOM!
Basic web page (100KB) 166. Facebook before you login is 86 KB
Rich web page (300KB) 50. My twitter.com page is 246KB so that is 50 page refreshes

When you look at these figure and think, "I won't look at 166 basic web pages a day" just remember you need to include all the other apps which are also using your bandwidth like emails and push services. Start going in to a app like Dropbox and pulling up that PDF then thats your daily limit gone quite quickly.

I'm not just saying "give me unlimited". I'm not stupid. "Network resources are finite. You can't offer infinite consumption of finite resources". All I am saying is find out why these 3% are using 1Gb a month (or more) and see what needs to change there. It might be as simple as the 3% are jailbreaking their phones to tether to their machines. In which case they are breaking the TOC so dump them.

I don't know the right answer here, but 500mb is the wrong one! Before we commit to anything as users we need to know some basic information:

  1. over the last 12 month have I even come close to the 500mb limit?
  2. can i put a restriction in place to physically stop me from going over the limit?
  3. how well (and accurately) will this be reported to me? (And don't say by text message as that uses the precious, buckling, network that we are trying to protect)? *there is sarcasm in there*

Update: Once you hit your limit your data speed will slow down. You will not be charged more. Which is nice!

Comments Comments (3) | Print Print | Send Send | 2105 Views

cffile in cfscript quick cheat sheet

First time for using CFFILE within cfscript so thought I should document this for myself and anyone else.

Open and close a file

view plain print about
1myFile = expandPath( "somefile.txt" );
2fileObj = fileRead( myFile );
3writeOutput(fileObj);
4// OR
5myFile = expandPath( "somefile.txt" );
6fileObj = fileOpen( myFile, "read" );
7fileClose( fileObj ); // Once a file is closed you cannot access the object

[More]

Comments Comments (1) | Print Print | Send Send | 2003 Views

cannot cast void to non-void

If you ever see this error it means you're trying to output a function which doesn't return a value.

For me I was playing around with fileDelete() and without looking at the docs I assumed this would pass back a boolean to tell you if it was successful or not.

Comments Comments (0) | Print Print | Send Send | 1485 Views

Subversive error because a newer version is already installed

Subversive error because a newer version is already installed

After a recent update to my Eclipse install every time I restarted the application I kept getting the following screen pop up
Subversive Connector Discovery

The issue was that it didn't matter which connector I installed I got a message stating
Cannot complete the request. See the error log for details.
"Native JavaHL XXX.XXX Implementation (Optional)" will be ignored because a newer version is already installed.
"Subversive SVN Connectors" will be ignored because a newer version is already installed.

After Google not helping me I went through the About Eclipse > Installation Details and removed all references to the connectors. In the screen shot below you can see the last couple of references highlighted
Eclipse Installation Details: Subversive Connectors

With all of them removed I restarted Eclipse and was again presented with the Subversive Connector Discovery screen but this time the selected connectors installed fine.

Comments Comments (1) | Print Print | Send Send | 1864 Views

Framework One for when you don't need a framework pt2

This post follows on from my first part and is all about using a framework for even the most simplest sites.

So our family member, Marvin Acme, has come back with the layout for his ACME gadgets to capture and kill rodents site.
Site layout

Being a family member means we're getting paid most likely with canned beer and with that in mind they are not getting me working on stylesheets!

[More]

Comments Comments (8) | Print Print | Send Send | 1337 Views

Framework One for when you don't need a framework

I've just deleted about 2 hours worth of writes and re-writes to simplify what this blog post is all about. Originally I was going to waffle about frameworks and how they can be bad for a project and how they can get in the way but they're not all-round "bad" for every project yada yada. In reallity this blog post is about 1 thing, Framework One, and how its so flexible I'm even using it for basic brouchware sites.

Sure for your big MVC/OO apps you can use FW/1 with your dumb Controllers passing data to the Service layer to request other data from the model to pass back to the view. Which is great, but what I've also enjoyed is that on the otherside it doesn't stop you from very quickly creating a 3 page brouchware site for your family member that doesn't require more core files for features you don't need i.e. dependency injection, than there are application files. Its actually because of all the corse files that in the past I would not of advocated a framework by any means for a 3 page site and it is all down to the overhead of the required CFC's. That stance has now changed and I am going to show you why you should even use Framework One for when you don't need a framework.

[More]

Comments Comments (0) | Print Print | Send Send | 1672 Views

Previous Entries / More Entries

BlogCFC by Raymond Camden + Twitter @AndyJ + ColdFusion jobs + Contact Me + Snippets/Downloads + RSS .