tag:blogger.com,1999:blog-160775942009-07-13T07:59:22.261ZSin noticias de Dios (No news from god)My thoughts, my life, me.julito-powerhttp://www.blogger.com/profile/00830938638699612248noreply@blogger.comBlogger148125tag:blogger.com,1999:blog-16077594.post-27499103957208111492009-07-13T07:58:00.002Z2009-07-13T07:59:22.542ZListen to Silvio<a href="http://www.myspace.com/nonewsfromgod"></a><object width="353" height="132"><embed src="http://www.goear.com/files/external.swf?file=a5f3466" type="application/x-shockwave-flash" wmode="transparent" quality="high" width="353" height="132"></embed></object><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16077594-2749910395720811149?l=tritanic.blogspot.com'/></div>julito-powerhttp://www.blogger.com/profile/00830938638699612248noreply@blogger.com0tag:blogger.com,1999:blog-16077594.post-82564528227514281912009-06-30T12:31:00.001Z2009-06-30T12:31:08.515Z2D Convolution exampleVery clear example of a 2D convolution:<br><br><a href="http://www.songho.ca/dsp/convolution/convolution2d_example.html">http://www.songho.ca/dsp/convolution/convolution2d_example.html</a><br><br><br>This kind of convolution can be used, for example, to implement and edge detector applying a <a href="http://en.wikipedia.org/wiki/Sobel_operator">Sobel operator</a>.<br> <br>Enjoy!!!<br><br> <div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16077594-8256452822751428191?l=tritanic.blogspot.com'/></div>julito-powerhttp://www.blogger.com/profile/00830938638699612248noreply@blogger.com0tag:blogger.com,1999:blog-16077594.post-5532892256907657382009-06-06T22:20:00.003Z2009-06-06T22:47:22.828ZBooks I´ve read this year so far<ul><li><a href="http://books.google.ie/books?id=gCC0XRKYpd0C&amp;dq=inauthor:Robert+inauthor:Ludlum&amp;ei=C-8qSsPuCoPcygSSsOmQBw&amp;pgis=1">The Bourne Identity</a>. Thrilling action pack book, you´ll definitely learn two English words, kerb and quay. 7 out of 10<br /></li><li><a href="http://books.google.ie/books?id=WnKLzfW6_cQC">The constant gardener</a>. Moving, enigmatic diplomatic atmosphere. I falls a little bit by the middle section, but has an amazing end that leave a great taste. 8 out of 10.<br /></li><li><a href="http://books.google.ie/books?id=-t3XmioLPk4C&amp;q=the+pillars+of+the+earth&amp;dq=the+pillars+of+the+earth&amp;ei=a-8qSrHMOITyzQTTy_WnBw&amp;pgis=1">The pillars of the earth</a>. This is my favorite book ever. I've read it twice in Spanish and twice in English. The last time I read it was between 2008 and 2009. 10 out of 10.<br /></li><li><a href="http://books.google.ie/books?id=EWnmAAAACAAJ&amp;dq=misery&amp;ei=ou8qSoS2E42yyQSzr4WwBw">Misery</a>. This is my second favourite book ever. How many times I have dreaded Ms Wilkes!!!! 9.5 out of 10.<br /></li><li><a href="http://books.google.ie/books?id=dfIRAAAACAAJ&amp;dq=Hannibal+rising&amp;ei=wu8qStTiBoGczQSEjpSTBw">Hannibal Rising</a>. The surprise of the year. The prose is quite unusual and for a non native English speaker (and reader) it causes some confusing at the beginning of the book. Once you get use to it, the is not a single moment dull in this book. I love Hannibal's character. 9 out of 10.<br /></li><li><a href="http://books.google.ie/books?id=HJ8Wg0u7CUgC">Alice´s adventures in wonderland</a>. I began reading this book today. So far I've read 20 of about 280 pages, and I´m absolutely delighted. The English used in the book is very very very easy to read, so I recommend this book for those of you learning English. So far 9 out of 10.<br /></li><li><a href="http://books.google.ie/books?id=A9nWaIpeXhkC&amp;q=a+brief+history+of+time&amp;dq=a+brief+history+of+time&amp;ei=BvAqSq3AAZ-GzQS11OChBw&amp;pgis=1">A brief history of time</a>. Just one sentence, do not read it if you don´t have a scientific background. I have a background in both chemical engineering, and computer science, thus my knowledge of maths and physics can be considered more than average, and the book became almost impossible to follow once it "falls" into black holes. However is really enjoyable while can be understood.</li></ul>I addition my parent´s gave me as abirthday present a wonderful <a href="http://www.sonystyle.com/webapp/wcs/stores/servlet/ProductDisplay?catalogId=10551&amp;storeId=10151&amp;langId=-1&amp;productId=8198552921665245739">Sony PRS-505</a>, this is an ebook reader, so I´m reading more than ever. I transfer to it every interesting article that I find on the net. With a good piece of software called <a href="http://calibre.kovidgoyal.net/">calibre </a>I can convert many formats to PRS's native format, and even download online newspapers automatically. Besides you can access more than 500.000 free books through <a href="http://ebookstore.sony.com/google-ebooks/">google</a> or <a href="http://www.gutenberg.org/wiki/Main_Page">Project Gutenberg</a>.<br /><br />Enjoy reading!!!!!<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16077594-553289225690765738?l=tritanic.blogspot.com'/></div>julito-powerhttp://www.blogger.com/profile/00830938638699612248noreply@blogger.com0tag:blogger.com,1999:blog-16077594.post-60794324133217859992009-05-13T19:30:00.003Z2009-05-13T19:39:13.843ZAntonio Vega has passed awayToday is a sad day for all of us who love music. During his life, <a href="http://uk.real.com/music/artist/Antonio_Vega/">Antonio Vega</a> composed a handful of songs that are part of the memories of a generation. An icon of "<a href="http://en.wikipedia.org/wiki/La_Movida_Madrile%C3%B1a">la modiva</a>" in the 80´s, unfortunately got addicted to drugs, which eventually led to his dead.<br /><br />We will never forget you, because your music will always be alive in our harts.<br /><br /><a href="http://www.youtube.com/results?search_type=&amp;search_query=antonio+vega&amp;aq=0&amp;oq=antonio+ve">Youtube links.</a><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16077594-6079432413321785999?l=tritanic.blogspot.com'/></div>julito-powerhttp://www.blogger.com/profile/00830938638699612248noreply@blogger.com1tag:blogger.com,1999:blog-16077594.post-13841451304376584902009-05-04T10:05:00.002Z2009-05-04T10:54:46.226ZGyms in Lausanne (Switzerland)I'm doing a little research about gyms with swimming pool in Laussane (Switzerland). There seems to be quite a lot of gyms there. These are the results<br /><br /><ul><li><a href="http://www.holmesplace.ch/e/clubs/highlight.php?clubid=2">Holmes Place</a>. This place looks really posh. Design is everywhere, a very clean modern look throughout the place. No swimming pool though.</li><li><a href="http://www.fitnessparc.ch/malley/front_content.php?idcat=1011">Migros fitness park</a>. There is a swimming pool here, but leisure one, with the temperature set to 32Celisiuss!!!!!!!!! You would like to be there swimming for an hour. Prices are kind of high.</li><li><a href="www.silhouette.ch">Silhouette</a>. Flashy, Flashy web page. It's hard to believe that some serious company has a web like that in 2009. There is a swimming pool with the water temperature set at 27 - 28 degrees. Enough not to overheat yourself, but still a little bit to high. No information about its size. The place look clean, moderns, but a little bit clattered. Wooden floors look great.</li><li><a href="http://http://www.letsgo-fit.ch/">Let's Go</a>. It doesn't seem to be a swimming on this one. It looks like the poores so far, although the standard seems very high in Switzerland.</li></ul>Indoor swimming pools:<br /><br /><ul><li><a href="http://www.lausanne.ch/view.asp?docId=30005&amp;domId=64605&amp;language=E">Bergières</a>.</li><li><a href="http://www.lausanne.ch/view.asp?docId=30185&amp;domId=64605&amp;language=E">Grand-Vennes</a>.</li><li><a href="http://www.lausanne.ch/view.asp?docId=30390&amp;domId=64605&amp;language=E">Mon Repos</a>.</li><li><a href="http://www.lausanne.ch/view.asp?docId=30227&amp;domId=64605&amp;language=E">Vallée de la jeunesse</a>.<br /></li></ul><br />Ok, now, this one is kind of funny.<br /><ul><li><a href="http://www.aquarius-lausanne.ch/Aquarius/Bienvenue.html">Aquarius gay swimming club</a>. WTF!!!!! jajajajajaja this is a GAY swimming club, but what in the name of god do sports have to do with sexual orientation. jajajaja, I mean, why would you want to swim with only gay and lesbian people, honestly I don't understand. Will they not admit me in the club becuase I'm not gay?<br /></li></ul><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16077594-1384145130437658490?l=tritanic.blogspot.com'/></div>julito-powerhttp://www.blogger.com/profile/00830938638699612248noreply@blogger.com1tag:blogger.com,1999:blog-16077594.post-86201152002700494262009-04-17T21:53:00.001Z2009-04-17T21:54:49.159ZEnrique BunburyEveryone who knows me will understand why I´m posting this:<div><br /></div><div><br /><embed src="http://www.rtve.es/swf/FLVPlayer.swf" flashvars="file=http://rtve.ondemand.flumotion.com/rtve/ondemand2/microsites/muchachadanui/03-01-celebrities-bunbury-02w10ert2.flv&amp;image=http://www.rtve.es/contenidos/muchachadanui/files/images/03-01-celebrities-bunbury-02w10ert2.jpg&amp;&amp;thumbnail=http://www.rtve.es/contenidos/muchachadanui/files/images/p03-01-celebrities-bunbury-02w10ert2.jpg&amp;autostart=false&amp;advertisement=url::http://www.rtve.es/comunes/publicidad/video/video/TE_SMUCHA-video-video.xml,type::antevenio,timeout::10,videoduracion::2700&amp;locale=http://www.rtve.es/swf/locale/es_ES&amp;config=http://www.rtve.es/swf/data/rtve_config_embed.xml&amp;embed=host::http://www.rtve.es,playerHost::http://www.rtve.es/swf,config::http://www.rtve.es/swf/data/rtve_config_embed.xml&amp;controlbar=live::false,volume::1,scrub::true,hideSend::true" allowscriptaccess="always" allowfullscreen="true" wmode="transparent" width="600" height="473" name="FLVPlayer" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"></embed><br /></div><div><br /></div><div>Enjoy!!!</div><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16077594-8620115200270049426?l=tritanic.blogspot.com'/></div>julito-powerhttp://www.blogger.com/profile/00830938638699612248noreply@blogger.com0tag:blogger.com,1999:blog-16077594.post-77833316856687278092009-03-29T19:19:00.003Z2009-04-02T20:49:38.992ZBack On TrackHi people!!!<br /><br /><div style="text-align: justify;">The sports season has begun, and what a beginning! Last week I run the <a href="http://plassey10k.skynet.ie/">Plassey 10K</a> race, event organized by the <a href="http://www2.ul.ie/web/WWW/Faculties/Education%20%26%20Health%20Sciences/Departments/Physical%20Education%20and%20Sport%20Sciences/">University of Limerick physical education</a> students. Enjoyable, not too bad for the first race in months. I didn't beat my PB (personals best) at all, but I have good sensations. My time was 47:05, not too impressive, I know.<br /></div><br />Today I took part in a Duathlon for the first time in my life.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.limericktriathlon.com/drupal/files/duathlon.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 400px;" src="http://www.limericktriathlon.com/drupal/files/duathlon.JPG" alt="" border="0" /></a><br /><br /><div style="text-align: justify;">The experience was amazing, thrilling, but also absolutely wrecking. The event was organized by the <a href="http://www.limericktriathlon.com/drupal/">Limerick Triathlon</a> Club. I work with the <a href="http://sixteenfiftys.blogspot.com/">swimming coach</a> of the club, and lately we've been training together (he was faster than me today). I did well on the first running leg, the on the bicycle I almost died. Ireland is famous for its continuous rain and wind, well today was one of those days when the country feels like honoring his fame. My time was 1:10:57 (3.9 run, 16 cycle, 3.9 run), awful, but I consider it a good starting point.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_2CPTItAuDOw/SdUktnfUG5I/AAAAAAAAALw/JFs4qpWk3q4/s1600-h/tribicy.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 213px;" src="http://2.bp.blogspot.com/_2CPTItAuDOw/SdUktnfUG5I/AAAAAAAAALw/JFs4qpWk3q4/s320/tribicy.jpg" alt="" id="BLOGGER_PHOTO_ID_5320198900921146258" border="0" /></a><br /></div><br />Enjoy!!!<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16077594-7783331685668727809?l=tritanic.blogspot.com'/></div>julito-powerhttp://www.blogger.com/profile/00830938638699612248noreply@blogger.com0tag:blogger.com,1999:blog-16077594.post-51009552237618008722009-03-02T22:36:00.002Z2009-03-02T22:38:15.568ZBrilliant!! Famous paintings recreated using Lego<a href="http://www.oddee.com/item_96540.aspx">http://www.oddee.com/item_96540.aspx</a><br /><br /><br /><img src="http://63.134.213.184/_media/imgs/articles/a313_p1.jpg" /><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16077594-5100955223761800872?l=tritanic.blogspot.com'/></div>julito-powerhttp://www.blogger.com/profile/00830938638699612248noreply@blogger.com0tag:blogger.com,1999:blog-16077594.post-46586281220650114942009-02-28T17:39:00.003Z2009-02-28T17:45:35.149ZConfessions of an Irish GamerI just want to recommend to those of you who like videogames, to visit the blog homonym with this entry:<br /><br /><a href="http://confessionsofanirishgamer.blogspot.com/">Confessions of an Irish Gamer</a><br /><br />The authors are not really prolific, but the posts are quality ones.<br /><br />Enjoy.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16077594-4658628122065011494?l=tritanic.blogspot.com'/></div>julito-powerhttp://www.blogger.com/profile/00830938638699612248noreply@blogger.com0tag:blogger.com,1999:blog-16077594.post-28282568987407309942009-02-22T12:47:00.003Z2009-02-22T12:59:43.423ZWIFI WPA Encryption with Ubuntu 6.10<div style="text-align: justify;">Connecting to a WIFI network that uses WEP encription is a pretty straight forward task using UBUNTU, you only have to use the "Wireless Assistant" tool integrated with the system. However, when you try to connect to a network using WPA encryption things get more complicated. For some reason the "Wireless Assistant" do not let you select a other encryption than WEP.<br /><br />After some research, i.e. google search, I found an entry in ubuntuforums.org that explain how to connect to WIFI networks that use WPA encryption. This process involves mainly editing text files, there is no "Windowzed" application to help:<a href="http://ubuntuforums.org/showthread.php?t=202834"><br /><br /></a></div><a href="http://ubuntuforums.org/showthread.php?t=202834">http://ubuntuforums.org/showthread.php?t=202834</a><br /><br /><div style="text-align: justify;">In my case I'm using a network with DHCP activated, and my computer runs a KUBUNTU 6.10. My laptop is an old Toshiba Satellite M70-165 with an integrated WIFI adapter. My /etc/network/interfaces looks like this:<br /></div><pre><br />auto lo<br />iface lo inet loopback<br /><br />auto eth1<br />iface eth1 inet dhcp<br />wpa-driver wext<br />wpa-ssid <span style="font-style: italic; font-weight: bold;">$your essid here$</span><br />wpa-ap-scan 1<br />wpa-proto WPA<br />wpa-pairwise TKIP<br />wpa-group TKIP<br />wpa-key-mgmt WPA-PSK<br />wpa-psk <span style="font-style: italic; font-weight: bold;">$your hex key code here$</span><br /></pre><br /><br /><div style="text-align: justify;">Just follow the procedure explain in the forum, it's easy and it worked for me with at the first attempt.<br /></div><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16077594-2828256898740730994?l=tritanic.blogspot.com'/></div>julito-powerhttp://www.blogger.com/profile/00830938638699612248noreply@blogger.com0tag:blogger.com,1999:blog-16077594.post-19751508676048012002009-02-08T18:36:00.003Z2009-02-08T18:49:21.384ZXSLT with Java and Dom4j-1.6<div style="text-align: justify;">Feeling geeky again!!<br /><br />Today I´ll show you how to perform an XSLT (XSL transformation) on an XML file using Java and <a href="http://www.dom4j.org/">Dom4j</a>. In contrast with the last Java/Dom4j post in this i´ll only show the class that acually performs the transformation. Dom4j is not able to perform the transformation on its own, it needs the help of <a href="https://jaxp-sources.dev.java.net/nonav/docs/api/">JAXP</a>:<br /></div><br /><br /><pre><br /><a name="line1"> 1</a> <span style="color:#0000ff;"><strong>package com.julio.xml;</strong></span><br /><a name="line2"> 2</a><br /><a name="line3"> 3</a> <span style="color:#0000ff;"><strong>import java.io.File;</strong></span><br /><br /><a name="line4"> 4</a> <span style="color:#0000ff;"><strong>import java.io.FileWriter;</strong></span><br /><a name="line5"> 5</a> <span style="color:#0000ff;"><strong>import java.io.IOException; // dom4j import</strong></span><br /><a name="line6"> 6</a> <span style="color:#0000ff;"><strong>import org.dom4j.Document;</strong></span><br /><a name="line7"> 7</a> <span style="color:#0000ff;"><strong>import org.dom4j.DocumentException;</strong></span><br /><br /><a name="line8"> 8</a> <span style="color:#0000ff;"><strong>import org.dom4j.io.SAXReader;</strong></span><br /><a name="line9"> 9</a> <span style="color:#0000ff;"><strong>import org.xml.sax.ErrorHandler;</strong></span><br /><a name="line10">10</a> <span style="color:#0000ff;"><strong>import org.xml.sax.SAXException;</strong></span><br /><a name="line11">11</a> <span style="color:#0000ff;"><strong>import org.xml.sax.SAXParseException;</strong></span><br /><br /><a name="line12">12</a><br /><a name="line13">13</a> <span style="color:#0000ff;"><strong>import javax.xml.transform.Transformer;</strong></span><br /><a name="line14">14</a> <span style="color:#0000ff;"><strong>import javax.xml.transform.TransformerConfigurationException;</strong></span><br /><a name="line15">15</a> <span style="color:#0000ff;"><strong>import javax.xml.transform.TransformerException;</strong></span><br /><a name="line16">16</a> <span style="color:#0000ff;"><strong>import javax.xml.transform.TransformerFactory;</strong></span><br /><br /><a name="line17">17</a> <span style="color:#0000ff;"><strong>import javax.xml.transform.stream.StreamSource;</strong></span><br /><a name="line18">18</a><br /><a name="line19">19</a> <span style="color:#0000ff;"><strong>import org.dom4j.io.DocumentResult;</strong></span><br /><a name="line20">20</a> <span style="color:#0000ff;"><strong>import org.dom4j.io.DocumentSource;</strong></span><br /><a name="line21">21</a> <span style="color:#0000ff;"><strong>import org.dom4j.io.DocumentSource;</strong></span><br /><br /><a name="line22">22</a> <span style="color:#0000ff;"><strong>import org.dom4j.io.XMLWriter;</strong></span><br /><a name="line23">23</a> <span style="color:#0000ff;"><strong>import org.dom4j.io.OutputFormat;</strong></span><br /><a name="line24">24</a><br /><a name="line25">25</a> <strong>public</strong> <strong>class</strong> <span style="color:#2040a0;">XmlTransformer</span> <span style="color:#4444ff;"><strong>{</strong></span><br /><br /><a name="line26">26</a> <span style="color:#444444;">// The input XML file</span><br /><a name="line27">27</a> <strong>private</strong> <span style="color:#2040a0;">File</span> <span style="color:#2040a0;">input</span><span style="color:#4444ff;">;</span><br /><a name="line28">28</a> <span style="color:#444444;">// The DOM document for the imput file</span><br /><br /><a name="line29">29</a> <strong>private</strong> <span style="color:#2040a0;">Document</span> <span style="color:#2040a0;">inputDoc</span><span style="color:#4444ff;">;</span><br /><a name="line30">30</a> <span style="color:#444444;">// Guess what!!!!</span><br /><a name="line31">31</a> <strong>private</strong> <span style="color:#2040a0;">File</span> <span style="color:#2040a0;">output</span><span style="color:#4444ff;">;</span><br /><br /><a name="line32">32</a> <span style="color:#444444;">// The xslt file</span><br /><a name="line33">33</a> <strong>private</strong> <span style="color:#2040a0;">File</span> <span style="color:#2040a0;">transformation</span><span style="color:#4444ff;">;</span><br /><a name="line34">34</a><br /><a name="line35">35</a> <strong>public</strong> <span style="color:#2040a0;">XmlTransformer</span><span style="color:#4444ff;"><strong>(</strong></span><span style="color:#2040a0;">File</span> <span style="color:#2040a0;">input</span>, <span style="color:#2040a0;">File</span> <span style="color:#2040a0;">transformation</span><span style="color:#4444ff;"><strong>)</strong></span> <span style="color:#4444ff;"><strong>{</strong></span><br /><br /><a name="line36">36</a> <strong>this</strong>.<span style="color:#2040a0;">input</span> <span style="color:#4444ff;">=</span> <span style="color:#2040a0;">input</span><span style="color:#4444ff;">;</span><br /><a name="line37">37</a> <strong>this</strong>.<span style="color:#2040a0;">transformation</span> <span style="color:#4444ff;">=</span> <span style="color:#2040a0;">transformation</span><span style="color:#4444ff;">;</span><br /><br /><a name="line38">38</a> <span style="color:#4444ff;"><strong>}</strong></span><br /><a name="line39">39</a><br /><a name="line40">40</a> <strong>public</strong> <span style="color:#2040a0;">File</span> <span style="color:#2040a0;">transform</span><span style="color:#4444ff;"><strong>(</strong></span><span style="color:#4444ff;"><strong>)</strong></span> <strong>throws</strong> <span style="color:#2040a0;">IOException</span> <span style="color:#4444ff;"><strong>{</strong></span><br /><br /><a name="line41">41</a> <span style="color:#444444;">// Need to create a factory using JAXP</span><br /><a name="line42">42</a> <span style="color:#2040a0;">TransformerFactory</span> <span style="color:#2040a0;">factory</span> <span style="color:#4444ff;">=</span> <span style="color:#2040a0;">TransformerFactory</span>.<span style="color:#2040a0;">newInstance</span><span style="color:#4444ff;"><strong>(</strong></span><span style="color:#4444ff;"><strong>)</strong></span><span style="color:#4444ff;">;</span><br /><br /><a name="line43">43</a> <strong>try</strong> <span style="color:#4444ff;"><strong>{</strong></span><br /><a name="line44">44</a> <span style="color:#444444;">// Now get a transformer using the facory</span><br /><a name="line45">45</a> <span style="color:#2040a0;">Transformer</span> <span style="color:#2040a0;">transformer</span> <span style="color:#4444ff;">=</span> <span style="color:#2040a0;">factory</span>.<span style="color:#2040a0;">newTransformer</span><span style="color:#4444ff;"><strong>(</strong></span><strong>new</strong> <span style="color:#2040a0;">StreamSource</span><span style="color:#4444ff;"><strong>(</strong></span><br /><br /><a name="line46">46</a> <span style="color:#2040a0;">transformation</span><span style="color:#4444ff;"><strong>)</strong></span><span style="color:#4444ff;"><strong>)</strong></span><span style="color:#4444ff;">;</span><br /><a name="line47">47</a> <span style="color:#444444;">// Convert the input file into a DOM document</span><br /><a name="line48">48</a> <strong>this</strong>.<span style="color:#2040a0;">createDoc</span><span style="color:#4444ff;"><strong>(</strong></span><span style="color:#4444ff;"><strong>)</strong></span><span style="color:#4444ff;">;</span><br /><br /><a name="line49">49</a> <span style="color:#444444;">// Dom4j support for trasnformations</span><br /><a name="line50">50</a> <span style="color:#2040a0;">DocumentSource</span> <span style="color:#2040a0;">source</span> <span style="color:#4444ff;">=</span> <strong>new</strong> <span style="color:#2040a0;">DocumentSource</span><span style="color:#4444ff;"><strong>(</strong></span><strong>this</strong>.<span style="color:#2040a0;">inputDoc</span><span style="color:#4444ff;"><strong>)</strong></span><span style="color:#4444ff;">;</span><br /><br /><a name="line51">51</a> <span style="color:#2040a0;">DocumentResult</span> <span style="color:#2040a0;">result</span> <span style="color:#4444ff;">=</span> <strong>new</strong> <span style="color:#2040a0;">DocumentResult</span><span style="color:#4444ff;"><strong>(</strong></span><span style="color:#4444ff;"><strong>)</strong></span><span style="color:#4444ff;">;</span><br /><a name="line52">52</a> <strong>try</strong> <span style="color:#4444ff;"><strong>{</strong></span><br /><br /><a name="line53">53</a> <span style="color:#444444;">// OK lets do the actual transformation</span><br /><a name="line54">54</a> <span style="color:#2040a0;">transformer</span>.<span style="color:#2040a0;">transform</span><span style="color:#4444ff;"><strong>(</strong></span><span style="color:#2040a0;">source</span>, <span style="color:#2040a0;">result</span><span style="color:#4444ff;"><strong>)</strong></span><span style="color:#4444ff;">;</span><br /><a name="line55">55</a> <span style="color:#444444;">// The rest is boiler plate code!!!</span><br /><br /><a name="line56">56</a> <span style="color:#2040a0;">Document</span> <span style="color:#2040a0;">outputDoc</span> <span style="color:#4444ff;">=</span> <span style="color:#2040a0;">result</span>.<span style="color:#2040a0;">getDocument</span><span style="color:#4444ff;"><strong>(</strong></span><span style="color:#4444ff;"><strong>)</strong></span><span style="color:#4444ff;">;</span><br /><a name="line57">57</a> <span style="color:#2040a0;">OutputFormat</span> <span style="color:#2040a0;">format</span> <span style="color:#4444ff;">=</span> <span style="color:#2040a0;">OutputFormat</span>.<span style="color:#2040a0;">createPrettyPrint</span><span style="color:#4444ff;"><strong>(</strong></span><span style="color:#4444ff;"><strong>)</strong></span><span style="color:#4444ff;">;</span><br /><br /><a name="line58">58</a> <span style="color:#2040a0;">output</span> <span style="color:#4444ff;">=</span> <strong>new</strong> <span style="color:#2040a0;">File</span><span style="color:#4444ff;"><strong>(</strong></span><span style="color:#008000;">"output.xml"</span><span style="color:#4444ff;"><strong>)</strong></span><span style="color:#4444ff;">;</span><br /><a name="line59">59</a> <span style="color:#2040a0;">XMLWriter</span> <span style="color:#2040a0;">writer</span> <span style="color:#4444ff;">=</span> <strong>new</strong> <span style="color:#2040a0;">XMLWriter</span><span style="color:#4444ff;"><strong>(</strong></span><strong>new</strong> <span style="color:#2040a0;">FileWriter</span><span style="color:#4444ff;"><strong>(</strong></span><span style="color:#2040a0;">output</span><span style="color:#4444ff;"><strong>)</strong></span>, <span style="color:#2040a0;">format</span><span style="color:#4444ff;"><strong>)</strong></span><span style="color:#4444ff;">;</span><br /><br /><a name="line60">60</a> <span style="color:#2040a0;">writer</span>.<span style="color:#2040a0;">write</span><span style="color:#4444ff;"><strong>(</strong></span><span style="color:#2040a0;">outputDoc</span><span style="color:#4444ff;"><strong>)</strong></span><span style="color:#4444ff;">;</span><br /><a name="line61">61</a> <span style="color:#2040a0;">writer</span>.<span style="color:#2040a0;">close</span><span style="color:#4444ff;"><strong>(</strong></span><span style="color:#4444ff;"><strong>)</strong></span><span style="color:#4444ff;">;</span><br /><br /><a name="line62">62</a> <span style="color:#4444ff;"><strong>}</strong></span> <strong>catch</strong> <span style="color:#4444ff;"><strong>(</strong></span><span style="color:#2040a0;">TransformerException</span> <span style="color:#2040a0;">e</span><span style="color:#4444ff;"><strong>)</strong></span> <span style="color:#4444ff;"><strong>{</strong></span><br /><a name="line63">63</a> <span style="color:#444444;">// TODO Auto-generated catch block</span><br /><br /><a name="line64">64</a> <span style="color:#2040a0;">e</span>.<span style="color:#2040a0;">printStackTrace</span><span style="color:#4444ff;"><strong>(</strong></span><span style="color:#4444ff;"><strong>)</strong></span><span style="color:#4444ff;">;</span><br /><a name="line65">65</a> <span style="color:#4444ff;"><strong>}</strong></span><br /><a name="line66">66</a> <span style="color:#4444ff;"><strong>}</strong></span> <strong>catch</strong> <span style="color:#4444ff;"><strong>(</strong></span><span style="color:#2040a0;">TransformerConfigurationException</span> <span style="color:#2040a0;">e</span><span style="color:#4444ff;"><strong>)</strong></span> <span style="color:#4444ff;"><strong>{</strong></span><br /><br /><a name="line67">67</a> <span style="color:#444444;">// TODO Auto-generated catch block</span><br /><a name="line68">68</a> <span style="color:#2040a0;">e</span>.<span style="color:#2040a0;">printStackTrace</span><span style="color:#4444ff;"><strong>(</strong></span><span style="color:#4444ff;"><strong>)</strong></span><span style="color:#4444ff;">;</span><br /><a name="line69">69</a> <span style="color:#4444ff;"><strong>}</strong></span><br /><br /><a name="line70">70</a> <strong>return</strong> <span style="color:#2040a0;">output</span><span style="color:#4444ff;">;</span><br /><a name="line71">71</a> <span style="color:#4444ff;"><strong>}</strong></span><br /><a name="line72">72</a><br /><a name="line73">73</a> <strong>private</strong> <strong>void</strong> <span style="color:#2040a0;">createDoc</span><span style="color:#4444ff;"><strong>(</strong></span><span style="color:#4444ff;"><strong>)</strong></span> <span style="color:#4444ff;"><strong>{</strong></span><br /><br /><a name="line74">74</a> <span style="color:#2040a0;">SAXReader</span> <span style="color:#2040a0;">reader</span> <span style="color:#4444ff;">=</span> <strong>new</strong> <span style="color:#2040a0;">SAXReader</span><span style="color:#4444ff;"><strong>(</strong></span><strong>false</strong><span style="color:#4444ff;"><strong>)</strong></span><span style="color:#4444ff;">;</span><br /><a name="line75">75</a> <strong>try</strong> <span style="color:#4444ff;"><strong>{</strong></span><br /><br /><a name="line76">76</a> <strong>this</strong>.<span style="color:#2040a0;">inputDoc</span> <span style="color:#4444ff;">=</span> <span style="color:#2040a0;">reader</span>.<span style="color:#2040a0;">read</span><span style="color:#4444ff;"><strong>(</strong></span><strong>this</strong>.<span style="color:#2040a0;">input</span><span style="color:#4444ff;"><strong>)</strong></span><span style="color:#4444ff;">;</span><br /><br /><a name="line77">77</a> <span style="color:#4444ff;"><strong>}</strong></span> <strong>catch</strong> <span style="color:#4444ff;"><strong>(</strong></span><span style="color:#2040a0;">DocumentException</span> <span style="color:#2040a0;">e</span><span style="color:#4444ff;"><strong>)</strong></span> <span style="color:#4444ff;"><strong>{</strong></span><br /><a name="line78">78</a> <span style="color:#444444;">// TODO Auto-generated catch block</span><br /><br /><a name="line79">79</a> <span style="color:#2040a0;">e</span>.<span style="color:#2040a0;">printStackTrace</span><span style="color:#4444ff;"><strong>(</strong></span><span style="color:#4444ff;"><strong>)</strong></span><span style="color:#4444ff;">;</span><br /><a name="line80">80</a> <span style="color:#4444ff;"><strong>}</strong></span><br /><a name="line81">81</a> <span style="color:#4444ff;"><strong>}</strong></span><br /><br /><a name="line82">82</a> <span style="color:#4444ff;"><strong>}</strong></span><br /><br /></pre><br /><hr /><br />syntax highlighted by <a href="http://www.palfrader.org/code2html">Code2HTML</a>, v. 0.9.1<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16077594-1975150867604801200?l=tritanic.blogspot.com'/></div>julito-powerhttp://www.blogger.com/profile/00830938638699612248noreply@blogger.com0tag:blogger.com,1999:blog-16077594.post-38976353462222945002009-02-02T19:32:00.002Z2009-02-02T19:34:21.339ZNew songsI´ve published a new recording in my Myspace:<br /><br /><a href="http://www.myspace.com/sinnoticiasdedios">http://www.myspace.com/sinnoticiasdedios</a><br /><br /><br />Enjoy!!!!<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16077594-3897635346222294500?l=tritanic.blogspot.com'/></div>julito-powerhttp://www.blogger.com/profile/00830938638699612248noreply@blogger.com0tag:blogger.com,1999:blog-16077594.post-88850613336628199662009-01-26T19:22:00.017Z2009-01-27T20:26:56.158ZXML schema validation with Dom4j<div style="text-align: justify;">Hi folks, today I´m feeling geeky!!<br /><br />First and foremost, if you don´t know what and XML schemas or XML documents are, you´d better listen to my music clicking on the youtube video on your right. For the rest of you, a bit obvious, Dom4j is a Java API, so........<br /><br />Ok, let´s get started.<br /><br />Dom4j is a Java API that makes XML manipulation sweet, and easier than with pure DOM or SAX. Besides it let you use XPATH to travers XML documents. Dom4j includes its own XML parser, but this in not able to validate document agains schemas. For that purpose we will use Xerces.<br /><br />In order to develop our example we will define a very little schema and and two XML documents usign that schema, one will be valid, and the other won´t.<br /><br />I´m using Java 5, and ignore if this would work with Java 1.4, let me know if you discover something. I will assume you have downloaded the following APIs:<br /><br /></div><ul style="text-align: justify;"><li>Latest dom4j (1.6.1 at the time or writting this).<br /></li><li>Latest Xerces (1.4.4 at the time of writting this).</li></ul><div style="text-align: justify;">I´ll use Eclipse througout the whole example, so let´s kick off:<br /><br /></div><ul style="text-align: justify;"><li>Create a Java project. Call it XmlValidation</li><li>Add the following libraries to the buid path (Project -> Properties -> Java Build Path -> Libraries -> Add external jars)<ul><li>dom4j-1.6.1.jar</li><li>xerces.jar</li></ul></li><li>Add an XML schema called SongSchema.xsd:</li></ul><pre><br />&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br />&lt;xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"<br /> targetNamespace="SongSchema" xmlns:album="SongSchema"<br /> elementFormDefault="qualified"&gt;<br /><br /> &lt;xsd:element name="album"&gt;<br /> &lt;xsd:complexType&gt;<br /> &lt;xsd:sequence&gt;<br /> &lt;xsd:element name="song" type="album:song" /&gt;<br /> &lt;xsd:element name="comment" type="xsd:string" /&gt;<br /> &lt;/xsd:sequence&gt;<br /> &lt;/xsd:complexType&gt;<br /> &lt;/xsd:element&gt;<br /><br /> &lt;xsd:complexType name="song"&gt;<br /> &lt;xsd:sequence&gt;<br /> &lt;xsd:element name="title" type="album:nonemptystring" /&gt;<br /> &lt;xsd:element name="author" type="album:nonemptystring" /&gt;<br /> &lt;xsd:element name="minutes" type="album:time" /&gt;<br /> &lt;xsd:element name="seconds" type="album:time" /&gt;<br /> &lt;/xsd:sequence&gt;<br /> &lt;/xsd:complexType&gt;<br /><br /><br /> &lt;xsd:simpleType name="time"&gt;<br /> &lt;xsd:restriction base="xsd:positiveInteger"&gt;<br /> &lt;xsd:pattern value='[0-6]?[0-9]'/&gt;<br /> &lt;/xsd:restriction&gt;<br /> &lt;/xsd:simpleType&gt;<br /><br /> &lt;xsd:simpleType name="nonemptystring"&gt;<br /> &lt;xsd:restriction base="xsd:string"&gt;<br /> &lt;xsd:pattern value="[\w\W]+"&gt;&lt;/xsd:pattern&gt;<br /> &lt;/xsd:restriction&gt;<br /> &lt;/xsd:simpleType&gt;<br />&lt;/xsd:schema&gt;<br /></pre><br /><br /><ul><li>Now we create our actual XML file, called MySongs.xml:</li></ul><pre><br />&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br />&lt;album xmlns="SongSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<br /> xsi:schemaLocation="SongSchema SongSchema.xsd"&gt;<br /> &lt;song&gt;<br /> &lt;title&gt;Oceano de sal&lt;/title&gt;<br /> &lt;author&gt;Julio Delgado&lt;/author&gt;<br /> &lt;minutes&gt;39&lt;/minutes&gt;<br /> &lt;seconds&gt;7&lt;/seconds&gt;<br /> &lt;/song&gt;<br /> &lt;comment&gt;Very Good Song,ideed.&lt;/comment&gt;<br />&lt;/album&gt;<br /></pre><br /><br /><ul><li>We are nearly there!!!</li><li>Create the validator class, called Validator, in the Validator.java file:</li></ul><pre><br />package com.julio.xml;<br /><br />import java.io.File;<br />// dom4j import<br />import org.dom4j.Document;<br />import org.dom4j.DocumentException;<br />import org.dom4j.io.SAXReader;<br />import org.xml.sax.ErrorHandler;<br />import org.xml.sax.SAXException;<br />import org.xml.sax.SAXParseException;<br /><br />public class Validator {<br /> private File file;<br /> private Document doc;<br /> private SAXReader reader;<br /> private handler h;<br /> <br /> public Validator(){<br /> reader = new SAXReader(true);<br /> h = new handler();<br /> // Lets configure the reader for full validation<br /> // set the validation feature to true to report validation errors<br /> try {<br /> reader.setFeature("http://xml.org/sax/features/validation", true);<br /> // set the validation/schema feature to true to report validation errors against a schema<br /> reader.setFeature("http://apache.org/xml/features/validation/schema", true);<br /><br /> // set the validation/schema-full-checking feature to true to enable full schema, grammar-constraint checking<br /> reader.setFeature("http://apache.org/xml/features/validation/schema-full-checking", true);<br /> reader.setFeature("http://apache.org/xml/features/continue-after-fatal-error", true);<br /> //reader.setFeature("http://apache.org/xml/features/validation-error-as-fatal", true);<br /> reader.setErrorHandler(h);<br /> } catch (SAXException e) {<br /> // TODO Auto-generated catch block<br /> e.printStackTrace();<br /> }<br /><br /><br /> };<br /> public Validator(String fileName)<br /> {<br /> this();<br /> file = new File(fileName);<br /> try {<br /> doc = reader.read(file);<br /> } catch (DocumentException e) {<br /> // TODO Auto-generated catch block<br /> e.printStackTrace();<br /> }<br /> <br /> // If everything went fine up to this point, now we have<br /> // an XML document in memory and can try to validate.<br /> }<br /> public void setFile(File file) {<br /> this.file = file;<br /> }<br /> <br /> public boolean validateXml(){<br /> try {<br /> h.setHasErrors(false);<br /> doc = reader.read(file);<br /> } catch (DocumentException e) {<br /> // TODO Auto-generated catch block<br /> System.out.println(e.getMessage());<br /> //e.printStackTrace();<br /> return false;<br /> }<br /> return !h.getHasErrors();<br /> }<br /> <br /> <br /> class handler implements ErrorHandler{<br /><br /> private boolean hasErrors;<br /> <br /> public handler()<br /> {<br /> hasErrors = false;<br /> }<br /> <br /> public boolean getHasErrors()<br /> {<br /> return hasErrors;<br /> }<br /> <br /> public void setHasErrors(boolean b)<br /> {<br /> this.hasErrors = b;<br /> }<br /> <br /> @Override<br /> public void error(SAXParseException exception) throws SAXException {<br /> System.out.println("Line: " + exception.getLineNumber() + ") " +<br /> exception.getMessage());<br /> hasErrors = true;<br /> }<br /><br /> @Override<br /> public void fatalError(SAXParseException exception) throws SAXException {<br /> // TODO Auto-generated method stub<br /> <br /> }<br /><br /> @Override<br /> public void warning(SAXParseException exception) throws SAXException {<br /> // TODO Auto-generated method stub<br /> <br /> }<br /> <br /> }<br /><br />}<br /><br /></pre><br /><br /><br /><div style="text-align: justify;">This code is doing 2 main things:</div><ol style="text-align: justify;"><li>Configure the parser in the Validator constructor. This include it´s behavior and a class to handle errors and warnings during parsing.<br /></li><li>Define a class to handle errors. This is needed because otherwise the applicacion would rise and exception with the first error found, and we couldn´t get a list of all the errors present on the Xml file.<br /></li></ol><ul><li>Finally the class that nails everything together, XmlTest, in the file XmlTest.java:</li></ul><pre><br />package com.julio.test;<br /><br />import java.io.File;<br /><br />import org.dom4j.Document;<br />import org.dom4j.DocumentException;<br />import org.dom4j.io.SAXReader;<br /><br />public class XmlTest {<br /><br /> // Entry point<br /> public static void main(String args[])<br /> {<br /> System.out.println("XmlTest.main()");<br /> XmlTest test = new XmlTest();<br /> test.printWellcomeScreen();<br /> SAXReader reader = new SAXReader();<br /> Document doc = null;<br /> try {<br /> doc = reader.read(new File("xml/Program.xml"));<br /> } catch (DocumentException e) {<br /> // TODO Auto-generated catch block<br /> e.printStackTrace();<br /> }<br /> if(doc != null)<br /> {<br /> System.out.println(doc.toString());<br /> if(doc.getRootElement().getName() == "program")<br /> {<br /> System.out.println("program\n");<br /> System.out.println(doc.getRootElement().attributeValue("buid"));<br /> }<br /> }<br /> }<br /><br /><br /> private void printWellcomeScreen()<br /> {<br /> System.out.println("WELLCOME!!!\n");<br /> }<br /><br />}<br /><br /></pre><br /><br /><ul style="text-align: justify;"><li>Now just compile and execute. Try different values in the Xml file, and you´ll see how well the validation works.</li></ul><br />Enjoy!!!!<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16077594-8885061333662819966?l=tritanic.blogspot.com'/></div>julito-powerhttp://www.blogger.com/profile/00830938638699612248noreply@blogger.com0tag:blogger.com,1999:blog-16077594.post-7956579363263716612009-01-17T20:56:00.002Z2009-01-17T20:59:51.137ZXBOX 360<div style="text-align: justify;">I've bought myself an XBOX 360 last week. After playing a couple of hours with PGR4 I connected the console to the Internet. The process was amazingly easy, I just plugged one edge the network cable to the console the other to the router, and ........ there we go, my XBOX 360 was happily downloading updates and videos from the Internet.<br /><br />So far I've been playing PGR4, Orange Box (A total must have), GTA4, and ........ Kung Fu Panda, I'm sorry but this game is really fun.<br /><br />Bye.<br /></div><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16077594-795657936326371661?l=tritanic.blogspot.com'/></div>julito-powerhttp://www.blogger.com/profile/00830938638699612248noreply@blogger.com0tag:blogger.com,1999:blog-16077594.post-28977511236830033242009-01-17T20:34:00.003Z2009-01-17T20:55:20.158ZLimerick information<div style="text-align: justify;">If you ask an Irish about <a href="http://www.limerickslife.com/">Limerick</a>, you'll see that look..., that smile on the face. "You mean <a href="http://www.guardian.co.uk/world/2007/feb/02/ukcrime.prisonsandprobation">Stab City</a>?" you'll hear. Limerick is known in Ireland as a city with high crime rates, lots of <a href="http://www.urbandictionary.com/define.php?term=knackers">knackers</a>, horses and some gang activities.<br /><br />For some historical reasons unknown to me, there are two rival gangs developing all kind of underground activities. This gangs usually kill members of the rival one but, unfortunately, every so often Innocent people get caught in the middle, badly wounded or even killed.<br /><br />My impression of the city is different, radically different. Once in the city ,quickly you get the feeling of a middle size one, with some big office buildings, lots of cars, and some big industrial areas. Certainly the city is not as nice as Galway is. But its size is also a good thing since the commercial offer is much bigger.<br /><br />Then you discover the vibrant <a href="http://www.ul.ie/">University of Limerick</a>, its huge campus with its marvelous sports facilities. The offices of the company I work for are in the middle of the campus, in the <a href="http://www.shannon-dev.ie/RegionalDevelopment/KnowledgeNetwork/NationalTechnologyParkLimerick/">International Science Center at the National Technology Park</a>.<br /><br />Also Limerick is a much more international city, somehow people is more open minded, though I'm not saying that people in Galway are not open minded, but here they are more.<br /><br />In terms of weather, it seems to be a combination of continental weather, with colder winters and hotter summers than Galway, and a little bit less rainy. This last point is yet to be confirmed.<br /><br />So far I'm happy here. There are two things that I really miss, Salthill's promenade, and the ability to go everywhere with my bike.<br /><br />Bye.<br /></div><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16077594-2897751123683003324?l=tritanic.blogspot.com'/></div>julito-powerhttp://www.blogger.com/profile/00830938638699612248noreply@blogger.com0tag:blogger.com,1999:blog-16077594.post-85808022572299863352009-01-13T19:41:00.002Z2009-01-13T19:43:37.699ZBack to life<div style="text-align: justify;">After a couple of month of craziness and overwhelming stress, I´m back. Today he have had the Internet connexion installed at home, at my new home in Limerick, Ireland. You´ll hear from me soon, promise.<br /><br />Byeeeeeeeeeeeee.<br /></div><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16077594-8580802257229986335?l=tritanic.blogspot.com'/></div>julito-powerhttp://www.blogger.com/profile/00830938638699612248noreply@blogger.com0tag:blogger.com,1999:blog-16077594.post-22530113894015515222008-10-26T01:25:00.002Z2008-10-26T01:33:41.145ZDon't forget you past<div style="text-align: justify;">A country that forget it's past is doomed to repeat it. These last days Spain is committed to break apart one of the most remarkable prisons of the dark time, and by dark time I mean Franco's rule: the <span class="blsp-spelling-error" id="SPELLING_ERROR_0">Carabanchel</span> Prison. Hundreds, if not thousands of innocents where kept inside those walls, just for the crime of thinking of a better society.<br /><br />No doubt we all evolve, but I can't help looking at how <span class="blsp-spelling-corrected" id="SPELLING_ERROR_1">Americans</span> have San Quintin and other famous prison as <span class="blsp-spelling-corrected" id="SPELLING_ERROR_2">reminders</span> of past mistakes. Spain is tearing apart a symbol of disrespect, of past repression, of denying the right to be an independent thinker. May be this is a sign of what is yet to come........<br /><br />Enjoy life, if you can............<br /></div><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16077594-2253011389401551522?l=tritanic.blogspot.com'/></div>julito-powerhttp://www.blogger.com/profile/00830938638699612248noreply@blogger.com2tag:blogger.com,1999:blog-16077594.post-72030896831145716812008-10-25T00:29:00.002Z2008-10-25T00:30:03.782ZFrom today on, I'm officially in Panic Mode<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16077594-7203089683114571681?l=tritanic.blogspot.com'/></div>julito-powerhttp://www.blogger.com/profile/00830938638699612248noreply@blogger.com0tag:blogger.com,1999:blog-16077594.post-88084364266106190262008-10-24T23:33:00.003Z2008-10-24T23:51:13.204ZNo Microsoft, It wasn't you!!!<div style="text-align: justify;">It wasn't you who discovered the benefits of multi-tire applications, no, it wasn't you who discovered the wonders of using namespaces to logically organize what you call types, and the rest of the world call classes, interfaces, and so on.<br /><br />These days of financial crisis I'm reading a book about ASP.NET. The book isn't bad at all, but is somehow Microsoft biased. Written by a bunch of MS MVPs (Most Valuable Professional) is not difficult to understand that the authors must keep the big brother happy. But sometimes is so much, that it feels like a comedy book. I'll give you some examples:<br /><br />1.- <span style="font-weight: bold;">Microsoft forget easily</span>: This book criticize merciless the classic ASP model. Well, I still remember how they sold us this cutting edge, flawless technology. Not only classic ASP was a total crap, but now M$ have found the way to make our life easier: fully object oriented server side code, and compiled, Ohhhhhh thanks M$, Thanks for delivering what Java gave us almost 8 years ago, thanks anyway for the laugh.<br /><br />2.- <span style="font-weight: bold;">Microsoft have discovered that mixing presentation and logic isn't good</span>: This is absolutely hilarious. Microsoft have discovered 2 years ago, a principle of Software Engineering that has been with us, software engineers, for almost 10 years now, if not more. It was about time lads!!!.<br /><br />3.- <span style="font-weight: bold;">The most amazing, namespaces</span>: .Net organizes classes into logical units called namespaces!!!!!!!!!!!! WTF at this point I though maybe I was drinking poisoned water. How is this possible, even the most M$ biased programmers now that namespaces have been around for about 20 years now. Of course the horrible Win32 API don't now much about this, but this is no reason to say that one of the wonders of the .NET framework (which I think is a good thing) are namespaces. I will put this in another way, .NET without namespaces would be absolutely pointless.<br /><br />Well, I could continue for hours, but I think it's enough for today. I hope you have laughed reading this as much as I'm reading that ASP.NET book.<br /><br />Maybe I'll give the book's title in a future post.<br /><br />Enjoy life lads!!!!<br /></div><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16077594-8808436426610619026?l=tritanic.blogspot.com'/></div>julito-powerhttp://www.blogger.com/profile/00830938638699612248noreply@blogger.com0tag:blogger.com,1999:blog-16077594.post-40230351900025985422008-10-20T22:22:00.006Z2008-10-20T22:39:19.535ZAlone in the crap, sorry, in the dark. The .. movie?<div style="text-align: justify;">I've just watched Alone in the dark, movie based on the homonym video game. The game was a classic in the era of ancient computers (spectrum and Friends), but the movie has nothing to make it worth the time, thus another 93 minutes of my precious life wasted.<br /></div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">The story is totally meaningless, well, this is shared with the video game. The acting is horrendous, totally dull characters. Christian Slater was good in The name of the rose, but is still using that lost puppy look, for every kind of feeling, which doesn´t work with terror o puzzlement, I´m sure you know what I mean. The music, ohhh the music. Music is meant to emphasize parts of a movie, making it more intense. Well in this movie music comes and goes, distracting and interrupting action, which may not be that bad. It´s used in the wrong place, and the selection doesn´t match the situations at all. Last, but not least, the special effects, well, umm, they really seem to have been created using the same kind of computers that made the videogame famous. If the designer of Alien is making money with the rights, this movie has given him enough for next Christmas presents. I presume they bought ONE kind of Alien monster, and used it once, and again, and again, .......<br /></div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">I like videogames and I like movies, but the combinations isn´t really working out. Games can be simple, because you are the main character, and that felling compensate the lack of depth or excessive simplicity, but in a movie you are only an spectator, and more have to be given to take you into the movie.<br /></div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Bye.<br /></div><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16077594-4023035190002598542?l=tritanic.blogspot.com'/></div>julito-powerhttp://www.blogger.com/profile/00830938638699612248noreply@blogger.com1tag:blogger.com,1999:blog-16077594.post-79103727921401961652008-10-18T22:04:00.001Z2008-10-18T22:04:59.272ZNo words, BRILLIANT<a href="http://blog.wfmu.org/freeform/2008/10/photoshop-conte.html">McCain - Obama</a><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16077594-7910372792140196165?l=tritanic.blogspot.com'/></div>julito-powerhttp://www.blogger.com/profile/00830938638699612248noreply@blogger.com0tag:blogger.com,1999:blog-16077594.post-26327072616876928732008-10-16T11:55:00.015Z2008-10-16T20:09:47.232ZMultithread programming<div style="text-align: justify;">Multi-threaded programs are a must in a world dominated by servers, GUI applications, multiprocessor computers and so on. The standard way of managing threads is by using POSIX threads. I've found and amazingly easy to follow article about POSIX threads. It's only recommendable for those of you who already have knowledge of the basic thread mechanisms and OS design:<br /><br /></div><a href="http://users.actcom.co.il/%7Echoo/lupg/tutorials/multi-thread/multi-thread.html"><span style="font-size:85%;">Multi-Threaded Programming With POSIX Threads</span></a><br /><br /><div style="text-align: justify;">Examples are written in plain old marvelous C, so it might be hard to understand for the Java, and C# crowd, but lads, this is real software!!! :)<br /><br />Here you have a little example using threads, it's not rocket science, but makes the job:<br /><br /><pre class="code"><br />#include <stdio.h><br />#include <pthread.h><br />#define LIMIT 100<br /><br />/* prototype of the function that will be executed by a<br />thread. It's compulsory to return a void * and to receive<br />a void * as the only parameter */<br />void * do_loop(void * arg);<br /><br /><br />int main()<br />{<br /> /* The thread to be created */<br /> pthread_t MiThread;<br /> /* We will use these two as parameters to do_loop */<br /> int th1 = 1;<br /> int th2 = 2;<br /> /* Will get the return value of pthread_create(...) */<br /> int rc;<br /> printf("Starting application\n");<br /> /* Actual thread creation. Parameters:<br /> 1st .- The thread to be initialized<br /> 2nd .- Configuration parameters, NULL to use default<br /> 3rd .- The function to be executed by the thread<br /> 4th .- The parameter to be passed to do_loop<br /> */<br /> rc = pthread_create(&MiThread,NULL,do_loop,(void *)&th1);<br /> /* The main thread also executes the loop, to show us the intermixed<br /> execution of both threads */<br /> do_loop((void*)&th2);<br /> /* Just in case, the main thread waits for the auxiliary thread to<br /> finish */<br /> pthread_join(MiThread,NULL);<br /> system("PAUSE");<br />}<br /><br />void * do_loop(void * arg)<br />{<br /> int i = 0;<br /> for (i = 0 ; i < LIMIT ; i++)<br /> printf("Hello Thread %d\n",*(int *)arg);<br /> return NULL;<br />}<br /></pre><br /><br /><br />By the way, there is a companion article that gives an introduction to parallel programming. Interesting for the newbie.<br /><br /><span style="font-size:85%;"><a href="http://users.actcom.co.il/%7Echoo/lupg/tutorials/parallel-programming-theory/parallel-programming-theory.html">Parallel Programming - Basic Theory For The Unwary</a></span><br /><br />Enjoy!<br /></div><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16077594-2632707261687692873?l=tritanic.blogspot.com'/></div>julito-powerhttp://www.blogger.com/profile/00830938638699612248noreply@blogger.com0tag:blogger.com,1999:blog-16077594.post-53134134451092826952008-10-14T21:51:00.004Z2008-10-14T22:15:14.644ZASP.Net Datagrid control<div style="text-align: justify;">Hi lads,<br /></div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Slowly but steadily I'm discovering the goods and bads of ASP.NET programming. On the one hand it's pretty simple to make a simple but rather functional web application, on the other hand the programming model, if any, it's really simplistic, and this is good, but also bad. On top of that there aren't billions of frameworks to use, in contrast to the Java world, that makes things easier, but also gives you less power. Other factors are the insane dependency on Microsoft, slave forever of IIS, that is definitely not good. Ahh, and don't forget you can program almost everything using very simple HTML and C#, this last one is becoming my favourite language, after god C++, of course.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Well, one very powerful web control provided by ASP.NET is the Datagrid control. It basically allows to show information in a table. This information must come to any source that implements the IEnumerable interface. All the dirty HTML code is automatically generated by ASP.NET, and this, for those of you who fought with the old classic ASP, is a blessing.</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">I have found a couple of good articles and web sites about the use of this Datagrid web control, I hope they are useful for you.</div><div style="text-align: justify;"><br /></div><div><ul><li style="text-align: justify;"><a href="http://aspnet.4guysfromrolla.com/articles/040502-1.aspx">An extensive examination of the Datagrid web control.</a></li><li style="text-align: justify;"><a href="http://www.datagridgirl.com/">Datagrid girl</a>, just don't even ask me.</li><li style="text-align: justify;"><a href="http://articles.techrepublic.com.com/5100-10878_11-5193577.html">Techrepublic.com on Datagrid.</a> Actually there are loads of articles in techrepublic.</li></ul><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Enjoy!!!!!!!</div></div><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16077594-5313413445109282695?l=tritanic.blogspot.com'/></div>julito-powerhttp://www.blogger.com/profile/00830938638699612248noreply@blogger.com0tag:blogger.com,1999:blog-16077594.post-13831326935344927852008-10-11T20:09:00.003Z2008-10-11T20:12:42.472ZMono 2.0 Use .NET out of Windows<div style="text-align: justify;">Since .NET assemblies compile down to CIL bytecode that's executed in a virtual machine under Windows, there's no reason, in principle, that they shouldn't be able to run under any platform. After all, Java's "write once, run anywhere" mantra has the same fundamental architecture: a VM running bytecode that taps into a series of standard APIs and classes.<br /></div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Visit the <a href="http://www.mono-project.com/news/archive/2008/Oct-06.html">Mono Project Official Release Notes</a>.</div><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16077594-1383132693534492785?l=tritanic.blogspot.com'/></div>julito-powerhttp://www.blogger.com/profile/00830938638699612248noreply@blogger.com0tag:blogger.com,1999:blog-16077594.post-70104960072472834522008-10-11T20:04:00.002Z2008-10-11T20:06:58.302ZU.S. takes North Korea off terror list<div style="text-align: justify;">Sounds like a joke. What a wonderful year! First the Olympic games in China, well known for it's respect for human rights, and now North Korea, one of the most open countries in Asia is taken off the terror list.<br /></div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">But these guys actually believe that we are stupid??? I hope Obama has a little more common sense.</div><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16077594-7010496007247283452?l=tritanic.blogspot.com'/></div>julito-powerhttp://www.blogger.com/profile/00830938638699612248noreply@blogger.com0