<?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>encoding &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://wordpress.com/tag/encoding/</link>
	<description>Feed of posts on WordPress.com tagged "encoding"</description>
	<pubDate>Sun, 12 Oct 2008 03:29:53 +0000</pubDate>

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

<item>
<title><![CDATA[Cambiar la codificación de caracteres de un fichero XML]]></title>
<link>http://tykall.wordpress.com/?p=134</link>
<pubDate>Sat, 11 Oct 2008 00:01:18 +0000</pubDate>
<dc:creator>tykall</dc:creator>
<guid>http://tykall.wordpress.com/2008/10/11/cambiar-la-codificacion-de-caracteres-de-un-fichero-xml/</guid>
<description><![CDATA[Por defecto XI genera los mensajes XML en formato UTF-8. Para que estos se codifiquen en otro format]]></description>
<content:encoded><![CDATA[<p>Por defecto XI genera los mensajes XML en formato UTF-8. Para que estos se codifiquen en otro formato como el ISO-8859-1 habrá que configurar el adaptador receptor para que éste se encargue de hacerlo.</p>
<p>Como ejemplo se mostrará la configuración para un receptor de tipo fichero. Para lograr que el “contenido” del fichero se muestre en formato ISO-8859-1 se necesita añadir un módulo específico al adaptador que se encarga de realizar la conversión, entre otras cosas. En el caso de los ficheros XML, para que el módulo pueda procesar el contenido del fichero éste deberá ser de tipo BINARIO, de otro modo se producirá una excepción a la hora de procesar el fichero diciendo que el fichero pasado no se encuentra en el formato correcto. Esta restricción queda especificada en el enlace <a href="http://help.sap.com/saphelp_nw04/Helpdata/EN/bc/bb79d6061007419a081e58cbeaaf28/content.htm">Configuring the Receiver File/FTP Adapter</a>, en el apartado "Select the File Type of the document".</p>
<p style="text-align:center;"><a href="http://tykall.files.wordpress.com/2008/10/file_adapter_parameters_processing.png"><img class="size-medium wp-image-135 aligncenter" title="file_adapter_parameters_processing" src="http://tykall.wordpress.com/files/2008/10/file_adapter_parameters_processing.png?w=300" alt="" width="300" height="128" /></a></p>
<p>En la pestaña Module del adaptador se inserta el módulo AF_Modules/XMLAnonymizerBean en una posición anterior al módulo CallSapAdapter ya que de lo contrario se enviaría el fichero antes de procesarlo.</p>
<p><a href="http://tykall.files.wordpress.com/2008/10/file_adapter_module.png"><img class="aligncenter size-medium wp-image-136" title="file_adapter_module" src="http://tykall.wordpress.com/files/2008/10/file_adapter_module.png?w=300" alt="" width="300" height="150" /></a></p>
<p>Una vez definido el módulo como tipo “Local Enterprise Bean”, se deberán especificar los parámetros anonymizer.acceptNamespaces y anonymizer.encoding. El primero sirve para filtrar los Espacios de Nombre (namespaces) del fichero que se desean conservar (los que no se informen aquí se eliminarán del fichero). Hay que tener en cuenta que un fichero XML puede contener más de un espacio de nombres definido y a través de este parámetro también se permitirá renombrar a los mismos. En el caso del namespace principal se indicará haciéndole corresponder 2 comillas simples (‘’). En la nota 880173 - XI 3.0 Adapter Framework XML Anonymizer Modulese se muestran varios ejemplos sobre el comportamiento de estos parámetros.</p>
<p>El segundo parámetro, encoding, indica el formato con el que se generarán los datos del fichero.</p>
<p>En este caso los valores que se le han dado a los parámetros han sido:</p>
<ul>
<li>anonymizer.acceptNamespaces = http://www.tirea.es/CAS/MultiComunicacionCAS ‘’</li>
<li>anonymizer.encoding = ISO-8859-1</li>
</ul>
<p>Para más información se pueden consultar los siguientes enlaces:</p>
<ul>
<li><a href="http://help.sap.com/saphelp_nw04/helpdata/en/45/d169186a29570ae10000000a114a6b/content.htm">XMLAnonymizerBean</a></li>
<li><span><a href="http://help.sap.com/saphelp_nw04/Helpdata/EN/bc/bb79d6061007419a081e58cbeaaf28/content.htm">Configuring the Receiver File/FTP Adapter</a><br />
</span></li>
<li><a href="https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/502991a2-45d9-2910-d99f-8aba5d79fb42">How To... Work with Character Encodings in Process Integration</a></li>
</ul>
]]></content:encoded>
</item>
<item>
<title><![CDATA[UTF-8 Endlösung in Python]]></title>
<link>http://drazraeltod.wordpress.com/?p=912</link>
<pubDate>Thu, 09 Oct 2008 08:57:51 +0000</pubDate>
<dc:creator>Dr. Azrael Tod</dc:creator>
<guid>http://drazraeltod.wordpress.com/2008/10/09/utf-8-endlosung-in-python/</guid>
<description><![CDATA[Da ich seit einiger Zeit von diversen Codierungsproblemen in Python genervt bin (und das sicher nich]]></description>
<content:encoded><![CDATA[<p>Da ich seit einiger Zeit von diversen Codierungsproblemen in Python genervt bin (und das sicher nicht nur mir so geht, z.B. <a href="http://www.wangoo.de/2008/07/python-utf8-und-bom-byte-order-mark/" target="_blank">Snookie hat da auch so seine Probleme</a>), habe ich mir nun eine mini-Funktion geschrieben die meine Probleme zu einem guten Teil lösen sollte.</p>
<p>Hauptproblem war: Wie bringe ich diverse Strings aus dem IRC (von den man nie weiß in welcher Codierung sie ankommen) in ein generelles UTF-8-Format?<!--more--></p>
<p><code><span><br />
def encodeMsg(self, msg):<br />
try:<br />
return msg.encode('utf-8')<br />
except:<br />
return msg<br />
</span></code></p>
<p>Das Ganze ist sicher noch zu verbessern, ein generelles except ist z.B. sicher kein guter Code (hier nicht so wichtig, aber bei längeren Abschnitten kann das nervig werden) aber es tut zumindest erstmal.<br />
Diese Funktion rufe ich nun auf wenn ich meine Nachrichten versende und schon hab ich keine Probleme mehr... egal ob die Daten in UTF-8 kommen oder nicht.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[La chaîne d'encodage UTF-8... de la requête client à la réponse serveur.]]></title>
<link>http://haveacafe.wordpress.com/?p=138</link>
<pubDate>Thu, 09 Oct 2008 02:22:03 +0000</pubDate>
<dc:creator>haveacafe</dc:creator>
<guid>http://haveacafe.wordpress.com/2008/10/09/la-chaine-dencodage-utf-8-de-la-requete-client-a-la-reponse-serveur/</guid>
<description><![CDATA[Lors de la mise en production d&#8217;une application web, j&#8217;ai du faire face comme tout progr]]></description>
<content:encoded><![CDATA[<p>Lors de la mise en production d'une application web, j'ai du faire face comme tout programmeur un jour ou l'autre à un problème, assez pénible, de charset:</p>
<p>Les accents (é, à et les ç) qui passaient pourtant sans broncher sur le serveur de dévelopement s'affichaient "cassés" sous forme Ä�... Bref de l'iso 8859 est venu mettre son nez dans notre circuit en UTF-8!</p>
<p>Les basiques à vérifier:</p>
<h2>1. entêtes des header lors de la requête, et lors de la réponse http:</h2>
<p><em>Pour vérifier les headers HTTp, je vous conseille l'excellent <strong>Live HTTP headers</strong>, plugin pour firefox...</em></p>
<p>Ils doivent spécifier un mime-type correct, suivi d'un point virgule et <strong>"charset=UTF-8"</strong></p>
<p>Cela se paramètre soit au niveau de votre serveur applicatif (<strong>header()</strong> en PHP, <strong>setContentType()</strong> avec J2EE / Java EE) soit au niveau d'Apache (directive <strong>addDefautCharset</strong>).</p>
<h2>2 Encodage du document:</h2>
<p>Le document HTML doit préciser la ligne meta suivante:</p>
<p><strong><span class="nodeLabelBox repTarget">&#60;<span class="nodeTag">meta</span><span class="nodeAttr editGroup"> <span class="nodeName editable">content</span>="<span class="nodeValue editable">text/html;charset=utf-8</span>"</span><span class="nodeAttr editGroup"> <span class="nodeName editable">http-equiv</span>="<span class="nodeValue editable">Content-Type</span>"</span><span class="nodeBracket editable insertBefore">/&#62;</span></span></strong></p>
<p>A partir de ces deux étapes tout document chez le client est donc en utf-8. Mais le problème persistait dans mon cas!</p>
<h2>3 Le système d'exploitation</h2>
<p>Taper<strong> locale charmap</strong> sous linux pour connaitre le charset utilisé par le système, en général UTF-8 par défaut sur les sytèmes récents, sinon un <strong>dpkg-reconfigure locales </strong>sera nécessaire (Debian).</p>
<h3>4 Le serveur applicatif</h3>
<p>Pour php, je ne peux plus rien pour vous, il ne gère pas l'utf8 en natif (bouuuuh, la honte !!!), il faudra vous <a title="utf8 php" href="http://fr2.php.net/manual/fr/ref.mbstring.php">renseigner </a>ailleurs sur ce sujet...Pour ce qui est des objets javascript, l'utf ne sera pas cassé car javascript gère parfaitement bien l'UTF-8 en natif par défaut. Java est par défaut en utf-8. A tout hasard, on peut forcer son usage en passant le paramètre <strong>Dfile.encoding=UTF-8</strong> à la JVM. Si vous lancez un serveur tomcat sous linux, il suffit pour cela de spécifier dans le script de démmarage du service: "<strong>CATALINA_OPTS="-Dfile.encoding=UTF-8"</strong>". Si vous utilisez un frontend, le passage de paramètres via l'url peut également casser l'utf-8 ... Configurez votre connecteur correctement avec l'attribut <strong>URIEncoding</strong> dans le <em>server.xml</em>. Voici un exemple:</p>
<p><strong>&#60;Connector port="8080" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="8443" acceptCount="100" debug="0" connectionTimeout="20000" disableUploadTimeout="true" <strong>URIEncoding="UTF-8</strong>"/&#62;</strong></p>
<h2>5 Le code source</h2>
<p>Concernant mon problème, ce n'était toujours pas reglé... J'étais désespéré, et je noyais mon chagrin en relisant la javadoc, quand soudain je tombai sur le <a href="http://fr.wikipedia.org/wiki/Deus_ex_machina">deus ex machina</a> du cycle de dévelopement d'une WebApp:</p>
<p><strong>request.setCharacterEncoding("UTF-8");<br />
response.setCharacterEncoding("UTF-8");</strong></p>
<h2>6. Encore plus loin</h2>
<p>Ouf! Pour moi l'aventure de la chasse à l'ISO 8859 était terminée, l'utf-8 regnait en maître, les derniers morceaux encodés en ISO se cachaient dans les recoins les plus sombres de la mémoire vive avant de mourir lors d'un sanglant reboot. Mais pour toi, lecteur qui cherche à résoudre ton problème d'encodage de caractères accentués, il faudra encore t'assurer que le reste de ta chaine de développement ne corrompt pas l'UTF 8. Par exempe, MySQL, crée tout ses tables en charset ISO latin par défaut :</p>
<div class="hl-main">
<p><strong><span class="hl-reserved">ALTER</span><span class="hl-code"> </span><span class="hl-reserved">TABLE</span><span class="hl-code"> </span><span class="hl-quotes">`</span><span class="hl-identifier">table_name</span><span class="hl-quotes">`</span><span class="hl-code"> </span><span class="hl-reserved">DEFAULT</span><span class="hl-code"> </span><span class="hl-reserved">CHARACTER</span><span class="hl-code"> </span><span class="hl-reserved">SET</span><span class="hl-code"> </span><span class="hl-identifier">utf8</span><span class="hl-code"> </span><span class="hl-reserved">COLLATE</span><span class="hl-code"> </span><span class="hl-identifier">utf8_bin</span></strong><span class="hl-identifier"> fera probablement l'affaire pour modifier a postériori une mauvaise création de table...<br />
</span></div>
<p>référence : <a href="http://dev.mysql.com/doc/refman/5.0/fr/charset-general.html">http://dev.mysql.com/doc/refman/5.0/fr/charset-general.html</a></p>
<p>Et puis... votre éditeur de texte doit lui aussi être configuré avec le bon charset... un erreur qui fait toujours sourire mais c'est parfois son propre outil qui ne sauve pas les fichiers avec le bon charset !</p>
<p>En espérant que cette petite checklist vous aura dépannés !</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Windows Media Video Compression Using Adobe Premiere Pro]]></title>
<link>http://veesoft.wordpress.com/?p=5</link>
<pubDate>Wed, 08 Oct 2008 16:03:44 +0000</pubDate>
<dc:creator>databack</dc:creator>
<guid>http://veesoft.wordpress.com/2008/10/08/windows-media-video-compression-using-adobe-premiere-pro/</guid>
<description><![CDATA[Windows Media Video Compression Using Adobe Premiere Pro
By [http://ezinearticles.com/?expert=Tom_Wa]]></description>
<content:encoded><![CDATA[<p>Windows Media Video Compression Using Adobe Premiere Pro<br />
By [http://ezinearticles.com/?expert=Tom_Wardrop]Tom Wardrop</p>
<p style="text-align:center;"><img src="http://www.buycdtoday.com/images/VCD/Adobe%20Premiere%20Pro%20CS3.jpg" alt="pre" width="130" height="157" /></p>
<p>I've written this tutorial for anyone who uses adobe premiere pro and wants to find out the best way to compress a video using "Windows Media Video".</p>
<p>I cover things like what bitrate to use with what resolution and frame rate aswell as what a few of the different settings do and mean. Find out for yourself and take a read...</p>
<p>(not you will need to copy and paste image url's in to your browser)</p>
<p>Getting to Adobe Media Encoder</p>
<p>1. Render all unrendered footage if you haven’t done so already in premiere pro</p>
<p>2. Now go, File &#62;&#62; Export &#62;&#62; Adobe Media Encoder</p>
<p>3. Select “Windows Media” from the format drop down list</p>
<p>4. Then, from the preset drop down list, select something like “WMV9 720 25p” (doesn’t really matter what you choose)</p>
<p>Video Settings</p>
<p>1. Select “Video” on the left hand side of the Adobe Media Encoder</p>
<p>2. Under Video, make sure…</p>
<p>Select “Windows Media Video 9” as the codec<br />
Leave “Allow Interlaced Processing” Unticked<br />
Under Bitrate Settings, Select “Two” encoding passes and make sure the mode is “Variable Constrained”. This offers way better results compared to a single encoding pass</p>
<p>Image: fullvoltage.com.au/index.php?action=dlattach;topic=333.0;id=29;image</p>
<p>Audio Settings</p>
<p>1. Select “Audio” on the left hand side of the Adobe Media Encoder</p>
<p>2. Under Audio, make sure…</p>
<p>Select “Windows Media Audio 9.1” as the audio codecUnder Bitrate Settings, Select “Two” encoding passes and make sure the mode is “Constant”. This will make sure the audio quality stays the same the whole way through the video</p>
<p>Image: fullvoltage.com.au/index.php?action=dlattach;topic=333.0;id=30;image</p>
<p>Audience Settings</p>
<p>1. Select “Audiences” on the left hand side of the Adobe Media Encoder</p>
<p>2. Audiences is the most important part as this is where you actually set the quality and the file size</p>
<p>3. Now, select your desired frame rate, it’s usually best to keep it at its original level. But, say you’re original level is 50 frames a second, reduce it to 25. If you’re going for a really small file, then you’d want to bring your fps down to 20 or 15, but 25 will always enhance the footage as it will appear a lot smoother.</p>
<p>4. For Pixel Aspect Ratio, set it to however you’re original footage is set. If you’re editing footage shot on the computer, then square pixels will give you the best results.</p>
<p>5. Frame Width and Frame Height is a big factor for when considering image quality with file size. You kind of need to match them both up. In theory, for simple scenes like a close up of a human face “1 bit” per 200 pixels will offer good results,you may even want to try 250 pixels per bit. But with a more complex scene which includes maybe scenery and shrubs or a fast action video.etc, you’d want to aim around “1 bit” per 100 pixels (no where over 140 pixels per bit). To work this out, simply look at all the scenes in your video. If your scenes vary a lot in terms of colour and complexity, then you want lesser pixels per bit, this will increase file size (or reduce image size) but will offer way better results otherwise. On the other hand, if you’re video contains long interviews with a still background. Then the compressor will be able to produce good results with a high pixel per bit rate.</p>
<p>6. Now, moving down to the basic audio settings, if you’re video contains a lot of sound and the sound is really important in the video. Then you wont want to go under 96kb/s, but I usually prefer to use 160kb/s or 128kb/s as if you compare the 160kb/s bitrate of the audio to the say 5000 bitrate of the video, you can see that the audio isn’t going to effect file size much in this case. The higher your video bitrate, the lesser the impact the audio will have on the filesize. Use CBR audio, not (A/V) CBR audio. Use stereo if your sound differs from channel to channel (most music does).</p>
<p>7. Back to the Video now, Set Decoder Complexity to Auto</p>
<p>8. For key frame interval, if you have a high action video with complex scenes, set this to about 1 or 2. On the other hand, if you have not so complex scenes like an interview with a still background, then you can raise this up to about 10.</p>
<p>9. Leave buffer size as default</p>
<p>10. Now, here is the good bit. Because earlier on, we set a Video Encoding mode to a Two pass encode with a variable but constrained bitrate. This means we can now give a maximum and average bitrate. It will use the maximum bitrate in the more complex scenes and will use the average bitrate for normal scenes. Now, setting your bitrate is important. This is basically, where we shove all our resolution and other data, in to a tightly packaged file. If you package your file to tight, bits of data start oozing out the corners which is why it’s important to package your video tight, but not too tight. Let’s say we have a rather complex video which is fairly fast paced with lots of different colours and scenes. We set our resolution to 1024x768 with a frame rate of 25 and we want excellent quality, but a small file size.</p>
<p>Ok, let’s put what we learnt in to play. Ok, 1024 multiplied by 768 gives us 786000 pixels. That means that every single frame will contain 786000 pixels. If our video is running at 25fps, that’s 19.2 million pixels a second. The way compressors work, is they look for similarities across multiple frames and they try and share the data. Sometimes, when you set the bitrate too low, it just can’t deal with that data so it needs to throw away some pixels. The lower the bitrate, the more pixels get thrown around or ripped up.</p>
<p>11. Now, we need to set the bitrate. So, seeing our scene is fairly complex, and we want good quality, I think 130 pixels per bit will be fine. So, lets divide 786000 by 130. This gives us 6040 bits. So, 6000 bits a second is what we need. We’ll set 6000 as the peak and 5000 as the average. Now, 5000 bits a second will produce a fairly large file in terms of the internet, but remember, we are using a resolution of 1024x768 which is very big in terms of the net, but we want viewers to see “all” the work we have put in to it.</p>
<p>12. Now, once the bitrate is set, we have our buffer size, the larger your bit rate, the larger you want your buffer size. In this case, a buffer of 20/25 will be fine (buffer usually doesn’t effect anything).</p>
<p>Image: fullvoltage.com.au/index.php?action=dlattach;topic=333.0;id=31;image</p>
<p>Saving</p>
<p>1. Now, save the preset buy hitting the floppy disk icon up the top of the Adobe Encoder Window. But, before you do that, place a comment for the preset if you want.</p>
<p>2. Now, hit ok at the bottom of the window which will then prompt you for a location to save it. It will also give an estimated file size based on your video length and you’re peak data rate (for both the video and audio). But seeing we are using a variable bit rate, this estimate is usually higher than the end result.</p>
<p>3. Let it render out, then enjoy.</p>
<p>Tips</p>
<p>It’s usually good to set your work area to a length of 5 seconds over a complex part of your video, that way, you can do test renders to find the best bit rate<br />
If you get errors while exporting and you use a hyperthreading processor or a dual core processor, visit this site to fix the problem. If you don’t get this problem, it may still be a good idea to visit the site and get the new adobe media encoder. http://www.adobe.com/support/techdocs/330380.html</p>
<p>I hope you learnt something from this tutorial Smiley</p>
<p>Cheers! http://www.fullvoltage.com.au</p>
<p>Article Source: http://EzineArticles.com/?expert=Tom_Wardrop http://EzineArticles.com/?Windows-Media-Video-Compression-Using-Adobe-Premiere-Pro&#38;id=169377</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[How To Encode PHP ]]></title>
<link>http://sutopa.wordpress.com/?p=5</link>
<pubDate>Wed, 08 Oct 2008 04:36:19 +0000</pubDate>
<dc:creator>topay</dc:creator>
<guid>http://sutopa.wordpress.com/2008/10/08/how-to-encode-php/</guid>
<description><![CDATA[Pada artikel ini saya coba membahas bagaimana cara meng-encode dan men-decode kode php, biasanya byk]]></description>
<content:encoded><![CDATA[<p>Pada artikel ini saya coba membahas bagaimana cara meng-encode dan men-decode kode php, biasanya byk programer-programer tidak menginginkan kode program yang di buatnya dapat dilihat oleh orang lain, dengan kata lain si programer ingin memproteksi kode-kode yang dibuatnya,</p>
<p>teknik yang paling mudah digunakan adalah dengan memanfaatkan base64-encode.<br />
base64 adalah satu kegunaan baris perintah yang digunakan untuk meng-encode serta men-dekode-kan berkas (file) dalam format ini.<br />
Itu mungkin digunakan di dalam satu saluran sebagai cara meng-encode atau memecahkan kode.</p>
<p>base64 kembali ke status 0 jika pemrosesan di selesaikan tanpa error, 1 jika satu I/O error terjadi atau error dideteksi dalam memecahkan kode satu berkas (file) yang menunjukan adalah salah atau tidak lengkap, dan 2 jika pemrosesan tidak dapat dilakukan sama sekali hak, sebagai contoh, kepada satu berkas (file) input kosong.</p>
<p>NAME</p>
<p>base64 - encode and decode base64 files</p>
<p>SYNOPSIS</p>
<p>base64 [ -d / -e ] [ options ] [ infile ] [ outfile ]</p>
<p>* Dekodekan string base64 (string/rantai base64 menyerupai YTM0NZomIzI2OTsmIzM0NTueYQ==)<br />
* Dekodekan satu base64 meng-encode berkas (file) (sebagai contoh ICO menyimpan file atau menyimpan file dari pesan MIME)<br />
* Mengkonversi data teks sumber dari beberapa halaman kode dan meng-encode mereka ke pada satu string base64 atau satu berkas (file)</p>
<p>contohnya sebelum di encode</p>
<p>&#60;?php<br />
echo "tes";<br />
?&#62;</p>
<p>sesudah di encode</p>
<p>&#60;?php<br />
$QEF66DA4204BB31A5B3766886895770EE="DQovKg0KRW5jb2RlciA6IEJvZURvZXQ<br />
gRW5jb2RlIHZlci4gMTkuMDgNCldFQiA6IGh0dHA6Ly9zdXRvcGEuY28uY2<br />
MvDQoqLw0KPz48P3BocA0KZWNobyAidGVzIjsNCj8+";eval<br />
(base64_decode($QEF66DA4204BB31A5B3766886895770EE));<br />
?&#62;</p>
<p>semoga bermanfaat</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[The forever-frame technique]]></title>
<link>http://vinaytech.wordpress.com/?p=149</link>
<pubDate>Thu, 25 Sep 2008 19:01:17 +0000</pubDate>
<dc:creator>Vinay J</dc:creator>
<guid>http://vinaytech.wordpress.com/2008/09/25/the-forever-frame-technique/</guid>
<description><![CDATA[
The forever-frame Comet technique is a true push implementation that is not based on polling, the X]]></description>
<content:encoded><![CDATA[<div>
<p>The forever-frame Comet technique is a true push implementation that is not based on polling, the XMLHttpRequest, or setting a dynamic script source.  Instead, features of HTTP 1.1 originally intended for transfer and incremental rendering of very large documents are put to use to incrementally deliver data through an HTML iframe element.</p>
<p>This technique is very low-latency because it avoids HTTP and TCP/IP set-up and tear-down by reusing a single long-lived connection.</p>
<h2>Chunked Encoding</h2>
<p>Chunked Encoding is the feature in the <a href="http://www.w3.org/Protocols/rfc2616/rfc2616.html">HTTP 1.1 specification</a> allowing a server to start sending a response before knowing its total length.  This allows the server to break a complete response into smaller “chunks”, sending them in series. Responses are easy to identify because their header contains “Transfer-Encoding: chunked”.  A specification for a message is as follows:</p>
<pre><code>
       Chunked-Body   = *chunk
                        last-chunk
                        trailer
                        CRLF

       chunk          = chunk-size [ chunk-extension ] CRLF
                        chunk-data CRLF
       chunk-size     = 1*HEX
       last-chunk     = 1*(”0″) [ chunk-extension ] CRLF

       chunk-extension= *( “;” chunk-ext-name [ "=" chunk-ext-val ] )
       chunk-ext-name = token
       chunk-ext-val  = token &#124; quoted-string
       chunk-data     = chunk-size(OCTET)
       trailer        = *(entity-header CRLF)
</code></pre>
<h2>Iframe</h2>
<p>In typical Comet server implementations such as mod_pubsub, KnowNow, and Lightstreamer, a hidden iframe element is opened in the browser after page load, establishing a long-lived connection inside the hidden iframe.  It is not supported in the current version of the Cometd client found in Dojo 1.0, but it will return in the near future.  That said, it’s simply a matter of using the DOM to create a hidden iframe, and setting the source with the necessary parameters to communicate with your Comet server.</p>
<h2>Incremental rendering and flushing</h2>
<p>Browsers incrementally render chunked encoded documents after each chunk is rendered.  Each chunk is wrapped in a script block, and executed with a function call in the Comet client library living in the parent document.  Not every browser behaves well.  For example, Internet Explorer requires a rendering element such as a &#60;br /&#62; tag, and Safari requires 1KB of data (usually sent in the form of whitespace), to force incremental rendering.  The major Comet toolkits provides these workarounds automatically.  In order to avoid excessive peak memory usage, the DOM nodes added to the iframe are typically removed after they are rendered.</p>
<h2>Summary</h2>
<p>The forever-frame technique uses HTTP 1.1 chunked encoding to establish a single, long-lived HTTP connection in a hidden iframe.  Data is pushed incrementally from the server to the client over this connection, and rendered incrementally by your web browser.</p></div>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Multiple video uploads with Tubemogul]]></title>
<link>http://dariusperkins.wordpress.com/?p=36</link>
<pubDate>Thu, 25 Sep 2008 10:59:37 +0000</pubDate>
<dc:creator>dariusperkins</dc:creator>
<guid>http://dariusperkins.wordpress.com/2008/09/25/multiple-video-uploads-with-tubemogul/</guid>
<description><![CDATA[
At work we have a bit of a nightmare trying to pick which video site to use. We currently use Brigh]]></description>
<content:encoded><![CDATA[<p><img class="alignnone" src="http://www.tubemogul.com/img/logo.gif" alt="" width="200" height="82" /></p>
<p>At work we have a bit of a nightmare trying to pick which video site to use. We currently use <a href="http://www.brightcove.tv/">Brightcove</a>, which has a nice uploading and conversion app and great embedded players that support playlists. Cos it's AOLTimeWarner though, their copyright restrictions are rather draconian - use ANY copyrighted music and they'll take your video down pronto.</p>
<p>Enter <a href="http://www.tubemogul.com/">Tubemogul</a>. No longer will you have to upload videos to one specific site, they upload it to shitloads of sites for you. <a href="http://www.tubemogul.com/about/video_sites.php">Check this link for a list of supported sites</a> (it's a lot). This is great for SEO of your own website, as it makes your content more visible (and any related links to your URL).</p>
<p>Sadly, they don't support uploads to Brightcove (nothing's perfect, eh?), but my workflow is this:</p>
<p>Export your finished video from your favourite editing app, encode it for the web into an FLV using Brightcove's Publishpod (also uploads to Brightcove), then upload that FLV to Tubemogul and distribute to the 20 sites they <em>do</em> support uploads to. Genius.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[How I Create the Ringtones]]></title>
<link>http://weeklyringtone.wordpress.com/?p=20</link>
<pubDate>Thu, 25 Sep 2008 02:46:06 +0000</pubDate>
<dc:creator>Jorge</dc:creator>
<guid>http://weeklyringtone.wordpress.com/2008/09/25/how-i-create-the-ringtones/</guid>
<description><![CDATA[OK, so I create the ringtones using Apple GarageBand. I really like that program. I just found the o]]></description>
<content:encoded><![CDATA[<p>OK, so I create the ringtones using <a href="http://www.apple.com/ilife/garageband/" target="_blank">Apple GarageBand</a>. I really like that program. I just found the other day that it has a guitar tuner built into it. I'm even using an old version of it (v2.0.2).</p>
<p>So, I create the "song", then use the "export to iTunes" function under the File Menu. It saves the file as a .aif file.</p>
<p>Then I open up an old <a href="http://www.panic.com/audion/download.html" target="_blank">Mac MP3 player called Audion</a> to encode it to MP3. It's a free program...it was once competing with WinAmp, but it looks like iTunes killed it. They offer it for free. I am using it instead of iTunes because as of one of their latest updates, I can't find where the preferrences is for changing the bit rate of the mp3 encoder.</p>
<p>So, with Audion, I set the preferrences to "mono", the Bit Rate to 64 kbps, and the quality to "fastest".</p>
<p>Once it's done encoding, I take that file and run it through a program called <a href="http://www.deepniner.net/mp3trimmer/" target="_blank">MP3 Trimmer</a>. It's free to try, but costs $10 to get rid of the reminder to register and pay.</p>
<p>I use this program to trim the mp3 in case there's too much silence at the end (I have found that Garage band adds some silence to the end of tracks if they are really short).</p>
<p>MP3 Trimmer doesn't change the  encoding settings, so I just save it and then I'm done.</p>
<p>Well, then  upload it to my server and then post about it here.</p>
<p>So, there's my process.</p>
<p>jorge</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[PHP &amp; XML]]></title>
<link>http://htdocs.wordpress.com/?p=3</link>
<pubDate>Wed, 24 Sep 2008 17:48:43 +0000</pubDate>
<dc:creator>htdocs</dc:creator>
<guid>http://htdocs.wordpress.com/2008/09/24/php-xml/</guid>
<description><![CDATA[Estudando um pouco de PHP me deparei com o seguinte problema: utilizando a biblioteca expat para faz]]></description>
<content:encoded><![CDATA[<p>Estudando um pouco de PHP me deparei com o seguinte problema: utilizando a biblioteca expat para fazer o parse em um arquivo XML o resultado estava sendo gerado com erro de encoding. Procurando a solução pela internet, encontrei dois links bastante interessante. O <a href="http://webprogramming.livejournal.com/#webprogramming1327" target="_blank">primeiro</a> explica que o PHP possui uma "característica"* que faz com que qualquer documento XML lido seja interpretado com o encoding UTF-8, ignorando absolutamente o encoding informado no arquivo. A sugestão é a utilização da função utf8_decode().  Uma informação importante, porém mesmo utilizando a função o problema não foi resolvido. Continuei pesquisando na internet e encontrei um <a href="http://www.itmnetworks.com.br/suporte/manuais/php/ref.xml.html#example.xml-external-entity" target="_blank">manual</a> com um exemplo que resolveu a questão.</p>
<p>Espero que esse post posso ajudar caso alguem precise.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[encoding of object-attributes into printed publication]]></title>
<link>http://followthislinkto.wordpress.com/?p=13</link>
<pubDate>Sun, 14 Sep 2008 12:44:32 +0000</pubDate>
<dc:creator>followthislinkto</dc:creator>
<guid>http://followthislinkto.wordpress.com/2008/09/14/another-one/</guid>
<description><![CDATA[The idea of using given atributes as values for an formula 
]]></description>
<content:encoded><![CDATA[<div>The idea of using given atributes as values for an formula [gallery]</div>
]]></content:encoded>
</item>
<item>
<title><![CDATA[SQLAlchemy와 Oracle에서 한글 사용]]></title>
<link>http://cpeter7.wordpress.com/?p=3</link>
<pubDate>Wed, 10 Sep 2008 06:05:29 +0000</pubDate>
<dc:creator>cpeter7</dc:creator>
<guid>http://cpeter7.wordpress.com/2008/09/10/sqlalchemy%ec%99%80-oracle%ec%97%90%ec%84%9c-%ed%95%9c%ea%b8%80-%ec%82%ac%ec%9a%a9/</guid>
<description><![CDATA[환경
framework : pylons 0.9.7
oracle : 10g
OS : windows XP
sqlalchemy : 0.5beta
cx_Oracle : 4.4
cx]]></description>
<content:encoded><![CDATA[<p><strong>환경</strong></p>
<p>framework : pylons 0.9.7</p>
<p>oracle : 10g</p>
<p>OS : windows XP</p>
<p>sqlalchemy : 0.5beta</p>
<p>cx_Oracle : 4.4</p>
<p>cx_Oracle은 ini 파일에서 sqlalchemy.convert_unicode=True 및 engine.dialect의 encoding 속성 변경이 도움이 되지 않았다. 즉 항상 db에서 넘어오는 str을 unicode로 변환하지 않고 그대로 str 타입으로 application에 전달한다. 따라서 그 전까지 application에서 항상 str을 unicode로 decode 혹은 반대로 encode를 해 주어야 했다.</p>
<p>위의 문제는 번거롭기도 하지만 프로세싱 시간에도 좋지 않다. <a href="http://markmail.org/message/xtgv7cjad6qfofbu?q=unicode+sqlalchemy+oracle+encoding&#38;page=1&#38;refer=xtgv7cjad6qfofbu">M. Bayer의 뉴스그룹 답글</a>에 이를 해결하는 답이 나와있다. 환경변수의 NLS_LANG 값을 AMERICAN_AMERICA.UTF8 로 세팅하면 된다. 이전에는 KOREAN_KOREA.KO16MSWIN949로 되어 있었다.</p>
<blockquote><p>feeding in <strong>unicode</strong> strings requires that they be <strong>encoded</strong> into   bytestrings first.  this can be accomplished by either the usage of   the <strong>Unicode</strong> type on your Column definitions, or by sending the flag   convert_<strong>unicode</strong>=True to create_engine().  the default <strong>encoding</strong> for   this flag is utf-8 which can be configured by the '<strong>encoding</strong>' flag   sent to create_engine().</p>
<p>additionally, when using <strong>Oracle</strong>, you have to ensure that the   environment variable NLS_LANG is set appropriately, such as "AMERICAN-  AMERICA.UTF8".</p></blockquote>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Oh Dear Where I Am I Going]]></title>
<link>http://december1975.wordpress.com/?p=370</link>
<pubDate>Tue, 09 Sep 2008 18:35:43 +0000</pubDate>
<dc:creator>Jason</dc:creator>
<guid>http://december1975.wordpress.com/2008/09/09/oh-dear-where-i-am-i-going/</guid>
<description><![CDATA[Many things have happened since last Friday (mostly my wireless packed up again) but that aside I]]></description>
<content:encoded><![CDATA[<p>Many things have happened since last Friday (mostly my wireless packed up again) but that aside I've had two lessons of Communication and Culture and one of Philosophy, which I'll come to in a min.</p>
<p>Yesterdays Communication class was more of the same as the one before, just a bit more of an introduction.  I took in my definition of Culture, deciding in the end to stick with the Lauren Lavern one.  Which I genuinely do think is very good.  Other people went into some deep and meaningful places with their definition so it does just show that culture has a wide range definition.</p>
<p>I did write more today, more note taking and writing out some answers to specific questions.  Oh, I nearly forgot, in the previous lesson we were asked to write a short piece to describe a character, naturally I chose a P.I. in the style of Dirk Gently.  It was only short but needed to be descriptive of the character and I received a good mark for it!  I wasn't even sure if I'd answered the question properly so that was boost to knowing I'm thinking in the right way for now.  err, where was I?</p>
<p>Oh yes, today, more about speaking and listening, how to and why we encode and decode.  How to listen attentively, how to show this and how it will be better for us.  I quite this subject but I'm not sure if it's more than I thought yet.  So far I've been finding out new things from text and then showing that I understand what is meant from the text.  It seems striaght-forward and I'm glad this is how it is now because we're at the beginning.  I am looking forward to the subject developing.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[We fixed it!]]></title>
<link>http://catwinelands.wordpress.com/?p=183</link>
<pubDate>Mon, 08 Sep 2008 09:30:08 +0000</pubDate>
<dc:creator>Yaroslav Kudiyarov</dc:creator>
<guid>http://catwinelands.wordpress.com/2008/09/08/we-fixed-it/</guid>
<description><![CDATA[The unreadable emails branded as SPAM by some mail servers due to incompatible MIME encoding are hop]]></description>
<content:encoded><![CDATA[<p>The unreadable emails branded as SPAM by some mail servers due to incompatible MIME encoding are hopefully the thing of the past.</p>
<p>I finally found the Outlook and Pegasus "compatible" encoding format (ISO) for the Novell client at work.</p>
<p>Thanks to Lauréne Dippenaar (Pioneer School, Worcester), Santjies Niewoudt (Bredasdorp HS), Gerda Malan (Worcester Gymnasium) and Thea Pieterse (Montagu HS) who helped me tremendously, supplying valuable feedback.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Encoded emails]]></title>
<link>http://catwinelands.wordpress.com/?p=177</link>
<pubDate>Sat, 06 Sep 2008 16:19:04 +0000</pubDate>
<dc:creator>Yaroslav Kudiyarov</dc:creator>
<guid>http://catwinelands.wordpress.com/2008/09/06/encoded-emails/</guid>
<description><![CDATA[Some of you might have experienced being unable to read my emails. I have been alerted to the fact b]]></description>
<content:encoded><![CDATA[<p>Some of you might have experienced being unable to read my emails. I have been alerted to the fact by a couple of colleagues.</p>
<p>After a while I had an idea why it kept happening. I browsed the forums on the Internet and have come across reviews of earlier versions of Pegasus Mail that seem to have had very limited support for multipart email messages using the UTF-8 encoding.</p>
<p>Next thing I did was to check my Novell Groupwise email client at work. Bingo, it was set to encode all outgoing multipart messages (with attachments) in UTF-8.</p>
<p>I switched my client to Windows default encoding on Friday afternoon and sent everybody the moderation programme as attachment. Can anybody please complain about not having received THAT email in a readable format? It will really help me to see if this change of tack worked!</p>
<p>A WORKAROUND FOR THE TECHNICALLY-MINDED:</p>
<p>There is a good chance (we tested it successfully with Santjies Nieuwoudt from Bredasdorp HS) that you will be able to view the encoded message by doing this:</p>
<p>1. Select any part of the message starting from "Content-Type: text/plain; charset=UTF-8..." up to just before the beginning of the next part ("--=__Part8FA60A9A.1__=").</p>
<p>2. Copy and paste it into NOTEPAD.</p>
<p>3. Save as (All Files) anyname.eml</p>
<p>4. Open the saved file with your favourite email client, e.g. OutlookExpress.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Barcode Encoding in JAVA]]></title>
<link>http://javasight.wordpress.com/?p=87</link>
<pubDate>Sat, 06 Sep 2008 08:03:55 +0000</pubDate>
<dc:creator>Frank</dc:creator>
<guid>http://javasight.wordpress.com/2008/09/06/barcode-encoding-in-java/</guid>
<description><![CDATA[Generating barcodes, be it 1D or 2D, have never been easier. I will be using the Barbecue open sourc]]></description>
<content:encoded><![CDATA[<p>Generating barcodes, be it 1D or 2D, have never been easier. I will be using the Barbecue open source project hosted on sourceforge to generate a 1D barcode. After the barcode is generated I will decode the barcode by uploading it to a website whose service we shall use. However its also very simple to write a barcode decoder which shall be a topic of discussion later.</p>
<h2><strong>How to ....</strong></h2>
<p><strong> </strong></p>
<p>First of all you need to download the <strong><a href="http://barbecue.sourceforge.net">Barbecue</a> </strong>. Following are the jars added in my classpath</p>
<ul class="unIndentedList">
<li> barbecue-1.5-beta1.jar</li>
<li> jdom.jar</li>
</ul>
<p>Following is the code to generate a sample barcode</p>
<p>[sourcecode language='java']<br />
package com.datel.barcode;</p>
<p>import java.io.File;</p>
<p>import net.sourceforge.barbecue.Barcode;<br />
import net.sourceforge.barbecue.BarcodeFactory;<br />
import net.sourceforge.barbecue.BarcodeImageHandler;</p>
<p>public class GenerateBarcode {</p>
<p>	public static void main(String[] args) throws Exception {</p>
<p>		Barcode barcode = BarcodeFactory.createCode128("HelloWorld:0505124456");<br />
        File f = new File("c:\\barcode.png");<br />
        BarcodeImageHandler.savePNG(barcode, f);</p>
<p>	}</p>
<p>}</p>
<p>[/sourcecode]</p>
<p>Now you should find a file named barcode.png in you file system in C: drive. It should look like this</p>
[caption id="attachment_89" align="aligncenter" width="484" caption="Barcode"]<a href="http://javasight.wordpress.com/files/2008/09/barcode.png"><img class="size-full wp-image-89" title="Barcode" src="http://javasight.wordpress.com/files/2008/09/barcode.png" alt="Barcode" width="484" height="48" /></a>[/caption]
<p>We shall try to decode this image the easy way by uploading it to a website. Navigate to this website: <strong><a href="http://zxing.org/w/decode.jspx">ZXing</a> </strong> This is a website hosted by the ZXing project team who have a java api for decoding barcode images. Upload your image and click Submit Query. You should see this as the output</p>
<h4><strong>HelloWorld:0505124456</strong></h4>
<h2><strong>A few words....</strong></h2>
<p>Even the Barbecue encoder is only beta and has been beta since May 2007. Also I really don't comprehend why in the world these cool guys would make the Barcode class extend from javax.swing.JComponent. This really drives me mad to see such a thing but the BarcodeImageHandler class comes to the rescue. Anyways keep up the good work.</p>
<h2><strong>Humble Insight...</strong></h2>
<p>After my extensive search on the web I could not find a single open source java barcode encoder worth mentioning. I would be very much happy if any one could mention a good open source barcode encoder. But there were quite a few decoders though. Sadly to mention, if you want to encode data into barcodes on production applications you will have to rely on some commercial products out there. They are very good at what they do and are can very easily be integrated into your application. Many have facilities for resizing/rotating your image and can be very handy at times.</p>
<p>Using Barbecue looks all nice, simple and dandy but when you start getting requirements from your customers saying "Hey I want to put 100 MB of data in a 2D barcode" then things get hard. Although that's a bit exaggerated, I know cases where my colleagues were asked for all weird kinds of things to be done with barcodes. To them I have only one thing to say... "Technology was made to help mankind and was not made to be abused by mankind".</p>
<p>There is tremendous potential in this barcode industry and advanced encoding techniques keep coming out.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Scalable Video Coding (SVC) smoothes MPEG4 h.264]]></title>
<link>http://grimfandango.wordpress.com/?p=202</link>
<pubDate>Sat, 06 Sep 2008 06:29:21 +0000</pubDate>
<dc:creator>grimfandango</dc:creator>
<guid>http://blog.davenicoll.com/2008/09/06/scalable-video-coding-svc-smoothes-mpeg4-h264/</guid>
<description><![CDATA[YouTube, YouTube, YouTube. They&#8217;re always making announcements, some guff, some not. But their]]></description>
<content:encoded><![CDATA[<p>YouTube, YouTube, YouTube. They're always making announcements, some guff, some not. But their <a href="http://www.scientificblogging.com/news_releases/scalable_video_coding_could_finally_mean_disruption_free_hdtv">latest annoucement</a> - that they'll be re-encoding their videos using an enhancement to the MPEG4 h.264 codec, called <a href="http://66.102.9.104/search?q=cache:rdJpTHd68pYJ:www.ace.ual.es/~vruiz/investigacion/LOPE05.pdf">scalable video coding</a> (SVC) - is seriously big news.</p>
<p>In simple terms, the idea behind encoding videos is you divide up the picture into blocks, and estimate the motion between the blocks. This allows you to store the difference between frames, and not the whole frame, which reduces the file size. MPEG4 h.264 is particularly wonderful at doing this, but when packets of information get delayed or lost while traveling through the Internet, you get small glitches in the picture. SVC to the rescue! Those clever boffins at <a href="http://www.hhi.fraunhofer.de/en.html">Fraunhofer</a> have devised a way to enhance the existing codec to accommodate these packet drops. And the best news is that it seems we won't need to change the players to make it work.</p>
<p>Hopefully it won't be too long before we implement SVC in the Kensei encoder...</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Writing Images out of Flash]]></title>
<link>http://lassieadventurestudio.wordpress.com/?p=22</link>
<pubDate>Wed, 03 Sep 2008 13:51:39 +0000</pubDate>
<dc:creator>bigmac</dc:creator>
<guid>http://lassieadventurestudio.wordpress.com/2008/09/03/writing-images/</guid>
<description><![CDATA[There was a question on the forums recently about how to save/write an image out of Flash as a valid]]></description>
<content:encoded><![CDATA[<p>There was a question on the forums recently about how to save/write an image out of Flash as a valid image file (such as a JPG or PNG). Ironically enough, this has come up in my office several times recently, so a couple weeks ago I built some resources to automate the process.</p>
<p>First off, we need the ability to write files out of Flash. As of Flash Player 10, we'll be able to do this directly (hurray!). However, in the meantime we're still dependent on a server-side technology like PHP. So, let's get that out of the way first. Save the following script to a PHP enabled server at a publicly enabled URL:</p>
<pre>&#60;?php
    // com.gmacwilliam.images.ImageCaptureService
    // PHP file service.

    if (isset($_POST['tempfile']))
    {
        $temp = $_POST['tempfile'];
        $target = $_POST['newpath'];
        rename($temp, $target);
        echo "complete!";
    }
    else
    {
        $temp = "temp";
        $fp = fopen( $temp, 'wb' );
        fwrite( $fp, $GLOBALS[ 'HTTP_RAW_POST_DATA' ] );
        fclose( $fp );
        echo $temp;
    }
?&#62;</pre>
<p>The above is a dirt simple file-write script that I threw together in a couple minutes. Feel free to improve upon it with validation, type-checking, size restrictions, etc. And of course, nothing says that this file-write process needs to be done with PHP. Any server-side scripting language will work.</p>
<p>So, that gives us a place to send formatted image data to be written. Now we need to capture and encode image data within Flash. For encoding, we need the image resources provided in Adobe's AS3 Corelib, available for free at: <a title="Adobe Corelib" href="http://code.google.com/p/as3corelib/" target="_blank">http://code.google.com/p/as3corelib/</a>. Download the corelib and place the source in your script library.</p>
<p>Lastly, we need some logic to capture an image, send it through the encoder, then post the resulting data to our PHP service. To automate this process, I wrote a small class library. The package (<em>com.gmacwilliam.images</em>) contains one service abstract and two concrete service classes. Both the JPG and PNG capture classes are instantiated with a reference to the DisplayObject that you want to save an image of, and a file location on the server at which to place the file (the location should be formatted as: "path/filename.ext". The "path/" value is relative to the PHP script's location).</p>
<p>1) save to: <strong>com/gmacwilliam/images/ImageCaptureService.as<br />
</strong><em>Note: update the "imageServiceURL" variable with the path to your PHP script.</em><strong></strong></p>
<pre>package com.gmacwilliam.images
{
    import flash.events.EventDispatcher;
    import flash.events.Event;
    import flash.utils.ByteArray;
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.net.URLRequestMethod;
    import flash.net.URLVariables;

    public class ImageCaptureService extends EventDispatcher
    {
        public static const FILE_WRITE_COMPLETE_EVENT:String = "ImageFileWriteComplete";
        public static var imageServiceURL:String = "http://your-image-service-path.php";

        private var _servicePath:String="";
        private var _filePath:String="";

        public function ImageCaptureService(filePath:String=""):void
        {
            super();
            _servicePath = ImageCaptureService.imageServiceURL;
            _filePath = filePath;
        }

        /* write
         * @desc: Writes image data to file.
         * @param: image data byte array.
         */

        protected function write(img:ByteArray):void
        {
            // configure data to send
            var req:URLRequest = new URLRequest(_servicePath);
            req.contentType = "application/octet-stream";
            req.method = URLRequestMethod.POST;
            req.data = img;

            // send data to file service
            var write:URLLoader = new URLLoader();
            write.addEventListener(Event.COMPLETE, this._onWriteComplete);
            write.load(req);
        }

        private function _onWriteComplete(evt:Event):void
        {
            // cleanup write operation
            var write:URLLoader = evt.target as URLLoader;
            write.removeEventListener(Event.COMPLETE, this._onWriteComplete);
            dispatchEvent(new Event(ImageCaptureService.FILE_WRITE_COMPLETE_EVENT));

            // move created file to target location
            _moveFile(write.data);
        }

        /* _moveFile
         * @desc: Moves created file to target location.
         * @param: reference to newly created file on server.
         */

        private function _moveFile(tempFile:String):void
        {
            var vars:URLVariables = new URLVariables();
            vars.tempfile = tempFile;
            vars.newpath = _filePath;

            var req:URLRequest = new URLRequest(_servicePath);
            req.method = URLRequestMethod.POST;
            req.data = vars;

            var moveto:URLLoader = new URLLoader();
            moveto.addEventListener(Event.COMPLETE, this._onMoveComplete);
            moveto.load(req);
        }

        private function _onMoveComplete(evt:Event):void
        {
            var moveto:URLLoader = evt.target as URLLoader;
            moveto.removeEventListener(Event.COMPLETE, this._onMoveComplete);
            dispatchEvent(new Event(Event.COMPLETE));
        }
    }
}</pre>
<p>2) save to: <strong>com/gmacwilliam/images/JPGCapture.as<br />
</strong><em>Implementation: new JPGCapture(clipToCapture:DisplayObject, filePath:String, [quality:int=0-100]);</em><strong></strong></p>
<pre>package com.gmacwilliam.images
{
    import flash.display.DisplayObject;
    import flash.display.BitmapData;
    import com.adobe.images.JPGEncoder;

    public final class JPGCapture extends ImageCaptureService
    {
        public function JPGCapture(clip:DisplayObject, filePath:String="", quality:int=50):void
        {
            super(filePath);
            var jpg:JPGEncoder = new JPGEncoder(quality);
            var bmp:BitmapData = new BitmapData(clip.width, clip.height, false, 0xFFFFFF);
            bmp.draw(clip);
            write(jpg.encode(bmp));
        }
    }
}</pre>
<p>3) save to: <strong>com/gmacwilliam/images/PNGCapture.as<br />
</strong><em>Implementation: new PNGCapture(clipToCapture:DisplayObject, filePath:String);</em></p>
<pre>package com.gmacwilliam.images
{
    import flash.display.DisplayObject;
    import flash.display.BitmapData;
    import com.adobe.images.PNGEncoder;

    public final class PNGCapture extends ImageCaptureService
    {
        public function PNGCapture(clip:DisplayObject, filePath:String=""):void
        {
            super(filePath);
            var bmp:BitmapData = new BitmapData(clip.width, clip.height, true, 0x00000000);
            bmp.draw(clip);
            write(PNGEncoder.encode(bmp));
        }
    }
}</pre>
<p>This was a pretty fast and unrefined implementation that I threw together while bidding a project with this technology. As such, there's some redundancy in the server communication. This service currently makes two server calls: one to post the data and a seperate call to move the file since I was running into problems with putting text and bianary data in the same server post. I remember reading something on Grant Skinner's blog a while back about mixing data formats in a server post, so I'll have to look that up and post and updated version once these service calls have been consolidated.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Ruby 1.9 and Code Generation: How I Learned to Stop Worrying and Love Unicode]]></title>
<link>http://naturalcode.wordpress.com/?p=122</link>
<pubDate>Sun, 24 Aug 2008 21:55:41 +0000</pubDate>
<dc:creator>naturalcode</dc:creator>
<guid>http://naturalcode.wordpress.com/2008/08/24/ruby-19-and-code-generation-how-i-learned-to-stop-worrying-and-love-unicode/</guid>
<description><![CDATA[So I was working on this Ruby-based tool for generating Netbeans-compliant Swing app projects. Basic]]></description>
<content:encoded><![CDATA[<p>So I was working on this Ruby-based tool for generating Netbeans-compliant Swing app projects. Basically, I create a file that looks like this:</p>
<p>[sourcecode language='ruby']<br />
require 'java_swing'</p>
<p>Swing.app 'Project03AK', :subtitle => 'Laptop lending tracker',<br />
:desc => 'This program keeps track of laptops borrowed by students.' do<br />
  # Insert code here<br />
end<br />
[/sourcecode]</p>
<p>I run this script, and it generates a Netbeans project with a main class that's a Swing window, automatically centered and titled, the project and the window all have nice clean standardized names. Everything was going great until I got to the part where I started inserting comments in the generated Java code.</p>
<p>Basically, I have this Ruby script that inserts the arguments passed to Swing.app into a bunch of templates, and uses the resulting text to generate both the Java code and the related Netbeans project files. The problem here is that both Ruby and SciTE, my text editor, encode text in ASCII by default, whereas Netbeans encodes text in UTF-8.</p>
<p>That's fine as long as Ruby is only generating code that uses the 26 english letters and regular english punctuation, but as soon as you start using things like àccéntêd characters, Netbeans interprets it as gibberish. I go to a French school, and my professors do not accept me handing in gibberish (except for VB code), so this is a problem.</p>
<p>If you don't know/care about any of these encoding schemes or non-english characters, <a href="http://www.joelonsoftware.com/articles/Unicode.html">you need to read this</a>. I did a few hours ago, and it helped me figure all of this out.</p>
<p>Basically, the solution is to <a href="http://www.ruby-lang.org/en/downloads/">install Ruby 1.9</a>, which has Unicode support, and then go to File-&#62;Encoding-&#62;UTF-8 in SciTE. An <strong>é</strong> in the text editor will then be written to the generated Java files as a UTF-8 <strong>é</strong>, which will then be correctly interpreted as an <strong>é</strong> by Netbeans.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[one stop shop for all the codecs you will ever need (probably)]]></title>
<link>http://flagrant3.wordpress.com/2008/08/23/one-stop-shop-for-all-the-codecs-you-will-ever-need-probably/</link>
<pubDate>Sat, 23 Aug 2008 04:01:49 +0000</pubDate>
<dc:creator>delajed</dc:creator>
<guid>http://flagrant3.wordpress.com/2008/08/23/one-stop-shop-for-all-the-codecs-you-will-ever-need-probably/</guid>
<description><![CDATA[I really had no intention of writing up another software recommendation so soon, but given the natur]]></description>
<content:encoded><![CDATA[<p>I really had no intention of writing up another <em>software</em> recommendation so soon, but given the nature of video playback/conversion, <a href="http://en.wikipedia.org/wiki/Video_codec" target="_blank">codecs</a> are a necessary thing - I'll leave it to Wikipedia to explain. There's always been a great debate to whether you should install codecs individually, or download and install them in packages. Those arguing against the latter claim that the problem with installing codec packs is that in the event that you do uninstall them, they leave traces behind, which complicates the video playback of your system. Going the individual route is probably safer in that sense, but really, having to read up on which codecs are compatible with one another, and then configuring the settings properly for the smoothest playback...well its a headache in its own way.</p>
<p>Fortunately, and I think on Anthony's recommendation, I tried the <a href="http://www.cccp-project.net/" target="_blank">Combined Community Codec Pack</a>. It is a package of codecs, but unlike the others out there, when you uninstall it, it actually does uninstall completely. It also doesn't hurt that it's maintained by a huge community of users - which almost guarantees its effectiveness and reliability. It also comes with two media players - media player classic, and zoom player - which between the two of them can play any video format out there. (But really, with the codec installed, I've been running the latest windows media player exclusively)</p>
<p>I do have to admit that I also download and install, the <a href="http://www.divx.com/" target="_blank">DivX</a> codec (it is free btw). I install it not so much for DivX playback (because the CCCP handles them fine), but more because of my preference of DivX encoding through Fairusewizard. It is totally compatible with the mentioned codec pack. If you for some reason prefer the DivX codec for playback, you can change the settings inside CCCP. </p>
<p>But really why would you want to? As their site states, "This is your <strike>only</strike> Best choice."</p>
<p>...</p>
<p>Once again Windows only. I'm not even going to bother recommending a similar codec package for the Mac, because other than DivX, I haven't got a clue what package is the most fully featured and reliable. </p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[DVD Ripping, Linux-Style]]></title>
<link>http://anjilslaire.wordpress.com/?p=73</link>
<pubDate>Fri, 22 Aug 2008 04:31:21 +0000</pubDate>
<dc:creator>anjilslaire</dc:creator>
<guid>http://anjilslaire.wordpress.com/2008/08/21/dvd-ripping-linux-style/</guid>
<description><![CDATA[Yeah, I&#8217;m a slacker. been 2 weeks since last post. That&#8217;s a problem with Linux: Things d]]></description>
<content:encoded><![CDATA[<p>Yeah, I'm a slacker. been 2 weeks since last post. That's a problem with Linux: Things don't often break when you get it up  running :)</p>
<p>OK, today I'm going to give a rundown on how to rip &#38; encode your precious DVD movie collection from the original disc to xvid format (.avi) which is playable and convenient to stream across your LAN to your display of choice, therefore removing the need to keep using (and potentially scratching) your discs.. In my case, that's a TV with an <a title="XBMC" href="http://xbmc.org/" target="_blank">XBMC</a>-enabled xbox.</p>
<p>1.<span style="text-decoration:underline;"> Ripping from the original media</span><br />
Most DVDs are encrypted with some scheme to prevent your backing up of your own purchased media. Now, truth be told, the decrypting tools native to Linux are not on par with those available to Windows. Sony's <a title="ick" href="http://en.wikipedia.org/wiki/ARccOS_Protection" target="_blank">ARccOS</a> protection is pretty crafty, and frankly does a rough job to the dvd standard spec. Luckily, there are relatively few discs with this garbage on them.</p>
<p>In many cases, the now-defunct <a href="http://dvdshrink.org/" target="_blank">DVDShrink</a> works great to rip the vast majority of titles, and works perfectly under wine. Just install it, and set the Windows version to XP. I have mfc420.dll, quartz.dll &#38; riched20.dll set to native/builtin. Yes, K9Copy in Linux does this, but I'm a fan of DVDShrink, and I know it has great quality. Your choice.</p>
<p>However, for more stubborn titles, <a title="DVDFab " href="http://www.dvdfab.com/free.htm" target="_blank">DVDFAB HD Decrypter</a> works great under wine as well, and is even ilsted as supported under Linux via wine by it's developers. I run it under wine as Windows 2000 with mfc42.dll in the library as native.built-in</p>
<p>Use one of these 2 apps to rip the main movie only, including the single language track of your choice (English 5.1 personally) to your hard drive. DVDFAB does this with no compression, and you need to manually override it in Shrink, unless you're looking to put it back on a single layer dvd. But that's another post :)</p>
<p><span style="text-decoration:underline;">2.Encoding</span><br />
After you have the decrypted files on your harddrive, (they are in a VIDEO_TS directory, comprised of several .VOBs, .BUPs, and IFOs), you'll want to re-encode them into a cohesive single high quality file for playback. My preference is XVID, because its open source, and high great quality. For encoding, enter Acidrip. It's in the Ubuntu repositories, and is simply a <strong><em>sudo apt-get install acidrip</em></strong> away.</p>
<p>Launch Acidrip, go to the Video tab, and configure it as follows:<br />
<strong>Codec: lavc<br />
Passes: 2<br />
Options: vcodec=mpeg4:vhq:v4mv:vqmin=2</strong></p>
<p>Now, the tricky part. Well, not really. You want the bits/Px to sit at .200, which the hint on this window tells you is a great ratio and the picture will be good. Not too high (wasteful) and not too low (blocky/pixelated). So, go to the Path window and point it at your source directory (where your .vob files are) and hit Load.<br />
Change the bitrate until the bits/px reach .200, and it should change to a grey color. You may need to enable the Lock box to change the bits. On most movies, this ends up with a bitrate of 2067, or somewhere abouts. You can now save your settings, although I prefer to save it <em>without</em> the final destination listed in the Load field, as it changes depending on the film title.</p>
<p>Oh, enable Crop, and hit Detect. This will detect th formatting and avoid processing the blank black bard on a widescreen movie. Saves on quality, and video size. Why waste time &#38; size on blank space?</p>
<p>OK, with all that set, flip over to the General tab, name the movie, and input the destination in th File name field. I prefer this:<br />
<em><strong>/home/username/movies/%T</strong></em>. This puts them in my movies folder, with a filename the same as the Track Title. Handy, huh?</p>
<p>In Audio, I prefer the following:<br />
<strong>Codec: mp3lame<br />
Options: abr:br=128<br />
Leave Gain a 0</strong><br />
I don't include extra subtitle racks, so the rest is empty.</p>
<p>Whern you're ready, click Start, and away it goes. On my Athlon 3200+ 2gigs ram, the average 2 hour movie takes a couple hours. YMMV. I suggest not doing anything else remotely intensive with the CPU in the meantime.</p>
<p>When it completes (remember, 2 Passes. It improves the quality), be sure to delete the original DVD files to save space, unless you want them for something else, or to burn a backup. I've discovered that most movies processed this way have a great picture (on a 31" standard TV, as well as a monitor) and good sound (through a 100watt receiver) with a file size between 1.2 - 2 gig each.</p>
<p>When I'm done, I store them on a share on my server, and stream them to my XBMC systems connected to each TV in my house (living room and bedroom) It works awesome, and I never have to see the annoying spam &#38; adverts on a movie, or search for my discs stored away in a box or a shelf somewhere.</p>
<p>Enjoy :)</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[The encoding chain]]></title>
<link>http://angelborroy.wordpress.com/?p=91</link>
<pubDate>Thu, 21 Aug 2008 09:23:19 +0000</pubDate>
<dc:creator>angelborroy</dc:creator>
<guid>http://angelborroy.wordpress.com/2008/08/21/the-encoding-chain/</guid>
<description><![CDATA[UTF-8 charset is normally used as default in all the components of a Java software system from data]]></description>
<content:encoded><![CDATA[<p><a title="UTF-8" href="http://www.cl.cam.ac.uk/~mgk25/unicode.html" target="_blank">UTF-8</a> charset is normally used as default in all the components of a Java software system from database to web browser.  Refer these links in order to get information about it.</p>
<ul>
<li><a title="Java Glossary" href="http://mindprod.com/jgloss/encoding.html" target="_blank">encoding: Java Glossary</a></li>
<li><a title="Character Conversion from Browser to Database" href="http://java.sun.com/developer/technicalArticles/Intl/HTTPCharset/" target="_blank">Sun Java Article - Character Conversion from Browser to Database</a></li>
</ul>
<p>However, external files can be served by other systems in any charset different to <a title="UTF-8" href="http://www.cl.cam.ac.uk/~mgk25/unicode.html" target="_blank">UTF-8</a>. To preserve encoding chain, file reading must be done specifying external charset in these terms.</p>
<p>[sourcecode lang="java"]<br />
import java.io.BufferedReader;<br />
import java.io.DataInputStream;<br />
import java.io.FileInputStream;<br />
import java.io.IOException;<br />
import java.io.InputStreamReader;</p>
<p>public class TestEncoding {</p>
<p>  public static void processFile(String filename, String charset) throws IOException {</p>
<p>    FileInputStream fstreamIn = new FileInputStream(filename);<br />
    DataInputStream in = new DataInputStream(fstreamIn);</p>
<p>    // Specify charset for the InputStream<br />
    BufferedReader br = new BufferedReader(<br />
        new InputStreamReader(in, charset));</p>
<p>    String strLine;<br />
    while ((strLine = br.readLine()) != null)   {<br />
      // Do something with the line: insert into database, ...<br />
    }</p>
<p>    fstreamIn.close();</p>
<p>  }</p>
<p>  public static void main(String...strings) throws IOException {</p>
<p>    String filename = "/hosts/data.input";<br />
    String charset = "ISO-8859-15";</p>
<p>    processFile(filename, charset);</p>
<p>  }</p>
<p>}<br />
[/sourcecode]</p>
]]></content:encoded>
</item>

</channel>
</rss>
