<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>The proof of concepts blog</title>
	<atom:link href="http://proofofconcepts.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://proofofconcepts.wordpress.com</link>
	<description>my Dev playground</description>
	<lastBuildDate>Tue, 09 Jun 2009 20:31:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='proofofconcepts.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>The proof of concepts blog</title>
		<link>http://proofofconcepts.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://proofofconcepts.wordpress.com/osd.xml" title="The proof of concepts blog" />
	<atom:link rel='hub' href='http://proofofconcepts.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Flex AutoResizable Textarea</title>
		<link>http://proofofconcepts.wordpress.com/2009/06/09/flex-autoresizable-textarea/</link>
		<comments>http://proofofconcepts.wordpress.com/2009/06/09/flex-autoresizable-textarea/#comments</comments>
		<pubDate>Tue, 09 Jun 2009 20:31:59 +0000</pubDate>
		<dc:creator>Guillaume</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[AdvancedTextarea]]></category>
		<category><![CDATA[autoresize]]></category>
		<category><![CDATA[Component]]></category>
		<category><![CDATA[Textarea]]></category>

		<guid isPermaLink="false">http://proofofconcepts.wordpress.com/?p=65</guid>
		<description><![CDATA[I&#8217;ve been quite busy those past weeks, working on some great projects and cool devices (Stay tune one will be available in all high tech shops soon). Recently, I faced a very simple Flex problem. I had to work with a Textarea but I needed it to be autoresizable, and ALSO I had be able [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=proofofconcepts.wordpress.com&amp;blog=3854699&amp;post=65&amp;subd=proofofconcepts&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been quite busy those past weeks, working on some great projects and cool devices (Stay tune one will be available in all high tech shops soon).</p>
<p>Recently, I faced a very simple Flex problem. I had to work with a Textarea but I needed it to be autoresizable, and ALSO I had be able to set so constraints such as : maxchars displayed and maxheight. I had a quick look on the internet but I didn&#8217;t find a conponent fitting my needs. You may find some example using mx_internal properties but I try to avoid using this namespace&#8230;for many reasons.</p>
<p>Anyway, I crafted my own Autoresizable Textarea and share it to everyone who want to play with/improve/crash/burn/..etc it.</p>
<pre class="brush: java;">

///////////////////////////////
// Author: Guillaume Nachury
//
//         Advanced Textarea
//
// -&gt; Auoresize feature with
//             -&gt; MaxChar limiter
//            -&gt; MaxHeight limiter
///////////////////////////////

package
{
 import mx.controls.TextArea;

 public class AdvancedTextarea extends TextArea
 {

 private var _autoResize:Boolean =  false;
 private var _lineOffset:int = 5;
 public var fullText:String=&quot;&quot;;

 public function AdvancedTextarea(isAutoResize:Boolean=false)
 {
 super();
 _autoResize = isAutoResize;
 }

 //overrides        
 override public function set maxChars(i:int):void{
 super.maxChars = i;
 doValidations();
 }

 override public function set maxHeight(n:Number):void{
 super.maxHeight = n;
 doValidations();
 }

 override public function set text(s:String):void{
 //limit the number of chars if there's a limit
 fullText = s;
 if(super.maxChars&gt;0 &amp;&amp; s.length &gt; super.maxChars){
 s = s.substring(0, super.maxChars)+&quot;...&quot;;    
 super.text = s;
 }
 super.text = s;

 validateNow();
 doValidations();
 }

 private function doValidations():void{
 if(super.text != null &amp;&amp; super.text.length &gt;0){

 //limit the height if there's a limit
 if(!isNaN(super.maxHeight)){
 var textH:int = this.textField.measuredHeight+_lineOffset;
 if(textH &gt; super.maxHeight &amp;&amp; _autoResize == true){
 this.height = super.maxHeight;
 }
 else{
 if(_autoResize == true)    this.height = this.textField.measuredHeight+_lineOffset;

 }

 }
 else{
 if(_autoResize == true){
 this.height = this.textField.measuredHeight+_lineOffset;
 }

 }
 }
 }

 public function set autoResize(b:Boolean):void{
 _autoResize = b;
 doValidations();
 }

 }
}
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/proofofconcepts.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/proofofconcepts.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/proofofconcepts.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/proofofconcepts.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/proofofconcepts.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/proofofconcepts.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/proofofconcepts.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/proofofconcepts.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/proofofconcepts.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/proofofconcepts.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/proofofconcepts.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/proofofconcepts.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/proofofconcepts.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/proofofconcepts.wordpress.com/65/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=proofofconcepts.wordpress.com&amp;blog=3854699&amp;post=65&amp;subd=proofofconcepts&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://proofofconcepts.wordpress.com/2009/06/09/flex-autoresizable-textarea/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f34be074578b066ceeaf2647b6dcc4fa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Guillaume</media:title>
		</media:content>
	</item>
		<item>
		<title>Skinning Flex HSLider component. part II</title>
		<link>http://proofofconcepts.wordpress.com/2009/02/06/skinning-flex-hslider-component-part-ii/</link>
		<comments>http://proofofconcepts.wordpress.com/2009/02/06/skinning-flex-hslider-component-part-ii/#comments</comments>
		<pubDate>Fri, 06 Feb 2009 15:45:17 +0000</pubDate>
		<dc:creator>Guillaume</dc:creator>
				<category><![CDATA[Bloggin']]></category>

		<guid isPermaLink="false">http://proofofconcepts.wordpress.com/?p=53</guid>
		<description><![CDATA[This post is a quick follow up on my last skinning post, since I realized  that I should add some details about the sliderThumb customization. In order to create our very own sliderThumb UI we created a class that extends SliderThumb (see full code below). But we need to override some method of SliderThumb otherwise the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=proofofconcepts.wordpress.com&amp;blog=3854699&amp;post=53&amp;subd=proofofconcepts&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This post is a quick follow up on my <a href="http://proofofconcepts.wordpress.com/2008/07/17/skinning-a-flex-slider/" target="_blank">last skinning post</a>, since I realized  that I should add some details about the sliderThumb customization.</p>
<p>In order to create our very own sliderThumb UI we created a class that extends SliderThumb (see full code below). But we need to override some method of SliderThumb otherwise the slider won&#8217;t be displayed correctly. (e.g. the original triangle thumb will still be visible :s )</p>
<p>In order to remove the legacy thumb there are several tricks.</p>
<ol>
<li><b>Reduce the size of the thumb, to make it almost invisible.</b></li>
<p>Just override the measure() function and set the size to 0*0 </p>
<pre class="brush: java;">
override protected function measure():void{
            super.measure();
            measuredWidth = 0;
            measuredHeight = 0;
            measuredMinHeight = -1;
            measuredMinWidth = -1;
        }
</pre>
<p>That &#8216;s not the best solution since a small glitchy point will remain visible as the thumb. Check below we can see a small &#8216;blueish&#8217; ball<br />
<a href="http://securilabs.free.fr/dev/myUIComponent.html"><img class="alignnone" src="http://securilabs.free.fr/dev/mySlider.PNG" alt="" width="197" height="205" /></a></p>
<li><b>Apply a transparent skin to the thumb. (Best solution so far)</b></li>
<p>In the properties of the H/VSlider we can set a thumbSkin and Flex replace the ugly triangle by our image/skin. The trick here is to use a 1 px transparent image as the skin which going to remove the old thumb so we can only see our custom component.</p>
<pre class="brush: java;">
//in the mxml
&lt;mx:Style&gt;
		HSlider{
			thumbSkin: Embed(source=&quot;com/GuN/UI/customUIComponent/slider/empty.png&quot;);
		}
	&lt;/mx:Style&gt;

	&lt;mx:Script&gt;
		&lt;![CDATA[
			import com.GuN.UI.customUIComponent.slider.SliderTrack;
			import com.GuN.UI.customUIComponent.slider.CSpSliderThumb;

			var arrayValues:Array = [&quot;null&quot;,&quot;January '08&quot;, &quot;February '08&quot;, &quot;March '08&quot;, &quot;April '08&quot;, &quot;May '08&quot;, &quot;June '08&quot;, &quot;July '08&quot;, &quot;August '08&quot;,
										&quot;September '08&quot;, &quot;October '08&quot;, &quot;November '08&quot;, &quot;December '08&quot;];

		]]&gt;
	&lt;/mx:Script&gt;
	&lt;mx: Panel x=&quot;0&quot; y=&quot;0&quot; width=&quot;527&quot; height=&quot;104&quot; layout=&quot;absolute&quot; title=&quot;Custom Slider&quot; backgroundColor=&quot;#000000&quot;&gt;
		&lt;mx:HSlider x=&quot;73.5&quot; y=&quot;10&quot;
			id=&quot;s&quot;
			showDataTip=&quot;false&quot;
			values=&quot;{arrayValues}&quot;
			creationComplete=&quot;{s.value=1}&quot;
			snapInterval=&quot;1&quot;
			minimum=&quot;1&quot;
			maximum=&quot;{arrayValues.length-1}&quot;
			liveDragging=&quot;true&quot;
			trackSkin=&quot;{SliderTrack}&quot;
			sliderThumbClass=&quot;{CSpSliderThumb}&quot;
			 width=&quot;360&quot;/&gt;
	&lt;/mx: Panel&gt;
</pre>
<p><a href="http://securilabs.free.fr/dev/CustomHSlider.html">Check the result here</a> (once on the page right click to get the src)</ol>
<p><span id="more-53"></span>Full custom sliderthumb source :</p>
<pre class="brush: java;">
package com.GuN.UI.customUIComponent.slider
{
	import com.GuN.UI.customUIComponent.slider.effect.FadeEffect;
	import com.GuN.UI.customUIComponent.slider.sprites.CSpSprite;

	import flash.events.MouseEvent;
	import flash.filters.DropShadowFilter;

	import mx.controls.sliderClasses.Slider;
	import mx.controls.sliderClasses.SliderThumb;

	public class CSpSliderThumb extends SliderThumb
	{
		var isMoving:Boolean = false;
		var spr:CSpSprite;
		var gfxFade:FadeEffect;
		var isDisplayed:Boolean = false;

			public function CSpSliderThumb()
			{

			initListeners();
			initSprite();

			var shadow: DropShadowFilter = new DropShadowFilter();
				shadow.distance = 3;
				shadow.angle = 45;
				spr.filters = [shadow];
			gfxFade = new FadeEffect(spr);
			spr.alpha = 0;
			addChild(spr);
			useHandCursor = true;

		}

		private function initListeners():void{
			addEventListener(MouseEvent.MOUSE_MOVE, myMouseMoveHandler);
			addEventListener(MouseEvent.MOUSE_OVER, mouseOver);
			addEventListener(MouseEvent.MOUSE_OUT, mouseOut);
		}

		private function myMouseMoveHandler(event:MouseEvent):void
			{
				if (isMoving)
				{
					spr.setValue(String(Slider(owner).values[Slider(owner).value]));
				}
			}

		private function mouseOver(evt:MouseEvent){
			if(!isDisplayed){
				    isDisplayed = true;
					gfxFade.show = true;
					spr.setValue(String(Slider(owner).values[Slider(owner).value]));
					gfxFade.play();
			}

		}

		private function mouseOut(evt:MouseEvent){
			if(isDisplayed &amp;&amp; !isMoving){
				    isDisplayed = false;
					gfxFade.show = false;
					spr.setValue(String(Slider(owner).values[Slider(owner).value]));
					gfxFade.play();
			}

		}

		override protected function mouseDownHandler(event:MouseEvent):void
			{
				super.mouseDownHandler(event);
				isMoving = true;

			}

		override protected function mouseUpHandler(event:MouseEvent):void
			{
				super.mouseUpHandler(event);
				isMoving = false;

			}

		private function initSprite():void{
			spr = new CSpSprite();
			spr.x = -(spr.width/2)+4;
			spr.y = 9;
		}

		override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{

            super.updateDisplayList(unscaledWidth,unscaledHeight);
            this.graphics.beginFill(0x000000,1);
            this.graphics.drawCircle(2,-8,4);
           	this.graphics.endFill();
        }

        override protected function measure():void{
            super.measure();
            measuredWidth = 4;
            measuredHeight = 4;
            measuredMinHeight = -1;
            measuredMinWidth = -1;
        }

	}
}
</pre>
<p>As always drop me an email/ or a comment if you have any question.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/proofofconcepts.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/proofofconcepts.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/proofofconcepts.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/proofofconcepts.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/proofofconcepts.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/proofofconcepts.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/proofofconcepts.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/proofofconcepts.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/proofofconcepts.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/proofofconcepts.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/proofofconcepts.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/proofofconcepts.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/proofofconcepts.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/proofofconcepts.wordpress.com/53/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=proofofconcepts.wordpress.com&amp;blog=3854699&amp;post=53&amp;subd=proofofconcepts&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://proofofconcepts.wordpress.com/2009/02/06/skinning-flex-hslider-component-part-ii/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f34be074578b066ceeaf2647b6dcc4fa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Guillaume</media:title>
		</media:content>

		<media:content url="http://securilabs.free.fr/dev/mySlider.PNG" medium="image" />
	</item>
		<item>
		<title>[Pixel Bender] Bright Pass filter</title>
		<link>http://proofofconcepts.wordpress.com/2008/10/09/pixel-bender-bright-pass-filter/</link>
		<comments>http://proofofconcepts.wordpress.com/2008/10/09/pixel-bender-bright-pass-filter/#comments</comments>
		<pubDate>Thu, 09 Oct 2008 11:48:54 +0000</pubDate>
		<dc:creator>Guillaume</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[Pixel Bender]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[bright pass]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[pixel bender]]></category>

		<guid isPermaLink="false">http://proofofconcepts.wordpress.com/?p=41</guid>
		<description><![CDATA[I&#8217;m pretty sure you already heard about pixel bender, if not check Adobe&#8217;s  or Lee Brimelow&#8217;s website for awsome tutorials.  Today I gonna share with you, my first pixel bender code ever, which is a bright pass filter. This filter set the dark pixels to black according a threshold value for the &#8216;darkness&#8217;. &#60;languageVersion : 1.0;&#62; kernel BrightPassFilter [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=proofofconcepts.wordpress.com&amp;blog=3854699&amp;post=41&amp;subd=proofofconcepts&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m pretty sure you already heard about <a href="http://labs.adobe.com/wiki/index.php/Pixel_Bender_Toolkit">pixel bender</a>, if not check Adobe&#8217;s  or <a href="http://theflashblog.com/?p=435">Lee Brimelow&#8217;s website</a> for awsome tutorials. </p>
<p>Today I gonna share with you, my first pixel bender code ever, which is a bright pass filter. This filter set the dark pixels to black according a threshold value for the &#8216;darkness&#8217;.</p>
<p><a href="http://securilabs.free.fr/img/BP.PNG"><img class="alignnone" title="Filter in action" src="http://securilabs.free.fr/img/BP.PNG" alt="" width="585" height="189" /></a></p>
<pre class="brush: cpp;">
&lt;languageVersion : 1.0;&gt;

kernel BrightPassFilter
&lt;   namespace : &quot;com.gun.uieffect.filter&quot;;
    vendor : &quot;Guillaume Nachury. http://proofofconcepts.wordpress.com/&quot;;
    version : 1;
    description : &quot;Set all the dark pixels to black. The dark threshold value can be modified.&quot;;
&gt;
{
    input image4 src;
    output pixel4 dst;

    parameter float thresholdValue;

    void
    evaluatePixel()
    {
        float Mx;
        float mn;
        float l;

        pixel4 p;
        p = sampleNearest(src,outCoord());

        /*-----------------------------------------------------------------------
            Here are some formulas to get the lightness :
        -----------------------------------------------------------------------*/

        /*(1) This one gave the best results so far.*/
         l = (240.0/255.0)*(0.239*p.r+0.686*p.g+0.075*p.b);

        /*(2) Quite the same as above but a bit tweaked
         l = (240.0/255.0)*(0.300*p.r+0.590*p.g+0.110*p.b);
         */

        /*(3) This one requires some steps before getting the lightness
        //Find which component is the highest
        if((p.r &gt; p.g) &amp;&amp; (p.r &gt; p.b)){
        Mx = p.r;
        }
        else if((p.g &gt; p.r) &amp;&amp; (p.g &gt; p.b)){
        Mx = p.g;
        }
        else if((p.b &gt; p.g) &amp;&amp; (p.b &gt; p.r)){
        Mx = p.b;
        }

        //Find which component is the lowest
        if((p.r &lt; p.g) &amp;&amp; (p.r &lt; p.b)){
        mn = p.r;
        }
        else if((p.g &lt; p.r) &amp;&amp; (p.g &lt; p.b)){
        mn = p.g;
        }
        else if((p.b &lt; p.g) &amp;&amp; (p.b &lt; p.r)){
        mn = p.b;
        }    

        l = 0.5*240.0*( (Mx+mn)/255.0),

      */

       /*Formula I found, but not sure of the result
         l = (240.0/255.0)*Mx;
         */

       if(l&lt;thresholdValue){
            p.r = p.b = p.g = 0.0; //black pxl
       } 

        dst = p;

    }
}
</pre>
<p>As usual this is a kind of proof of concept, feel free to share any comment/change.<br />
Stay tuned for the next Pixel Bender code which will reuse this filter.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/proofofconcepts.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/proofofconcepts.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/proofofconcepts.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/proofofconcepts.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/proofofconcepts.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/proofofconcepts.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/proofofconcepts.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/proofofconcepts.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/proofofconcepts.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/proofofconcepts.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/proofofconcepts.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/proofofconcepts.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/proofofconcepts.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/proofofconcepts.wordpress.com/41/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=proofofconcepts.wordpress.com&amp;blog=3854699&amp;post=41&amp;subd=proofofconcepts&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://proofofconcepts.wordpress.com/2008/10/09/pixel-bender-bright-pass-filter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f34be074578b066ceeaf2647b6dcc4fa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Guillaume</media:title>
		</media:content>

		<media:content url="http://securilabs.free.fr/img/BP.PNG" medium="image">
			<media:title type="html">Filter in action</media:title>
		</media:content>
	</item>
		<item>
		<title>Back online</title>
		<link>http://proofofconcepts.wordpress.com/2008/10/09/back-online/</link>
		<comments>http://proofofconcepts.wordpress.com/2008/10/09/back-online/#comments</comments>
		<pubDate>Thu, 09 Oct 2008 06:18:50 +0000</pubDate>
		<dc:creator>Guillaume</dc:creator>
				<category><![CDATA[Bloggin']]></category>

		<guid isPermaLink="false">http://proofofconcepts.wordpress.com/?p=37</guid>
		<description><![CDATA[The last 2 months were just restless for me, except my 3 weeks off where I had the chance to go 1 week in the French Alps, 1 week at the sea and 1 week in Croatia.(This country is beautiful by the way), my &#8216;main tasks&#8217; list was HUGE. Tasks List : Finish my professionnal [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=proofofconcepts.wordpress.com&amp;blog=3854699&amp;post=37&amp;subd=proofofconcepts&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The last 2 months were just restless for me, except my 3 weeks off where I had the chance to go 1 week in the French Alps, 1 week at the sea and 1 week in Croatia.(This country is beautiful by the way), my &#8216;main tasks&#8217; list was HUGE.</p>
<p>Tasks List :</p>
<ul>
<li><span style="text-decoration:line-through;">Finish my professionnal dev.</span> <em>done</em></li>
<li>Writing docs. <em>On progress</em>  <em>(I really hate this part&#8230;)</em></li>
<li><span style="text-decoration:line-through;">Fixing my car.</span> <em>done</em></li>
<li>Posting some CoolUselessHack here. <em>On progress (I have a lot of ideas)</em></li>
<li>Getting back to university every night in order to finish my MSc in Computer science. <em>On progress -_-zzZZz</em></li>
<li>Finding a new job.<em> On progress</em></li>
<li>Playing Warhammer Online. <em>&lt;&lt; grr.. not enough hours in a day (damn small 24h)</em></li>
<li><span style="text-decoration:line-through;">Writing LUA addons for warhammer Online</span>. <em>done (OMG I realize that I spend more time coding addons than playing&#8230;)</em></li>
<li>Playing with pixel bender.<em> On progress</em></li>
<li>Buying <a href="http://www.sheldonshirts.com/Graphic%20Files/greenlantern.jpg">Sheldon&#8217;s green lantern tshirt</a>. You can buy me one <a onclick="return mugicPopWin(this,event);" oncontextmenu="mugicRightClick(this);" href="http://www.teeshirtsrock.com/greenlanternlogot-shirt.aspx">here </a> <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  </li>
<li>&#8230;and alot more</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/proofofconcepts.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/proofofconcepts.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/proofofconcepts.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/proofofconcepts.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/proofofconcepts.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/proofofconcepts.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/proofofconcepts.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/proofofconcepts.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/proofofconcepts.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/proofofconcepts.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/proofofconcepts.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/proofofconcepts.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/proofofconcepts.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/proofofconcepts.wordpress.com/37/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=proofofconcepts.wordpress.com&amp;blog=3854699&amp;post=37&amp;subd=proofofconcepts&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://proofofconcepts.wordpress.com/2008/10/09/back-online/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f34be074578b066ceeaf2647b6dcc4fa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Guillaume</media:title>
		</media:content>
	</item>
		<item>
		<title>Skinning a Flex Slider</title>
		<link>http://proofofconcepts.wordpress.com/2008/07/17/skinning-a-flex-slider/</link>
		<comments>http://proofofconcepts.wordpress.com/2008/07/17/skinning-a-flex-slider/#comments</comments>
		<pubDate>Thu, 17 Jul 2008 03:26:20 +0000</pubDate>
		<dc:creator>Guillaume</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Component]]></category>
		<category><![CDATA[Skin]]></category>
		<category><![CDATA[Slider]]></category>
		<category><![CDATA[UI]]></category>

		<guid isPermaLink="false">http://proofofconcepts.wordpress.com/?p=19</guid>
		<description><![CDATA[[a part II of this post is available here] It&#8217;s been a long long time since my last post but I recently move to my new apartment and it ISP forgot to move my internet access&#8230;It was a bit annoying at the beginning since I could not work on the version of NURVE, but I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=proofofconcepts.wordpress.com&amp;blog=3854699&amp;post=19&amp;subd=proofofconcepts&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>[a part II of this post is available <a href="http://proofofconcepts.wordpress.com/2009/02/06/skinning-flex-hslider-component-part-ii/">here</a>]<br />
It&#8217;s been a long long time since my last post but I recently move to my new apartment and it ISP forgot to move my internet access&#8230;It was a bit annoying at the beginning since I could not work on the version of <a href="http://proofofconcepts.wordpress.com/2008/06/13/nurve-public-alpha-release/" target="_blank">NURVE</a>, but I had a lot of time to explore new Flex features and especially customizing/creating UI components. I had so much fun doing this that I gonna write few posts on it.</p>
<p>The first component I worked on was the Slider (actually HSlider), because I think it&#8217;s the component that can be used in numerous cases and also because most of the time it doesn&#8217;t fit <span style="text-decoration:line-through;">our</span> my UI needs. Sorry to all the <strong>GREAT</strong> developers that worked on Flex UI components but the default Slider is just ugly&#8230;</p>
<p>Fortunately they add a cool feature that allow everyone to  customize the <strong>look</strong> and <strong>feel</strong>. (I think it&#8217;s important to understand that some of the time it may be interesting to change the look but changing the feel is also really important.) I won&#8217;t talk about the styles we can apply via CSS, but instead, how to use the <strong>sliderThumbClass</strong> and the <strong>trackSkin</strong> from the Slider Object.</p>
<p>Before jumping into the code, lets have a look to the result :</p>
<p><a href="http://securilabs.free.fr/dev/myUIComponent.html"><img class="alignnone" src="http://securilabs.free.fr/dev/mySlider.PNG" alt="" width="197" height="205" /></a></p>
<p>As you can see, no more default UI and a &#8216;Tooltip&#8217; more useful. I used this Slider in one of my project where I had to navigate thru archives.</p>
<p>Ok so as I said I used <strong>sliderThumbClass</strong> to modify the ThumbSlider UI and the <strong>trackSkin</strong> in order to change the track of the slider.</p>
<p><strong>The track skin:</strong></p>
<p>This part is really easy, we just have to create a <strong>UIComponent</strong> with the desired shape. So just Create a new Class that extends <strong>UIComponent</strong> and override <strong>updateDisplayList</strong> function with your code that draws the shape you want.</p>
<pre class="brush: java;">
package com.GuN.UI.customUIComponent.slider
{
	import mx.core.UIComponent;

	public class SliderTrack extends UIComponent
	{
			override public function get height():Number{
	            return 20;
	        }

        override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
            super.updateDisplayList(unscaledWidth, unscaledHeight);

            //create 2 circle that will act like round corners
            this.graphics.beginFill(0xFFFFFF,1);
            this.graphics.drawCircle(0,0,5);
            this.graphics.drawCircle(unscaledWidth,0,5);
            this.graphics.endFill();
            //create the line that represents the track
            this.graphics.moveTo(0,0);
            this.graphics.lineStyle(10,0xFFFFFF);
            this.graphics.lineTo(unscaledWidth,0);

        }

	}
}
</pre>
<p>I could use a drawRoundRect() aswell, but I will explain that on an other component customization post.<br />
Ok now the track is now done, let&#8217;s have a look to the Thumb.</p>
<p><strong>The slider Thumb</strong></p>
<p>My Slider have a really simple thumb, it&#8217;s actually just a black circle. Like what we&#8217;ve done for the the track, we&#8217;ll do exactly the same for the Thumb. So create a class extends <strong>SliderThumb</strong> to inherit the behavior of a slider and override the <strong>updateDisplayList</strong> function.</p>
<pre class="brush: java;">
package com.GuN.UI.customUIComponent.slider
{
	import mx.controls.sliderClasses.SliderThumb;

	public class CSpSliderThumb extends SliderThumb
	{

public function CSpSliderThumb()
		{
			super();
}

           override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
            super.updateDisplayList(unscaledWidth,unscaledHeight);
            this.graphics.beginFill(0x000000,1);
            this.graphics.drawCircle(2,-8,4);
           	this.graphics.endFill();
        }
     }
}
</pre>
<p>At this point you have a new slider without any cool effect. You can still continue using the default datatooltip but you can also create your very own datatooltip UI. On my slider I added a Sprite beneath the Thumb to display the data while sliding.</p>
<p>Here is the code for the datatip container :</p>
<pre class="brush: java;">
package com.GuN.UI.customUIComponent.slider.sprites
{
	import flash.display.Sprite;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	import flash.text.TextFormat;

	public class CSpSprite extends Sprite
	{
		var lbl:TextField;
		var bkgColor:uint = 0x000000;
		var bkgAlpha:Number = .5;

		var textColor:uint = 0xFFFFFF;

		public function CSpSprite()
		{
			super();
			lbl = new TextField();
			drawShape();
			drawText();

		}

		private function drawText():void{
			lbl.x = -10;
			lbl.y = 3;
			lbl.autoSize = TextFieldAutoSize.CENTER;
            lbl.background = false;
            lbl.border = false;

            var format:TextFormat = new TextFormat();
            format.font = &quot;Verdana&quot;;
            format.color = textColor;
            format.size = 9;
            format.underline = false;

            lbl.defaultTextFormat = format;
            addChild(lbl);
		}

		private function drawShape():void
		{

			this.graphics.beginFill(bkgColor,bkgAlpha);
			this.graphics.lineTo(35,0);
			this.graphics.lineTo(40,-9);
			this.graphics.lineTo(45,0);
			this.graphics.lineTo(80,0);
			this.graphics.lineTo(80,25);
			this.graphics.lineTo(0,25);
			this.graphics.lineTo(0,0);
			this.graphics.endFill();

			//Create a white border
			this.graphics.lineStyle(1, 0xFFFFFF, 1);
			this.graphics.moveTo(-1,-1);
			this.graphics.lineTo(34,-1);
			this.graphics.lineTo(39,-10);
			this.graphics.lineTo(44,-1);
			this.graphics.lineTo(79,-1);
			this.graphics.lineTo(79,24);
			this.graphics.lineTo(-1,24);
			this.graphics.lineTo(-1,-1);

		}

		public function setValue(v:String):void{
			lbl.text = v;
		}

	}
}
</pre>
<p>We can add our datatipcontainer to the SliderThumbClass we created before</p>
<pre class="brush: java;">
package com.GuN.UI.customUIComponent.slider
{
	import mx.controls.sliderClasses.SliderThumb;

	public class CSpSliderThumb extends SliderThumb
	{

public function CSpSliderThumb()
		{
			super();
			initSprite();
			addChild(spr);

		}

private function initSprite():void{
			spr = new CSpSprite();
			spr.x = -(spr.width/2)+4;
			spr.y = 9;
		}

           override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void{
            super.updateDisplayList(unscaledWidth,unscaledHeight);
            this.graphics.beginFill(0x000000,1);
            this.graphics.drawCircle(2,-8,4);
           	this.graphics.endFill();
        }
     }
}
</pre>
<p>Now that our Slider is almost done, we can create the mxml that will house the custom slider. Like I  said I used this slider to navigate thru archives so used an array of values that contains all the months that had to work with.</p>
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; layout=&quot;absolute&quot; backgroundGradientAlphas=&quot;[1.0, 1.0]&quot; backgroundGradientColors=&quot;[#353535, #353535]&quot;&gt;
	&lt;mx:Script&gt;
		&lt;![CDATA[
			import com.GuN.UI.customUIComponent.slider.SliderTrack;
			import com.GuN.UI.customUIComponent.slider.CSpSliderThumb;

			var arrayValues:Array = [&quot;null&quot;,&quot;January '08&quot;, &quot;February '08&quot;, &quot;March '08&quot;, &quot;April '08&quot;, &quot;May '08&quot;, &quot;June '08&quot;, &quot;July '08&quot;, &quot;August '08&quot;,
										&quot;September '08&quot;, &quot;October '08&quot;, &quot;November '08&quot;, &quot;December '08&quot;];

		]]&gt;
	&lt;/mx:Script&gt;

		&lt;mx:HSlider x=&quot;10&quot; y=&quot;107&quot;
		id=&quot;s&quot;
		showDataTip=&quot;false&quot;
		values=&quot;{arrayValues}&quot;
		creationComplete=&quot;{s.value=1}&quot;
		snapInterval=&quot;1&quot;
		minimum=&quot;1&quot;
		maximum=&quot;{arrayValues.length-1}&quot;
		liveDragging=&quot;true&quot;
		trackSkin=&quot;{SliderTrack}&quot;
		sliderThumbClass=&quot;{CSpSliderThumb}&quot;
		 width=&quot;502&quot;/&gt;

&lt;/mx:Application&gt;
</pre>
<p>For more details you can have look to the sources my work, as usual you can freely reuse/hack my code. <br />
By the way, if you wanna see cool effects check <a href="http://graphics-geek.blogspot.com/" target="_blank">Chet Haase&#8217;s &#8216;Codedependent&#8217; Blog</a> and especially the <a href="http://graphics-geek.blogspot.com/2008/07/spring-is-in-air.html" target="_blank">Spring is in the AIR?</a> post which is really interesting.<br />
<a class="DiggThisButton DiggMedium" href="http://digg.com/submit?url=http%3A%2F%2Fproofofconcepts.wordpress.com%2F2008%2F07%2F17%2Fskinning-a-flex-slider%2F&amp;title=Skinning+a+Flex%26nbsp%3BSlider"></a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/proofofconcepts.wordpress.com/19/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/proofofconcepts.wordpress.com/19/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/proofofconcepts.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/proofofconcepts.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/proofofconcepts.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/proofofconcepts.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/proofofconcepts.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/proofofconcepts.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/proofofconcepts.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/proofofconcepts.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/proofofconcepts.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/proofofconcepts.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/proofofconcepts.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/proofofconcepts.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/proofofconcepts.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/proofofconcepts.wordpress.com/19/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=proofofconcepts.wordpress.com&amp;blog=3854699&amp;post=19&amp;subd=proofofconcepts&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://proofofconcepts.wordpress.com/2008/07/17/skinning-a-flex-slider/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f34be074578b066ceeaf2647b6dcc4fa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Guillaume</media:title>
		</media:content>

		<media:content url="http://securilabs.free.fr/dev/mySlider.PNG" medium="image" />
	</item>
		<item>
		<title>Create HTTPs request with phpWebrequest</title>
		<link>http://proofofconcepts.wordpress.com/2008/06/27/create-https-request-with-phpwebrequest/</link>
		<comments>http://proofofconcepts.wordpress.com/2008/06/27/create-https-request-with-phpwebrequest/#comments</comments>
		<pubDate>Fri, 27 Jun 2008 09:46:20 +0000</pubDate>
		<dc:creator>Guillaume</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Authentication]]></category>
		<category><![CDATA[Basic]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[phpWebRequest]]></category>
		<category><![CDATA[Request]]></category>

		<guid isPermaLink="false">http://proofofconcepts.wordpress.com/?p=17</guid>
		<description><![CDATA[I received several emails about my phpWebRequest php class, asking how we can create HTTPs POST request. Before I answer this I think it&#8217;s important to understant the HTTP authentication mechanism. There are 2 kinds of authentication: Basic and Digest. I gonna describe only Basic since it&#8217;s very is to use in the phpWebRequest class. Basic [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=proofofconcepts.wordpress.com&amp;blog=3854699&amp;post=17&amp;subd=proofofconcepts&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I received several emails about my phpWebRequest php class, asking how we can create HTTPs POST request. Before I answer this I think it&#8217;s important to understant the HTTP authentication mechanism.</p>
<p>There are 2 kinds of authentication: <strong>Basic </strong>and <strong>Digest</strong>. I gonna describe only Basic since it&#8217;s very is to use in the phpWebRequest class.</p>
<p>Basic is the easiest authentication to setup, since it do not provide any encryption during the transmission of the HTTP request.<br />
Here is what happens when you try to reach a secured page (on https://a.server.com/the/secure/page.dll)<br />
<code><br />
Client:<br />
GET /the/secure/page.dll HTTP/1.1<br />
Server:<br />
HTTP/1.1 401 Authorization Required<br />
WWW-Authenticate: Basice realm="Basic Realm"<br />
</code><br />
In the answer we have from the server, we can see that a <strong>Basic </strong>authentication is required. That means in our HTTP header we need to add a field called Authorization that contains the login and password to reach the secured page. In our case the login is <em>myLogin </em>and the password is <em>myPasswrd</em> . The new Authorization field value will be <strong>myLogin:myPasswd</strong> encoded as a base64 string so <em>bXlMb2dpbjpteVBhc3N3ZCA=</em><br />
We can now try to reach the page :<br />
<code><br />
Client:<br />
GET /the/secure/page.dll HTTP/1.1<br />
Authorization: Basic bXlMb2dpbjpteVBhc3N3ZCA=<br />
Server:<br />
HTTP/1.1 200<br />
</code></p>
<p>Here is how to do that with the phpWebRequest class:</p>
<pre class="brush: php;">
&lt;?php
require_once('phpWebRequest.class.php');

$XMLString = '&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;root&gt;&lt;elems&gt;&lt;e1&gt;Element1&lt;/e1&gt;&lt;/elems&gt;&lt;/root&gt;';

$rq = new PhpWebRequest();
$passwd =base64_encode(&quot;myLogin:myPasswd&quot;) ;

$rq-&gt;InitServer(&quot;256.256.256.256&quot;,&quot;/the/secure/page.dll&quot;);

$strSize = $rq-&gt;DataReaderFactory($XMLString);

$rq-&gt;InitRequest(&quot;POST&quot;);

$headerElements = array(&quot;Host&quot; =&gt; &quot;256.256.256.256&quot;,
						&quot;Authorization&quot; =&gt; &quot;Basic &quot;.$passwd,
                        &quot;Connection&quot; =&gt; &quot;Close&quot;,
                        &quot;Content-type&quot; =&gt; &quot;multipart/mixed&quot;,
                        &quot;Content-length&quot; =&gt; $strSize
                        );

$rq-&gt;CfgHeader($headerElements);

if($rq-&gt;SendRequest()){
    echo &quot;Request sent !&quot;;
}
else{
    echo &quot;ERROR&quot;;
}

?&gt;
</pre>
<p>You can also have a look to the <a href="ftp://ftp.isi.edu/in-notes/rfc2617.txt" target="_blank">RFC2617 </a>for more details on Basic and Digest.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/proofofconcepts.wordpress.com/17/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/proofofconcepts.wordpress.com/17/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/proofofconcepts.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/proofofconcepts.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/proofofconcepts.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/proofofconcepts.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/proofofconcepts.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/proofofconcepts.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/proofofconcepts.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/proofofconcepts.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/proofofconcepts.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/proofofconcepts.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/proofofconcepts.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/proofofconcepts.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/proofofconcepts.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/proofofconcepts.wordpress.com/17/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=proofofconcepts.wordpress.com&amp;blog=3854699&amp;post=17&amp;subd=proofofconcepts&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://proofofconcepts.wordpress.com/2008/06/27/create-https-request-with-phpwebrequest/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f34be074578b066ceeaf2647b6dcc4fa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Guillaume</media:title>
		</media:content>
	</item>
		<item>
		<title>Increase the traffic to your website :: Perl hack</title>
		<link>http://proofofconcepts.wordpress.com/2008/06/19/increase-the-traffic-to-your-website-perl-hack/</link>
		<comments>http://proofofconcepts.wordpress.com/2008/06/19/increase-the-traffic-to-your-website-perl-hack/#comments</comments>
		<pubDate>Thu, 19 Jun 2008 10:02:14 +0000</pubDate>
		<dc:creator>Guillaume</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[cloaked connection]]></category>
		<category><![CDATA[IEAutomation]]></category>
		<category><![CDATA[traffic]]></category>

		<guid isPermaLink="false">http://proofofconcepts.wordpress.com/?p=15</guid>
		<description><![CDATA[I was about cleansing my old blog archives, and I discovered a post that I never publish. The post was about a hack used to increase the number of visit of an web page. 2 years ago, friends of mine were playing an online game which consisted in forwarding more people as they can, on a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=proofofconcepts.wordpress.com&amp;blog=3854699&amp;post=15&amp;subd=proofofconcepts&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I was about cleansing my old blog archives, and I discovered a post that I never publish. The post was about a hack used to increase the number of visit of an web page. 2 years ago, friends of mine were playing an online game which consisted in forwarding more people as they can, on a web page. The more people visited you page, the more your popularity increased. And of course the goal was to have the highest popularity.</p>
<p>On of my friend started few weeks after, and was obviously outdistanced by the others. So I wrote him this quick hack that increase the traffic to his page.</p>
<p>Of course the page vistors had to reach had &#8216;protections&#8217;:</p>
<ul>
<li>Only real browser could accessed it</li>
<li>An IP can only access the page once a day.</li>
</ul>
<p>I could use sockets and craft my own HTTP requests, but since I&#8217;m a lazy  developper I used another way to simulate a real Visitor. The solution was to automatically reach the page with Internet Explorer via a proxy that change at each access(I change the IE proxy.pac after every connection ).</p>
<p>I wrote the code in Perl and used IEAutomation API to control IE.</p>
<p>#       ~*~ Cloak me ~*~<br />
# This program will create cloaked connection san URL<br />
# by using anonymous proxy servers all around the world.<br />
# 07-2007<br />
# v0.1<br />
#<br />
#HOW TO<br />
# 1) Just replace MY_URL by the address you wanna reach, and change MY_OUTPUT_FILE by the path to your proxy.pac file<br />
#2) Place your proxy list file in the cloak_me.pl &#8216;s directory.<br />
#3) Change ie&#8217;s settings to use the proxy.pac file<br />
#4) let&#8217;s run the program </p>
<p>use Win32::IEAutomation;<br />
my $ie = Win32::IEAutomation-&gt;new();<br />
$VERSION = &#8220;v0.1&#8243;;</p>
<p>print &#8220;[+] Starting ~*~Cloak me~*~\n&#8221;;<br />
print &#8220;[+] Version : $VERSION\n\n&#8221;;</p>
<p>open(PROXY_LIST, &#8216;proxyList&#8217;)|| die (&#8220;[!] Cannot open proxy list\n&#8221;);<br />
print &#8220;[+] Proxy list loaded\n&#8221;;<br />
$i = 0;</p>
<p>while(){<br />
chomp;<br />
$content_text = &#8220;function FindProxyForURL(url, host){\nif(shExpMatch(url, &#8216;MY_URL&#8217;)){\nreturn &#8216;PROXY &#8220;.$_.&#8221;&#8216;;\n}}&#8221;;<br />
open(OUTFILE, &#8220;&gt;MY_OUTPUT_FILE&#8221;);<br />
print OUTFILE ($content_text);<br />
close(OUTFILE);</p>
<p>print &#8220;[i] Using proxy : $_\n&#8221;;</p>
<p>$ie-&gt;gotoURL(&#8216;MY_URL&#8217;);<br />
$ie-&gt;WaitforDone;<br />
$ie-&gt;closeIE();</p>
<p>$i++;<br />
}</p>
<p>print &#8220;[+] Done \n&#8221;;<br />
print &#8220;[+] Total cloaked access :&#8221;.$i.&#8221;\n&#8221;;</p>
<p>Notice that I do not provide any proxy list, you need to create / find one by yourself.<br />
You can use this code to create cloaked connection to any site.</p>
<p>If you have any question just drop me an email.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/proofofconcepts.wordpress.com/15/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/proofofconcepts.wordpress.com/15/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/proofofconcepts.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/proofofconcepts.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/proofofconcepts.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/proofofconcepts.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/proofofconcepts.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/proofofconcepts.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/proofofconcepts.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/proofofconcepts.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/proofofconcepts.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/proofofconcepts.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/proofofconcepts.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/proofofconcepts.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/proofofconcepts.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/proofofconcepts.wordpress.com/15/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=proofofconcepts.wordpress.com&amp;blog=3854699&amp;post=15&amp;subd=proofofconcepts&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://proofofconcepts.wordpress.com/2008/06/19/increase-the-traffic-to-your-website-perl-hack/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f34be074578b066ceeaf2647b6dcc4fa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Guillaume</media:title>
		</media:content>
	</item>
		<item>
		<title>T-SQL multi OUTPUT when using sp_executesql</title>
		<link>http://proofofconcepts.wordpress.com/2008/06/18/t-sql-multi-output-when-using-sp_executesql/</link>
		<comments>http://proofofconcepts.wordpress.com/2008/06/18/t-sql-multi-output-when-using-sp_executesql/#comments</comments>
		<pubDate>Wed, 18 Jun 2008 09:11:17 +0000</pubDate>
		<dc:creator>Guillaume</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[ETL]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[multi OUTPUT]]></category>
		<category><![CDATA[T-SQL]]></category>

		<guid isPermaLink="false">http://proofofconcepts.wordpress.com/?p=12</guid>
		<description><![CDATA[One of my current professional dev project is to write an ETL from scratch using a lot of technologies. I had to play a lot with T-SQL (Transact-SQL) which was quite interesting to work with. The code I will share today (not about RIA at all) is a cool trick when using sp_executesql. In some case, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=proofofconcepts.wordpress.com&amp;blog=3854699&amp;post=12&amp;subd=proofofconcepts&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>One of my current professional dev project is to write an ETL from scratch using a lot of technologies. I had to play a lot with T-SQL (<a href="http://technet.microsoft.com/en-us/library/ms189826.aspx" target="_blank">Transact-SQL</a>) which was quite interesting to work with.</p>
<p>The code I will share today (not about RIA at all) is a cool trick when using sp_executesql. In some case, when you want to retreive only one record from a db, it could be interesting to have the result (the fields) or a part (some fields) of the result directly as variables instead of using another table to store the result and then re query to retreive the fields you want.</p>
<p>Imagine you have a Table called myContacts that have 6 columns:</p>
<p>id|Field1|Field2|Field3|Field4|Field5       &lt;id as a primary key</p>
<p>And you want to query this table to retreive the record where id=4 and directly set some fields as variables, so you will be able to use them right after in you code.</p>
<p>Here is the trick :</p>
<pre class="brush: sql;">
declare
--The variables that will house the fields
   @myField1   int,
   @myField3   nvarchar(max),
   @myField5   nvarchar(max),

--query variables
   @sql						nvarchar(max),
   @ParamDef					nvarchar(max)

--The query
select @sql = 'select @myField1=Field1, @myField3=Field3, @myField5=Field5 FROM myContacts WHERE id = 4'

--The parameters
select @ParamDef = '@myField1 int OUTPUT, @myField3 nvarchar(max) OUTPUT, @myField5 nvarchar(max) OUTPUT'

--Execute de sql statement
exec sp_executesql @sql, @paramDef, @myField1 OUTPUT, @myField3 OUTPUT, @myField5 OUTPUT

Print 'Field #1 = '+convert(nvarchar,@myField1)+ ' Fields 3 &amp; 5 : '+@myField3+',' +@myField5
</pre>
<p>OUTPUT : Field #1 = 1 Fields 3 &amp; 5 : This is the Content 3, And this is Content 5</p>
<p>That&#8217;s an easy way to initiate variable on fly with from a sp_executesql result.<br />
 </p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/proofofconcepts.wordpress.com/12/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/proofofconcepts.wordpress.com/12/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/proofofconcepts.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/proofofconcepts.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/proofofconcepts.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/proofofconcepts.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/proofofconcepts.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/proofofconcepts.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/proofofconcepts.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/proofofconcepts.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/proofofconcepts.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/proofofconcepts.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/proofofconcepts.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/proofofconcepts.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/proofofconcepts.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/proofofconcepts.wordpress.com/12/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=proofofconcepts.wordpress.com&amp;blog=3854699&amp;post=12&amp;subd=proofofconcepts&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://proofofconcepts.wordpress.com/2008/06/18/t-sql-multi-output-when-using-sp_executesql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f34be074578b066ceeaf2647b6dcc4fa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Guillaume</media:title>
		</media:content>
	</item>
		<item>
		<title>NURVE &#8211; Public alpha release</title>
		<link>http://proofofconcepts.wordpress.com/2008/06/13/nurve-public-alpha-release/</link>
		<comments>http://proofofconcepts.wordpress.com/2008/06/13/nurve-public-alpha-release/#comments</comments>
		<pubDate>Fri, 13 Jun 2008 01:37:28 +0000</pubDate>
		<dc:creator>Guillaume</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[NURVE]]></category>
		<category><![CDATA[Papervision3D]]></category>

		<guid isPermaLink="false">http://proofofconcepts.wordpress.com/?p=10</guid>
		<description><![CDATA[I&#8217;m pretty excited today since I&#8217;m releasing the first public alpha version of a project I&#8217;m working on, based on Adobe AIR/FLEX and Papervision3D , called NURVE. NURVE is 3D, film trailers browser with an iTunes coverflow like navigation experience. NURVE allows you to browse the newest films trailers and watch them in HD quality on any, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=proofofconcepts.wordpress.com&amp;blog=3854699&amp;post=10&amp;subd=proofofconcepts&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m pretty excited today since I&#8217;m releasing the first public alpha version of a project I&#8217;m working on, based on <a href="http://www.adobe.com/products/air/" target="_blank">Adobe AIR/FLEX </a>and <a href="http://code.google.com/p/papervision3d/" target="_blank">Papervision3D </a>, called NURVE.</p>
<p>NURVE is 3D, film trailers browser with an iTunes coverflow like navigation experience. NURVE allows you to browse the newest films trailers and watch them in HD quality on <strong>any,</strong> internet connected, <strong>OS</strong> that have AIR installed</p>
<p>Preview:</p>
<p style="text-align:center;"><a href="http://securilabs.free.fr/wordpress/NURVE/Nurve.png" target="_blank"><img class="aligncenter" src="http://securilabs.free.fr/wordpress/NURVE/NurveThumb.png" alt="" width="320" height="240" /></a></p>
<p> </p>
<p style="text-align:center;"><a href="http://securilabs.free.fr/wordpress/NURVE/Nurve2.png"><img class="aligncenter" style="vertical-align:top;" src="http://securilabs.free.fr/wordpress/NURVE/Nurve2Thumb.png" alt="" width="320" height="240" /></a></p>
<p>As my first shot with both FLEX and Papervision3D and since NURVE is still under development you may find some bugs/glitches or suggestions so please drop me an email or leave a comment here.</p>
<p>=&gt; <a href="http://securilabs.free.fr/nurve/releases/Current/Nurve.air" target="_blank">Download NURVE</a>  (don&#8217;t forget to install <a href="http://get.adobe.com/air/" target="_blank">Adobe AIR  </a>)</p>
<p>Expected in the new release:</p>
<ul>
<li>more 3D animations</li>
<li>film information displayed</li>
<li>some fix </li>
<li>new icons</li>
<li>more films source</li>
</ul>
<p> </p>
<p>Like most of my works, I will release le source code as soon as most of the bugs are fixed;)</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/proofofconcepts.wordpress.com/10/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/proofofconcepts.wordpress.com/10/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/proofofconcepts.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/proofofconcepts.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/proofofconcepts.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/proofofconcepts.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/proofofconcepts.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/proofofconcepts.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/proofofconcepts.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/proofofconcepts.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/proofofconcepts.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/proofofconcepts.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/proofofconcepts.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/proofofconcepts.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/proofofconcepts.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/proofofconcepts.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=proofofconcepts.wordpress.com&amp;blog=3854699&amp;post=10&amp;subd=proofofconcepts&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://proofofconcepts.wordpress.com/2008/06/13/nurve-public-alpha-release/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f34be074578b066ceeaf2647b6dcc4fa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Guillaume</media:title>
		</media:content>

		<media:content url="http://securilabs.free.fr/wordpress/NURVE/NurveThumb.png" medium="image" />

		<media:content url="http://securilabs.free.fr/wordpress/NURVE/Nurve2Thumb.png" medium="image" />
	</item>
		<item>
		<title>How to Create/Read HTTP POST request</title>
		<link>http://proofofconcepts.wordpress.com/2008/06/12/how-to-createread-http-post-request/</link>
		<comments>http://proofofconcepts.wordpress.com/2008/06/12/how-to-createread-http-post-request/#comments</comments>
		<pubDate>Thu, 12 Jun 2008 08:46:15 +0000</pubDate>
		<dc:creator>Guillaume</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[POST]]></category>
		<category><![CDATA[socket]]></category>
		<category><![CDATA[Stream]]></category>
		<category><![CDATA[webRequest]]></category>

		<guid isPermaLink="false">http://proofofconcepts.wordpress.com/?p=8</guid>
		<description><![CDATA[This post is actually a follow-up to my last one called http post streaming where I tried to create a php class that provides a way to send a HTTP POST request. I recoded the class and added new features (e.g. a way to read the body of an HTTP request, a dynamic way of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=proofofconcepts.wordpress.com&amp;blog=3854699&amp;post=8&amp;subd=proofofconcepts&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This post is actually a follow-up to my last one called <a href="http://proofofconcepts.wordpress.com/2008/06/10/http-post-streaming/">http post streaming</a> where I tried to create a php class that provides a way to send a HTTP POST request. I recoded the class and added new features (e.g. a way to read the body of an HTTP request, a dynamic way of setting the headers fields&#8230;etc.).</p>
<p>The body of an HTTP request can be easily read from php by using <strong>php://input</strong> stream. This stream return the raw POST data.</p>
<p>The phpWebRequest class is still under developpment but I post it because it may help some of you. (Of course anytime I add a feature I will update this post)</p>
<p>TO DO:</p>
<ul>
<li>Finish the DataReaderFactory so we can use either read from an url or file to create the body of the request.</li>
<li>Create an HTTPs support</li>
</ul>
<p> </p>
<p><strong>phpWebRequest</strong><br />
 </p>
<pre class="brush: php;">
&lt;?php
/*
PhpWebRequest objects provide methods to send or read HTTP requests
Date: June-08
Author: Guillaume Nachury
Version: 0.1

*/

class PhpWebRequest{
//VERSION
var $version = &quot;0.1&quot;;

//HTTP
var $boundary;
var $method;
var $header;
var $body;
var $protocol;
var $headerElements; 

//SERVER
var $address;
var $path;
var $port;

var $isOverSSL = false;

//FEED
var $xml;

/**
* InitServer()
* $a = server address
* $p = path to the ressource
* $prt = port (by default 80)
*/
function InitServer($a,$p,$prt=80){
$this-&gt;address = $a;
$this-&gt;path = $p;
$this-&gt;port = $prt;
}

/**
* InitRequest()
* $m = the HTTP method you wanna use
* $secured = in case we use HTTPS
* $bounds = a string to create a boundary (unused since v 0.1)
*/
function InitRequest($m, $secured = false, $bounds=&quot;PhpWebRequest&quot;){
$this-&gt;method = $m;
$this-&gt;boundary = md5($bounds);
$this-&gt;isOverSSL = $secured;
if($this-&gt;isOverSSL === false){
$this-&gt;protocol = &quot;HTTP/1.1&quot;;
}
else{
$this-&gt;protocol = &quot;HTTPS&quot;;
}
}

/**
* DataReaderFactory()
* a factory that can read data from either a file, an URL or a String to be used as the content of the request
* $u = the path to the data ( for a file start with file://
* for an URL start with http://
* for string just enter chars)
*/
function DataReaderFactory($u){
//if we wanna read from a file
if(strpos($u,'file://' ) === true){

}
//or from a remote web page
elseif(strpos($u,'http://' ) === true){

}
//a string have been passed
else{
$this-&gt;xml=$u;
return strlen($this-&gt;xml);
}
}

/**
* CfgHeader()
* Create the HTTP header fields
* $attributesArray = an array of headers that MUST have keys
* keys = field name
* value = field calue
*/
function CfgHeader($attributesArray){
while(list($k,$v) = each($attributesArray)){
$this-&gt;headerElements .= $k.&quot;: &quot;.$v.&quot;\n&quot;;
}
}

/**
* CraftRequest()
* Create a HTTP request
*/
function CraftRequest(){
$this-&gt;header = $this-&gt;method.&quot; &quot;.$this-&gt;path.&quot; &quot;.$this-&gt;protocol. &quot;\n&quot;.$this-&gt;headerElements.&quot;\n&quot;;
$this-&gt;body = $this-&gt;xml.&quot;\n&quot;;
}

/**
* SendRequest()
* Send the request, return true if successfully sent
*/
function SendRequest(){
$this-&gt;CraftRequest();
$request = $this-&gt;header.$this-&gt;body;

$fs = fsockopen($this-&gt;address,$this-&gt;port);
if(!$fs){
return false;
}
else{
fputs($fs,$request);
fflush($fs);
fclose($fs);
return true;
}

}

/**
* readHTTPRequest()
* return the HTTP request BODY
*/
function readHTTPRequest(){
return @file_get_contents('php://input');
}

}
?&gt;
</pre>
<p><strong>Usage :</strong></p>
<pre class="brush: php;">
&lt;?php
require_once('phpWebRequest.class.php');

$rq = new PhpWebRequest();
$rq-&gt;InitServer(&quot;127.0.0.1&quot;,&quot;/aPath/test.php&quot;);
$strSize = $rq-&gt;DataReaderFactory(&quot;the body of the request&quot;);
$rq-&gt;InitRequest(&quot;POST&quot;);

//header fields
$headerElements = array(&quot;Host&quot; =&gt; &quot;127.0.0.1&quot;,
&quot;Connection&quot; =&gt; &quot;Close&quot;,
&quot;Content-type&quot; =&gt; &quot;multipart/mixed&quot;,
&quot;Content-length&quot; =&gt; $strSize
);
//load the headers
$rq-&gt;CfgHeader($headerElements);

//send it
if($rq-&gt;SendRequest()){
echo &quot;Request sent !&quot;;
}
else{
echo &quot;ERROR&quot;;
}

?&gt;
</pre>
<p>If you have any question feel free to send me an email.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/proofofconcepts.wordpress.com/8/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/proofofconcepts.wordpress.com/8/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/proofofconcepts.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/proofofconcepts.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/proofofconcepts.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/proofofconcepts.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/proofofconcepts.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/proofofconcepts.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/proofofconcepts.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/proofofconcepts.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/proofofconcepts.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/proofofconcepts.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/proofofconcepts.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/proofofconcepts.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/proofofconcepts.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/proofofconcepts.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=proofofconcepts.wordpress.com&amp;blog=3854699&amp;post=8&amp;subd=proofofconcepts&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://proofofconcepts.wordpress.com/2008/06/12/how-to-createread-http-post-request/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f34be074578b066ceeaf2647b6dcc4fa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Guillaume</media:title>
		</media:content>
	</item>
	</channel>
</rss>
