Posts filed under 'Programming'

Password Value as Text

I was working on a design the other day that only had text fields with no labels, the label was in the text field and would disappear when clicked on

Continue Reading Add comment November 17, 2009

CFHTTP Connection Failure

If you’re getting a “Connection Failure” error when using the ColdFusion CFHTTP tag and have absolutely no idea what the problem could be as surfing the page via the browser works, then the web server most likely compresses the content and ColdFusion can’t handle the output.

To fix this issue just add the following two cfhttpparam tags to the request, they will tell the remote web server not to return a compressed response.

<cfhttpparam type=”header” name=”accept-encoding” value=”deflate;q=0″>
<cfhttpparam type=”header” name=”te” value=”deflate;q=0″>

1 comment September 28, 2009

How to import Excel into MS SQL

First, forget about importing Excel into MS SQL, it is to time consuming to get it right. You are better of converting the Excel file to a simple CSV file, change the setting to a large string value for the columns, import it into MS SQL and then convert the field types to the proper field types.

1 comment September 17, 2009

Eway online payment gateway (recurring payments)

Just a quick warning for everyone who are about to use eway (www.eway.com.au) for their recurring online payments (accepting Credit Cards online etc.).

Continue Reading Add comment July 6, 2009

SWFUpload Error 500 or Request object error ‘ASP 0104 : 80004005′ Operation not Allowed

This error is to do with the maximum file upload size allowed by ASP as global setting. By default the max size is set to 200KB.

To change this setting you need to edit the MetaBase.xml file located under c:\windows\system32\inetsrv\

  1. Stop IIS
  2. Open c:\windows\system32\inetsrv\MetaBase.xml
  3. Search for “AspMaxRequestEntityAllowed”
  4. Change the value to 1073741824 (one gigabyte) or some other maximum value that’s valid for your setup
  5. Save and close the file
  6. Start IIS

Add comment June 2, 2009

CFPOP GMail

To check gmail with cfpop you need to use the following code before you make your cfpop call

<cfscript>
javaSystem = createObject( “java”, “java.lang.System” );
jProps = javaSystem.getProperties();
jProps.setProperty( “mail.pop3.socketFactory.class”, “javax.net.ssl.SSLSocketFactory” );
jProps.setproperty( “mail.pop3.port”, 995 );
jProps.setProperty( “mail.pop3.socketFactory.port”, 995 );
</cfscript>

<cfpop action=”getheaderonly” name=”rsEmail” startrow=”1″ maxrows=”50″ server=”pop.gmail.com” port=”995″ username=”your@username.com.au” password=”yourpassword”>

Add comment May 24, 2009

Query Of Queries syntax error. Encountered “DELETE.

If you want to delete some rows from a Query of Query with the DELETE statement you will most likely have encountered the error: Query Of Queries syntax error. Encountered “DELETE.

You can’t use the DELETE statementin QoQ.

Try the following instead

<cfquery
dbtype=”query”
name=”rsDelete”>
SELECT        expiryDateTime
, cacheHash
FROM        variables.instance.cacheCollection
WHERE        (expiryDateTime < <cfqueryparam value=”#now()#” cfsqltype=”CF_SQL_DATE”>)
</cfquery>
<cfloop query=”rsDelete”>
rsDelete.deleteRows( javaCast( “int”, (rsDelete.currentRow – 1) ), javaCast( “int”, 1 ) );
</cfloop>

1 comment May 23, 2009

ColdFusion Flickr Photos API

I’ve written a ColdFusion CFC that integrates with the Flickr API. I know there is already another component out there written in ColdFusion, but I found that one a bit too complicated (no offense intended) and it did not do what I wanted it to do, which is simply displaying the sets and photos.

See an example of the FlickrCFC in use here Boot Camp Photos

I’m more than happy to share the code base, it’s not ready yet for publishing here but can certainly send a copy to anyone who requests it. Of course a nice text link in return is always appreciated! ;-) A text link in return is required (when you email please include the link you can offer).

8 comments May 13, 2009

Saving change is not permitted MS SQL 2008

Been battling with MS SQL 2008 and ran across the issue (it’s actually a feature!) of not being able to save changes made to a table in designer view. I got the following error:

Saving change is not permitted. the changes you have made require the following tables to be dropped and re-created. You have either made changes to a table that cant be re-created or enabled the option Prevent Saving changes that require the table to be re-created.

Seems there is an easy fix (if you know where to look), go to
Tools Menu >
Options >
Designers >
And untick the option “Prevent saving changes that require a table re-creation”

2 comments May 4, 2009

Convert HTML entities from XML in JavaScript

Sometimes you get passed a string from XML and it can contain HTML entities like the following

&amp;
&lt;
&gt;
&quot;
&copy;
&reg;
&laquo;
&raquo;
&apos;

If you write the string with JavaScript then you get something like didn&apos;t instead of didn’t

I’ve searched around for a function that could handle this but could not find one, so I wrote my own. I thought I’d share it with the world!

The following will convert &amp; to &, convert &apos; to ‘ etc.

Following is the code, if you need help implementing it, I’m more than happy to explain how you install and run this function in return for a text link on your website, now that’s cheap as, considering I normally charge $140 an hour ;-)

String.prototype.trim = function () {
	return this.split( /\s/ ).join( " " );
}
String.prototype.convertHTMLEntity = function () {
	var myString = this;
	myString = myString.replace( /\&amp;/g, '&' );
	myString = myString.replace( /\&lt;/g, '<' );
	myString = myString.replace( /\&quot;/g, '"' );
	myString = myString.replace( /\&copy;/g, '©' );
	myString = myString.replace( /\&reg;/g, '®' );
	myString = myString.replace( /\&laquo;/g, '«' );
	myString = myString.replace( /\&raqou;/g, '»' );
	myString = myString.replace( /\&apos;/g, "'" );
	return myString;
}

Add comment April 15, 2009

Previous Posts


Email Subscription

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Categories

Archives

Recent comments

Blogroll

Top Rated

Top Clicks

Category Cloud

Advertising Brisbane SEO clickfind Business Directory ColdFusion Environmental initiatives Google Google Adwords Google Analytics In the media JavaScript JavaScript Form Validation Marketing MS SQL Other Programming Search Engine Optimization & Marketing Yahoo

Tags

alexa alexa ranking analytics anchor text links australia Australian Search Engines bartercard base bbx business directories business directory business directory review cfc clickfind ColdFusion confidence forum gadget Google hash html internet traffic keywords list local search markup MS SQL online marketing pagerank PR Programming RSS search engine search engines security SEO spellcheck spelling stored procedure tool trust tutorial validation website design www.mergermarket.com

Blog Stats

Top Posts

Authors