latest reactions

Tjarko
Hi David, that won't work with at least…
David
You only need this really - order of mag …
Gustavo Felisberto
Just adding a simple :ORDER BY tablefi …
TLM
Just like everyone else, worked like a c …
Addikus
I just ran it on a table with 30 000 000 …

Clicky Web Analytics
Use OpenDNS
ZERIGO DNS

Ultimate dns hosting based on pre-defined templates, DNS redirection and lot's more.

mxna feeds

E-Seminar on Slatwall next weekPresentation Files for Automated System Testing at CFObjectiveMuse Reviews: Charlie Arehart on ColdFusion 10 Server Options at CfobjectiveMy cfObjective 2012 slides on New Language changes in ColdFusion 10ColdFusion 10 featuresWhat’s New in ColdFusion 10Getting Started with RESTful Web Services in ColdFusionAdobe Developer Connect article on RESTful Web Services in ColdFusion 10Important note on availability of ColdFusion 9Availability of ColdFusion 9Speaking May 21-25 in 5-day European #ColdFusion Road Tour, Scotch on the RoadGet Your ColdFusion Downloads While They LastSpeaking this week at cf.Objective(): Two #coldfusion sessions and a lightning round talkAll-New Adobe ColdFusion 10 Delivers Advanced Capabilities for Interactive Web ApplicationsAll ColdFusion 10 features at a glance

All files are strictly confidential: all information is classified.
© Copyright 2002 - 2012 mximize.com.
All right reserved.

Visit Carlos GallupaMXNA webfeed

Log analyzer plugin for Railo admin

A briljant and long missing plugin for log analyzing within the admin of Railo. Made by my good friend Paul Klinkenberg, a must have for every Railo user.

Railo Log Analyzer

2966 viewed | Your opinion...  | Tjarko @ 11:03 cet

Getting the closest locations based on Latitude / Longitude

I'm not going to explain what is being done here (SQL script) because I just don't understand. I searched a long time for this script and at the moment i'm not even sure where I got it... bottomline.. it works, and really really good.

Let's say you got the lat/lng from an http call to the Google API (small example below) and you want to get the nearest 10 other "stores" in the area around you.

<cfhttp url="http://maps.google.com/maps/geo?q=#yourpostcode-address#&gl=nl&output=csv&sensor=false&key=#yourGooglekey#" method="GET" />

<cfset aRet = listToArray(cfhttp.filecontent) />

<!--- Is it a good request and is the accuracy more then 5 (postcode level) --->
<cfif aRet[1] eq 200>
   -- call the stored procedure
   EXEC getstores @lat = #aRet[3]#
   ,@lng = #aRet[4]#
</cfif>

<!-- Save procedure in your database MSSQL 2000 and up. -->

CREATE PROCEDURE [dbo].[getstores] @lat float,  @lng float AS
DECLARE @radius float, @DegToRad float
SET @DegToRad = 57.29577951
SET @radius = 25000
SELECT TOP 10
    sto_city
    ,sto_name
    ,sto_lat
    ,sto_lng
    ,sto_street
    ,sto_postcode
    ,sto_tel
    ,sto_fax
    ,sto_email
    ,sto_url
    ,sto_supplier
    ,sto_cnt_code
    ,ROUND((ACOS((SIN(@lat/57.2958) * SIN(sto_lat/@DegToRad)) +(COS(@lat/@DegToRad) * COS(sto_lat/@DegToRad) *COS(sto_lng/@DegToRad - @lng/@DegToRad))))* 6387.7, 2) AS distance
FROM store
WHERE (sto_lat >= @lat - (@radius/111))
And (sto_lat <= @lat + (@radius/111))
AND (sto_lng >= @lng - (@radius/111))
AND (sto_lng <= @lng + (@radius/111))
AND (
     ISNUMERIC(sto_lat) = 1
    AND
    ISNUMERIC(sto_lat) = 1
)
ORDER BY distance


The distance column from the stored procedure is the total distance from the location you submitted to the Google API (postcode / address). Hope you can find a good use for this.. I did for several projects already :-)

5262 viewed | 3 opinion(s)  | Tjarko @ 23:43 cet

Get SEO keywords automatically from an article or page

I just finished a nice little function to get the "best" keywords for the page displayed in every website we build with our CMS. Below is an example, what you get is a list of the words that are mostly used in the given page and therefore the best to use as META keywords or tags in your page. At least if you like to be found on the contents of your page...

<cfsavecontent variable="txt">
A nice little piece of text with at least twice the word little in the text, and off course three times the word text ;-)
</cfsavecontent>

<cffunction name="getSEOWords" access="public" output="true">
    <cfargument name="content" required="true" type="string" />
    <cfset var lsStopWords = "stop wordlist in your language (google it)" />
    <cfset list = arrayToList(listToArray(REReplace(arguments.content, "[[:space:]]{2,}"," ", "all" ), " ")) />
    <cfset var stWords = structNew() />
    <cfset var lsTop = "" />
    <cfset var aSort = arrayNew(1) />
   
    <!--- Get a unique structure of words counted --->
    <cfloop list="#list#" index="value">
        <cfif !listFindNoCase(lsStopWords, value) && !isNumeric(value)>
            <cfset value = trim(value) />
            <cfif structKeyExists(stWords, value)>
                <cfset stWords[value] = stWords[value] + 1 />
            <cfelse>
                <cfset stWords[value] = 1 />
            </cfif>
        </cfif>
    </cfloop>
   
    <!--- Order the structure with words, first keys are the words with the most counts --->
    <cfset aSort = structSort(stWords, "numeric", "desc") />
   
    <!--- Get the first 15 words from the list, if the count is more than one. --->
    <cfloop from="1" to="15" index="i">
        <cfif stWords[aSort[i]] GT 1>
            <cfset lsTop = listAppend(lsTop, aSort[i]) />
        </cfif>
    </cfloop>

    <cfreturn lsTop />
</cffunction>

<cfoutput>
    #getSEOWords(txt)#
</cfoutput>

6814 viewed | 16 opinion(s)  | Tjarko @ 17:19 cet

Delete errors since hotfix 3 Coldfusion 8

Since the last hotfix these errors come flying by. This has always worked without any problems and all of a sudden these errors appear.

ColdFusion could not delete the file C:\somedir\somefile.jpg for an unknown reason.

Does someone know what a good solution is?? We need to delete the file after some file operations. These are not big files, maybe 1MB at the most. Seems like a timing or locking issue but it always worked until last week when we installed the hotfix.

6149 viewed | 1 opinion(s)  | Tjarko @ 12:13 cet

Strange font behaviour with cfdocument pdf

When we run a scheduled task that produces PDF files with cfdocument we get randomly PDF files with the complete text but in a strange font, or something?? (see example)

After searching on the internet I cannot find anything that explains this.... Does anyone have a clue on what's going on with these PDF files?? We produce hundreds a day without a problem but every now and then we get jibberish like below. It's becoming a real problem because these are contracts with people who are getting or wanting a home and can't see what's in the letter.

The PDF document that looks strange

If someone from Adobe sees this, I still have the other issue posted on this blog with PDF files (and more people do) fix it please!! We pay you for it!!

Thanks in advance if you can point me in the right direction.

6063 viewed | 1 opinion(s)  | Tjarko @ 9:48 cet