Googolflex!!
  • Home
  • About
  • Contracting

Recent Posts

  • Sprint’s new “Simply ‘Almost’ Everything®” Plans
  • CSS Changes in Flex 4
  • Dotted Underline LinkButton (Flex)

About The Author : jwd

This is John Dusbabek's tech blog. John is a software engineer and Flex developer in Provo, UT, where he lives with his lovely wife and four sons.

Recent Comments

  • Nikos on Flex: Binding to an Interface
  • Iain Hosking on Apache mod_proxy_balancer: No Protocol handler was valid

Archive for October, 2007

Oct
02

Lab 2 – List Server

Posted by: jwd | Comments (0)

After climbing over the learning curve of the first lab, lab 2 was a piece of cake. Speaking of cake, I switched to PHP for this lab. I had my fill of mod_python for a little while, I may switch back to it for the next lab, but I haven’t decided.

I used Smarty for templating. It’s one of the only 2 templating systems I’ve used for PHP (the other being the one built into PHP itself), and I prefer Smarty. It has plenty of features, is pretty lightweight and performs very well after the templates have been compiled and cached. Getting PHP and Smarty working was trivial, I had a little more difficulty getting JSON working.

I was able to get my code written quickly on my development machine. I used file_get_contents to retrieve the JSON data, which reads/stores the contents of a file or the response from an HTTP GET request as a string. PHP’s JSON library has two methods json_encode and json_decode. By means of a flag, you can decode a JSON message into a PHP object, or an associative array. I chose the associative array, and used a template to generate my XML.

The only difficulty I had was setting up PHP’s JSON library on my EC2 server. The library comes bundled with PHP 5.2, but not with the previous versions. And there is no yum installer for PHP 5.2 on FC4. yum install php_json did the trick in the end (took me about 2 hours to get there).

I used mod_rewrite to map our URL interface to my backend. It worked well once I got my regular expressions correct.

P.S. – My bill for September was only $1.81.

Categories : Uncategorized
Comments (0)

Search

Feedburner

Subscribe to

Get the latest updates delivered via email

Calendar

October 2007
M T W T F S S
« Sep   Nov »
1234567
891011121314
15161718192021
22232425262728
293031  

Archives

  • July 2010 (1)
  • June 2010 (2)
  • May 2010 (1)
  • February 2010 (11)
  • January 2010 (3)
  • December 2009 (5)
  • November 2009 (1)
  • August 2009 (8)
  • July 2009 (8)
  • May 2009 (4)
  • April 2009 (1)
  • March 2009 (6)
  • January 2009 (1)
  • November 2008 (4)
  • October 2008 (5)
  • September 2008 (1)
  • August 2008 (5)
  • July 2008 (1)
  • June 2008 (2)
  • May 2008 (8)
  • April 2008 (5)
  • March 2008 (2)
  • February 2008 (3)
  • January 2008 (1)
  • December 2007 (6)
  • November 2007 (9)
  • October 2007 (1)
  • September 2007 (2)

Categories

Tag Cloud

adobe apache Architecture book review C++ centos client server architecture Custom Components database Design error message fedora flash catalyst flex Flex 3 Flex 4 fms iis 6 Interaction Design load balancing master-master master-slave mod_proxy_balancer Monkey Patching MySQL no protocol p2p peer to peer Perl PHP Red5 regex replication self registration selinux Shell Scripting shortcut manager skins socket policy file sockets states stored procedures stratus tools workflow

Coworkers

  • Casey Jackman
  • Sean Murphy

Family

  • Emily & CJ
  • Family Blog
  • Gary Dusbabek

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org

RSS FlexExamples

  • Styling the text selection format on a Spark TextArea control in Flex 4
  • Setting the scale mode on a Spark Image control in Flex Hero
  • Setting the fill mode on a Spark Image control in Flex Hero
  • Setting a bitmap image fill on a Spark Form container in Flex Hero
  • Setting a bitmap image fill on a Spark FormHeading control in Flex Hero

Spam Blocked

847 spam comments
blocked by
Akismet

Sponsored Links

JUICE Chat

BYU Adobe Users Group


Copyright © 2010 All Rights Reserved
Flexx Theme by iThemes
Powered by WordPress