<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments for felipeNascimento.org(true);</title>
	<atom:link href="http://felipenascimento.org/en/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://felipenascimento.org</link>
	<description>Making the web a better place to live</description>
	<lastBuildDate>Mon, 26 Jul 2010 19:45:50 -0300</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on Removing an item from an Array in Javascript by Jeferson</title>
		<link>http://felipenascimento.org/en/removing-an-item-from-an-array-in-javascript/comment-page-1/#comment-220</link>
		<dc:creator>Jeferson</dc:creator>
		<pubDate>Mon, 26 Jul 2010 19:45:50 +0000</pubDate>
		<guid isPermaLink="false">http://felipenascimento.org/?p=168#comment-220</guid>
		<description>Thanks!</description>
		<content:encoded><![CDATA[<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Starting with Canvas in javascript by don don</title>
		<link>http://felipenascimento.org/en/starting-with-canvas-in-javascript/comment-page-1/#comment-211</link>
		<dc:creator>don don</dc:creator>
		<pubDate>Mon, 28 Jun 2010 18:08:47 +0000</pubDate>
		<guid isPermaLink="false">http://felipenascimento.org/?p=266#comment-211</guid>
		<description>Yes, it helps.  In the meantime, I found the following code cleaner and it works well.

 function loadCanvas() {
 // first of all, we simply get the canvas element itself
 var canvas= document.getElementById(&#039;theCanvasElement&#039;);
 var ctx= canvas.getContext(&#039;2d&#039;);
	 
	canvas.width= 480;
	canvas.height= 340;

	var img= new Image();
	img.onload = function(){
    canvas.width = img.width;
    canvas.height = img.height;
    ctx.drawImage(img, 0, 0, img.width, img.height);
	}

	img.src = &#039;someImage.png&#039;;
}

Now, I have another complex question for you.  I come across some library for canvas and it works well as a simple HTML script to draw within a canvas but now when I attempted to incorporate it into a more meaningful setting (as an element of a form) it messed up the coordinates, that is, pointing to X and Y but it would start to draw at another location.  May I send the two scripts for you to take a look?  Many thanks.</description>
		<content:encoded><![CDATA[<p>Yes, it helps.  In the meantime, I found the following code cleaner and it works well.</p>
<p> function loadCanvas() {<br />
 // first of all, we simply get the canvas element itself<br />
 var canvas= document.getElementById(&#8217;theCanvasElement&#8217;);<br />
 var ctx= canvas.getContext(&#8217;2d&#8217;);</p>
<p>	canvas.width= 480;<br />
	canvas.height= 340;</p>
<p>	var img= new Image();<br />
	img.onload = function(){<br />
    canvas.width = img.width;<br />
    canvas.height = img.height;<br />
    ctx.drawImage(img, 0, 0, img.width, img.height);<br />
	}</p>
<p>	img.src = &#8217;someImage.png&#8217;;<br />
}</p>
<p>Now, I have another complex question for you.  I come across some library for canvas and it works well as a simple HTML script to draw within a canvas but now when I attempted to incorporate it into a more meaningful setting (as an element of a form) it messed up the coordinates, that is, pointing to X and Y but it would start to draw at another location.  May I send the two scripts for you to take a look?  Many thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Starting with Canvas in javascript by Felipe Nascimento</title>
		<link>http://felipenascimento.org/en/starting-with-canvas-in-javascript/comment-page-1/#comment-209</link>
		<dc:creator>Felipe Nascimento</dc:creator>
		<pubDate>Mon, 28 Jun 2010 02:40:28 +0000</pubDate>
		<guid isPermaLink="false">http://felipenascimento.org/?p=266#comment-209</guid>
		<description>Hi.
Well, let&#039;s see your code:

you can use this line, instead of adding the onload to the body element
// window.addEventListener(&#039;load&#039;, loadCanvas, false);


 function loadCanvas() {
  canvas= document.getElementById(&#039;theCanvasElement&#039;);
   ctx= canvas.getContext(&#039;2d&#039;);

       canvas.width= 480;
       canvas.height= 340;

// until here, it was ok. But there, you don&#039;t need to use these two lines yet.
//       var img= new Image();
//       img.src= &#039;kn_head-aligned_small.png&#039;;

       var img= new Image();

       img.addEventListener(&#039;load&#039;, function(){
           // here, is when the image is dran
           ctx.drawImage(this);

       }, false); // here, it was missing the third argument &quot;false&quot;

// this line will trigger the load listener to the iamge when it loads.
       img.src= &#039;kn_head-aligned_small.png&#039;;


// here, it is not going to work because the &quot;this&quot; is not the image,
//&quot;this&quot; will be the image only inside that listener, you set before
//       ctx.drawImage(this, 30, 30);
// to apply the 30,30 to the image, set it inside the image load listener, where the image is drawn
       }

I hope it helps you :)</description>
		<content:encoded><![CDATA[<p>Hi.<br />
Well, let&#8217;s see your code:</p>
<p>you can use this line, instead of adding the onload to the body element<br />
// window.addEventListener(&#8217;load&#8217;, loadCanvas, false);</p>
<p> function loadCanvas() {<br />
  canvas= document.getElementById(&#8217;theCanvasElement&#8217;);<br />
   ctx= canvas.getContext(&#8217;2d&#8217;);</p>
<p>       canvas.width= 480;<br />
       canvas.height= 340;</p>
<p>// until here, it was ok. But there, you don&#8217;t need to use these two lines yet.<br />
//       var img= new Image();<br />
//       img.src= &#8216;kn_head-aligned_small.png&#8217;;</p>
<p>       var img= new Image();</p>
<p>       img.addEventListener(&#8217;load&#8217;, function(){<br />
           // here, is when the image is dran<br />
           ctx.drawImage(this);</p>
<p>       }, false); // here, it was missing the third argument &#8220;false&#8221;</p>
<p>// this line will trigger the load listener to the iamge when it loads.<br />
       img.src= &#8216;kn_head-aligned_small.png&#8217;;</p>
<p>// here, it is not going to work because the &#8220;this&#8221; is not the image,<br />
//&#8221;this&#8221; will be the image only inside that listener, you set before<br />
//       ctx.drawImage(this, 30, 30);<br />
// to apply the 30,30 to the image, set it inside the image load listener, where the image is drawn<br />
       }</p>
<p>I hope it helps you <img src='http://felipenascimento.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Starting with Canvas in javascript by don don</title>
		<link>http://felipenascimento.org/en/starting-with-canvas-in-javascript/comment-page-1/#comment-208</link>
		<dc:creator>don don</dc:creator>
		<pubDate>Sun, 27 Jun 2010 14:16:44 +0000</pubDate>
		<guid isPermaLink="false">http://felipenascimento.org/?p=266#comment-208</guid>
		<description>shoot, sorry...
what&#039;s inside the body
 &lt;canvas id=&quot;theCanvasElement&quot;&gt;&lt;/canvas&gt;</description>
		<content:encoded><![CDATA[<p>shoot, sorry&#8230;<br />
what&#8217;s inside the body<br />
 &lt;canvas id=&#8221;theCanvasElement&#8221;&gt;&lt;/canvas&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Starting with Canvas in javascript by don don</title>
		<link>http://felipenascimento.org/en/starting-with-canvas-in-javascript/comment-page-1/#comment-207</link>
		<dc:creator>don don</dc:creator>
		<pubDate>Sun, 27 Jun 2010 14:15:51 +0000</pubDate>
		<guid isPermaLink="false">http://felipenascimento.org/?p=266#comment-207</guid>
		<description>The HTML body part looks like:

&lt;body onload=&quot;loadCanvas();&quot;&gt;
    
&lt;/body&gt;</description>
		<content:encoded><![CDATA[<p>The HTML body part looks like:</p>
<p>&lt;body onload=&#8221;loadCanvas();&#8221;&gt;</p>
<p>&lt;/body&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Starting with Canvas in javascript by don don</title>
		<link>http://felipenascimento.org/en/starting-with-canvas-in-javascript/comment-page-1/#comment-206</link>
		<dc:creator>don don</dc:creator>
		<pubDate>Sun, 27 Jun 2010 14:14:00 +0000</pubDate>
		<guid isPermaLink="false">http://felipenascimento.org/?p=266#comment-206</guid>
		<description>Hi, I&#039;m new to Canvas, tried to piggyback your sample code, what I&#039;d like to do is to load an existing png to canvas.  Here&#039;s my code, it&#039;s not working, err msg: &quot;uncaught exception: [Exception... &quot;Not enough arguments&quot; nsresult: &quot;0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)&quot; location: &quot;JS frame :: http://127.0.0.1:8600/loadimg2canvas.html :: loadCanvas :: line 23&quot; data: no]&quot;
from firebug under Firefox v3.6.4.  Could it because the png is not 2d?  
Thanks in advance.





// document.addEventListener(&#039;load&#039;, canvasHandler, false);

 function loadCanvas() {
 // first of all, we simply get the canvas element itself
 canvas= document.getElementById(&#039;theCanvasElement&#039;);
 // now, we need to have the CONTEXT to work with
    ctx= canvas.getContext(&#039;2d&#039;);
	 
	canvas.width= 480;
	canvas.height= 340;

	var img= new Image();
	img.src= &#039;kn_head-aligned_small.png&#039;;

	// instantiate an image
	var img= new Image();
	// we need to use the image when it has finished to load
	img.addEventListener(&#039;load&#039;, function(){
	    // after downloading the image, we can draw it into the canvas
	    ctx.drawImage(this);
	    // where this= the image just downloaded
	});	
	// then, we say the image&#039;s url, to it start loading
	img.src= &#039;kn_head-aligned_small.png&#039;;

	// draws the image in the position left=30, top=30
	ctx.drawImage(this, 30, 30);
	// draws the image in the 0/0 position, changing its size
	// ctx.drawImage(this, 0, 0, 45, 75);
	// more complex, draws the image croping it
	}

	// document.addEventListener(&#039;load&#039;, canvasHandler, false);
 




    

</description>
		<content:encoded><![CDATA[<p>Hi, I&#8217;m new to Canvas, tried to piggyback your sample code, what I&#8217;d like to do is to load an existing png to canvas.  Here&#8217;s my code, it&#8217;s not working, err msg: &#8220;uncaught exception: [Exception... "Not enough arguments" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame :: <a href="http://127.0.0.1:8600/loadimg2canvas.html" rel="nofollow">http://127.0.0.1:8600/loadimg2canvas.html</a> :: loadCanvas :: line 23" data: no]&#8221;<br />
from firebug under Firefox v3.6.4.  Could it because the png is not 2d?<br />
Thanks in advance.</p>
<p>// document.addEventListener(&#8217;load&#8217;, canvasHandler, false);</p>
<p> function loadCanvas() {<br />
 // first of all, we simply get the canvas element itself<br />
 canvas= document.getElementById(&#8217;theCanvasElement&#8217;);<br />
 // now, we need to have the CONTEXT to work with<br />
    ctx= canvas.getContext(&#8217;2d&#8217;);</p>
<p>	canvas.width= 480;<br />
	canvas.height= 340;</p>
<p>	var img= new Image();<br />
	img.src= &#8216;kn_head-aligned_small.png&#8217;;</p>
<p>	// instantiate an image<br />
	var img= new Image();<br />
	// we need to use the image when it has finished to load<br />
	img.addEventListener(&#8217;load&#8217;, function(){<br />
	    // after downloading the image, we can draw it into the canvas<br />
	    ctx.drawImage(this);<br />
	    // where this= the image just downloaded<br />
	});<br />
	// then, we say the image&#8217;s url, to it start loading<br />
	img.src= &#8216;kn_head-aligned_small.png&#8217;;</p>
<p>	// draws the image in the position left=30, top=30<br />
	ctx.drawImage(this, 30, 30);<br />
	// draws the image in the 0/0 position, changing its size<br />
	// ctx.drawImage(this, 0, 0, 45, 75);<br />
	// more complex, draws the image croping it<br />
	}</p>
<p>	// document.addEventListener(&#8217;load&#8217;, canvasHandler, false);</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on PHPDevBar  has  grown by Felipe Nascimento</title>
		<link>http://felipenascimento.org/en/phpdevbar-has-grown/comment-page-1/#comment-199</link>
		<dc:creator>Felipe Nascimento</dc:creator>
		<pubDate>Fri, 18 Jun 2010 04:34:59 +0000</pubDate>
		<guid isPermaLink="false">http://felipenascimento.org/?p=264#comment-199</guid>
		<description>Olá Justino.
Seguinte, pra se construir um addon pro firefox (nele, uma barra é um addon) é preciso manjar de javascript, css e XUL(que é muito parecida com XML) com bons conhecimentos em DOM.
A documentação para isto encontra-se em https://addons.mozilla.org/pt-BR/developers
Mas já aviso que a documentação ainda não está completa, então algumas coisas tu vais ter que testar para ir descobrindo e aprendendo conforme a necessidade. Todavia, lá é o local onde há a maior concentração de informações sobre o assunto. O JetPack é algo interessante para se dar uma olhada também. Ajuda a desenvolver addons de forma muito mais fácil, em especial para quem já esta acostumado com as tecnologias mais comuns utilizadas para o desenvolvimento web.</description>
		<content:encoded><![CDATA[<p>Olá Justino.<br />
Seguinte, pra se construir um addon pro firefox (nele, uma barra é um addon) é preciso manjar de javascript, css e XUL(que é muito parecida com XML) com bons conhecimentos em DOM.<br />
A documentação para isto encontra-se em <a href="https://addons.mozilla.org/pt-BR/developers" rel="nofollow">https://addons.mozilla.org/pt-BR/developers</a><br />
Mas já aviso que a documentação ainda não está completa, então algumas coisas tu vais ter que testar para ir descobrindo e aprendendo conforme a necessidade. Todavia, lá é o local onde há a maior concentração de informações sobre o assunto. O JetPack é algo interessante para se dar uma olhada também. Ajuda a desenvolver addons de forma muito mais fácil, em especial para quem já esta acostumado com as tecnologias mais comuns utilizadas para o desenvolvimento web.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on PHPDevBar  has  grown by Justino Porto</title>
		<link>http://felipenascimento.org/en/phpdevbar-has-grown/comment-page-1/#comment-198</link>
		<dc:creator>Justino Porto</dc:creator>
		<pubDate>Fri, 18 Jun 2010 03:23:41 +0000</pubDate>
		<guid isPermaLink="false">http://felipenascimento.org/?p=264#comment-198</guid>
		<description>Boa noite!
Primeiramente meus parabéns pela ideia da PHP DevBar, achei ótima.
Mas estou aqui mais para te pedir um direcionamento, me deu na cabeça hoje de pesquisar, sobre como posso fazer uma barra de ferramentas, e nas minhas pesquisas acabei esbarando na sua ferramenta, achei o máximo.
Tem como me indicar o que eu tenho que estudar, em que eu desenvolvo e onde posso procurar materiais sobre como desenvolver barras assim?
Mas desde já agradeço!</description>
		<content:encoded><![CDATA[<p>Boa noite!<br />
Primeiramente meus parabéns pela ideia da PHP DevBar, achei ótima.<br />
Mas estou aqui mais para te pedir um direcionamento, me deu na cabeça hoje de pesquisar, sobre como posso fazer uma barra de ferramentas, e nas minhas pesquisas acabei esbarando na sua ferramenta, achei o máximo.<br />
Tem como me indicar o que eu tenho que estudar, em que eu desenvolvo e onde posso procurar materiais sobre como desenvolver barras assim?<br />
Mas desde já agradeço!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on PHPDevBar reaches 5 thousands downloads by krishna</title>
		<link>http://felipenascimento.org/en/phpdevbar-reaches-5-thousands-downloads/comment-page-1/#comment-174</link>
		<dc:creator>krishna</dc:creator>
		<pubDate>Mon, 08 Mar 2010 07:10:26 +0000</pubDate>
		<guid isPermaLink="false">http://felipenascimento.org/?p=237#comment-174</guid>
		<description>Great tool. Keep it up...</description>
		<content:encoded><![CDATA[<p>Great tool. Keep it up&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Removing an item from an Array in Javascript by Felipe Nascimento</title>
		<link>http://felipenascimento.org/en/removing-an-item-from-an-array-in-javascript/comment-page-1/#comment-153</link>
		<dc:creator>Felipe Nascimento</dc:creator>
		<pubDate>Tue, 22 Dec 2009 14:13:06 +0000</pubDate>
		<guid isPermaLink="false">http://felipenascimento.org/?p=168#comment-153</guid>
		<description>thanks for the comment.
Yes, I remember that discussion at js-bra.
I did some tests and verified my function 73 milesseconds slower than yours, when compared with 50 thousand loops.
It&#039;s a real little point to deal with, and caching the regular expression, this difference would become even smaller...although... would still be there.
I had even forgoten this post... had not had much time to keep my page up to date... but thanks for the contact... I&#039;ll update it as soon as possible.
About the &quot;;&quot; character, yes, that a point too, because that&#039;s an identifier... technically, we should not use &quot;;&quot; in IDs, of elements... and that was the point of this example... anyways, it&#039;s still an option...I think it&#039;s interesting to show that, there are options... options which should be tested and compared to other, as you&#039;ve done.

Cheers.</description>
		<content:encoded><![CDATA[<p>thanks for the comment.<br />
Yes, I remember that discussion at js-bra.<br />
I did some tests and verified my function 73 milesseconds slower than yours, when compared with 50 thousand loops.<br />
It&#8217;s a real little point to deal with, and caching the regular expression, this difference would become even smaller&#8230;although&#8230; would still be there.<br />
I had even forgoten this post&#8230; had not had much time to keep my page up to date&#8230; but thanks for the contact&#8230; I&#8217;ll update it as soon as possible.<br />
About the &#8220;;&#8221; character, yes, that a point too, because that&#8217;s an identifier&#8230; technically, we should not use &#8220;;&#8221; in IDs, of elements&#8230; and that was the point of this example&#8230; anyways, it&#8217;s still an option&#8230;I think it&#8217;s interesting to show that, there are options&#8230; options which should be tested and compared to other, as you&#8217;ve done.</p>
<p>Cheers.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
