<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>George Papayiannis &#187; Technology</title>
	<atom:link href="http://www.sematopia.com/category/technology/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sematopia.com</link>
	<description></description>
	<lastBuildDate>Sat, 01 May 2010 04:50:01 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Understanding the difference between POST and GET</title>
		<link>http://www.sematopia.com/2007/05/understanding-the-difference-between-post-and-get/</link>
		<comments>http://www.sematopia.com/2007/05/understanding-the-difference-between-post-and-get/#comments</comments>
		<pubDate>Wed, 02 May 2007 20:50:29 +0000</pubDate>
		<dc:creator>George A. Papayiannis</dc:creator>
				<category><![CDATA[Device UI]]></category>
		<category><![CDATA[History]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.sematopia.com/?p=186</guid>
		<description><![CDATA[Think about that.  Do you really know the difference?  I didn&#8217;t.  I asked myself that question when I was reading through the YUI Connection Manager library.  Read here and you&#8217;ll learn all about it.
]]></description>
			<content:encoded><![CDATA[<p>Think about that.  Do you really know the difference?  I didn&#8217;t.  I asked myself that question when I was reading through the YUI <a href="http://developer.yahoo.com/yui/connection/">Connection Manager</a> library.  Read <a href="http://www.cs.tut.fi/%7Ejkorpela/forms/methods.html">here</a> and you&#8217;ll learn all about it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sematopia.com/2007/05/understanding-the-difference-between-post-and-get/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A closer look into what Google Adwords charges..</title>
		<link>http://www.sematopia.com/2007/03/a-closer-look-into-what-google-adwords-charges/</link>
		<comments>http://www.sematopia.com/2007/03/a-closer-look-into-what-google-adwords-charges/#comments</comments>
		<pubDate>Sun, 11 Mar 2007 05:31:15 +0000</pubDate>
		<dc:creator>George A. Papayiannis</dc:creator>
				<category><![CDATA[Corporate]]></category>
		<category><![CDATA[Marketing]]></category>
		<category><![CDATA[PHP/MySQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.sematopia.com/?p=169</guid>
		<description><![CDATA[This is interesting, though on a small scale, it&#8217;s still relevant.  I run Google Adwords (display ads on specific search terms with Google) for a service I created called WebBasedCron.  A little while ago, I decided to start tracking what ads were really being clicked &#8212; i.e. when an advertisement was clicked, it [...]]]></description>
			<content:encoded><![CDATA[<p>This is interesting, though on a small scale, it&#8217;s still relevant.  I run Google Adwords (display ads on specific search terms with Google) for a service I created called <a href="http://www.webbasedcron.com">WebBasedCron</a>.  A little while ago, I decided to start tracking what ads were really being clicked &#8212; i.e. when an advertisement was clicked, it would send them to a special URL (ex. www.webbasedcron.com/?action=advwbc).  Then I would use PHP code like the following to record the persons IP, the date, time and their session id.</p>
<div class='code_parent'>
<div class='code_title'>Code:</div>
<div class='code_child'><code>
<div class='pre_container'>
<pre>if ( $read_action == "advwbc" ) {
        $session = $user->db->quote(session_id());
        $ip = $user->db->quote($_SERVER['REMOTE_ADDR']);
        $date = $user->db->quote(date("'Y-m-d'"));
        $time = $user->db->quote(date('H:i:s'));
        $sqlInsert = "INSERT INTO webcron_google(date,time,ip,session) VALUES ($date,$time,$ip,$session)";
        $user->db->query($sqlInsert);
}</pre>
</div>
<p></code></div>
</div>
<p>The session is important because it tells me if the advertisement was clicked in the same instance of the browser or not (when you restart your browser, you get a new session).  So lets look at the results for March 9th (yesterday).  I changed nothing, only hid half the persons IP address.</p>
<div class='code_parent'>
<div class='code_title'>Code:</div>
<div class='code_child'><code>
<div class='pre_container'>
<pre>2007-03-09  	04:16:35  	211.30.xxx.xx  	9fbe09012f7ce71854b1e040b0b0fe3c
2007-03-09 	04:17:20 	211.30.xxx.xx 	9fbe09012f7ce71854b1e040b0b0fe3c
2007-03-09 	04:17:47 	211.30.xxx.xx 	9fbe09012f7ce71854b1e040b0b0fe3c
2007-03-09 	04:18:07 	211.30.xxx.xx 	9fbe09012f7ce71854b1e040b0b0fe3c
2007-03-09 	04:18:10 	211.30.xxx.xx 	9fbe09012f7ce71854b1e040b0b0fe3c
2007-03-09 	04:18:13 	211.30.xxx.xx 	9fbe09012f7ce71854b1e040b0b0fe3c
2007-03-09 	04:18:34 	211.30.xxx.xx 	9fbe09012f7ce71854b1e040b0b0fe3c
2007-03-09 	04:18:36 	211.30.xxx.xx 	9fbe09012f7ce71854b1e040b0b0fe3c
2007-03-09 	07:47:21 	193.71.xx.x 	 1895a2c135512d29fa7002e6a8126e65
2007-03-09 	09:51:47 	59.144.xxx.xxx 	b5c090a6f26d83b890fd2faf79c17464</pre>
</div>
<p></code></div>
</div>
<p>You may notice, that the first 8 lines were from the same IP address (211.30.xxx.xx) clicked between <strong>04:16:35</strong> to <strong>04:18:36</strong>.  It&#8217;s easy to see this person got pretty click happy, clicking the ad, hitting back, clicking the ad, etc.  Furthermore, the session id is the same for all the 8 clicks, which means he/she was using the same browser instance.  I would expect Google to be able to detect this type of click fraud and only charge me for 2 legitimate clicks, the ones placed at <strong>07:47:21</strong> and <strong>09:51:47</strong> (not from 211.30.xxx.xx).  The strange part, is I was charged <a href="http://farm1.static.flickr.com/162/417156489_d2c677acf1_o.jpg">for 4 clicks that day</a>.  That means of the 8 illegitimate clicks, Google charged me for 2 of them.  </p>
<p>Believe me, at an average <a href="http://farm1.static.flickr.com/162/417156489_d2c677acf1_o.jpg">cost per click of $0.11</a>, it really doesn&#8217;t matter, but I can imagine for larger companies, Google must be making a fortune off these people.  Its really hard to side with Google on this, I mean if they deemed 6 of those clicks illegitimate, why not the remaining 2??  Do people really click the same advertisement 8 times in 2 minutes, with many of them 3 seconds apart?  It&#8217;s easy to see that even through blatant click fraud Google shamelessly makes money.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sematopia.com/2007/03/a-closer-look-into-what-google-adwords-charges/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Desensitized to Spam</title>
		<link>http://www.sematopia.com/2007/02/desensitized-to-spam/</link>
		<comments>http://www.sematopia.com/2007/02/desensitized-to-spam/#comments</comments>
		<pubDate>Wed, 28 Feb 2007 21:23:42 +0000</pubDate>
		<dc:creator>George A. Papayiannis</dc:creator>
				<category><![CDATA[Coffee]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.sematopia.com/?p=173</guid>
		<description><![CDATA[It’s gotten to the point, were I don’t even care about spam anymore.  On my contact page, I just put my email as is &#8212; sure, I could try and hide it with something like papayiya_REMOVE_THIS@gmail_DOT_com.  But really, is there any point?  The spam bots have built in regular expressions that would [...]]]></description>
			<content:encoded><![CDATA[<p>It’s gotten to the point, were I don’t even care about spam anymore.  On my contact page, I just put my email as is &#8212; sure, I could try and hide it with something like papayiya_REMOVE_THIS@gmail_DOT_com.  But really, is there any point?  The spam bots have built in regular expressions that would strip away caps, underscores, etc..  GMail is generally pretty good anyway, of the 100+ spam messages I get a day, only one or two make it through the filter.  Thank God for Akismet or my blog would be finished..</p>
<p><img src="http://farm1.static.flickr.com/153/406077361_211072fb6e_o.jpg" alt="" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sematopia.com/2007/02/desensitized-to-spam/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Yahoo Pipes &#8211; amazing, intense, awsome&#8230;</title>
		<link>http://www.sematopia.com/2007/02/yahoo-pipes-amazing-intense-awsome/</link>
		<comments>http://www.sematopia.com/2007/02/yahoo-pipes-amazing-intense-awsome/#comments</comments>
		<pubDate>Mon, 12 Feb 2007 16:43:40 +0000</pubDate>
		<dc:creator>George A. Papayiannis</dc:creator>
				<category><![CDATA[Corporate]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.sematopia.com/?p=166</guid>
		<description><![CDATA[I can&#8217;t figure out what&#8217;s better &#8211; the actual application (Pipes) or the UI component widgetry developed to make it happen.  The concept is simple, then again the best ideas are.
Pipes is an interactive feed aggregator and manipulator. Using Pipes, you can create feeds that are more powerful, useful and relevant.
And that&#8217;s exactly what [...]]]></description>
			<content:encoded><![CDATA[<p>I can&#8217;t figure out what&#8217;s better &#8211; the actual application (<a href="http://pipes.yahoo.com">Pipes</a>) or the UI component widgetry developed to make it happen.  The concept is simple, then again the best ideas are.</p>
<blockquote><p>Pipes is an interactive feed aggregator and manipulator. Using Pipes, you can create feeds that are more powerful, useful and relevant.</p></blockquote>
<p>And that&#8217;s exactly what it is, you take feeds (RSS, Atom, etc..) and using an crazy UI, create new ones with rules and filters.<br />
So what could you do?</p>
<ul>
<li><a href="http://pipes.yahoo.com/pipes/1mrlkB232xGjJDdwXqIxGw/edit?opendesc=true">Apartment Near Something</a></li>
<li><a href="http://pipes.yahoo.com/pipes/fELaGmGz2xGtBTC3qe5lkA/edit?opendesc=true">Aggregated News Alerts</a></li>
<li><a href="http://pipes.yahoo.com/pipes/ns70kRi32xGhv8UAt5qdmw/edit?opendesc=true">Upcoming.org Combined Feed</a></li>
<li><a href="http://pipes.yahoo.com/pipes/avkEShi32xG_EF6KZVUMqA/edit?opendesc=true">eBay Price Watch</a></li>
</ul>
<p>This is the first official product to come out of <a href="http://www.businessweek.com/technology/content/feb2007/tc20070209_179924.htm">Yahoo!&#8217;s Brickhouse</a> and I&#8217;m sure not the last.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sematopia.com/2007/02/yahoo-pipes-amazing-intense-awsome/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Friday wrap-up #4 &#8211; The Peanut Butter Manifesto</title>
		<link>http://www.sematopia.com/2006/11/friday-wrap-up-4-the-peanut-butter-manifesto/</link>
		<comments>http://www.sematopia.com/2006/11/friday-wrap-up-4-the-peanut-butter-manifesto/#comments</comments>
		<pubDate>Sun, 19 Nov 2006 06:08:13 +0000</pubDate>
		<dc:creator>George A. Papayiannis</dc:creator>
				<category><![CDATA[Capital Markets]]></category>
		<category><![CDATA[Corporate]]></category>
		<category><![CDATA[Friday]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.sematopia.com/?p=162</guid>
		<description><![CDATA[Update (Nov. 20 2006): The more I thought about this manifesto the more annoyed I became.  This reeks of shameless self promotion.  Furthermore after learning about Garlinghouse&#8217;s track record and reading Kevin Kelleher article from the TheStreet.com I couldn&#8217;t agree more:
So, now heads must roll at Yahoo!. If so, I&#8217;d like to nominate [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update</strong> (Nov. 20 2006): The more I thought about this manifesto the more annoyed I became.  This reeks of shameless self promotion.  Furthermore after learning about Garlinghouse&#8217;s track record and reading <a href="http://www.thestreet.com/_googlen/newsanalysis/techstockupdate/10323250.html?cm_ven=GOOGLEN&#038;cm_cat=FREE&#038;cm_ite=NA">Kevin Kelleher article from the TheStreet.com</a> I couldn&#8217;t agree more:</p>
<blockquote><p>So, now heads must roll at Yahoo!. If so, I&#8217;d like to nominate the first one: Brad Garlinghouse.</p></blockquote>
<p>Things have been busy this last couple weeks, but nothing really that I can disclose.  That coupled with things coming up prevented me from writing a wrap-up the last couple weeks.  </p>
<p>I came across across an article on <a href="http://www.marketwatch.com">MarketWatch</a> about the <a href="http://www.marketwatch.com/news/story/story.aspx?siteid=mktw&#038;guid=%7B83BF6816-9F14-470E-994E-10C87CBE23DC%7D">Peanut Butter Manifesto</a> &#8211; an internal (now external) memo written by Yahoo! exec Brad Garlinghouse.  After reading other reports, I learned that this has been circulating inside Yahoo for the last couple weeks now.  Garlinghouse is <del datetime="2006-11-20T19:35:39+00:00">a gutsy guy</del> a confused fellow and actually (had) shaved a Y into the back of his head.  Initially I thought this was purposely leaked as a precursor to big changes coming &#8211; after reading the memo, I think it may have been purposely leaked but for other reasons..</p>
<blockquote><p>I&#8217;ve heard our strategy described as spreading peanut butter across the myriad opportunities that continue to evolve in the online world. The result: a thin layer of investment spread across everything we do and thus we focus on nothing in particular. I hate peanut butter. We all should.</p></blockquote>
<p>The entire letter can be <a href="http://online.wsj.com/public/article/SB116379821933826657-0mbjXoHnQwDMFH_PVeb_jqe3Chk_20061125.html">read from the WSJ</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sematopia.com/2006/11/friday-wrap-up-4-the-peanut-butter-manifesto/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Friday wrap-up #3</title>
		<link>http://www.sematopia.com/2006/10/friday-wrap-up-3/</link>
		<comments>http://www.sematopia.com/2006/10/friday-wrap-up-3/#comments</comments>
		<pubDate>Sun, 29 Oct 2006 02:22:03 +0000</pubDate>
		<dc:creator>George A. Papayiannis</dc:creator>
				<category><![CDATA[Corporate]]></category>
		<category><![CDATA[Friday]]></category>
		<category><![CDATA[IBM]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[iSeries]]></category>

		<guid isPermaLink="false">http://www.sematopia.com/?p=155</guid>
		<description><![CDATA[This was a busy week, a lot of catching up from all the time spent at CASCON last week.  Continuing on from last week, I&#8217;ve gotten more intimate (?) with Dojo and its inner workings.  I wrote about Dojo a couple months ago, and I&#8217;m still really impressed with everything going on there. [...]]]></description>
			<content:encoded><![CDATA[<p>This was a busy week, a lot of catching up from all the time spent at CASCON last week.  Continuing on from last week, I&#8217;ve gotten more intimate (?) with Dojo and its inner workings.  I wrote about Dojo a couple months ago, and I&#8217;m still really impressed with everything going on there.  A lot of big name sites are built off this toolkit, including Meebo.</p>
<p>IBM results came out last week, the System i had a rough quarter, but IBM did well overall.  Last year at this time (3Q05) the System i had a break out quarter due to an upgrade cycle.  This  year (3Q06) there were no new upgrades and results were the same as 3Q04.  This <a href="http://www.systeminetwork.com/article/news/53420/index.html">article sums things up</a>:</p>
<blockquote><p>
IBM revenue for the System i fell 22 percent in the third quarter of 2006, or 23 percent at constant currency when compared to the same period of 2005. At the same time, nearly every other major IBM business unit saw revenue increase. Overall, earnings rose 47 percent compared to the previous year, up to $2.22 billion on revenues of $22.6 billion, which were up 5 percent.</p>
<p>The supply chain issues IBM faced in the second quarter of this year for System i sales, which were connected to a 7 percent drop in revenue for System i over the second quarter of 2005, have cleared up. IBM CFO Mark Loughridge noted that IBM&#8217;s supply chain did a superb job delivering System p, i, z, and storage but faltered over System x deliveries, contributing to the low rise of 4 percent for the System x. System p revenues increased 10 percent, and System z was a breakout star with a 25 percent increase in revenues while IBM delivered a 16 percent increase in System z MIPS (millions of instructions per second).</p>
<p>For the System i, IBM says 3Q06 compares to a particularly strong 3Q05 quarter, which was driven by upgrade activity from a fully refreshed roadmap, which in turn caused slowing revenue as customers leveraged those previous upgrades. Overall, IBM notes that System i revenue performance remains dependent upon cyclical upgrades.
</p></blockquote>
<p>I was at a Halloween fund raiser for Diabetes last night, it was a good time for a good cause.  I&#8217;m amazed that no matter what type of social event I may be at, there&#8217;s always someone thats directly involved with the System i in some way.</p>
<p>In other news, RedHat got murdered this week in the markets.  Cisco announced they would be creating a fork the RedHat&#8217;s version of Linux and providing half price support until the new year.  If any good can be seen out of this, it just re-affirms RedHat&#8217;s dominance in the Enterprise Linux market.</p>
<p>FireFox 2 came out this week, it generally seems more responsive, but definitely not as polished as it should be.  The memory leak issue doesn&#8217;t seem to have been fixed, since as I type FireFox is using upwards of 80mb memory and climbing.  The new spell checking feature is great though, any work misspelled get underlined in red, right click the and suggestions appear.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sematopia.com/2006/10/friday-wrap-up-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To: Making a PHP REST client to call REST resources</title>
		<link>http://www.sematopia.com/2006/10/how-to-making-a-php-rest-client-to-call-rest-resources/</link>
		<comments>http://www.sematopia.com/2006/10/how-to-making-a-php-rest-client-to-call-rest-resources/#comments</comments>
		<pubDate>Fri, 20 Oct 2006 21:36:27 +0000</pubDate>
		<dc:creator>George A. Papayiannis</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[PHP/MySQL]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.sematopia.com/?p=153</guid>
		<description><![CDATA[A lot of companies these days (including Amazon and Yahoo!) are exposing their web services in the form of REST resources.  At a high level REST is pretty easy to understand, all you&#8217;re doing is exposing a web service in the form of a URL.  Users can then query this URL, through HTTP [...]]]></description>
			<content:encoded><![CDATA[<p>A lot of companies these days (including <a href="http://aws.amazon.com">Amazon</a> and <a href="http://developer.yahoo.com/maps/rest/V1/geocode.html">Yahoo!</a>) are exposing their web services in the form of <a href="http://en.wikipedia.org/wiki/Representational_State_Transfer">REST resources</a>.  At a high level REST is pretty easy to understand, all you&#8217;re doing is exposing a web service in the form of a URL.  Users can then query this URL, through HTTP methods like GET and POST.  REST calls generally return some type of XML or Object Encoding like JSON.</p>
<p>An example would be <a href="http://developer.yahoo.com/maps/rest/V1/geocode.html">Yahoo!&#8217;s Geocoding API</a>, with the following URL:</p>
<div class='code_parent'>
<div class='code_title'>Code:</div>
<div class='code_child'><code>
<div class='pre_container'>
<pre>http://api.local.yahoo.com/MapsService/V1/geocode?appid=YahooDemo&#038;street=701+First+Street&#038;city=Sunnyvale&#038;state=CA</pre>
</div>
<p></code></div>
</div>
<p>I would get:</p>
<div class='code_parent'>
<div class='code_title'>Code:</div>
<div class='code_child'><code>
<div class='pre_container'>
<pre>&#60;Result precision="address">
   &#60;Latitude>37.416384&#60;/Latitude>
   &#60;Longitude>-122.024853&#60;/Longitude>
   &#60;Address>701 FIRST AVE&#60;/Address>
   &#60;City>SUNNYVALE&#60;/City>
   &#60;State>CA&#60;/State>
   &#60;Zip>94089-1019&#60;/Zip>
   &#60;Country>US&#60;/Country>
&#60;/Result></pre>
</div>
<p></code></div>
</div>
<p>So Yahoo! exposes the Geocode URL and allows you to query this resource using URL parameters like <strong>appid</strong> and <strong>street</strong>.  Dynamically building your URL to query a given resource is OK, generally that&#8217;s what people do, like the following:</p>
<div class='code_parent'>
<div class='code_title'>Code:</div>
<div class='code_child'><code>
<div class='pre_container'>
<pre>$base = 'http://xml.amazon.com/onca/xml3';
$query_string = "";

$params = array( 'ManufacturerSearch' => "O'Reilly",
    'mode'  => 'books',
    'sort'  => '+salesrank',
    'page'  => 1,
    'type'  => 'lite',
    'f'     => 'xml',
    't'     => 'trachtenberg-20' ,
    'dev-t' => 'XXXXXXXXXXXXXX' ,
);

foreach ($params as $key => $value) {
    $query_string .= "$key=" . urlencode($value) . "&#038;";
}

$url = "$base?$query_string";
$output = file_get_contents($url);</pre>
</div>
<p></code></div>
</div>
<p>The problem here, is that REST is meant to take advantage of HTTP methods GET, POST, PUT, DELETE, etc.. When people are showing examples which dynamically build queries and call file_get_contents, the average user doesn&#8217;t appreciate (understand) what type of request is being made.  Do they care?  Should they care?  We’ll that’s another story.  Eventually though, more intense REST resources will become widely available, and it will be critical the user (developer) understands if their making a POST or PUT request.</p>
<p>I came across a great PEAR package the other day called <a href="http://pear.php.net/package/HTTP_Request/">HTTP_REQUEST</a>, which among many things supports GET/POST/HEAD/TRACE/PUT/DELETE, basic authentication, proxy, proxy authentication, SSL, file uploads and more.  Using this package, I got started on a simple wrapper class called RESTclient, which gives intuitive support for making REST resource calls.</p>
<p>So if I was going to use RESTclient to call the Geocode API above, it would look like this:</p>
<div class='code_parent'>
<div class='code_title'>Code:</div>
<div class='code_child'><code>
<div class='pre_container'>
<pre>&#60;?php

require_once "RESTclient.php";

$rest = new RESTclient();

$inputs = array();
$inputs["appid"] = "YahooDemo";
$inputs["street"] = "701 First Street";
$inputs["city"] = "Sunnyvale";
$inputs["state"] = "CA";

$url = "http://api.local.yahoo.com/MapsService/V1/geocode/"
$rest->createRequest("$url","POST",$inputs);
$rest->sendRequest();
$output = $rest->getResponse();
echo $output;

?></pre>
</div>
<p></code></div>
</div>
<p>At this point, you might be thinking, who cares &#8212; what’s the difference between using a loop to dynamically generate the URL or RESTclient.  There are lots of reasons, first off, I can easily call the Geocode resource again using another address just by changing:</p>
<div class='code_parent'>
<div class='code_title'>Code:</div>
<div class='code_child'><code>
<div class='pre_container'>
<pre>$inputs["street"] = "1600 Amphitheatre Parkway";
$inputs["city"] = "Mountain View";</pre>
</div>
<p></code></div>
</div>
<p>There was no need to re-generate the URL.  Furthermore, I&#8217;m explicitly specifying a POST request.  Just as easily I can make a PUT, DELETE, etc. request on a given resource by changing the <strong>createRequest</strong> method parameters.</p>
<p>The class below is RESTclient.  Note, I put this together to prove a point, it still needs some work if you plan on using it.</p>
<div class='code_parent'>
<div class='code_title'>Code:</div>
<div class='code_child'><code>
<div class='pre_container'>
<pre>&#60;?php

require_once "HTTP/Request.php";

class RESTClient {

    private $root_url = "";
    private $curr_url = "";
    private $user_name = "";
    private $password = "";
    private $response = "";
    private $responseBody = "";
    private $req = null;

    public function __construct($root_url = "", $user_name = "", $password = "") {
        $this->root_url = $this->curr_url = $root_url;
        $this->user_name = $user_name;
        $this->password = $password;
        if ($root_url != "") {
            $this->createRequest("GET");
            $this->sendRequest();
        }
        return true;
    }

    public function createRequest($url, $method, $arr = null) {
        $this->curr_url = $url;
        $this->req =&#038; new HTTP_Request($url);
        if ($this->user_name != "" &#038;&#038; $this->password != "") {
           $this->req->setBasicAuth($this->user_name, $this->password);
        }        

        switch($method) {
            case "GET":
                $this->req->setMethod(HTTP_REQUEST_METHOD_GET);
                break;
            case "POST":
                $this->req->setMethod(HTTP_REQUEST_METHOD_POST);
                $this->addPostData($arr);
                break;
            case "PUT":
                $this->req->setMethod(HTTP_REQUEST_METHOD_PUT);
                // to-do
                break;
            case "DELETE":
                $this->req->setMethod(HTTP_REQUEST_METHOD_DELETE);
                // to-do
                break;
        }
    }

    private function addPostData($arr) {
        if ($arr != null) {
            foreach ($arr as $key => $value) {
                $this->req->addPostData($key, $value);
            }
        }
    }

    public function sendRequest() {
        $this->response = $this->req->sendRequest();

        if (PEAR::isError($this->response)) {
            echo $this->response->getMessage();
            die();
        } else {
            $this->responseBody = $this->req->getResponseBody();
        }
    }

    public function getResponse() {
        return $this->responseBody;
    }

}
?></pre>
</div>
<p></code></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.sematopia.com/2006/10/how-to-making-a-php-rest-client-to-call-rest-resources/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
		<item>
		<title>Friday wrap-up #1</title>
		<link>http://www.sematopia.com/2006/10/friday-wrap-up-1/</link>
		<comments>http://www.sematopia.com/2006/10/friday-wrap-up-1/#comments</comments>
		<pubDate>Fri, 13 Oct 2006 19:29:36 +0000</pubDate>
		<dc:creator>George A. Papayiannis</dc:creator>
				<category><![CDATA[Friday]]></category>
		<category><![CDATA[IBM]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.sematopia.com/?p=151</guid>
		<description><![CDATA[Update (Nov. 18 2006): I&#8217;ll try and do this weekly, but no guarantees.
Last thing I want to do is write another AJAX framework, but it seems that’s the only way to fully understand large-scale AJAX development.  We&#8217;ll see what happens &#8212; I&#8217;ve spent a lot of time looking into Object Notations (ON) (JSON, YAML, [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update</strong> (Nov. 18 2006): I&#8217;ll try and do this weekly, but no guarantees.</p>
<p>Last thing I want to do is write another AJAX framework, but it seems that’s the only way to fully understand <strong>large-scale</strong> AJAX development.  We&#8217;ll see what happens &#8212; I&#8217;ve spent a lot of time looking into Object Notations (ON) (JSON, YAML, etc.) this past week, weighing out trade-offs between run-time extensions to server side scripts.  I&#8217;ve been getting a lot of people asking for another AJAX tutorial to continue from the original &#8212; I&#8217;ll try and write something soon.</p>
<p>This past Tuesday, I sat in on the 3rd and final Technology Showcase my 2nd line manager had organized.  This one in particular was on C, C++, and Fortran Compilers.  A lot of cool stuff in the works, we even got a demo (video) of the <strong>PS3</strong> in action.</p>
<p>Motivated by Ryan&#8217;s idea of <a href="http://blogs.gnome.org/view/ryanl/2005/12/04/0">KeyboardCast</a>, I made a couple suggestions to the Target Management (Remote Systems Explorer) subproject in Eclipse, about being able to execute a single shell command on multiple servers (or targets).  After some discussions, agreeing to help out in specs/code/discussions, I got sucked into testing for their 1.0 release!  Ah, it was ok, I had a small commitment of 2 hours.</p>
<p>I finally submitted my 2nd application for a patent @ IBM.  Considering the backlog at the US patent office is something ridiculous like 2+ years &#8212; I have a while to wait.  The patent is for a revolutionary new type of XML Parser that a manager and I came up with &#8212; that’s all I can say about it now.</p>
<p>Next week is the <a href="https://www-927.ibm.com/ibm/cas/cascon/index.shtml">CASCON</a> conference.  Aside from the keynotes and walk-in talks, I&#8217;ve signed up for 3 workshops:</p>
<ul>
<li>Hands-on: Building a Ruby on Rails application with DB2 Express-C 9</li>
<li>Social Computing: Best Practices</li>
<li>Social Computing: How the Social Web (R)evolution is Changing the Business Landscape</li>
</ul>
<p>I&#8217;ll also be holding a Technology Showcase @ CASCON on WDSC &#038; JWL Tuesday, Wednesday and Thursday from 11:30am till 1:30pm:</p>
<blockquote><p><strong>WDSC JWL 3.0 in Action</strong><br />
This exhibit will demonstrate the rich JSF/JavaScript-based widget library JWL. Currently in the finishing stages of development, JWL will revolutionize the way users interact with applications. Widgets/abilities include full AJAX support, key press bindings, calendars, panel dialogs, panel menus, context assist, converters, and much more.</p></blockquote>
<p>I fallen off my <em>great quest</em> to become an expert at object oriented design patterns &#8212; I seriously have to spend some this weekend.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sematopia.com/2006/10/friday-wrap-up-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Comet: Life after AJAX</title>
		<link>http://www.sematopia.com/2006/08/comet-life-after-ajax/</link>
		<comments>http://www.sematopia.com/2006/08/comet-life-after-ajax/#comments</comments>
		<pubDate>Tue, 08 Aug 2006 20:13:49 +0000</pubDate>
		<dc:creator>George A. Papayiannis</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.sematopia.com/?p=118</guid>
		<description><![CDATA[There is no doubt that AJAX is a brilliant idea, which has pushed web development to a new level.  That said, the framework has many limitations, and a lot of big time names in the open source industry (Alex Russel being one of them) have taken notice.  People that don&#8217;t understand Comet call [...]]]></description>
			<content:encoded><![CDATA[<p>There is no doubt that AJAX is a brilliant idea, which has <em>pushed</em> web development to a new level.  That said, the framework has many limitations, and a lot of big time names in the open source industry (<a href="http://alex.dojotoolkit.org/?p=545">Alex Russel</a> being one of them) have taken notice.  People that don&#8217;t understand Comet call it &#8220;disgruntled AJAX developers who went off on their own&#8221;.  The reality is, that a server-side event driven model for web development is needed.  The catch?  A long-lived static connection from the client-side (browser) to the server is needed.  For example, this event driven server-side model, means that the server can now tell the client to refresh a panel on demand (without the client making a request).</p>
<p>On Sunday, the Dojo Foundation <a href="http://blog.dojotoolkit.org/2006/08/06/cometd-new-dojo-project">announced</a> <a href="http://www.cometd.com/">Cometd</a> as a new Dojo project.</p>
<blockquote><p>Cometd is a scalable HTTP-based event routing bus that uses a push technology pattern known as Comet.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.sematopia.com/2006/08/comet-life-after-ajax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dojo: A glimpse into the future of web development</title>
		<link>http://www.sematopia.com/2006/08/dojo-a-glimpse-into-the-future-of-web-development/</link>
		<comments>http://www.sematopia.com/2006/08/dojo-a-glimpse-into-the-future-of-web-development/#comments</comments>
		<pubDate>Thu, 03 Aug 2006 19:11:52 +0000</pubDate>
		<dc:creator>George A. Papayiannis</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.sematopia.com/?p=117</guid>
		<description><![CDATA[Update (Aug. 17 2006): The more I use Dojo, the more impressed I am with what is being done.  The entire project has so much attention to detail.  I just spent a little while looking at dojo.io.* and am blown away at this easy to use, transparent approach to AJAX.
That’s a powerful title, [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update</strong> (Aug. 17 2006): The more I use Dojo, the more impressed I am with what is being done.  The entire project has so much attention to detail.  I just spent a little while looking at dojo.io.* and am blown away at this easy to use, transparent approach to AJAX.</p>
<p>That’s a powerful title, will it come true?  Who knows.  At this moment and time, at version 0.3, Dojo is insanely impressive.<br />
So the first question that most people will have is: What is Dojo?</p>
<blockquote><p>Dojo is the Open Source Javascript toolkit that makes professional web development better, easier, and faster</p></blockquote>
<p>A little more detail:</p>
<blockquote><p>Dojo is an Open Source DHTML toolkit written in JavaScript. It builds on several contributed code bases (nWidgets, Burstlib, f(m)), which is why we refer to it sometimes as a &#8220;unified&#8221; toolkit. Dojo aims to solve some long-standing historical problems with DHTML which prevented mass adoption of dynamic web application development.</p>
<p>Dojo allows you to easily build dynamic capabilities into web pages and any other environment that supports JavaScript sanely. You can use the components that Dojo provides to make your web sites more useable, responsive, and functional. With Dojo you can build degradeable user interfaces more easily, prototype interactive widgets quickly, and animate transitions. You can use the lower-level APIs and compatibility layers from Dojo to write portable JavaScript and simplify complex scripts. Dojo&#8217;s event system, I/O APIs, and generic language enhancement form the basis of a powerful programming environment</p></blockquote>
<p>I hear people say &#8220;Dojo, that’s the AJAX framework&#8221;.  Sure, Dojo is about asynchronous interaction, but that’s only a part of the story.  The problem with JavaScript is that it blew up way too fast.  It’s a powerful programming language, but lacks the subtleties, which would make it easy to develop large-scale JavaScript applications.  I doubt in the mid 90s Netscape envisioned JavaScript the way its used today.  In 2002, Doug Crockford got fed up and made JSLint:</p>
<blockquote><p>When C was a young programming language, there were several common programming errors that were not caught by the primitive compilers, so an accessory program called lint  was developed which would scan a source file, looking for problems.  As the language matured, the definition of the language was strengthened to eliminate some insecurities, and compilers got better at issuing warnings. lint is no longer needed.</p>
<p>JavaScript is a young language. It was originally intended to do small tasks in webpages, tasks for which Java was too heavy and clumsy. But JavaScript is a very capable language, and it is now being used in larger projects. Many of the features that were intended to make the language easy to use are troublesome for larger projects. A lint for JavaScript is needed: JSLint, a JavaScript syntax checker and validator.
</p></blockquote>
<p>The good folks at Dojo have taken this a massive step further, put very gently:</p>
<blockquote><p>dojo.lang.* contains wrappers for common idioms. It doesn&#8217;t provide replacements for language constructs. We only provide functions that provide value-added above the standard javascript routines, or functions that mask browser incompatibilites, etc.</p></blockquote>
<p>The reality is, an amazing, transparent, useful framework has been (is being) developed, which will give the Web developer power they’ve only dreamt of.  Were talking proper class constructs, inheritance, the ability to override methods, and much more.</p>
<p>In total there is the Dojo Infrastructure (fundamental behaviors), General purpose libraries (String manip., DOM manip., etc…), Data Structures (Dictionary, ArrayList, Queue, etc..), Web I/O (RPC, JSON, etc.), Visual Web (animations, graphics, etc.), Math and Cryptogrpahy (speaks for itself.. clientside Crypto, like Meebo) and a great Widget library.</p>
<p>What kind of widgets are we looking at?  Here is a taste of what you can expect:</p>
<p><a href="http://www.sematopia.com/dojo/demos/widget/Fisheye.html">FisheyeList</a> – hover over the menu at the top…<br />
<a href="http://www.sematopia.com/dojo/tests/widget/test_Dialog3.html">Popup Dialogs</a> – click the links on the top left…<br />
<a href="http://www.sematopia.com/dojo/tests/widget/test_FloatingPane.html">Floating Pane</a> – drag them, close them.. the world is your oyster<br />
<a href="http://www.sematopia.com/dojo/tests/widget/test_InlineEditBox.html">Inline Edit Box</a> – just like Flikr, click the title and text…</p>
<p>All this, and their only in version 0.3.  Give it a try: <a href="http://www.dojotoolkit.com">dojotoolkit.com</a> &#8212; be warned documentation to the specifics of the API is sparse.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sematopia.com/2006/08/dojo-a-glimpse-into-the-future-of-web-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
