comment spam

I wish whoever is adding comment spam to my blog would just stop it.

You may be the only ones visiting my blog!

Simple test of Plaxo badge

The simple test of Plaxo badge has failed (or worked, depending on how you like your security). A Coldfusion server setting prevents the script tag from being saved in your database. So instead of 'script' it saves <InvalidTag>

<div id="plaxo-pulse-widget"></div><InvalidTag src="http://www.plaxo.com/widget/get?authTicket=4BFdVL%2BNpPtYTShnfai4Xor6AZKvys%2BST0YOICZKDOo%3D&type=frame&version=2&height=491&width=125" type="text/javascript" charset="utf-8"></script>

Coldfusion snapshot Memory Analyzer?

Pavan Kumar Gorakavi has posted an article on Using Eclipse Memory Analyzers

I wonder if it can be used in looking at a Coldfusion snapshot?

Tagcloud example using Flash SWFObject

This tagcloud serves up keywords from the titles of courses offered at a University.

I wonder how useful it is if a user just wanted a broad overview of what was on offer.

WP-Cumulus

It serves up this xml

I presume undergraduates have a general idea and postgraduates have a specific idea of what they want. Is the number of links just too large?

CF cannot terminate threads in a "native thread" state

Charlie Arehart replied with this on [cfaussie]:

>>> "charlie arehart" 10/12/2009 10:58 am >>> Scott, as far as I can tell, nothing has changed in the CF Enterprise Server Monitor from 8 to 9. Both it, and FusionReactor, and SeeFusion can all attempt to kill requests.

Just beware: such an attempt is only that, an "attempt". There's no guarantee it can be interrupted. If a CF request is in what's called a native thread (that is, talking to something outside of CF, such as hung talking to a database, doing a cfhttp, or invoking a web service, etc.) then none of the tools can interrupt the request.

Yes, that does mean that CF requests can hang for a very long time, indeed indefinitely in some cases and that you can't really do anything about it. And no, not even the CF admin timeout setting can change this. It's subject to the same limitation. It is worth noting that putting a TIMEOUT on CFHTTTP or CFINVOKE is a good ideas, as sometimes it can allow CF to interrupt those. We had a discussion of that here last year, if I recall. There's also a TIMEOUT on CFQUERY too, but it doesn't always work and depends on the drive version, type, database, and other variables.

Finally, should anyone wonder, all this inability to timeout requests in a native thread state is not a CF bug. It's a JVM thing. The CF "kill thread" mechanisms above merely processes ask the JVM to terminate the thread, and it cannot terminate threads in a "native thread" state.

less popular pages

I wrote a very simple CMS (for a university) that was designed to draw traffic to the less popular pages.

Users could enter keywords and create categories that their content belonged in.

An autocomplete search showed visitors that some keywords were not available.

The more popular the category the more clicks it took to drill down to the content.

Keywords distinguished one page from another while categories grouped them together. The category would not appear until at least two content items belonged to it.

This worked because there were not a very large number of content items. Approximately 20 subcategories in 20 categories was about right in this case

hotmail accounts hacked

On the 25th of September 2009 Hotmail accounts were hacked. A story was released saying only accounts starting with A and B were hacked. This is not true. I know because my account starts with M and everyone in my contacts list got this email:

>dear,

> I would like to introduce a very good company, electronic

> products dealer.

> I have bought some products from company,the price

> was very cheap,

> and the products are very good quality!They accept paypal,

> credit card transactions,

> bank transfers,and more.

> Just have a look at this web page :

> I am sure you will could save a lot of money!

> Best regards! > Let us help with car

> news, reviews and more Looking

> for a new car this winter?

I know this is what PDFs are for but my clients want a nicely styled word docx

I know this is what PDFs are for but my clients want a nicely styled word docx, so I tried this:


<cfsavecontent variable="style4html4word">
<style>
h1, h2, h3 {text-align:center;font-family: Arial;}
p {font-size:11pt;font-family: Arial;margin: 0 1cm 0 1cm;}
.bottomtext {text-align:right;padding-top:15em;margin-bottom:2em;}
</style>
</cfsavecontent>

This works but is it just nuts?


<form action="https://secure.whatever.com/notauthenticated/tohtml4word.cfm" method="post" target="_blank">
<input type="hidden" name="filename" value="well_formed_name" />
<cfoutput><textarea cols="50" rows="10" name="content" style="display: none;"><html><head><title>All Whatever</title>#variables.style4html4word#</head><body>#allContent#</body></html></textarea></cfoutput>
<div><input type="submit" value=" Open as Word " onclick="progress();" /></div>
</form>
<cfoutput>
#allContent#
</cfoutput>

tohtml4word.cfm is just:


<cfheader name="Content-type" value="application/html">
<cfheader name="Cache-Control" value="max-age=0">
<cfheader name="Pragma" value="public">
<cfheader name="Content-disposition" value="attachment; filename=#form.filename#.htm">
<cfoutput>#form.content#</cfoutput>

Am I just abusing Coldfusion ease-of-use? What would be better from a maintenance point of view?

Variables and This scopes and the onRequest method

Rex posted this on the CFDEV list (I think it bears repeating):

The VARIABLES scope is the default scope for an unscoped variable, and is shared with the cfincluded page that is called by the onRequest method. The THIS scope only exists in a CFC or in a method of the CFC. Since the cfinclude is called in a method, then the THIS scope is available in the cfincluded page. When there is no onRequest method, the page is just executed, and the called page, test.cfm, does not have access to any of the cfc variables, so VARIABLES scope is empty, and the THIS scope does not exist.

cflogin documentation really sucks

I think the cflogin documentation really sucks because Coldfusion is so easy and so flexible.

That is, there are so many cool things you can do once a user is authenticated that Adobe has failed to provide a very simple example.


<cfset authUserFail = false>
<cflogin>
<cfif isDefined("cflogin") and len(cflogin.name) and len(cflogin.password)>
<cfldap server="ldap"
action="query" attributes="dn"
filter="(uid=#cflogin.name#)"
start=""
name="findUser">

<cfif findUser.recordCount>
<cftry>
<cfldap server="ldap" action="query" attributes="n"
filter="(uid=#cflogin.name#)" start=""
username="#findUser.dn#" password="#cflogin.password#" name="authUser">

<cfcatch>
<cfset authUserFail = true>
</cfcatch>
</cftry>
<cfif not authUserFail and authUser.recordCount eq 1>
<cfloginuser name="#cflogin.name#" password="#cflogin.password#" roles="">
<cfset session.user = cflogin.name>
<cfelse>
<cfset request.infoWarningsErrors.addError('authUserFail','Authentication failed')>
<cfinclude template="dsp_login.cfm">
</cfif>
<cfelse>
<cfset request.infoWarningsErrors.addError('findUserFail','Authentication failed')>
<cfinclude template="dsp_login.cfm">
</cfif>
<cfelseif isDefined("cflogin") and (not len(cflogin.name) and not len(cflogin.password))>
<cfset request.infoWarningsErrors.addError('noblanks','Please enter username and password')>
</cfif>
</cflogin>
<cfif len(getAuthUser()) and (not structKeyExists(session,"user")>
<cfldap server="ldap" action="query" attributes=""
filter="(uid=#getAuthUser()#)" start="" name="refreshUser">

<cfif refreshUser.recordCount eq 1>
<cfset session.user = getAuthUser()>
        DO SOME CLEVER SESSION.USER STUFF HERE    
</cfif>
</cfif>
<cflog file="lostsession" text="#getAuthUser()#, #isDefined('cflogin')#, #yesNoFormat(authUserFail)#, #isDefined('authUser')#, #isDefined('refreshUser')#">
</cfif>

More Entries

BlogCFC was created by Raymond Camden. This blog is running version 5.9.1.002. Contact Blog Owner