Mar 26, 2009
Coldfusion jQuery and Twitter = Good times
The past few night Thomas Stiegler and I have been working on a Coldfusion, jQuery powered twitter app called TweetTrail.
The idea is that you can search for a term and see who are the top 20 tweeters mentioning that term. Rather then claiming you tweet the most about #jQuery for example now you can prove it. http://www.tweettrail.com/search/jquery
The logic went through several re-writes before an optimized method of caching and performance were archived. The Ajax went through several iterations but is quite nice ( click and avatar ).
Thanks to all who helped in the private Aplha test this week we tried to sort out as many issues as possible. Were still not totally ie6 or 7 friendly ( ie8 works well though ) but we are happy with the Beta release.
We also have a bot TweetTrail which re-announces your search and the results. Each term will be announce only once per month.
We have several ideas and additions in the works. Comments/Suggestions welcome.
Special thanks to Coldfusion and CFML in general for giving us the tools pre-packaged to accomplish this in such a short time.
Also if you like it Digg it: Digg.com
Mar 21, 2009
Sending binary from Flash 10 to PHP with Flex 4
Yes I did it I put PHP in the title of a blog post. I'm all about using whats best for the job at hand and if that means your using PHP then so be it. I'm currently re-writing a section of our app in both C# and Groovy just to keep my skills upto date but more of that in another post ;)
The topic of this post is to answer a comment to my Loading binary data in the Flash player client side post. Dave asked "How can I upload this to the server after modifying it if I'm not using ColdFusion? I don't understand what you're doing with the RemoteObject object."
Initially I though it would be easy as per my reply. And well it actually was just that easy. I needed a base64 encoding class and a simple PHP script to accept and base64 decode the data and write it to a file. Thanks to Thomas Stiegler who whipped up this quick script.
Here is a working demo with view source enabled: http://code.kukiel.net/blog/phpresize
You still need Flash 10 and it still only works on Windows but it will post to any server side language you have access to. I'll assume the same could be done over WebOrb for PHP, ( c# ect ) using amf or webservices.
The topic of this post is to answer a comment to my Loading binary data in the Flash player client side post. Dave asked "How can I upload this to the server after modifying it if I'm not using ColdFusion? I don't understand what you're doing with the RemoteObject object."
Initially I though it would be easy as per my reply. And well it actually was just that easy. I needed a base64 encoding class and a simple PHP script to accept and base64 decode the data and write it to a file. Thanks to Thomas Stiegler who whipped up this quick script.
Here is a working demo with view source enabled: http://code.kukiel.net/blog/phpresize
You still need Flash 10 and it still only works on Windows but it will post to any server side language you have access to. I'll assume the same could be done over WebOrb for PHP, ( c# ect ) using amf or webservices.
Mar 13, 2009
Determine database type with cf dbinfo in Coldfusion and Railo.
Way back some one asked on learncf.com "Is there a way to determine which database engine is being used, so you could code a cfif or cfswitch to choose the correct phrase for the return value?"
Well with CF8 yes it is possible. And its quite easy!
This also works in the same way on Railo.
It dosn't work with Access ( returns an error about the driver ) and I don't have any other databases running so I can't test the rest but here is a running example of SQLLite, mySQL and Apache Derby.
Run the example on Coldfusion: Coldfusion Demo
Thanks to Ray Camden for the reminder.
Well with CF8 yes it is possible. And its quite easy!
This also works in the same way on Railo.
It dosn't work with Access ( returns an error about the driver ) and I don't have any other databases running so I can't test the rest but here is a running example of SQLLite, mySQL and Apache Derby.
Run the example on Coldfusion: Coldfusion Demo
Thanks to Ray Camden for the reminder.
Mar 10, 2009
Coldfusion on the fly image resize
Resizing images on the fly with Coldfusion is easy. While it does put a strain on your server you may have a valid reason for wanting to do this ie not allowing someone to hot link an image?
This works in Coldfusion 8 and Railo ( probably Open BD )
Here is the code:
The temporary files end up here: {cf8root}\tmpCache\CFFileServlet\_cf_image and they are cleared after 5 mins on the next image resize. Railo links the images back to {webContextroot}/WEB-INF/railo/temp/graph/
Here is a demo:
Coldfusion http://cf9.kukiel.net/demos/onflyimageresize/
Railo http://railo.kukiel.net/blog/onflyimageresize/
This works in Coldfusion 8 and Railo ( probably Open BD )
Here is the code:
The temporary files end up here: {cf8root}\tmpCache\CFFileServlet\_cf_image and they are cleared after 5 mins on the next image resize. Railo links the images back to {webContextroot}/WEB-INF/railo/temp/graph/
Here is a demo:
Coldfusion http://cf9.kukiel.net/demos/onflyimageresize/
Railo http://railo.kukiel.net/blog/onflyimageresize/
Mar 4, 2009
Pushing data to Flex clients with Coldfusion event gateways with demo.
A few months ago I started looking at how I could "push" data from Coldfusion to Flex with Live cycle. I was able to get datagrids to sync among Flex client's but it took some serious modifications to several of the XML files and started as one of the code generated master pieces in Flexbuilder. Recently I decided to revisit this and approached this using event gateways. I started with this as a base: João Fernandes - Flex and CF.
So what is generally one of the most fun things to write, yep a chat application. I made some modifications to allow pressing enter to send data and a few bits of logic to determine what what to display. I also thought it would be fun to have a "Page me" button. This idea came from the widgets where you can embed mini versions of MSN and AIM into your website so people can chat with you without needing a long sign in process.
The best part of this is that the messages are being sent over rtmp so the data is actually pushed to the client. open 2 browsers and watch how quick the messages are sent and received. As this is setup to run over port 2048 if you are behind a strict firewall where the port is blocks it will automatically fall back to polling (every 3 seconds) over port 80.

I put some code in to eliminate people spamming me more then one per 10 mins. All this can be achieved on CF8 ( I think 7 aswell ) standard edition.
Code is available here: View Source
There is alot more that can be achieved but this is a simple example of how Coldfusion can push data to Flex.
Thanks to João Fernandes great blog and Dave Watts Max 2008 session for answering some of my questions.
The Gateway:
So what is generally one of the most fun things to write, yep a chat application. I made some modifications to allow pressing enter to send data and a few bits of logic to determine what what to display. I also thought it would be fun to have a "Page me" button. This idea came from the widgets where you can embed mini versions of MSN and AIM into your website so people can chat with you without needing a long sign in process.
The best part of this is that the messages are being sent over rtmp so the data is actually pushed to the client. open 2 browsers and watch how quick the messages are sent and received. As this is setup to run over port 2048 if you are behind a strict firewall where the port is blocks it will automatically fall back to polling (every 3 seconds) over port 80.

I put some code in to eliminate people spamming me more then one per 10 mins. All this can be achieved on CF8 ( I think 7 aswell ) standard edition.
Code is available here: View Source
There is alot more that can be achieved but this is a simple example of how Coldfusion can push data to Flex.
Thanks to João Fernandes great blog and Dave Watts Max 2008 session for answering some of my questions.
The Gateway:
Mar 3, 2009
Validating Email address's in Flex
I had a need to save a bunch of email address's to a data base as well and send mail. I wanted to make sure only valid email address's were saved. I wanted this to be as simple and if I can re-use it all the better. Using the EmailValidator in Flex I came up with this:
The submit button will stay inactive till all 3 email address's are valid. Hovering over an invalid email address field will tell you why it's invalid.
This avoids the need to validate the email address server side before emailing and saving.
Code is available here: View Source
The submit button will stay inactive till all 3 email address's are valid. Hovering over an invalid email address field will tell you why it's invalid.
This avoids the need to validate the email address server side before emailing and saving.
Code is available here: View Source
Subscribe to:
Posts (Atom)