<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<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/"
	>

<channel>
	<title>wrapper &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/wrapper/</link>
	<description>Feed of posts on WordPress.com tagged "wrapper"</description>
	<pubDate>Wed, 02 Dec 2009 16:30:56 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[Cigar Review - Arturo Fuente King 'T']]></title>
<link>http://wrapperbinderfiller.wordpress.com/2009/12/01/cigar-review-arturo-fuente-king-t/</link>
<pubDate>Tue, 01 Dec 2009 10:54:56 +0000</pubDate>
<dc:creator>W. B. Filler</dc:creator>
<guid>http://wrapperbinderfiller.wordpress.com/2009/12/01/cigar-review-arturo-fuente-king-t/</guid>
<description><![CDATA[Arturo Fuente King &quot;T&quot; Cigar: Arturo Fuente King &#8216;T&#8217; Size: Tubo (Churchill, 7]]></description>
<content:encoded><![CDATA[Arturo Fuente King &quot;T&quot; Cigar: Arturo Fuente King &#8216;T&#8217; Size: Tubo (Churchill, 7]]></content:encoded>
</item>
<item>
<title><![CDATA[Pyramids of Giza vs. The Burrito (The Downside of Having a Creepy Embalmed Dude Inside You, Part 1)]]></title>
<link>http://miguelmitchell.wordpress.com/2009/11/18/pyramids-of-giza-vs-the-burrito-the-downside-of-having-a-creepy-embalmed-dude-inside-you/</link>
<pubDate>Wed, 18 Nov 2009 18:52:40 +0000</pubDate>
<dc:creator>miguelmitchell</dc:creator>
<guid>http://miguelmitchell.wordpress.com/2009/11/18/pyramids-of-giza-vs-the-burrito-the-downside-of-having-a-creepy-embalmed-dude-inside-you/</guid>
<description><![CDATA[Time for a showdown.  In one corner we have the Pyramids of Giza&#8230;those ancient structures that]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Time for a showdown.  In one corner we have the Pyramids of Giza&#8230;those ancient structures that have amazed, inspired, and enflamed the curiosity of millions throughout the centuries.  In the other corner is the burrito&#8230;that delicious meal of meat, bean, cheese (and various other tasty condiments) snuggled in a delicious encasement of tortilla.  One may think the Pyramid to be the favorite in such a showdown &#8211; a collosal monument, the last surviving Ancient Wonder of the World, the Titan of Tetrahedrons versus a glorified snack wrap?  Let&#8217;s watch the fight as it unfolds:</p>
<h2><!--more-->Round 1: Portability</h2>
<p><a href="http://miguelmitchell.wordpress.com/files/2009/11/back-pocket-burrito.jpg"><img class="size-medium wp-image-44 alignleft" title="Back Pocket Burrito" src="http://miguelmitchell.wordpress.com/files/2009/11/back-pocket-burrito.jpg?w=240" alt="" width="191" height="235" /></a>Burrito is clearly the winner of this round.  While I am physically able to carry a number of concealed burritos on my person if I see fit (and I do), I don&#8217;t think I&#8217;ll be carrying a pyramid around anytime soon.  The burrito is testament to the very essence of portability.  Yes the picture seen here is an approximation of what it would look like if I decided to keep a burrito in the back pocket of my (apparently bedazzled) jeans.</p>
<h2> </h2>
<h2> </h2>
<h2> </h2>
<h2> </h2>
<h2> </h2>
<h2> </h2>
<h2>Round 2: Halloween Costume Possibility</h2>
<p><a href="http://miguelmitchell.wordpress.com/files/2009/11/pyramid-costume.jpg"><img class="alignright size-medium wp-image-48" title="pyramid costume" src="http://miguelmitchell.wordpress.com/files/2009/11/pyramid-costume.jpg?w=300" alt="" width="300" height="215" /></a>Round two ends up as a tie.  At first it seems as though burrito would take this round as well, until I saw this picture online.  While a burrito costume allows  you to make such amazing jokes as &#8220;Would you care to taste my spicy filling?&#8221; and &#8220;Dude, check out my costume &#8211; I&#8217;m a FUCKING BURRITO!&#8221;, the Pyramid costume allows you to bump into people ALL NIGHT, chalking your clumsiness up to the fact that you&#8217;re dressed as a large tetrahedron. SIDE NOTE: I&#8217;m not an expert but I&#8217;m pretty sure his use of MASSIVE AMOUNTS of masking tape is historically accurate.</p>
<h2> </h2>
<h2> </h2>
<h2> </h2>
<h2>Round 3: Visible From Space</h2>
<p>A knockout round for the Pyramids &#8211; while not visible from the moon as some had previously speculated, they are <a href="http://space.about.com/od/fungamesandhumor/ss/Great_Wall_3.htm">visible in orbit </a>which is pretty badass.  I mean, an extra-terrestrial whizzing by our planet wouldn&#8217;t think twice about burritos, but they might notice the Pyramids, and realize that there is intelligent life on our planet.   Even if the aliens then stopped by and ate some burritos (declaring them delicious, of course, in a series of clicks or otherwise alieny noises), they would have the Pyramids to thank for the resulting taste explosion.</p>
<h2> </h2>
<h2>Round 4: Creepy Embalmed Guy Stored Inside</h2>
<p><a href="http://miguelmitchell.wordpress.com/files/2009/11/the-chipotle-burrito.jpg"><img class="alignleft size-medium wp-image-53" title="the-chipotle-burrito" src="http://miguelmitchell.wordpress.com/files/2009/11/the-chipotle-burrito.jpg?w=300" alt="" width="300" height="118" /></a>OH MY GOD burrito wins.   One of the best things about burritos, in fact, is that they are refreshingly devoid of DEAD DUDES.  It may even be a good marketing idea to include that fact on EVERY BURRITO WRAPPER.</p>
<h2> </h2>
<h2> </h2>
<h2> </h2>
<h2>Round 5: Geometric Symmetry/Structural Integrity</h2>
<p>Round five goes to the Pyramids.  It&#8217;s a no brainer &#8211; while the burrito is roughly cylindrical and unable to withstand any sort of rough or rapid movement without falling to pieces, the Pyramids are sublime exaltations to the tetrahedron, and have withstood millenia of abuse.</p>
<h2>Round 6: Constructed by Slaves</h2>
<p>It&#8217;s a well known fact that the Pyramids were constructed by slaves who were required to pull, lug, sweat and otherwise toil to the death under threat of whip.  Apparently, however, <a href="http://thepumphandle.wordpress.com/2008/07/03/chipotles-food-with-integrity-ignores-tomato-pickers/">Chipotle isn&#8217;t too far off with the way they treat their tomato pickers</a>, with the result being another tied round.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Java e sua escolha de métodos em sobrecarga]]></title>
<link>http://raphaelrodrigues.wordpress.com/2009/11/17/java-e-sua-escolha-de-metodos/</link>
<pubDate>Tue, 17 Nov 2009 14:09:55 +0000</pubDate>
<dc:creator>raphaelrodrigues</dc:creator>
<guid>http://raphaelrodrigues.wordpress.com/2009/11/17/java-e-sua-escolha-de-metodos/</guid>
<description><![CDATA[No post anterior falei um pouco de varargs, e como java escolhe quando tem dois ou mais métodos poss]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>No post anterior falei um pouco de varargs, e como java escolhe quando tem dois ou mais métodos possíveis de se encaixar , sendo um deles varargs. O segredo foi que varargs sempre será escolhido por último.</p>
<p>Hoje, continuando a falar de escolha de métodos, tenho um novo problema. Digamos que vc tenha o seguinte código, já adianto que ele compila e roda.</p>
<div id="_mcePaste">static void method1(int a){  System.out.println(&#8220;int&#8221;); }</div>
<div id="_mcePaste">static void method1(long a){  System.out.println(&#8220;long&#8221;); }</div>
<div id="_mcePaste">static void method1(double a){  System.out.println(&#8220;double&#8221;); }</div>
<div id="_mcePaste">public static void main(String[] args) {</div>
<div id="_mcePaste">byte x = 1;</div>
<div id="_mcePaste">short y = 2;</div>
<div id="_mcePaste">int z = 3;</div>
<div id="_mcePaste">float f = 4f;</div>
<div id="_mcePaste"><em>method1</em>(x);</div>
<div id="_mcePaste"><em>method1</em>(y);</div>
<div id="_mcePaste"><em>method1</em>(z);</div>
<div id="_mcePaste"><em>method1</em>(f);</div>
<div id="_mcePaste">}</div>
<div>Saída será:</div>
<div>
<div>int</div>
<div>int</div>
<div>int</div>
<div>double</div>
</div>
<div>
<div>O que aconteceu foi que as variáveis do tipo byte e short foram ampliadas para o método recebendo int. E a variável com float, foi ampliada para o método recebendo double. Primeiro ensinamento então foi sobre <strong>ampliação</strong>.</div>
<div>Agora abrir um parêntese rápido. Olha o seguinte exemplo parecido:</div>
<div>
<div><span style="white-space:pre;"> </span>static void method1(Integer a){  System.out.println(&#8220;int&#8221;); }</div>
<div><span style="white-space:pre;"> </span>static void method1(Long a){  System.out.println(&#8220;long&#8221;); }</div>
<div><span style="white-space:pre;"> </span>static void method1(Double a){  System.out.println(&#8220;double&#8221;); }</div>
<div><span style="white-space:pre;"> </span>public static void main(String[] args) {</div>
<div><span style="white-space:pre;"> </span> byte x = 1;</div>
<div><span style="white-space:pre;"> </span> short y = 2;</div>
<div><span style="white-space:pre;"> </span> int z = 3;</div>
<div><span style="white-space:pre;"> </span> float f = 4f;</div>
<div><span style="white-space:pre;"> </span> method1(x); //erro de compilação</div>
<div><span style="white-space:pre;"> </span> method1(y); //erro de compilação</div>
<div><span style="white-space:pre;"> </span> method1(z);</div>
<div><span style="white-space:pre;"> </span> method1(f); //erro de compilação</div>
<div><span style="white-space:pre;"> </span>}</div>
</div>
<div>Os erros de compilação acontecem porque java não faz <strong>Ampliação</strong> e <strong>Autobox </strong>juntos.</div>
<div>Seguindo sobre prioridade em métodos. Digamos que temos dois métodos, um que temos um primitivo e outro seu wrapper correspondente. Qual a jvm escolherá? Ampliação ou Boxing?</div>
<div>
<div><span style="white-space:pre;"> </span>static void method1(long a){  System.out.println(&#8220;long&#8221;); }</div>
<div><span style="white-space:pre;"> </span>static void method1(Integer a){  System.out.println(&#8220;Integer&#8221;); }</div>
<div><span style="white-space:pre;"> </span>public static void main(String[] args) {</div>
<div><span style="white-space:pre;"> </span> int x = 1;</div>
<div><span style="white-space:pre;"> </span> <em>method1</em>(x);</div>
<div><span style="white-space:pre;"> </span>}</div>
</div>
<div>Saída será: &#8220;long&#8221;</div>
<div>Temos o segundo ensinamento. Entre Ampliação e Boxing, a jvm escolherá <strong>Ampliação</strong>.</div>
<div></div>
<div>Agora por último. E entre ampliação e vargs?</div>
<div></div>
<div>
<div><span style="white-space:pre;"> </span>static void method1(long a){  System.out.println(&#8220;long&#8221;); }</div>
<div><span style="white-space:pre;"> </span>static void method1(byte&#8230; a){  System.out.println(&#8220;byte&#8230;&#8221;); }</div>
<div><span style="white-space:pre;"> </span>public static void main(String[] args) {</div>
<div><span style="white-space:pre;"> </span> byte x = 1;</div>
<div><span style="white-space:pre;"> </span> <em>method1</em>(x);</div>
<div><span style="white-space:pre;"> </span>}</div>
<div></div>
</div>
<div>Saída será: &#8220;long&#8221; . De novo?hehe</div>
<div></div>
<div>Logo temos uma seqüência de prioridades:<strong> Ampliação &#62; Autobox &#62; Varargs</strong></div>
<div></div>
<div>Regrinhas para decorar:</div>
<div></div>
<div>
<ul>
<li>se tratando de primitivos o método escolhido será o  de menor argumento possível</li>
<li>não pode ampliar de um wrapper para outro</li>
<li>não pode ampliar e depois boxing (Um int não pode se tornar um Long)</li>
<li>é possível fazer boxing e depois ampliar. (Um int pode se tornar um Integer , e ser passado para um parâmetro do tipo Object)</li>
<li>varargs pode ser combinado ampliação ou boxing</li>
</ul>
</div>
<div><strong><br />
</strong></div>
<div>Agora só por curiosidade, a razão para ampliação ser o primeiro é simples. Autobox e Varargs são recursos que foram incorporados a partir da versão 5. Logo, como o lema do java é que atualize a jvm e continue com seu legado funcionando (sabemos que na prática não é bem assim, mas eles tentam),  os desenvolvedores tiveram que priorizar a ampliação, para que códigos legados continuem funcionando, e nada de esquisito aconteça.</div>
<div>Essas comparações são fichas certas no exame. É bom ficar com elas na cabeça <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</div>
</div>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Godiva Christmas Collection 2009]]></title>
<link>http://icedbac0n.wordpress.com/2009/11/15/godiva-christmas-collection-2009/</link>
<pubDate>Sun, 15 Nov 2009 13:12:01 +0000</pubDate>
<dc:creator>icedbac0n</dc:creator>
<guid>http://icedbac0n.wordpress.com/2009/11/15/godiva-christmas-collection-2009/</guid>
<description><![CDATA[Christmas Gifts &amp; Gift Hampers &#8211; Welcome to our collection of Christmas Gifts &amp; Gift H]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a href="http://icedbac0n.wordpress.com/2009/11/15/godiva-christmas-collection-2009/xmas-2009/" rel="attachment wp-att-125"><img src="http://icedbac0n.wordpress.com/files/2009/11/xmas-2009.jpg" alt="xmas 2009" title="xmas 2009" width="300" height="300" class="alignnone size-full wp-image-125" /></a></p>
<p>Christmas Gifts &#38; Gift Hampers &#8211; Welcome to our collection of Christmas Gifts &#38; Gift Hampers 2009 all available for delivery to the whole UAE &#8211; Abu Dhabi, Dubai, Sharjah, Fujeirah, Ajman, Ras Al-Khaimah, Umm Al-Quwain</p>
<p>more of this Christmas Collection 2009 @<a href="http://moka-group.com/store/christmas-gifts-2009.html"> http://moka-group.com/store/christmas-gifts-2009.html</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[photos...]]></title>
<link>http://rajmistry2.wordpress.com/2009/11/14/photos/</link>
<pubDate>Sat, 14 Nov 2009 08:52:19 +0000</pubDate>
<dc:creator>Raj Mistry</dc:creator>
<guid>http://rajmistry2.wordpress.com/2009/11/14/photos/</guid>
<description><![CDATA[My BIL brought a chocolate from London, and we all liked it much but loved more its wrapper&#8230;.p]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>My BIL brought a chocolate from London, and we all liked it much but loved more its wrapper&#8230;.please look at the wrapper of it and you will understand the meaning of being innovative in sharing love&#8230;feelings&#8230;relations with others&#8230;..go for it&#8230;.<strong>read each and every word written on that&#8230;.that is the innovations for sharing love&#8230;joy..</strong></p>
<div id="attachment_502" class="wp-caption aligncenter" style="width: 586px"><img class="size-large wp-image-502" title="diwali1 (62)" src="http://rajmistry2.wordpress.com/files/2009/11/diwali1-62.jpg?w=576" alt="diwali1 (62)" width="576" height="1024" /><p class="wp-caption-text">celebrations in wrapper</p></div>
<p>&#160;</p>
<div id="attachment_503" class="wp-caption aligncenter" style="width: 586px"><img class="size-large wp-image-503" title="diwali1 (63)" src="http://rajmistry2.wordpress.com/files/2009/11/diwali1-63.jpg?w=576" alt="diwali1 (63)" width="576" height="1024" /><p class="wp-caption-text">chocolate 100% love 1000%</p></div>
<p>&#160;</p>
<p>so love is showering from all side and you can feel and share in this way also&#8230;.thanks baby&#8230;.love you&#8230;</p>
<p>Raj</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Varargs e como Java escolhe os métodos]]></title>
<link>http://raphaelrodrigues.wordpress.com/2009/11/13/varargs-e-como-java-escolhe-os-metodos/</link>
<pubDate>Fri, 13 Nov 2009 18:52:49 +0000</pubDate>
<dc:creator>raphaelrodrigues</dc:creator>
<guid>http://raphaelrodrigues.wordpress.com/2009/11/13/varargs-e-como-java-escolhe-os-metodos/</guid>
<description><![CDATA[Vargags é um assunto um tanto fácil quando se vê a primeira vez. E de fato é uma feature bem legal a]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Vargags é um assunto um tanto fácil quando se vê a primeira vez. E de fato é uma feature bem legal admito. Porém, como nada na vida é por acaso, existem umas regrinhas que precisam ser satisfeitas:</p>
<p>1.  Métodos que misturam outros parâmetros com varargs, o varargs deve sempre  ser o último parametro.</p>
<p>ex: void method1(int p1, long p2, String p3, int&#8230; p4)</p>
<p>2. Em decorrência da número 1, não pode haver mais de um varargs no mesmo método. Por razões óbvias, se houvesse mais de 1, um deles não seria o último! <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>3. A sintaxe é tipo + &#8230; . Cuidado pois é diferente de array que aceita colchetes ou antes ou depois.</p>
<p>ex:  void method1(Animal a &#8230;) //erro de compilação</p>
<p>Até aí regrinhas básicas. Agora vamos para parte interessante da coisa. Se tenho uma situação que o compilador tem que fazer uma escolha, qual critério? Por exemplo:</p>
<p>static void method1(int x, int y){</p>
<p>System.out.print(&#8220;1&#8243;);</p>
<p>}</p>
<p>static void method1(int a, int&#8230; x){</p>
<p>System.out.print(&#8220;2&#8243;);</p>
<p>}</p>
<p>Os dois métodos compilam sem menor problema. Se eu chamar:  <em>method1</em>(1,2); Qual o compilador escolherá?</p>
<p>Saída será : &#8220;1&#8243;, pelo simples fato que métodos com vargargs, serão <strong>sempre</strong> escolhidos por último. Fácil né? Mas, o exame vai usar isso para confundir, para quem já sabe é moleza&#8230; hehe</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Comparando Wrappers]]></title>
<link>http://raphaelrodrigues.wordpress.com/2009/11/13/comparando-wrappers/</link>
<pubDate>Fri, 13 Nov 2009 00:09:05 +0000</pubDate>
<dc:creator>raphaelrodrigues</dc:creator>
<guid>http://raphaelrodrigues.wordpress.com/2009/11/13/comparando-wrappers/</guid>
<description><![CDATA[Depois de alguns meses estudando aos pouquinhos, está chegando o momento certo que eu marcarei a ben]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Depois de alguns meses estudando aos pouquinhos, está chegando o momento certo que eu marcarei a bendita prova da SCJP. Depois de ver muitas pegadinhas, vou ter que documentá-las para ficar preparado para prova. E talvez o melhor lugar seja aqui <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Começando, falarei um pouco de Wrappers do Java. Não o básico, mas sim o que importa para o exame. Todos primitivos podem ser empacotados em seus respectivos Wrappers usando o autobox (feature do Java 5). Todo classe java por principio extende de Object, e logo tem seu método equals. No caso dos Wrappers não são diferentes, eles sobrescrevem equals, e retornam verdade caso sejam &#8220;significamente equivalentes&#8221;.</p>
<p>Ou seja,</p>
<p>Integer x = 1000;</p>
<p>Integer y = 1000;</p>
<p>System.out.print(x.equals(y) ) // Imprimirá true</p>
<p>Até aí muito fácil <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>Um pouco sobre o operador de comparação == . Esse operador retorna true quando usado em comparação de referências de objetos, ou seja, se duas váriaveis são atribuídas para o mesmo objeto.  Sendo assim,</p>
<p>Integer x = 1000;</p>
<p>Integer y = 1000;</p>
<p>System.out.print(x==y ) // Imprimirá false</p>
<p>Opa opa, muita calma nessa hora. Wrappers tentam reutilizar sempre a memória caso a mesma referência já tenha sido criada, assim como é feito com String literais. Só que tem uma condição para isso ser feito:</p>
<div id="_mcePaste">■ Boolean</div>
<div id="_mcePaste">■ Byte</div>
<div id="_mcePaste">■ Character from \u0000 to \u007f (7f is 127 in decimal)</div>
<div id="_mcePaste">■ Short and Integer from -128 to 127</div>
<div>Logo o seguinte código,</div>
<div>
<p>Short  x = 10;</p>
<p>Short y = 10;</p>
<p>System.out.print(x==y ) // Imprimirá true, x e y apontam para o mesmo local da memória</p>
<p>Então lá vai uma dica para o mundo real <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  . Com Wrappers sempre use equals, ou faça Wrapper.xxxValue() (retorna o primitivo) e use o operador == .</p>
</div>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[The Fab Folds: Various Ways to Wrap Gifts in Fabric.]]></title>
<link>http://quoleshnablog.wordpress.com/2009/11/05/the-fab-folds-various-ways-to-wrap-gifts-in-fabric/</link>
<pubDate>Thu, 05 Nov 2009 16:48:40 +0000</pubDate>
<dc:creator>quoleshnablog</dc:creator>
<guid>http://quoleshnablog.wordpress.com/2009/11/05/the-fab-folds-various-ways-to-wrap-gifts-in-fabric/</guid>
<description><![CDATA[I&#8217;ve wrapped gifts with fabric before, but I never thought to do it like this!  And, it looks ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I&#8217;ve wrapped gifts with fabric before, but I never thought to do it like this!  And, it looks super duper easy.  Craziness.  Save on everything by using fabric you already have (be creative!).  And, I suggest even including instructions on how to fold it&#8230;or at least the YouTube address <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  (http://www.youtube.com/watch?v=Bn6zdyCAwJs)</p>
<p>&#160;</p>
<p><span style='text-align:center; display: block;'><object width='425' height='350'><param name='movie' value='http://www.youtube.com/v/Bn6zdyCAwJs&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;hd=0' /><param name='allowfullscreen' value='true' /><param name='wmode' value='transparent' /><embed src='http://www.youtube.com/v/Bn6zdyCAwJs&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;hd=0' type='application/x-shockwave-flash' allowfullscreen='true' width='425' height='350' wmode='transparent'></embed></object></span></p>
<p>&#160;</p>
<p>This idea courtesty of <a href="http://craftingagreenworld.com/">http://craftingagreenworld.com/</a>.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Cigar Review - 5 Vegas Cask Strength II]]></title>
<link>http://wrapperbinderfiller.wordpress.com/2009/11/03/cigar-review-5-vegas-cask-strength-ii/</link>
<pubDate>Tue, 03 Nov 2009 17:52:24 +0000</pubDate>
<dc:creator>W. B. Filler</dc:creator>
<guid>http://wrapperbinderfiller.wordpress.com/2009/11/03/cigar-review-5-vegas-cask-strength-ii/</guid>
<description><![CDATA[&nbsp; 5 Vegas Cask Strength II &nbsp; &nbsp; Cigar: 5 Vegas Cask Strength II Size: Toro (6&#215;52)]]></description>
<content:encoded><![CDATA[&nbsp; 5 Vegas Cask Strength II &nbsp; &nbsp; Cigar: 5 Vegas Cask Strength II Size: Toro (6&#215;52)]]></content:encoded>
</item>
<item>
<title><![CDATA[Be a designer and win €10,000 with Cadburys]]></title>
<link>http://girlfromthehills.wordpress.com/2009/11/03/be-a-designer-and-win-e10000-with-cadburys/</link>
<pubDate>Tue, 03 Nov 2009 15:04:14 +0000</pubDate>
<dc:creator>girlfromthehills</dc:creator>
<guid>http://girlfromthehills.wordpress.com/2009/11/03/be-a-designer-and-win-e10000-with-cadburys/</guid>
<description><![CDATA[See it&#8217;s all about the chocolate this week! Cadburys want you to design a new Cadbury Dairy Mi]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><img src="http://girlfromthehills.wordpress.com/files/2009/11/welcomepicture_v3.png" alt="welcomePicture_v3" title="welcomePicture_v3" width="450" height="425" class="alignnone size-full wp-image-1276" /><br />
See it&#8217;s all about the chocolate this week! Cadburys want you to design a new Cadbury Dairy Milk wrapper with an Irish theme. The best five wrappers will go to a public vote on this website in January 2010. If everyone loves it you’ll win €10,000 and see your wrapper in shops across Ireland. If nobody loves it: you’re fired!</p>
<p>What you use to design your wrapper is up to you: draw it, paint it, stencil it, paste it, photograph it, stitch it, knit it or do it on a computer. It’s all up to you so the €10,000 is yours to win or lose.</p>
<p><strong>There are three ways to enter:</strong><br />
1. Pick up a leaflet in your nearest store, cafe or college campus. Design your wrapper using the template on the back, then post it to: Cadbury Apprentice Promotion, 6 Ely Place, Dublin 2, or scan it and submit it below.<br />
2. Download and print the template then post your design to the address above.<br />
3. Design your wrapper in the Cadbury Studio and submit it on and submit it online.</p>
<p>For more information or to enter online, go to <a href="http://theapprentice.cadbury.ie/">http://theapprentice.cadbury.ie/</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Make a native Mac App Bundle of Qt Designer with Qt Jambi]]></title>
<link>http://olliwang.com/2009/11/01/make-a-native-mac-app-bundle-of-qt-designer-with-qt-jambi/</link>
<pubDate>Sun, 01 Nov 2009 05:21:59 +0000</pubDate>
<dc:creator>Olli Wang</dc:creator>
<guid>http://olliwang.com/2009/11/01/make-a-native-mac-app-bundle-of-qt-designer-with-qt-jambi/</guid>
<description><![CDATA[Qt Designer is an important tool for designing and building graphical user interface from Qt compone]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Qt Designer is an important tool for designing and building graphical user interface from Qt components. However, if you are a Java programmer and want to use Qt Designer with Qt Jambi in Mac, you can&#8217;t simply double-click the Designer app bundle shipped with Qt Jambi SDK. If you do so, you can still invoke the Designer, but&#8230; with the C++ environments, it&#8217;s useless for Java programmers. Instead, if you want to use Qt Designer with Qt Jambi. You have to start the program from a `designer.sh` script placed in your Qt directory. It&#8217;s pretty annoying because you&#8217;ll need a Terminal to run this script until you turn it off. Also, it&#8217;s not intuitive.</p>
<p>So, I checked the script code and found what it does is simply to set some environment variables and then execute the Designer binary within the Designer app bundle. Therefore, I decided to make a &#8220;real&#8221; app bundle for the Qt Designer with Qt Jambi. It&#8217;s pretty easy to do this job by using <a href="http://opensource.ollix.com/jump">Jump</a>, one of my open source projects. Here&#8217;s the instructions.</p>
<ol>
<li>Go to the `QTDIR/bin` directory in Finder.</li>
<li>Right-click the `Designer` app bundle, select `Show Package Contents`, and it will open a new Finder window.</li>
<li>In the new opened Finder window, go to the `Contents/MacOS` directory, then copy the `Designer` binary back to `QTDIR/bin`.</li>
<li>Now pick a location to start writing our wrapper. I simply make a directory called `designer` in my home directory, then open a Terminal and switch to it.</li>
<li>Back to the new opened Finder window, copy the `Contents/Resources/designer.icns` file to our new created `designer` directory.</li>
<li>Create a Python module named `designer.py` in `designer` directory, and its content looks like this:
<pre class="brush: python;">import os
# Replace this path to your QTDIR
qt_home = '/Users/olliwang/workspace/qtjambi-mac-lgpl-4.5.2_01'

def main():
    os.environ['QTDIR'] = qt_home
    os.environ['DYLD_LIBRARY_PATH'] = os.path.join(qt_home, 'lib')
    os.environ['QT_PLUGIN_PATH'] = os.path.join(qt_home, 'plugins')
    os.environ['PATH'] = os.path.join(qt_home, 'bin')

    classpaths = []
    for filename in os.listdir(qt_home):
        if filename.endswith('.jar'):
            classpath = os.path.join(qt_home, filename)
            classpaths.append(classpath)
    os.environ['CLASSPATH'] = ':'.join(classpaths)
    os.system(os.path.join(qt_home, 'bin/Designer'))</pre>
</li>
<li>Create a `config.jp` file with following content:
<pre class="brush: bash;">dist_name = Designer
main_entry_point = designer:main
icns = designer.icns</pre>
</li>
<li>Run `jump app` in your Terminal, and you&#8217;ll see a new created directory called `dist`, our new app bundle is in there.</li>
<li>Copy the created app bundle back to the `QTDIR/bin` directory, now double-click the `Designer` app bundle and everything should work fine. Cheers!</li>
</ol>
<p>I use Python to write this wrapper for easy, you can of course do the same thing in Java. Just remember to modify the `main_entry_point` to the `Main Class` in config file.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Review - CAO eXtreme]]></title>
<link>http://wrapperbinderfiller.wordpress.com/2009/10/28/review-cao-extreme/</link>
<pubDate>Thu, 29 Oct 2009 00:35:06 +0000</pubDate>
<dc:creator>W. B. Filler</dc:creator>
<guid>http://wrapperbinderfiller.wordpress.com/2009/10/28/review-cao-extreme/</guid>
<description><![CDATA[Cigar: CAO eXtreme Size: Toro (6&#215;50) Cost: $9.00 Wrapper: Ecuadorian Sumatra Seed Wrapper Binde]]></description>
<content:encoded><![CDATA[Cigar: CAO eXtreme Size: Toro (6&#215;50) Cost: $9.00 Wrapper: Ecuadorian Sumatra Seed Wrapper Binde]]></content:encoded>
</item>
<item>
<title><![CDATA[Review - Cubano Viso Fuerte by Fonseca]]></title>
<link>http://wrapperbinderfiller.wordpress.com/2009/10/20/review-cubano-viso-fuerte-by-fonseca/</link>
<pubDate>Tue, 20 Oct 2009 16:38:33 +0000</pubDate>
<dc:creator>W. B. Filler</dc:creator>
<guid>http://wrapperbinderfiller.wordpress.com/2009/10/20/review-cubano-viso-fuerte-by-fonseca/</guid>
<description><![CDATA[Fantastic Morning Cigar Cigar: Cubano Viso Fuerte by Fonseca Size: Robusto (5&#215;50) Cost: $6.50 W]]></description>
<content:encoded><![CDATA[Fantastic Morning Cigar Cigar: Cubano Viso Fuerte by Fonseca Size: Robusto (5&#215;50) Cost: $6.50 W]]></content:encoded>
</item>
<item>
<title><![CDATA[WBF Attends 4th Annual Long Island Herf]]></title>
<link>http://wrapperbinderfiller.wordpress.com/2009/10/15/wbf-attends-4th-annual-long-island-herf/</link>
<pubDate>Thu, 15 Oct 2009 04:24:26 +0000</pubDate>
<dc:creator>W. B. Filler</dc:creator>
<guid>http://wrapperbinderfiller.wordpress.com/2009/10/15/wbf-attends-4th-annual-long-island-herf/</guid>
<description><![CDATA[Stan and I (Joe) had the opportunity to attend the 4th Annual Long Island Herf almost a month ago, a]]></description>
<content:encoded><![CDATA[Stan and I (Joe) had the opportunity to attend the 4th Annual Long Island Herf almost a month ago, a]]></content:encoded>
</item>
<item>
<title><![CDATA[Wrapper Classes en Java]]></title>
<link>http://nicofrench.wordpress.com/2009/10/06/wrapper-classes-en-java/</link>
<pubDate>Tue, 06 Oct 2009 00:00:14 +0000</pubDate>
<dc:creator>nicolasfrench</dc:creator>
<guid>http://nicofrench.wordpress.com/2009/10/06/wrapper-classes-en-java/</guid>
<description><![CDATA[Estas clases fueron diseñadas para poder envolver (wrap) los valores primitivos en objetos. De esta ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Estas clases fueron diseñadas para poder envolver (wrap) los valores primitivos en objetos. De esta manera, los primitivos pueden realizar operaciones que se dan solo entre objetos, por ejemplo, agregarse a un objeto de tipo <em>Collection</em>.<!--more--></p>
<p>Existe una Wrapper Class por cada valor primitivo en Java. La siguiente tabla enumera todas las Wrapper y sus valores primitivos asociados:</p>
<p>Todas las Wrapper Classes poseen dos constructores, uno que trae como argumento el valor del primitivo (i1) y otro que tiene como argumento un valor String del valor primitivo que se pretende envolver (i2).</p>
<p><span style="font-family:Consolas, Monaco, 'Courier New', Courier, monospace;line-height:18px;font-size:12px;white-space:pre;">Integer i1 = new Integer(42);</span></p>
<p><span style="font-family:Consolas, Monaco, 'Courier New', Courier, monospace;line-height:18px;font-size:12px;white-space:pre;">Integer i2 = new Integer(&#8220;42&#8243;);</span></p>
<p><span style="font-family:Consolas, Monaco, 'Courier New', Courier, monospace;line-height:18px;font-size:12px;white-space:pre;"><br />
</span></p>
<p>En el caso de la clase Character, solo existe un proveedor y el mismo toma como argumento un objeto de tipo String</p>
<p><span style="font-family:Consolas, Monaco, 'Courier New', Courier, monospace;line-height:18px;font-size:12px;white-space:pre;">Character c1 = new Character(&#8216;c&#8217;);</span></p>
<p><span style="font-family:Consolas, Monaco, 'Courier New', Courier, monospace;line-height:18px;font-size:12px;white-space:pre;"><br />
</span></p>
<p>Los constructores para los objetos Boolean pueden tomar un valor booleano (true o false) o un valor String. Hay que tener en cuenta que cuando se construye un objeto Boolean pasandole como argumento un objeto String, el argumento es case-sensitive. Es decir, si nosotros pasamos como argumento</p>
<p><span style="font-family:Consolas, Monaco, 'Courier New', Courier, monospace;line-height:18px;font-size:12px;white-space:pre;">Boolean b1 = new Boolean(&#8220;True&#8221;);</span></p>
<p><span style="font-family:Consolas, Monaco, 'Courier New', Courier, monospace;line-height:18px;font-size:12px;white-space:pre;"><br />
</span></p>
<p><span style="font-family:Consolas, Monaco, 'Courier New', Courier, monospace;line-height:18px;font-size:12px;white-space:pre;"><span style="font-family:Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;line-height:19px;white-space:normal;font-size:13px;">El valor del objeto Boolean sera falso.</span></span></p>
<p>Desde Java 5, los objetos Boolean pueden ser evaluados en una expresion booleana:</p>
<p><span style="font-family:Consolas, Monaco, 'Courier New', Courier, monospace;line-height:18px;font-size:12px;white-space:pre;">Boolean b = new Boolean(&#8220;false&#8221;);</span></p>
<p><span style="font-family:Consolas, Monaco, 'Courier New', Courier, monospace;line-height:18px;font-size:12px;white-space:pre;">if(b) // si estamos usando Java 5 o superior este codigo compilara.</span></p>
<p><span style="font-family:Consolas, Monaco, 'Courier New', Courier, monospace;font-size:small;"><span style="line-height:18px;white-space:pre;"><span style="font-family:Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;font-size:small;"><span style="line-height:19px;white-space:normal;"><br />
</span></span></span></span></p>
<p><span style="font-family:Consolas, Monaco, 'Courier New', Courier, monospace;line-height:18px;font-size:12px;white-space:pre;"><span style="font-family:Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;line-height:19px;white-space:normal;font-size:13px;">Esto es posible, ya que a partir de Java 5,  el compilador utiliza el &#8216;unboxing&#8217; y permite que el objeto Boolean sea tratado como un valor booleano primitivo.</span></span></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Palette Training: Maduro Wrappers Part 1]]></title>
<link>http://stogiepro.wordpress.com/2009/10/04/palette-training-maduro-wrappers-part-1/</link>
<pubDate>Sun, 04 Oct 2009 11:00:32 +0000</pubDate>
<dc:creator>stogiepro</dc:creator>
<guid>http://stogiepro.wordpress.com/2009/10/04/palette-training-maduro-wrappers-part-1/</guid>
<description><![CDATA[I&#8217;ve had a lot of discussions over the years about maduros and I&#8217;ve found many smokers h]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I&#8217;ve had a lot of discussions over the years about maduros and I&#8217;ve found many smokers have some misconceptions regarding these beauties. I am going to address some of those here.</p>
<p>The first item I want to discuss is strength versus the darkness of the wrapper. You cannot say with certainty that a cigar with a darker wrapper is stronger than a cigar with a lighter wrapper. For example, the Joya de Nicaragua Serie C is a strong cigar with a Connecticut wrapper. It is much stronger than the Torano Casa Torano Maduro, even though it has a nice dark wrapper. If you are a fan of stronger cigars, don&#8217;t limit yourself to dark wrapper cigars. Do the research and you will find others to try.</p>
<p>Secondly, the is a lot of confusion when discussing maduros- are we talking about a maduro color or the maduro process? There are about 50 color classifications to wrapper colors, usually reduced to six broad categories (thank goodness) presented below with all of their equivalent names:</p>
<ul>
<li>Double claro, candela, American Market Selection (AMS), jade</li>
<li>Claro, natural</li>
<li>Colorado claro, English Market Selection (EMS)</li>
<li>Colorado</li>
<li>Maduro, Spanish Market Selection (SMS)</li>
<li>Oscuro, double maduro, maduro maduro, negro, black</li>
</ul>
<p>Some of the cigars marketed as maduros are actually oscuros, or even colorado, when talking about color. Even worse is that a few manufacturers have added dyes to their cigars to make them nice and dark and labelled them as maduros. And technically, they are right- they are <strong>maduro in color</strong>.This practice was much more common in the cigar boom of the 90s, but I&#8217;m sad to say a couple of cigars at the last IPCPR show also had the dye treatment. I&#8217;m sure many of the retailers did not order them once they discovered the black stains on their mouths and fingertips. At least I hope so.</p>
<p>To get cigar wrappers dark naturally without dyes requires an intense and expensive fermentation process. &#8220;Maduro&#8221; translates to &#8220;ripe&#8221; in Spanish. As tobacco leaves are harvested from the fields, they are placed in curing barns for around 45 days. The leaves change from green to brown. For darker leaves, the tobacco is stacked in large piles called pillones. Heat is generated as the leaves ferment, and the pillones have to be rearranged from time to time to keep the all of the tobacco fermenting at the same rate and to inspect the progress. Leaves can spend several years (usually 3-5) in the pillones before they are finally ready. The fermentation brings out the natural sugars in the leaf causing the darkening color change. The longer this fermentation process goes the milder the wrapper becomes. The extra time and storage required for producing maduro wrapper is what leads to the maduro-wrapped versions of cigars being more expensive than their natural-wrapped counterparts.</p>
<p>There is another common way to create maduro wrapper. It is usually called &#8220;cooking.&#8221; It is really a steaming process where the wrapper leaf is placed in a steam chamber until the desired color is achieved. Obviously this is a quicker and cheaper method than the first method I described. The problem? It doesn&#8217;t really bring the sugars out like the natural process. The result is a maduro-colored wrapper without much of the maduro sweetness. These wrappers are usually used only on milder maduro cigars.</p>
<p>To do any of these methods, you must have a leaf that can take the intense process. You must use tobacco leaves that are particularly thick and hearty. Usually only leaves from the top two-thirds of the plant are used. The leaves near the top have more sugar, as the top leaves received more sunlight to fuel photosynthesis. The leaves at the top of the plant also produce more oils, which are used by the plant to help protect it from the sun. The stronger maduro wrappers are made from the top leaves of the plant, and the milder ones from the middle of the plant.</p>
<p>In part 2, I&#8217;ll discuss which tobacco varieties can handle this harsh process and how the region they are grown in affects their taste.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Idea #10]]></title>
<link>http://wingedkitten.wordpress.com/2009/10/01/idea-10/</link>
<pubDate>Thu, 01 Oct 2009 14:15:05 +0000</pubDate>
<dc:creator>wingedkitten</dc:creator>
<guid>http://wingedkitten.wordpress.com/2009/10/01/idea-10/</guid>
<description><![CDATA[Non-crinkly wrappers for food that you bring to class! That said, non-crinkly wrappers for anything.]]></description>
<content:encoded><![CDATA[Non-crinkly wrappers for food that you bring to class! That said, non-crinkly wrappers for anything.]]></content:encoded>
</item>
<item>
<title><![CDATA[Idea #9]]></title>
<link>http://wingedkitten.wordpress.com/2009/09/30/idea-9/</link>
<pubDate>Thu, 01 Oct 2009 02:41:29 +0000</pubDate>
<dc:creator>wingedkitten</dc:creator>
<guid>http://wingedkitten.wordpress.com/2009/09/30/idea-9/</guid>
<description><![CDATA[So I was eating McDonald&#8217;s tonight for dinner (yeah, yeah I know), and glancing at the wrapper]]></description>
<content:encoded><![CDATA[So I was eating McDonald&#8217;s tonight for dinner (yeah, yeah I know), and glancing at the wrapper]]></content:encoded>
</item>
<item>
<title><![CDATA[Draggable &amp; Resizable Widgets in Flex 3]]></title>
<link>http://tylermac.wordpress.com/2009/09/25/widgets-in-flex-3/</link>
<pubDate>Sat, 26 Sep 2009 00:56:41 +0000</pubDate>
<dc:creator>Tyler MacLeod</dc:creator>
<guid>http://tylermac.wordpress.com/2009/09/25/widgets-in-flex-3/</guid>
<description><![CDATA[Working on a project, a requirement was for widgets to be placed on the main view. These widgets whe]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Working on a project, a requirement was for widgets to be placed on the main view. These widgets where required to be moveable and resizable.</p>
<p>In the past, I have used <a href="http://code.google.com/p/flexmdi/">FlexLib’s MDI Canvas</a> to accomplish this. In this instance however, I wanted to use pre existing components, and didn’t want to have to extend other classes.</p>
<p>My solutions was to create a wrapper for MXML for <a title="Flex 3 - TitleWindow layout container" href="http://livedocs.adobe.com/flex/3/html/layouts_12.html">TitleWindows</a> that would turn any container into bounds for the TitleWindows.</p>
<p>  <!--more-->
<p>Here is the Widget Manager that I’ve come up with.</p>
<pre class="brush: java;">
package com.cso.utils
{
	import flash.display.DisplayObject;
	import flash.display.Sprite;
	import flash.events.Event;

	import mx.binding.utils.ChangeWatcher;
	import mx.containers.Panel;
	import mx.containers.TitleWindow;
	import mx.core.IDeferredInstance;
	import mx.core.IMXMLObject;
	import mx.core.UIComponent;
	import mx.events.CloseEvent;
	import mx.managers.PopUpManager;

	[DefaultProperty(&#34;children&#34;)]
	/**
	 * Class to handle widgets on the screen
	 */
	public class WidgetManager implements IMXMLObject
	{
		private var _parent:UIComponent;
		private var _id:String;
		private var _initalizedCount:int;

		[InstanceType(&#34;mx.containers.TitleWindow&#34;)]
		[ArrayElementType(&#34;mx.core.IDeferredInstance&#34;)]
		public var children:Array;

		public function WidgetManager()
		{
		}

		public function initialized(document:Object, id:String):void
		{
			_parent = document as UIComponent;
			_id = id;

			_initalizedCount = 0;
			if(_parent)
			{
				//Preoptimization, just for fun
				_parent.addEventListener(Event.ENTER_FRAME, proccessAChild);
			}
		}

		private function proccessAChild(event:Event):void
		{
			if(_initalizedCount == children.length)
			{
				_parent.removeEventListener(Event.ENTER_FRAME, proccessAChild);
				return;
			}
			var win:TitleWindow = IDeferredInstance(children[_initalizedCount]).getInstance() as TitleWindow;
			ChangeWatcher.watch(win,&#34;includeInLayout&#34;,toggleDisplay);
			if(win.includeInLayout)
			{
				displayWindow(win);
			}
			_initalizedCount++;
		}

		private function toggleDisplay(event:Event):void
		{
			var win:TitleWindow = TitleWindow(event.target);
			if(win.includeInLayout)
			{
				displayWindow(win);
			} else {
				closeWindow(win);
			}
		}

		private function displayWindow(win:TitleWindow):void
		{
			win.showCloseButton = true;
			win.addEventListener(CloseEvent.CLOSE,handleCloseButton);

			win.maxHeight = _parent.height - 10;
			win.maxWidth = _parent.width - 10;

			PopUpManager.addPopUp(win, _parent);
			if(win.x == win.y &#38;&#38; win.x == 0) {
				PopUpManager.centerPopUp(win);
			}
			win.callLater(drawResizeGraphic, [win]);
		}

		private function closeWindow(win:TitleWindow):void
		{
			win.removeEventListener(CloseEvent.CLOSE, handleCloseButton);
			PopUpManager.removePopUp(win);
		}

		private function handleCloseButton(event:CloseEvent):void
		{
			TitleWindow(event.target).includeInLayout = false;
		}

		public function toString():String
		{
			return _id;
		}

		private function drawResizeGraphic(win:Panel):void
		{
			var s:Sprite = new ResizeIcon();
			s.name = 'resizeGraphic';
			win.rawChildren.addChild(s);
		}

		private function positionResizeGraphic(win:Panel):void
		{
			var s:DisplayObject = win.rawChildren.getChildByName('resizeGraphic');
			s.x = win.width - s.width;
			s.y = win.height - s.height;
		}
	}
}
	import flash.display.Sprite;
	import flash.events.Event;
	import mx.controls.Alert;
	import flash.display.Graphics;
	import flash.display.DisplayObjectContainer;
	import mx.effects.Resize;
	import mx.core.UIComponent;
	import flash.display.DisplayObject;
	import flash.events.MouseEvent;
	import mx.managers.CursorManager;
	import mx.collections.CursorBookmark;
	import mx.managers.PopUpManager;
	import flash.display.Shape;
	import mx.managers.SystemManager;
	import flash.media.Microphone;

class ResizeIcon extends Sprite
{
	private var _parent:DisplayObjectContainer;
	private var _hitArea:Sprite;

	public function ResizeIcon(color:uint = 0x000000)
	{
		this.draw(color);
		this.setHitArea();
		this.setupListeners();
	}

	override public function get hitArea():Sprite
	{
		return _hitArea;
	}

	private function draw(colour:uint):void
	{
		var g:Graphics = graphics;
		g.clear();
		g.lineStyle(2,colour);
		g.moveTo(4, 9)
		g.curveTo(7, 7, 9, 4);
		g.moveTo(4, 9)
		g.curveTo(5, 5, 6, 5);
	}

	private function setHitArea():void
	{
		this._hitArea = new Sprite();
		this._hitArea.graphics.drawRect(0,0,10,10);
	}

	private function setupListeners():void
	{
		this.addEventListener(Event.ADDED, added);
		this.addEventListener(Event.REMOVED, removed);
		this.addEventListener(MouseEvent.MOUSE_DOWN, startResize);
	}

	private function added(event:Event):void
	{
		if(this.parent == _parent) return;

		if(_parent)
		{
			_parent.removeEventListener(Event.RESIZE, parentResized);
		}

		_parent = this.parent;
		positionResizeIcon();

		_parent.addEventListener(Event.RESIZE, parentResized);
	}

	private function removed(event:Event):void
	{
		if(_parent)
		{
			_parent.removeEventListener(Event.RESIZE, parentResized);
		}

		_parent == null;
	}

	private function positionResizeIcon():void
	{
		x = _parent.width - 10;
		y = _parent.height - 10;
	}

	private function parentResized(event:Event):void
	{
		positionResizeIcon();
	}

	private function startResize(event:Event):void
	{
		var rubber:RubberbandPlaceHolder = new RubberbandPlaceHolder();
		rubber.mimic(this.parent as UIComponent);
	}
}

class RubberbandPlaceHolder extends UIComponent
{
	private var mimicedWin:UIComponent;

	public function RubberbandPlaceHolder() { super(); }

	public function mimic(win:UIComponent):void
	{
		this.mimicedWin = win;
		this.x = win.x;
		this.y = win.y;
		this.height = win.height;
		this.width = win.width;
		PopUpManager.addPopUp(this, win.parent,true);
		systemManager.addEventListener(MouseEvent.MOUSE_MOVE,handleMouseMove);
		systemManager.addEventListener(MouseEvent.MOUSE_UP,handleMouseUp);
	}

	private function handleMouseMove(event:MouseEvent):void
	{
		event.stopPropagation();
		this.width = Math.min(Math.max(event.stageX - this.x, 150, mimicedWin.minWidth), mimicedWin.maxWidth, mimicedWin.parent.width - this.x - 5);
		this.height = Math.min(Math.max(event.stageY - this.y, 300, mimicedWin.minHeight), mimicedWin.maxHeight, mimicedWin.parent.height - this.y - 5);
	}

	private function handleMouseUp(event:MouseEvent):void
	{
		event.stopPropagation();
		mimicedWin.width = this.width;
		mimicedWin.height = this.height;

		systemManager.removeEventListener(MouseEvent.MOUSE_MOVE, handleMouseMove);
		systemManager.removeEventListener(MouseEvent.MOUSE_UP, handleMouseUp);
		PopUpManager.removePopUp(this);

		this.mimicedWin = null;
	}

	override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
	{
		var g:Graphics = graphics;
		g.clear();
		g.lineStyle(1);
		g.beginFill(0xCCCCCC,.8);
		g.drawRect(0,0,unscaledWidth, unscaledHeight);
		g.endFill();
	}
}
</pre>
<p>* Some clean up required.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Обернул ScrollBar]]></title>
<link>http://miksayer.wordpress.com/2009/09/22/%d0%be%d0%b1%d0%b5%d1%80%d0%bd%d1%83%d0%bb-scrollbar/</link>
<pubDate>Tue, 22 Sep 2009 19:41:59 +0000</pubDate>
<dc:creator>miksayer</dc:creator>
<guid>http://miksayer.wordpress.com/2009/09/22/%d0%be%d0%b1%d0%b5%d1%80%d0%bd%d1%83%d0%bb-scrollbar/</guid>
<description><![CDATA[Вот обернул ScrollBar в класс. Реализовывалось под свои нужды, поэтому работа ведется только со стан]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Вот обернул ScrollBar в класс. Реализовывалось под свои нужды, поэтому работа ведется только со стандартными скроллбарами контролов(т.е. с вертикальным, горизонтальным или сразу с обоими). Выкладываю код:</p>
<pre class="brush: cpp;">
class ScrollBar : Window
{
public:
	ScrollBar(HWND hParent)
	{
		_hParent = hParent;
	}

	void enableScrollBar(UINT wSBflags, UINT wArrows)
	{
		::EnableScrollBar(_hParent, wSBflags, wArrows);
	}

	void getScrollBarInfo(LONG idObject, PSCROLLBARINFO psbi)
	{
		::GetScrollBarInfo(_hParent, idObject, psbi);
	}

	void getScrollInfo(int fnBar, LPSCROLLINFO lpsi)
	{
		::GetScrollInfo(_hParent, fnBar, lpsi);
	}

	void scrollWindow(int dx, int dy, const RECT *prcScroll, UINT flags)
	{
		::ScrollWindowEx(_hParent, dx, dy, prcScroll, NULL, NULL, NULL, flags);
	}

	void setScrollInfo(int fnBar, LPCSCROLLINFO lpsi, BOOL fRedraw = TRUE)
	{
		::SetScrollInfo(_hParent, fnBar, lpsi, fRedraw);
	}

	void showScrollBar(int wBar, BOOL bShow = TRUE)
	{
		::ShowScrollBar(_hParent, wBar, bShow);
	}

	static WORD getScrollingReguest(WPARAM wParam)
	{
		return LOWORD(wParam);
	}

};
</pre>
<p>В принципе дополнить класс для работы со скроллбаром как с отдельным контролом не проблема, может быть как-нибудь займусь(что там заниматься: пару строчек дописать и все <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  )</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Notorius Super Big Bol, Wrapper]]></title>
<link>http://sizzyphus.wordpress.com/2009/09/21/notorius-super-big-bol-wrapper/</link>
<pubDate>Mon, 21 Sep 2009 15:30:17 +0000</pubDate>
<dc:creator>Allison Huyett</dc:creator>
<guid>http://sizzyphus.wordpress.com/2009/09/21/notorius-super-big-bol-wrapper/</guid>
<description><![CDATA[  We are nothing if not our associations. Constructs and connections, web of thoughts. A prime heron]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>  We are nothing if not our associations. Constructs and connections, web of thoughts. A prime heron establishes itself on a prominent rock upstream of the overpass. Commanding attention, commanding a view. The rock upon which it stands is split-level and big enough to be a small island. Someone has left behind a candy wrapper, to sustain my existence. It is a BIG BOL wrapper, something you don&#8217;t see every day. SUPER is encircled or surrounded by an oval line. Combines with a crushed hickory hull &#8211; six pieces &#8211; that has a football shape. BIG BOL, super bowl, Notorius B.I.G., the rapper, BIG GLO, BIG BLO, BIG BLOW, fellatio or a crush. Crush proof box, New! BIG OIL, big oil producers. Big lob or a big glob. Bigeloil and Bigelow and a great big globe. Super. Super. Very BIG. GO. Pass go, collect 200 dollars and go outside and play.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Guest cigar review of the Padron 80 Years Maduro]]></title>
<link>http://jbrookeiv.wordpress.com/2009/09/13/guest-cigar-review-of-the-padron-80-years-maduro/</link>
<pubDate>Mon, 14 Sep 2009 01:53:21 +0000</pubDate>
<dc:creator>John Brooke</dc:creator>
<guid>http://jbrookeiv.wordpress.com/2009/09/13/guest-cigar-review-of-the-padron-80-years-maduro/</guid>
<description><![CDATA[This week, we have another guest review from our friend Danny Principe. Hope you enjoy! I dont reall]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><blockquote><p>This week, we have another guest review from our friend Danny Principe. Hope you enjoy!</p></blockquote>
<p style="text-align:center;">
<p><img class="aligncenter size-full wp-image-660" title="Padron 80 80th Years Anniversity Maduro" src="http://jbrookeiv.wordpress.com/files/2009/09/5573_628167475509_32815717_37251578.jpg" alt="5573_628167475509_32815717_37251578" width="391" height="437" /></p>
<p>I dont really know what else to say about this cigar other than it is absolute perfection. This is quite possibly my desert island cigar. I have been very lucky in my life. I have been able to sample the finest Cubans, some of the most elusive NCs, but this takes the cake. Very few cigars are of this caliber, though some do come to mind.</p>
<p><span style="text-decoration:underline;"><em><strong>The Verdict:</strong></em></span><br />
<strong> Appearance: 14/15</strong><br />
Beautiful wrapper. No visible veins whatsoever, the only flaw was a slight hole in the wrapper. But this did not effect the enjoyment of the cigar whatsoever. Really the only flaw.</p>
<p><strong>Flavor: 25/25</strong><br />
Unreal. Coffee, cocoa, at times leather, nuts, toast, some sweet cedar. Very typical Padron flavors, but so remarkably smooth that it really is hard to pinpoint anything standing out above the rest. Everything was in perfect harmony. The cigar was in the full bodied category, but it was just so smooth I did not seem to notice.</p>
<p><strong>Construction: 25/25</strong><br />
Flawless. The cigar cut like a hot knife through butter. It lit up instantly, I used one match and it honestly lit up in 1/4 of a second and did not require a single bit of attention for the entire 3 hours I took to smoke this beauty. The draw was perfect. Like a razor the entire time. And every 80 Years I have smoked has been EXACTLY the same in this regard.</p>
<p><strong>Overall Impression: 35/35</strong><br />
The price point is high, but I have to say, it is damn near worth it.</p>
<p><strong>Final Score: 99/100</strong></p>
<p>I know it seems a bit high, but if you have smoked one, and you love Padrons as much as I do, I am sure you will agree. Cant wait to see how the 45ths I just picked up do in comparison.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Eats for the Big Apple]]></title>
<link>http://thefoodiediaries.com/2009/09/11/eats-for-the-big-apple/</link>
<pubDate>Fri, 11 Sep 2009 19:35:12 +0000</pubDate>
<dc:creator>The Foodie Diaries</dc:creator>
<guid>http://thefoodiediaries.com/2009/09/11/eats-for-the-big-apple/</guid>
<description><![CDATA[I always have trouble talking about 9/11—mostly because that day, for me, was defined by an abundanc]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I always have trouble talking about 9/11—mostly because that day, for me, was defined by an abundance of emotion coupled with a scarcity of words. On a day when an entire nation was at a loss for words, there was nothing to do but feel, think and wonder.</p>
<p>For all its tragedy and somber, 9/11 was one of our generation’s most poignant events. Living through it moved our nation to redefine its identity and rediscover its pride. Experiencing it as a New Yorker moved me to fall in love with the city that’s always been my home <strong>all over again</strong>. </p>
<p>So, today, instead of awkwardly fumbling for words to commemorate all that was lost on 9/11, I’m celebrating a city that refused to let tragedy rob its spirit and virtue. Today, I’m eating for the Big Apple.</p>
<p><strong>My Big Apple Breakfast:</strong></p>
<p><a href="http://thefoodiediaries.files.wordpress.com/2009/09/img_0364.jpg"><img title="IMG_0364" style="border-right:0;border-top:0;display:inline;border-left:0;border-bottom:0;" height="376" alt="IMG_0364" src="http://thefoodiediaries.files.wordpress.com/2009/09/img_0364_thumb.jpg?w=500&#038;h=376" width="500" border="0" /></a>&#160;</p>
<p>I got the idea for <strong>fruit cereal</strong> from Katie at <a href="http://yesiwantcake.com/2009/09/10/tired-turned-grateful/">Yes, I Want Cake</a> and couldn’t wait any longer to try it. </p>
<p>In my bowl: </p>
<ul>
<li><font color="#444444">massive Ginger Crisp apple</font></li>
<li><font color="#444444">figs</font></li>
<li><font color="#444444">raisins</font></li>
<li><font color="#444444">slivered almonds</font></li>
<li><font color="#444444">ground flax</font></li>
<li><font color="#444444">cinnamon</font></li>
<li><font color="#444444">almond milk</font></li>
</ul>
<p>I let it sit in the fridge for 5 minutes because I like my real cereal soggy—and figured the same preference would likely apply here. </p>
<p><a href="http://thefoodiediaries.files.wordpress.com/2009/09/img_0365.jpg"><img title="IMG_0365" style="border-right:0;border-top:0;display:inline;border-left:0;border-bottom:0;" height="380" alt="IMG_0365" src="http://thefoodiediaries.files.wordpress.com/2009/09/img_0365_thumb.jpg?w=505&#038;h=380" width="505" border="0" /></a>&#160; </p>
<p><strong>Oh my god.</strong> Genius. The raisins and the figs were the perfect addition, and apples in almond milk? What an unlikely badass duo? This breakfast will be making frequent appearances.</p>
<p>I sort of wanted it again for lunch, but in an attempt avoid both monotony and physical transformation into a green apple, I went for this:</p>
<p><a href="http://thefoodiediaries.files.wordpress.com/2009/09/img_0377.jpg"><img title="IMG_0377" style="border-right:0;border-top:0;display:inline;border-left:0;border-bottom:0;" height="388" alt="IMG_0377" src="http://thefoodiediaries.files.wordpress.com/2009/09/img_0377_thumb.jpg?w=516&#038;h=388" width="516" border="0" /></a> </p>
<p>That’d be Jenny’s <strong><a href="http://www.pbandjenny.com/2009/08/best-wrapper-alive.html">best wrapper alive</a></strong>, which I’d previously <a href="http://thefoodiediaries.wordpress.com/2009/09/03/its-10-p-m-do-you-know-where-your-dinner-is/">remixed</a>. I used all the original’s components this time: tuna, garlic &#38; herb LC, plain greek yogurt, diced apple and salt &#38; pepper on a whole wheat wrap. </p>
<p><a href="http://thefoodiediaries.files.wordpress.com/2009/09/img_0378.jpg"><img title="IMG_0378" style="border-right:0;border-top:0;display:inline;border-left:0;border-bottom:0;" height="325" alt="IMG_0378" src="http://thefoodiediaries.files.wordpress.com/2009/09/img_0378_thumb.jpg?w=245&#038;h=325" width="245" border="0" /></a> <a href="http://thefoodiediaries.files.wordpress.com/2009/09/img_0379.jpg"><img title="IMG_0379" style="border-right:0;border-top:0;display:inline;margin-left:0;border-left:0;margin-right:0;border-bottom:0;" height="325" alt="IMG_0379" src="http://thefoodiediaries.files.wordpress.com/2009/09/img_0379_thumb.jpg?w=245&#038;h=325" width="245" border="0" /></a>&#160;&#160; </p>
<p>Lil’ Wayne’s got some competition because this is, indeed, the best wrapper alive. I loved my remix, but the <strong>apples</strong> really were the key ingredient. The wrap was&#160; sort of overflowing—<em>all the good ones do</em>—but I managed to salvage any of its lost innards.<em> Si,</em> by that I do mean that I licked the plate.</p>
<p>Ok, I’m off to jumpstart my weekend (yes, weekends are still weekends when you’re unemployed because that’s when your employed friends come out to play!). I hope all your weekends are fun and food-filled!</p>
<p>T.G.I.F. (I wish Sabrina was still on),</p>
<p><strong><font size="5">-Sarah</font></strong></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[QuickDB - The MySQL Wrapper]]></title>
<link>http://sarfraznawaz.wordpress.com/2009/09/08/quickdb-the-mysql-wrapper/</link>
<pubDate>Tue, 08 Sep 2009 08:46:12 +0000</pubDate>
<dc:creator>Sarfraz Ahmed</dc:creator>
<guid>http://sarfraznawaz.wordpress.com/2009/09/08/quickdb-the-mysql-wrapper/</guid>
<description><![CDATA[When working on different projects, you have to use time-consuming mysql commands every now and then]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><img class="alignleft size-full wp-image-189" title="quickdb" src="http://sarfraznawaz.wordpress.com/files/2009/09/quickdb.png" alt="quickdb" width="300" height="184" />When working on different projects, you have to use time-consuming mysql commands every now and then. Same was the case with me and i had really got sick of all those commands, so i decided to create my own mysql wrapper with ability to perform the similar tasks far more quickly and easily than their mysql counterparts. I have used it in many projects i have developed and it has saved me about 50% of the time as compared to using mysql default functions.</p>
<p>You can download the file whole class with example <a title="QuickDB Mysql wrapper" href="http://www.phpclasses.org/browse/package/5318.html" target="_blank">here.</a></p>
<p><span style="color:#ffffff;">.</span><br />
<a title="Tweet This" href="http://twitter.com/home/?status=QuickDB The MySQL Wrapper http://tinyurl.com/ybjmlca" target="_blank"><img class="alignleft size-full wp-image-352" title="tweet_this" src="http://sarfraznawaz.wordpress.com/files/2009/09/tweet_this.png" alt="tweet_this" width="100" height="28" /></a><br />
<span style="color:#ffffff;">.</span></p>
<p>So here is the code for the sample file, name it <strong>quickdb_example.php</strong></p>
<pre class="brush: php;">
	// Online Class Location:
	// http://www.phpclasses.org/browse/package/5318.html

	/*

	In order to use the example here, you need to create a table,
	just execute the following SQL lines using your MySQL client:
	-------------------------------------------------------------

	################################
	CREATE TABLE `quickdbtest` (
	  `catid` int(11) NOT NULL auto_increment,
	  `catname` varchar(255) default NULL,
	  PRIMARY KEY  (`catid`)
	);
	insert  into `quickdbtest`(`catid`,`catname`) values (1,'Big'),(2,'Small'),(3,'Average'),(4,'Light'),(5,'Huge');
	################################

	*/

	// This file uses most of the functions of QuickDB MySQL wrapper.
	// It is very easy to use these funtions (methods), see below examples.
	// Once you know how to use this, i bet you are gonna use it in future as well <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> 

	require_once &#34;quickdb.class.php&#34;;
	// Argumentd are: host, user, password, database, persistent connection, show errors on screen
	$db = new QuickDB(&#34;localhost&#34;, &#34;root&#34;, &#34;&#34;, &#34;test&#34;, false, true);

	## execute Method/Function
	// it can run any query whether select, insert, update or delete like mysql_query function

	// returns:
	// 1) resource identifier for &#34;Select query&#34; that can later be used with mysql_fetch_array or mysql_fetch_object
	// 2) number of rows affected for &#34;insert, update or delete&#34; queries

																											// Usage Of:
																											// --------------------------

	$result = $db-&#62;execute(&#34;select * from quickdbtest order by catname&#34;);									// $db-&#62;execute
	// Or
	// 		$result = $db-&#62;select(&#34;quickdbtest&#34;);															// $db-&#62;select

	while ($row = mysql_fetch_array($result))
	{
		print $row[&#34;catname&#34;] . &#34;
&#34;;
	}

	print &#34;
Number of rows selected from previous query : &#34; . $db-&#62;count_select();						// $db-&#62;count_select()

	$affected = $db-&#62;execute(&#34;insert into quickdbtest set catname = 'New Category'&#34;);
	// Or
	//		$affected = $db-&#62;insert(&#34;quickdbtest&#34;, &#34;catname = 'New Category'&#34;);								// $db-&#62;insert

	print &#34;
Number of rows affected are: $affected&#34;;
	// Or
	print &#34;
Number of rows affected using class method: &#34; . $db-&#62;count_affected();						// $db-&#62;count_affected()
	$db-&#62;success_msg(&#34;Record was added successfully !!&#34;);

	$affected = $db-&#62;update(&#34;quickdbtest&#34;, &#34;catname = 'New Category 2'&#34;, &#34;catname = 'New Category'&#34;);		// $db-&#62;update
	print &#34;
Number of rows affected are: $affected&#34;;

	$db-&#62;delete(&#34;quickdbtest&#34;, &#34;catid = &#34; . $db-&#62;last_insert_id());											// $db-&#62;last_insert_id(), $db-&#62;delete
	print &#34;
Number of rows affected using class method: &#34; . $db-&#62;count_affected();

	print &#34;
Total records in table are: &#34; . $db-&#62;count_all(&#34;quickdbtest&#34;);								// $db-&#62;count_all

	print &#34;
Counting records using 'count_rows' : &#34; . $db-&#62;count_rows(&#34;select * from quickdbtest&#34;);	// $db-&#62;count_rows

	// $db-&#62;insert_update will update if row exists, or insert data if it doesn't with catid=5
	$affected = $db-&#62;insert_update(&#34;quickdbtest&#34;, &#34;catname='Test Category'&#34;, &#34;catid=5&#34;);					// $db-&#62;insert_update
	print &#34;
Number of rows affected are: $affected
&#34;;

	$result = $db-&#62;select_limited(&#34;quickdbtest&#34;, 4, 1);														// $db-&#62;select_limited

	while ($row = mysql_fetch_array($result))
	{
		print $row[&#34;catname&#34;] . &#34;
&#34;;
	}

	if ($db-&#62;has_rows(&#34;quickdbtest&#34;))																		// $db-&#62;has_rows
	{
		print &#34;This table is not empty, it has rows in it !!&#34;;
	}
	else
	{
		print &#34;Oops, the table is empty !!!&#34;;
	}

	if ($db-&#62;row_exists(&#34;select * from quickdbtest where catid = 5&#34;))										// $db-&#62;row_exists
	{
		print &#34;
Yes, row exists&#34;;
	}
	else
	{
		print &#34;
No, row does not exist&#34;;
	}

	// fetch a single row from db
	$row = $db-&#62;fetch_row(&#34;select * from quickdbtest where catid = 1&#34;);										// $db-&#62;fetch_row
	print &#34;
The fetched values are: &#34; . $row-&#62;catid . &#34; &#34; . $row-&#62;catname ;

	// fetch a single row from db
	$catname = $db-&#62;fetch_value(&#34;quickdbtest&#34;, &#34;catname&#34;, &#34;catid = 3&#34;);										// $db-&#62;fetch_value
	print &#34;
The fetched value is: &#34; . $catname;

	print &#34;
 The date today is: &#34; . $db-&#62;get_date();													// $db-&#62;get_date()
	print &#34;
 The current time is: &#34; . $db-&#62;get_time();													// $db-&#62;get_time()

	// $db-&#62;last_query() gives the last run query, may be useful for debugging queries
	print &#34;
 The last run query was: &#60;strong&#62;&#34; . $db-&#62;last_query()  . &#34;&#60;/strong&#62;

&#34;;

	// using very useful $db-&#62;load_data()
	$db-&#62;select(&#34;quickdbtest&#34;);																				// $db-&#62;select
	$data = $db-&#62;load_array();																				// $db-&#62;load_array()
	print_r($data);
	/////////////////////////

	// using another very useful function that convert db table to a html table
	$db-&#62;get_html(&#34;select * from quickdbtest order by catname&#34; , true, 'width = 50%, align=&#34;center&#34;');		// $db-&#62;get_html

	print &#34;
&#60;strong&#62;Database Tables&#60;/strong&#62;
&#34;;
	$db-&#62;list_tables();																						// $db-&#62;list_tables()

	print &#34;
&#60;strong&#62;Table Information&#60;/strong&#62;
&#34;;
	$db-&#62;table_info(&#34;quickdbtest&#34;);																			// $db-&#62;table_info

	$db-&#62;success_msg(&#34;Wow, this is cool class !!&#34;);															// $db-&#62;success_msg

	// just a wrong table to get that error
	$db-&#62;count_rows(&#34;select * from NO_TABLE&#34;);
	$db-&#62;display_errors();																					// $db-&#62;display_errros()

	$db-&#62;failure_msg(&#34;Oops, i must have received the error !!&#34;);											// $db-&#62;failure_msg

	$db-&#62;alert_msg(&#34;This is general alert message !!&#34;);														// $db-&#62;alert_msg

	print &#34;

&#34; . $db-&#62;success_msg(&#34;&#60;STRONG&#62;REQUEST:&#60;/STRONG&#62; IF YOU LIKE THIS THEN PLEASE GO AHEAD AND &#60;a href='http://www.phpclasses.org/browse/package/5318.html'&#62;RATE&#60;/a&#62; THIS AT PHPCLASSES.ORG, THANKS <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> &#34;) . &#34;

&#34;;
</pre>
<p>and here is the code for the class itself, <strong>quickdb.class.php</strong></p>
<pre class="brush: php;">
	#########################################################
	#			QuickDB-&#62;MySQL Wrapper Class				#
	#-------------------------------------------------------#
	#	Author: SARFRAZ AHMED CHANDIO						#
	#			Web Developer								#
	#			Brains Technology							#
	#			http://www.brainstech.com					#
	#			http://sarfraznawaz.wordpress.com			#
	#														#
	#	Date Created: 12 April 2009							#
	#########################################################

	#-------------------------------------------------------#
	# 	+++ Future Additions +++							#
	#-------------------------------------------------------#
	#	Paging												#
	#	Multi-Language Support								#
	#-------------------------------------------------------#

	class QuickDB
	{
		private $con 			= null;		// for db connection
		private $result 		= null;		// for mysql result resource id
		private $row 			= null;		// for fetched row
		private $rows 			= null;		// for number of rows fetched
		private $affected 		= null;		// for number of rows affected
		private $insert_id 		= null;		// for last inserted id
		private $query 			= null;		// for the last run query
		private $show_errors 	= null;		// for knowing whether to display errors
		private $emsg 			= null;		// for mysql error description
		private $eno 			= null;		// for mysql error number

		// Intialize the class with connection to db
		public function __construct($host, $user, $password, $db, $persistent = false, $show_errors = false)
		{
			if ($show_errors == true)
			{
				$this-&#62;show_errors = true;
			}

			if ($persistent == true)
			{
				$this-&#62;con = @mysql_pconnect($host, $user, $password);
			}
			else
			{
				$this-&#62;con = @mysql_connect($host, $user, $password);
			}

			if ($this-&#62;con)
			{
				$result = mysql_select_db($db, $this-&#62;con) or die(&#34;Could Not Select The Database !!&#34;);
				return $result;
			}
			else
			{
				die(&#34;Could Not Establish The Connection !!&#34;);
			}
		}

		// Close the connection to database
		public function __destruct()
		{
			$this-&#62;close();
		}

		// Close the connection to database
		public function close()
		{
			$result = @mysql_close($this-&#62;con);
			return $result;
		}

		// stores mysql errors
		private function setError($msg, $no)
		{
			$this-&#62;emsg = $msg;
			$this-&#62;eno = $no;

			if ($this-&#62;show_errors == true)
			{
				print '
&#60;div style=&#34;background:#f6f6f6; padding:5px; font-size:13px; font-family:verdana; border:1px solid #cccccc;&#34;&#62;
						&#60;span style=&#34;color:#ff0000;&#34;&#62;MySQL Error Number&#60;/span&#62; : ' . $no . '
						&#60;span style=&#34;color:#ff0000;&#34;&#62;MySQL Error Message&#60;/span&#62; : ' . $msg . '&#60;/div&#62;
';
			}
		}

		#################################################
		#				General Functions				#
		#################################################

		// Runs the SQL query (general execute query function)
		public function execute($command)
		{
			# Params:
			# 		$command = query command

			if (!$command)
			{
				exit(&#34;No Query Command Specified !!&#34;);
			}

			$this-&#62;query = $command;

			// For Operational query
			if 	(
				(stripos($command, &#34;insert &#34;) !== false) &#124;&#124;
				(stripos($command, &#34;update &#34;) !== false) &#124;&#124;
				(stripos($command, &#34;delete &#34;) !== false) &#124;&#124;
				(stripos($command, &#34;replace &#34;) !== false)
				)
			{
				$this-&#62;result = mysql_query($command) or $this-&#62;setError(mysql_error(), mysql_errno());

				if (stripos($command, &#34;insert &#34;) !== false)
				{
					if ($this-&#62;result)
					{
						$this-&#62;insert_id = intval(mysql_insert_id());
					}
				}

				if ($this-&#62;result)
				{
					$this-&#62;affected = intval(mysql_affected_rows());
					// return the number of rows affected
					return $this-&#62;affected;
				}
			}
			else
			{
				// For Selection query
				$this-&#62;result = mysql_query($command) or $this-&#62;setError(mysql_error(), mysql_errno());
				if ($this-&#62;result)
				{
					$this-&#62;rows = intval(mysql_num_rows($this-&#62;result));
					// return the query resource for later processing
					return $this-&#62;result;
				}
			}
		}

		// Gets records from table
		public function select($table, $rows = &#34;*&#34;, $condition = null, $order = null)
		{
			# Params:
			# 		$table = the name of the table
			#		$rows = rows to be selected
			# 		$condition = example: where id = 99
			#		$order = ordering field name

			if (!$table)
			{
				exit(&#34;No Table Specified !!&#34;);
			}

			$sql = &#34;select $rows from $table&#34;;

			if($condition)
			{
				$sql .= ' where ' . $condition;
			}
			else if($order)
			{
				$sql .= ' order by ' . $order;
			}

			$this-&#62;query = $sql;
			$this-&#62;result = mysql_query($sql) or $this-&#62;setError(mysql_error(), mysql_errno());

			if ($this-&#62;result)
			{
				$this-&#62;rows = intval(mysql_num_rows($this-&#62;result));
				// return the query resource for later processing
				return $this-&#62;result;
			}
		}

		// Inserts records
		public function insert($table, $data)
		{
			# Params:
			# 		$table = the name of the table
			# 		$data = field/value pairs to be inserted

			if ($table)
			{
				if ($data)
				{
					$this-&#62;result = mysql_query(&#34;insert into $table set $data&#34;) or $this-&#62;setError(mysql_error(), mysql_errno());
					$this-&#62;query = &#34;insert into $table set $data&#34;;

					if ($this-&#62;result)
					{
						$this-&#62;affected = intval(mysql_affected_rows());
						$this-&#62;insert_id = intval(mysql_insert_id());
						// return the number of rows affected
						return $this-&#62;affected;
					}
				}
				else
				{
					print &#34;No Data Specified !!&#34;;
				}
			}
			else
			{
				print &#34;No Table Specified !!&#34;;
			}
		}

		// Updates records
		public function update($table, $data, $condition)
		{
			# Params:
			# 		$table = the name of the table
			# 		$data = field/value pairs to be updated
			# 		$condition = example: where id = 99

			if ($table)
			{
				if ($data)
				{
					if ($condition)
					{
						$this-&#62;result = mysql_query(&#34;update $table set $data where $condition&#34;) or $this-&#62;setError(mysql_error(), mysql_errno());
						$this-&#62;query = &#34;update $table set $data where $condition&#34;;

						if ($this-&#62;result)
						{
							$this-&#62;affected = intval(mysql_affected_rows());
							// return the number of rows affected
							return $this-&#62;affected;
						}
					}
					else
					{
						print &#34;No Condition Specified !!&#34;;
					}
				}
				else
				{
					print &#34;No Data Specified !!&#34;;
				}
			}
			else
			{
				print &#34;No Table Specified !!&#34;;
			}
		}

		// Deletes records
		public function delete($table, $condition)
		{
			# Params:
			# 		$table = the name of the table
			# 		$condition = example: where id = 99

			if ($table)
			{
				if ($condition)
				{
					$this-&#62;result = mysql_query(&#34;delete from $table where $condition&#34;) or $this-&#62;setError(mysql_error(), mysql_errno());
					$this-&#62;query = &#34;delete from $table where $condition&#34;;

					if ($this-&#62;result)
					{
						$this-&#62;affected = intval(mysql_affected_rows());
						// return the number of rows affected
						return $this-&#62;affected;
					}
				}
				else
				{
					print &#34;No Condition Specified !!&#34;;
				}
			}
			else
			{
				print &#34;No Table Specified !!&#34;;
			}
		}

		// returns table data in array
		public function load_array()
		{
			$arr = array();

			while ($row = mysql_fetch_object($this-&#62;result))
			{
				$arr[] = $row;
			}

			return $arr;
		}

		// print a complete html table from the specified db table
		public function get_html($command, $display_field_headers = true, $table_attribs = 'border=&#34;0&#34; cellpadding=&#34;5&#34; cellspacing=&#34;0&#34; style=&#34;padding-bottom:5px; border:1px solid #cccccc; font-size:13px; font-family:verdana;&#34;')
		{
			if (!$command)
			{
				exit(&#34;No Query Command Specified !!&#34;);
			}

			$this-&#62;query = $command;
			$this-&#62;result = mysql_query($command) or $this-&#62;setError(mysql_error(), mysql_errno());

			if ($this-&#62;result)
			{
				$this-&#62;rows = intval(mysql_num_rows($this-&#62;result));

				$num_fields = mysql_num_fields($this-&#62;result);

				print '
&#60;div&#62;
&#60;table ' . $table_attribs . '&#62;'
						. &#34;\n&#34; . '
&#60;tr&#62;';

				if ($display_field_headers == true)
				{
					// printing table headers
					for($i = 0; $i &#60; $num_fields; $i++)
					{
						$field = mysql_fetch_field($this-&#62;result);
						print &#34;
&#60;td bgcolor='#f6f6f6' style=' border:1px solid #cccccc; padding:5px;'&#62;&#60;strong style='color:#666666;'&#62;&#34; . ucwords($field-&#62;name) . &#34;&#60;/strong&#62;&#60;/td&#62;
\n&#34;;
					}
					print &#34;&#60;/tr&#62;
\n&#34;;
				}

				// printing table rows
				while($row = mysql_fetch_row($this-&#62;result))
				{
					print &#34;
&#60;tr&#62;&#34;;

					foreach($row as $td)
					{
						print &#34;
&#60;td bgcolor='#f6f6f6'&#62;$td&#60;/td&#62;
\n&#34;;
					}

					print &#34;&#60;/tr&#62;
\n&#34;;
				}
				print &#34;&#60;/table&#62;
&#60;/div&#62;
&#34;;
			}
		}

		public function last_insert_id()
		{
			if ($this-&#62;insert_id)
			{
				return $this-&#62;insert_id;
			}
		}

		// Counts all records from a table
		public function count_all($table)
		{
			if (!$table)
			{
				exit(&#34;No Table Specified !!&#34;);
			}

			$this-&#62;result = mysql_query(&#34;select count(*) as total from $table&#34;) or $this-&#62;setError(mysql_error(), mysql_errno());
			$this-&#62;query = &#34;select count(*) as total from $table&#34;;

			if ($this-&#62;result)
			{
				$this-&#62;row = mysql_fetch_array($this-&#62;result);
				return intval($this-&#62;row[&#34;total&#34;]);
			}
		}

		// Counts records based on specified criteria
		public function count_rows($command)
		{
			# Params:
			# 		$command = query command

			if (!$command)
			{
				exit(&#34;No Query Command Specified !!&#34;);
			}

			$this-&#62;query = $command;
			$this-&#62;result = mysql_query($command) or $this-&#62;setError(mysql_error(), mysql_errno());

			if ($this-&#62;result)
			{
				return intval(mysql_num_rows($this-&#62;result));
			}
		}

		// Updates a row if it exists or adds if it doesn't already exist.
		public function insert_update($table, $data, $condition)
		{
			# Params:
			# 		$table = the name of the table
			# 		$data = field/value pairs to be added/updated
			# 		$condition = example: where id = 99

			if ($table)
			{
				if ($data)
				{
					if ($condition)
					{
						if ($this-&#62;row_exists(&#34;select * from $table where $condition&#34;))
						{
							$this-&#62;result = mysql_query(&#34;update $table set $data where $condition&#34;) or $this-&#62;setError(mysql_error(), mysql_errno());
							$this-&#62;query = &#34;update $table set $data where $condition&#34;;

							if ($this-&#62;result)
							{
								$this-&#62;affected = intval(mysql_affected_rows());
								// return the number of rows affected
								return $this-&#62;affected;
							}
						}
						else
						{
							$this-&#62;result = mysql_query(&#34;insert into $table set $data&#34;) or $this-&#62;setError(mysql_error(), mysql_errno());
							$this-&#62;query = &#34;insert into $table set $data&#34;;

							if ($this-&#62;result)
							{
								$this-&#62;insert_id = intval(mysql_insert_id());
								$this-&#62;affected = intval(mysql_affected_rows());
								// return the number of rows affected
								return $this-&#62;affected;
							}
						}
					}
					else
					{
						print &#34;No Condition Specified !!&#34;;
					}
				}
				else
				{
					print &#34;No Data Specified !!&#34;;
				}
			}
			else
			{
				print &#34;No Table Specified !!&#34;;
			}
		}

		// Runs the sql query with claus &#34;limit x, x&#34;
		public function select_limited($table, $start, $return_count, $condition = null, $order = null)
		{
			# Params:
			# 		$start = starting row for limit clause
			# 		$return_count = number of records to fetch
			# 		$condition = example: where id = 99
			# 		$order = ordering field name

			if ($table &#38;&#38; $start &#62;= 0 &#38;&#38; $return_count)
			{
				if ($condition)
				{
					if ($order)
					{
						$this-&#62;result = mysql_query(&#34;select * from $table where $condition order by $order limit $start, $return_count&#34;) or $this-&#62;setError(mysql_error(), mysql_errno());
						$this-&#62;query = &#34;select * from $table where $condition order by $order limit $start, $return_count&#34;;
					}
					else
					{
						$this-&#62;result = mysql_query(&#34;select * from $table where $condition limit $start, $return_count&#34;) or $this-&#62;setError(mysql_error(), mysql_errno());
						$this-&#62;query = &#34;select * from $table where $condition limit $start, $return_count&#34;;
					}
				}
				else
				{
					if ($order)
					{
						$this-&#62;result = mysql_query(&#34;select * from $table order by $order limit $start, $return_count&#34;) or $this-&#62;setError(mysql_error(), mysql_errno());
						$this-&#62;query = &#34;select * from $table order by $order limit $start, $return_count&#34;;
					}
					else
					{
						$this-&#62;result = mysql_query(&#34;select * from $table limit $start, $return_count&#34;) or $this-&#62;setError(mysql_error(), mysql_errno());
						$this-&#62;query = &#34;select * from $table limit $start, $return_count&#34;;
					}
				}

				if ($this-&#62;result)
				{
					$this-&#62;rows = intval(mysql_num_rows($this-&#62;result));
					// return the query resource for later processing
					return $this-&#62;result;
				}
			}
			else
			{
				print &#34;Parameter Missing !!&#34;;
			}
		}

		#################################################
		#				Utility Functions				#
		#################################################

		// Counts rows from last Select query
		public function count_select()
		{
			if ($this-&#62;rows)
			{
				return $this-&#62;rows;
			}
		}

		// Gets the number of affected rows after Operational query has executed
		public function count_affected()
		{
			if ($this-&#62;affected)
			{
				return $this-&#62;affected;
			}
		}

		// Checks whether a table has records
		public function has_rows($table)
		{
			$rows = $this-&#62;count_all($table);

			if ($rows)
			{
				return true;
			}
			else
			{
				return false;
			}
		}

		// Checks whether or not a row exists with specified criteria
		public function row_exists($command)
		{
			# Params:
			# 		$command = query command

			if (!$command)
			{
				exit(&#34;No Query Command Specified !!&#34;);
			}

			$this-&#62;query = $command;
			$this-&#62;result = mysql_query($command) or $this-&#62;setError(mysql_error(), mysql_errno());

			if ($this-&#62;result)
			{
				if (mysql_num_rows($this-&#62;result))
				{
					return true;
				}
				else
				{
					return false;
				}
			}
		}

		// Returns single fetched row
		public function fetch_row($command)
		{

			if (!$command)
			{
				exit(&#34;No Query Command Specified !!&#34;);
			}

			$this-&#62;query = $command;
			$this-&#62;result = mysql_query($command) or $this-&#62;setError(mysql_error(), mysql_errno());

			if ($this-&#62;result)
			{
				$this-&#62;rows = intval(mysql_num_rows($this-&#62;result));
				$this-&#62;row = mysql_fetch_object($this-&#62;result);
				return $this-&#62;row;
			}
		}

		// Returns single field value
		public function fetch_value($table, $field, $condition = null)
		{

			if (!$table &#124;&#124; !$field)
			{
				exit(&#34;Arguments Missing !!&#34;);
			}

			$query = &#34;select $field from $table&#34;;

			if ($condition != null)
			{
				$query = &#34;select $field from $table where $condition&#34;;
			}

			$this-&#62;query = $query;
			$this-&#62;result = mysql_query($query) or $this-&#62;setError(mysql_error(), mysql_errno());

			if ($this-&#62;result)
			{
				$this-&#62;rows = intval(mysql_num_rows($this-&#62;result));
				$this-&#62;row = mysql_fetch_object($this-&#62;result);
				return $this-&#62;row-&#62;$field;
			}
		}

		// Returns the last run query, useful for debugging queries
		public function last_query()
		{
			if ($this-&#62;query)
			{
				return $this-&#62;alert_msg($this-&#62;query);
			}
		}

		// Gets today's date
		public function get_date($format = null)
		{
			# Params:
			#		$format = date format like Y-m-d

			if ($format)
			{
				$today = date($format);
			}
			else
			{
				$today = date(&#34;Y-m-d&#34;);
			}

			return $today;
		}

		// Gets currents time
		public function get_time($format = null)
		{
			# Params:
			#		$format = date format like H:m:s

			if ($format)
			{
				$time = date($format);
			}
			else
			{
				$time = date(&#34;H:m:s&#34;);
			}

			return $time;
		}

		// Adds slash to the string irrespective of the setting of getmagicquotesgpc
		public function smartslashes($value)
		{
			if (get_magic_quotes_gpc())
			{
				$value = stripslashes($value);
			}

			if (!is_numeric($value))
			{
				$value = mysql_real_escape_string($value);
			}

			return $value;
		}

		// This function can be used to discard any characters that can be used to manipulate the SQL queries or SQL injection

		/* EXAMPLE USE:

			if (is_valid($_REQUEST[&#34;username&#34;]) === true &#38;&#38; is_valid($_REQUEST[&#34;pass&#34;]) === true)
			{
				//login now
			}
		*/

		public function is_valid($input)
		{
			$input = strtolower($input);

			if (str_word_count($input) &#62; 1)
			{
				$loop = &#34;true&#34;;
				$input = explode(&#34; &#34;,$input);
			}

			$bad_strings = array(&#34;'&#34;,&#34;--&#34;,&#34;select&#34;,&#34;union&#34;,&#34;insert&#34;,&#34;update&#34;,&#34;like&#34;,&#34;delete&#34;,&#34;1=1&#34;,&#34;or&#34;);

			if ($loop)
			{
				foreach($input as $value)
				{
					if (in_array($value, $bad_strings))
					{
					  return false;
					}
					else
					{
					  return true;
					}
				}
			}
			else
			{
				if (in_array($input, $bad_strings))
				{
				  return false;
				}
				else
				{
				  return true;
				}
			}
		}

		// lists tables of database
		public function list_tables()
		{
			$this-&#62;result = mysql_query(&#34;show tables&#34;);
			$this-&#62;query = &#34;show tables&#34;;

			if ($this-&#62;result)
			{
				$tables = array();
				while($row = mysql_fetch_array($this-&#62;result))
				{
					$tables[] = $row[0];
				}

				foreach ($tables as $table)
				{
					print $table . &#34;
&#34;;
				}
			}
		}

		// provides info about given table
		public function table_info($table)
		{
			if ($table)
			{
				$this-&#62;result = mysql_query(&#34;select * from $table&#34;);
				$this-&#62;query = &#34;select * from $table&#34;;

				$fields = mysql_num_fields($this-&#62;result);
				$rows   = mysql_num_rows($this-&#62;result);
				$table = mysql_field_table($this-&#62;result, 0);

				print &#34;	The '&#60;strong&#62;&#34; . $table . &#34;&#60;/strong&#62;' table has &#60;strong&#62;&#34; . $fields . &#34;&#60;/strong&#62; fields and &#60;strong&#62;&#34; . $rows . &#34;&#60;/strong&#62;
						record(s) with following fields.\n
&#60;ul&#62;&#34;;

				for ($i=0; $i &#60; $fields; $i++)
				{
					$type  = mysql_field_type($this-&#62;result, $i);
					$name  = mysql_field_name($this-&#62;result, $i);
					$len   = mysql_field_len($this-&#62;result, $i);
					$flags = mysql_field_flags($this-&#62;result, $i);

					print &#34;&#60;strong&#62;
	&#60;li&#62;&#34; . $type . &#34; &#34; . $name . &#34; &#34; . $len . &#34; &#34; . $flags . &#34;&#60;/strong&#62;&#60;/li&#62;
\n&#34;;
				}
				print &#34;&#60;/ul&#62;
&#34;;

			}
			else
			{
				print &#34;The table not specified !!&#34;;
			}
		}

		// displays any mysql errors generated
		public function display_errors()
		{
			if ($this-&#62;show_errors == false)
			{
				if ($this-&#62;emsg)
				{
					print '
&#60;div style=&#34;background:#f6f6f6; padding:5px; font-size:13px; font-family:verdana; border:1px solid #cccccc;&#34;&#62;
							&#60;span style=&#34;color:#ff0000;&#34;&#62;MySQL Error Number&#60;/span&#62; : ' . $this-&#62;eno . '
							&#60;span style=&#34;color:#ff0000;&#34;&#62;MySQL Error Message&#60;/span&#62; : ' . $this-&#62;emsg . '&#60;/div&#62;
';
				}
				else
				{
					print '
&#60;div style=&#34;background:#f6f6f6; padding:5px; font-size:13px; font-family:verdana; border:1px solid #cccccc;&#34;&#62;
							&#60;strong&#62;No Erros Found !!&#60;/strong&#62;&#60;/div&#62;
';
				}
			}
		}

		// to display success message
		public function success_msg($msg)
		{
			print '
&#60;div align=&#34;center&#34; style=&#34;background:#EEFDD7; padding:5px; font-size:13px; font-family:tahoma, verdana; border:1px solid #8DD607; margin:5px 0px 5px 0px;&#34;&#62;
					&#60;strong&#62;' . $msg . '
					&#60;/strong&#62;&#60;/div&#62;
';
		}

		// to display failure message
		public function failure_msg($msg)
		{
			print '
&#60;div align=&#34;center&#34; style=&#34;background:#FFF2F2; padding:5px; font-size:13px; font-family:tahoma, verdana; border:1px solid #FF8080; margin:5px 0px 5px 0px;&#34;&#62;
					&#60;strong&#62;' . $msg . '
					&#60;/strong&#62;&#60;/div&#62;
';
		}

		// to display general alert message
		public function alert_msg($msg)
		{
			print '
&#60;div align=&#34;center&#34; style=&#34;background:#FFFFCC; padding:5px; font-size:13px; font-family:tahoma, verdana; border:1px solid #CCCC33; margin:5px 0px 5px 0px;&#34;&#62;
					&#60;strong&#62;' . $msg . '
					&#60;/strong&#62;&#60;/div&#62;
';
		}

	////////////////////////////////////////////////////////
	}
</pre>
<p>Enjoy and reply with your feedbacks <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
</div>]]></content:encoded>
</item>

</channel>
</rss>
