Showing posts with label coldfusion. Show all posts
Showing posts with label coldfusion. Show all posts

Friday, April 1, 2016

CF & the need to parse street addresses equals CF & Java & Python

This is a POC / WIP. I have been looking for a CF or Java solution to parse addresses.
What I have found so far that works best is a Python library.

The good thing is I came across a blog post by Mark Mandel RUNNING PYTHON ON COLDFUSION there is Jthon that allows you to run Python from Java & we all know you can run Java from CF.

The Python code I want to run is here

There is a nice web based example of it here

QUESTIONS:

  • Is there a PURE CF solution?
  • Is there a better Java solution?
  • Will this CF/Java/Python thing run like a slug?
  • Is there anything I missed?

Wednesday, May 13, 2015

Docker for Lucee & ColdFusion on the Mac

I'm a mac user and usually run Linux in a VM or on headless devices.

I have been Docker curious, but Docker requires Linux, you can do it in a VM, but running in Kitematic is sweet!

It makes everything really easy, so let get to the video & explore how to use Docker.

Sunday, February 22, 2015

Lucee Bitnami VM

Hi Folks get your unofficial Bitnami Lucee VM!

* Special note to Scott Stroz: None of this is original art, everything has been copied from smarter people than me!

In short, I wanted to take Lucee for a test drive, figured I'd see how quickly I could get it up and running, short answer QUICK!

As stated in the Lucee docs, you can easily swap out the jar files and be running Lucee in no time.

Feel free to pull down a copy here

Special thanks to the Bitnami & Lucee folks for making everything so easy!

Friday, February 6, 2015

Create image in CF & write to browser without saving to file ( AJAX POC )

Here is the cool thing! You can copy the code and paste it into cflive.net and run it!

This is a Proof Of Concept that an AJAX call from a page can create an image in a ColdFusion component, convert the image to base64 send it back to the calling page as JSON data and render the image from the base64 data.

UPDATE! This works in my code. I hope to be submitting more code in the next week.

Friday, August 22, 2014

TinyCore Open CFML Distribution & Ohio Linux Fest

Ohio Linux Fest has accepted my talk on a completely open source distribution of the CFML engine and editing tools on October 25th. Guess where I will be spending my birthday? Ohio!

http://www.ohiolinux.org/

100 % Open Source ColdFusion

Here is the SourceForge project it is a 277 MB virtual machine.

It will run with any virtual machine software.

You can download virtualbox here

Prior Post on topic

Sunday, May 4, 2014

Railux 4 (cfubuntu)

I first want to give credit to Ozzy at blog.thesitestudio.com

He has publicly made available three linux distributions containing Railo the open source CFML engine.

CFML Virtual Machine Appliance has MySQL database and Ubuntu desktop. It has (almost) everything for CFML development, including;

Here are links to his prior works:

Railux 4 is a 3 GB virtual machine, his smallest version Railux 3.3 was 335MB

I have been working on an open source Railo distribution that includes the Bluefish editor based on Tiny Core Linux VM that starts out at 12MB. After adding the JVM and Railo it is about 250 MB, I hope to get it smaller.

The main reason I am posting this is I did not see any mentions of Railux at CFBloggers.org and I wanted to make sure that it was a resource that is available to the community.

I have submitted a talk to Ohio Linux Fest on the Tiny Core project & I will post updates to this page.

Here is the SourceForge project it is a 277 MB virtual machine.

It will run with any virtual machine software.

You can download virtualbox here

Monday, June 24, 2013

The Saga of CF SAML a mini series

This is from the LinkedIn group "ColdFusion - 5000+ Members!"

The question of a SAML solution was posted.

I have worked on some CF SAML implementations post development, had a project that required it then terminated before the SAML was coded.

I was going to wrap https://wiki.shibboleth.net/confluence/display/OpenSAML/Home with ColdFusion.

Ilia Ametov commented that you could use http://www1.datafilehost.com/d/6f032fac

Anthony Israel-Davis posted a link to this code in GitHub https://github.com/anthony-id/cfSAML

Jim Harris has hope for all of us! I am hoping for a good CF solution!

Monday, May 6, 2013

Select only records with valid e-mail addresses from a table

Ok, doing some hired gun work. The client wants the record set returned from a query to have only valid e-mails.

The gist includes fully working CFML that demonstrates this example.

The core of this is the isValid function. In this case it is used to validate an e-mail address

isValid('email', email) email, the second one, is a filed in the table.

The code also adds a column to the record set with QueryAddColumn and then does a query of queries to get only valid e-mail addresses

Some good comments, if you use underscore or mySQL...
Thanks Russ & Timothy Leach

SELECT `email`
FROM `users`
WHERE `email`
REGEXP '[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}'
GROUP BY `email`

SQL Server would have to be something like:
WHERE email like '[a-z,0-9,_,-]%@[a-z,0-9,_,-]%.[a-z][a-z]%'

Monday, April 1, 2013

Scott Stroz Vows to make a Better Stack Overflow

Odd behavior with structFindValue() with JSON

The JSON value of true displays as YES

Line 13 & 14 should work correctly right?

 variables.miner.cat=variables.miner.dog.alive;
 variables.miner.livedog = structFindValue(variables.miner.dog, variables.miner.cat, "all");

Line 12 works correctly and finds the value in the struct:

variables.miner.liveWorker = structFindValue(data.workers, true, "all");

Adam Cameron says as I paraphrase, "Clear as mud!"

Here is his code:

Monday, March 11, 2013

i18n (internationalization) playing nice with different operating systems

Hi Guys,

I did a little tweak to get this code to work properly on any OS.

The main issue is the file separator.

This code detects the OS and returns the proper file separator:

http://blogs.adobe.com/cantrell/archives/2003/03/making_your_col_1.html

The riaforge code for i18n did not play nice in the Linux & OS X world, I fixed that.

http://i18n.riaforge.org/

Here is a link for the code:

http://ppl.ug/qmJNBVsaEmI/

The sample page when run successfully looks like this:

Monday, March 4, 2013

ColdFusion Target?

CFML Target generator, enjoy!.

ColdFusion wrapper for Google Chart API to generate QR Codes

If you have a site that uses HTTPS, you will want all the images coming from you directly so you do not get the insecure content error.

You could take some code from Ben Nadel & make it detect if an image was received successfully

Tuesday, February 26, 2013

I looking for a Senior ColdFusion Opportunity!

Hi Folks!
I am looking to my social network to find my next opportunity.
If you can help spread the word, I greatly appreciate it!

I have 12 years Object Oriented CF, from CF4.5-CF10

I have experience with ModelGlue, FW/1, Mach-II & FuseBox

Please contact me richardhughes260@gmail.com

Monday, October 22, 2012

jquery.myPass tweak

I did some slight tweaks on this jQuery that does some password masking, it now allows for text to be pasted in and handles deletes across all browsers

http://www.mysrc.de/allgemein/jquery-mypass-password-hiding-iphone-style

http://www.mysrc.de/allgemein/jquery-mypass-password-hiding-iphone-style/

Saturday, October 13, 2012

Continuous Integration with FREE Coveros SecureCI

When I was Software Development Manager at Cornell Medical Center in NYC. My predecessor set up Buildix which included CruiseControl, Subversion, Trac, Apache Ant, Apache Tomcat, Apache HTTP Server. We were leveraging Ant to run Selenium RC to test and deploy the code to the test server. It had some integration issues, but all in all a great product.

What got me looking is a call to do a side project. They had no project management tools. I was looking for a VM with Trac & Subversion as a minimum.

I have been looking for a replacement. Coveros SecureCI is available as a vmware image or on the Amazon EC2.

It is designed for java development, but that does not mean it can't be used for ColdFusion. It is CF10 ready with Apache Tomcat! Under the hood are a boat load of packages!

  • Trac
  • Sonar
  • ratproxy
  • Subversion
  • Hudson
  • Apache Ant
  • Apache Maven
  • Sonatype Nexus
  • JUnit
  • Cobertura
  • Selenium Remote Control
  • Checkstyle
  • FindBugs
  • PMD
  • JDepend
  • Apache HTTP Server
  • Apache Tomcat
  • MySQL Server
  • Sun Java Development Kit
  • Sun Java EE 5
  • Ubuntu Server Edition JeOS

Please leave a comment if you have ideas on haw to modify the image to be more CF friendly!

Thursday, April 12, 2012

MAD About Code! :)

On a new consulting gig, and wanting to improve the legacy code...

We can all agree this is awful!!! Right???

And that it will run slow as a nutrirat with two broken legs up hill in the rain

*nutrirat is a cajun delicacy, ask Ray Camden! :)

No, what you remember is that you used to drive that old busted joint. See, I drive... the new hotness.


<cfset descrabbrev_var="ABBREV">

<select name="states">

<OPTION VALUE=""> </OPTION>

<OPTION VALUE="AL" ><cfif descrabbrev_var EQ "ABBREV">AL<cfelse>Alabama</cfif></OPTION>

<OPTION VALUE="AK" ><cfif descrabbrev_var EQ "ABBREV">AK<cfelse>Alaska</cfif></OPTION>

<OPTION VALUE="AZ" ><cfif descrabbrev_var EQ "ABBREV">AZ<cfelse>Arizona</cfif></OPTION>

<OPTION VALUE="AR" ><cfif descrabbrev_var EQ "ABBREV">AR<cfelse>Arkansas</cfif></OPTION>

<OPTION VALUE="CA" ><cfif descrabbrev_var EQ "ABBREV">CA<cfelse>California</cfif></OPTION>

<OPTION VALUE="CO" ><cfif descrabbrev_var EQ "ABBREV">CO<cfelse>Colorado</cfif></OPTION>

<OPTION VALUE="CT" ><cfif descrabbrev_var EQ "ABBREV">CT<cfelse>Connecticut</cfif></OPTION>

<OPTION VALUE="DE" ><cfif descrabbrev_var EQ "ABBREV">DE<cfelse>Delaware</cfif></OPTION>

<OPTION VALUE="DC" ><cfif descrabbrev_var EQ "ABBREV">DC<cfelse>Dist Of Col</cfif></OPTION>

<OPTION VALUE="FL" ><cfif descrabbrev_var EQ "ABBREV">FL<cfelse>Florida</cfif></OPTION>

<OPTION VALUE="GA" ><cfif descrabbrev_var EQ "ABBREV">GA<cfelse>Georgia</cfif></OPTION>

<OPTION VALUE="HI" ><cfif descrabbrev_var EQ "ABBREV">HI<cfelse>Hawaii</cfif></OPTION>

<OPTION VALUE="ID" ><cfif descrabbrev_var EQ "ABBREV">ID<cfelse>Idaho</cfif></OPTION>

<OPTION VALUE="IL" ><cfif descrabbrev_var EQ "ABBREV">IL<cfelse>Illinois</cfif></OPTION>

<OPTION VALUE="IN" ><cfif descrabbrev_var EQ "ABBREV">IN<cfelse>Indiana</cfif></OPTION>

<OPTION VALUE="IA" ><cfif descrabbrev_var EQ "ABBREV">IA<cfelse>Iowa</cfif></OPTION>

<OPTION VALUE="KS" ><cfif descrabbrev_var EQ "ABBREV">KS<cfelse>Kansas</cfif></OPTION>

<OPTION VALUE="KY" ><cfif descrabbrev_var EQ "ABBREV">KY<cfelse>Kentucky</cfif></OPTION>

<OPTION VALUE="LA" ><cfif descrabbrev_var EQ "ABBREV">LA<cfelse>Louisiana</cfif></OPTION>

<OPTION VALUE="ME" ><cfif descrabbrev_var EQ "ABBREV">ME<cfelse>Maine</cfif></OPTION>

<OPTION VALUE="MD" ><cfif descrabbrev_var EQ "ABBREV">MD<cfelse>Maryland</cfif></OPTION>

<OPTION VALUE="MA" ><cfif descrabbrev_var EQ "ABBREV">MA<cfelse>Massachusetts</cfif></OPTION>

<OPTION VALUE="MI" ><cfif descrabbrev_var EQ "ABBREV">MI<cfelse>Michigan</cfif></OPTION>

<OPTION VALUE="MN" ><cfif descrabbrev_var EQ "ABBREV">MN<cfelse>Minnesota</cfif></OPTION>

<OPTION VALUE="MS" ><cfif descrabbrev_var EQ "ABBREV">MS<cfelse>Mississippi</cfif></OPTION>

<OPTION VALUE="MO" ><cfif descrabbrev_var EQ "ABBREV">MO<cfelse>Missouri</cfif></OPTION>

<OPTION VALUE="MT" ><cfif descrabbrev_var EQ "ABBREV">MT<cfelse>Montana</cfif></OPTION>

<OPTION VALUE="NE" ><cfif descrabbrev_var EQ "ABBREV">NE<cfelse>Nebraska</cfif></OPTION>

<OPTION VALUE="NV" ><cfif descrabbrev_var EQ "ABBREV">NV<cfelse>Nevada</cfif></OPTION>

<OPTION VALUE="NH" ><cfif descrabbrev_var EQ "ABBREV">NH<cfelse>New Hampshire</cfif></OPTION>

<OPTION VALUE="NJ" ><cfif descrabbrev_var EQ "ABBREV">NJ<cfelse>New Jersey</cfif></OPTION>

<OPTION VALUE="NM" ><cfif descrabbrev_var EQ "ABBREV">NM<cfelse>New Mexico</cfif></OPTION>

<OPTION VALUE="NY" ><cfif descrabbrev_var EQ "ABBREV">NY<cfelse>New York</cfif></OPTION>

<OPTION VALUE="NC" ><cfif descrabbrev_var EQ "ABBREV">NC<cfelse>North Carolina</cfif></OPTION>

<OPTION VALUE="ND" ><cfif descrabbrev_var EQ "ABBREV">ND<cfelse>North Dakota</cfif></OPTION>

<OPTION VALUE="OH" ><cfif descrabbrev_var EQ "ABBREV">OH<cfelse>Ohio</cfif></OPTION>

<OPTION VALUE="OK" ><cfif descrabbrev_var EQ "ABBREV">OK<cfelse>Oklahoma</cfif></OPTION>

<OPTION VALUE="OR" ><cfif descrabbrev_var EQ "ABBREV">OR<cfelse>Oregon</cfif></OPTION>

<OPTION VALUE="PA" ><cfif descrabbrev_var EQ "ABBREV">PA<cfelse>Pennsylvania</cfif></OPTION>

<OPTION VALUE="RI" ><cfif descrabbrev_var EQ "ABBREV">RI<cfelse>Rhode Island</cfif></OPTION>

<OPTION VALUE="SC" ><cfif descrabbrev_var EQ "ABBREV">SC<cfelse>South Carolina</cfif></OPTION>

<OPTION VALUE="SD" ><cfif descrabbrev_var EQ "ABBREV">SD<cfelse>South Dakota</cfif></OPTION>

<OPTION VALUE="TN" ><cfif descrabbrev_var EQ "ABBREV">TN<cfelse>Tennessee</cfif></OPTION>

<OPTION VALUE="TX" ><cfif descrabbrev_var EQ "ABBREV">TX<cfelse>Texas</cfif></OPTION>

<OPTION VALUE="UT" ><cfif descrabbrev_var EQ "ABBREV">UT<cfelse>Utah</cfif></OPTION>

<OPTION VALUE="VT" ><cfif descrabbrev_var EQ "ABBREV">VT<cfelse>Vermont</cfif></OPTION>

<OPTION VALUE="VA" ><cfif descrabbrev_var EQ "ABBREV">VA<cfelse>Virginia</cfif></OPTION>

<OPTION VALUE="WA" ><cfif descrabbrev_var EQ "ABBREV">WA<cfelse>Washington</cfif></OPTION>

<OPTION VALUE="WV" ><cfif descrabbrev_var EQ "ABBREV">WV<cfelse>West Virginia</cfif></OPTION>

<OPTION VALUE="WI" ><cfif descrabbrev_var EQ "ABBREV">WI<cfelse>Wisconsin</cfif></OPTION>

<OPTION VALUE="WY" ><cfif descrabbrev_var EQ "ABBREV">WY<cfelse>Wyoming</cfif></OPTION>

</SELECT>


So my slick new code bellow will be much faster right?

<cfscript>

 

variables.aryStates=[       

          {twoLetter='AL', fullName='Alabama'}

          ,{twoLetter='AK', fullName='Alaska'}

          ,{twoLetter='AZ', fullName='Arizona'}

          ,{twoLetter='AR', fullName='Arkansas'}

          ,{twoLetter='CA', fullName='California'}

          ,{twoLetter='CO', fullName='Colorado'}

          ,{twoLetter='CT', fullName='Connecticut'}

          ,{twoLetter='DE', fullName='Delaware'}

          ,{twoLetter='DC', fullName='Dist Of Col'}

          ,{twoLetter='FL', fullName='Florida'}

          ,{twoLetter='GA', fullName='Georgia'}

          ,{twoLetter='HI', fullName='Hawaii'}

          ,{twoLetter='ID', fullName='Idaho'}

          ,{twoLetter='IL', fullName='Illinois'}

          ,{twoLetter='IN', fullName='Indiana'}

          ,{twoLetter='IA', fullName='Iowa'}

          ,{twoLetter='KS', fullName='Kansas'}

          ,{twoLetter='KY', fullName='Kentucky'}

          ,{twoLetter='LA', fullName='Louisiana'}

          ,{twoLetter='ME', fullName='Maine'}

          ,{twoLetter='MD', fullName='Maryland'}

          ,{twoLetter='MA', fullName='Massachusetts'}

          ,{twoLetter='MI', fullName='Michigan'}

          ,{twoLetter='MN', fullName='Minnesota'}

          ,{twoLetter='MS', fullName='Mississippi'}

          ,{twoLetter='MO', fullName='Missouri'}

          ,{twoLetter='MT', fullName='Montana'}

          ,{twoLetter='NE', fullName='Nebraska'}

          ,{twoLetter='NV', fullName='Nevada'}

          ,{twoLetter='NH', fullName='New Hampshire'}

          ,{twoLetter='NJ', fullName='New Jersey'}

          ,{twoLetter='NM', fullName='New Mexico'}

          ,{twoLetter='NY', fullName='New York'}

          ,{twoLetter='NC', fullName='North Carolina'}

          ,{twoLetter='ND', fullName='North Dakota'}

          ,{twoLetter='OH', fullName='Ohio'}

          ,{twoLetter='OK', fullName='Oklahoma'}

          ,{twoLetter='OR', fullName='Oregon'}

          ,{twoLetter='PA', fullName='Pennsylvania'}

          ,{twoLetter='RI', fullName='Rhode Island'}

          ,{twoLetter='SC', fullName='South Carolina'}

          ,{twoLetter='SD', fullName='South Dakota'}

          ,{twoLetter='TN', fullName='Tennessee'}

          ,{twoLetter='TX', fullName='Texas'}

          ,{twoLetter='UT', fullName='Utah'}

          ,{twoLetter='VT', fullName='Vermont'}

          ,{twoLetter='VA', fullName='Virginia'}

          ,{twoLetter='WA', fullName='Washington'}

          ,{twoLetter='WV', fullName='West Virginia'}

          ,{twoLetter='WI', fullName='Wisconsin'}

          ,{twoLetter='WY', fullName='Wyoming'}

];

         

         

          //variables.dspType='fullName';                

          variables.dspType='twoLetter';                 

</cfscript>

 

<cfoutput>

          <select id="state" name="state">

              <cfloop array="#variables.aryStates#" index="variables.i">

                  <option value="#variables.i['twoLetter']#">#variables.i[variables.dspType]#</option>

              </cfloop>

          </select>

</cfoutput>

 


To put the hurt on respectively:
old busted joint:

new hotness:

This is running on a CF9.01 CHF2 installed.
I am just not happy!

For those of you that know there is more than one country in North America...

<cfscript>

      

       //This selects the language to be displayed

//     variables.language='enSubject';  

       variables.language='frSubject';  

      

       variables.aryStates=[

              {twoLetter='AL',     fullName='Alabama'}

              ,{twoLetter='AK',    fullName='Alaska'}  

              ,{twoLetter='AZ',    fullName='Arizona'} 

              ,{twoLetter='AR',    fullName='Arkansas'}

              ];       

             

       variables.aryEnStates=[

              {twoLetter='ND',     fullName='North Dakota'}

              ,{twoLetter='SD',    fullName='South Dakota'}  

              ]; 

             

       variables.aryFrStates=[

              {twoLetter='ND',     fullName='Dakota du Nord'}

              ,{twoLetter='SD',    fullName='Dakota du Sud'} 

              ]; 

 

      

       if (variables.language eq 'frSubject'){

              variables.aryStates.addAll( variables.aryFrStates );

              //addAll is a java function

       };

       if (variables.language eq 'enSubject'){

              variables.aryStates.addAll( variables.aryEnStates );

              //addAll is a java function

       };

                                                      

       //This selects the language to be displayed

//     variables.dspType='twoLetter';   

       variables.dspType='fullName';           

</cfscript>

 

<cfoutput>

       <select id="state" name="state">

           <cfloop array="#variables.aryStates#" index="variables.i">

               <option value="#variables.i['twoLetter']#">#variables.i[variables.dspType]#</option>

           </cfloop>

       </select>

</cfoutput>