<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>bugflux.org &#187; software</title>
	<atom:link href="http://bugflux.org/tag/software/feed/" rel="self" type="application/rss+xml" />
	<link>http://bugflux.org</link>
	<description>André Prata, nDray</description>
	<lastBuildDate>Fri, 16 Sep 2011 07:54:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>pacman: like, +1, upvote, digg, &#8230;</title>
		<link>http://bugflux.org/blog/1538:pacman-like-1-upvote-digg/</link>
		<comments>http://bugflux.org/blog/1538:pacman-like-1-upvote-digg/#comments</comments>
		<pubDate>Wed, 14 Sep 2011 16:43:18 +0000</pubDate>
		<dc:creator>nDray</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[en]]></category>
		<category><![CDATA[archlinux]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://bugflux.org/?p=1538</guid>
		<description><![CDATA[i have been a quite happy archlinux user for a few years now. one of the reasons is surely pacman and, today, i have turned a little bit happier about it. quite often, when working on a project, i have &#8230; <a href="http://bugflux.org/blog/1538:pacman-like-1-upvote-digg/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>i have been a quite happy archlinux user for a few years now. one of the reasons is surely pacman and, today, i have turned a little bit happier about it.</p>
<p>quite often, when working on a project, i have to install several packages and libraries that, most certainly, i&#8217;ll never use again after the project is done, so i need to remember to remove them. what i usually did was:</p>
<ol>
<li>install the packages as dependencies (<strong>pacman -S &#8211;asdeps</strong>) and then,</li>
<li>later, when project is done, check my database for all installed packages that depended on no other explicitly installed package (<strong>pacman -Qdt</strong>).</li>
</ol>
<p><span class="Apple-style-span" style="color: #444444; font-family: Georgia, 'Bitstream Charter', serif; font-size: 16px; line-height: 24px;">the thing is that, over time, and many simultaneous projects, the listing gets crowded, and mixed up with optional dependencies for packages that i use (i install them as dependencies so they get removed when i remove the main package (<strong>pacman -Rncs</strong>)).</span></p>
<p>what i needed was a feature to &#8220;mark this installation with a reason: this project&#8221;. no, pacman does not support that, afaik. but it does support something perhaps better: meta-packages! for example, for the <a title="odtone @ helios.av.it.pt" href="http://helios.av.it.pt/embedded/odtone/index.html">odtone</a> project (my thesis depends on), i created the <strong>odtone-meta</strong> package that depends on all the packages that are needed, and has no particular source! thus, all i need to do is install the package, all dependencies are managed automatically! the PKGBUILD:</p>
<pre class="brush: bash; title: ; notranslate">pkgname=odtone-meta
pkgver=001
pkgrel=1
pkgdesc=&quot;This package depends on all necessary packages for odtone&quot;
arch=('any')
url=&quot;http://helios.av.it.pt/embedded/odtone/index.html&quot;
license=('LGPL')
depends=('boost' 'boost-libs' 'rasqal' 'raptor' 'redland' 'redland-storage-sqlite')</pre>
<p>this way, when the project is finished, i just remove the odtone-meta package, and everything that isn&#8217;t a dependency for another package is just removed!</p>
<p>neat!!</p>
]]></content:encoded>
			<wfw:commentRss>http://bugflux.org/blog/1538:pacman-like-1-upvote-digg/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>unintended (dis)honesty</title>
		<link>http://bugflux.org/blog/1528:unintended-dishonesty/</link>
		<comments>http://bugflux.org/blog/1528:unintended-dishonesty/#comments</comments>
		<pubDate>Fri, 17 Jun 2011 16:42:05 +0000</pubDate>
		<dc:creator>nDray</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[en]]></category>
		<category><![CDATA[education]]></category>
		<category><![CDATA[personal]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://bugflux.org/?p=1528</guid>
		<description><![CDATA[this morning i slipped to my boss/coordinator/teacher that i don&#8217;t have aspirations of going too far in my professional career. well, given some thought, that&#8217;s sort of a lie. what i usually mean by this is that i don&#8217;t want &#8230; <a href="http://bugflux.org/blog/1528:unintended-dishonesty/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>this morning i slipped to my <a title="diogogomes.com" href="http://diogogomes.com/" target="_blank">boss/coordinator/teacher</a> that i don&#8217;t have aspirations of going too far in my professional career. well, given some thought, that&#8217;s sort of a lie. what i usually mean by this is that i don&#8217;t want to be the head of something too large to handle on the nine to five schedule! for as long as i&#8217;ve known myself, i always felt great for being complimented. i often get that for being good at what i do, so i&#8217;ll keep trying!</p>
<p>for the next &#8220;year&#8221;, the big thesis road, my mind is more or less settled on working on top of <a title="odtone @ atnog.av.it.pt" href="http://atnog.av.it.pt/projects/odtone" target="_blank">odtone</a>. maybe you laptop-owner-linux-user will read my name in a few manpages in the future! =)</p>
]]></content:encoded>
			<wfw:commentRss>http://bugflux.org/blog/1528:unintended-dishonesty/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>my own hdr tutorial</title>
		<link>http://bugflux.org/blog/en/1523:my-own-hdr-tutorial/</link>
		<comments>http://bugflux.org/blog/en/1523:my-own-hdr-tutorial/#comments</comments>
		<pubDate>Sat, 11 Jun 2011 11:01:05 +0000</pubDate>
		<dc:creator>nDray</dc:creator>
				<category><![CDATA[en]]></category>
		<category><![CDATA[photography]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://bugflux.org/?p=1523</guid>
		<description><![CDATA[in the past, before owning a camera, i&#8217;d seen some samples of hdr art. everyone likes it, there&#8217;s something about all that fake colors that makes us dream. well, but it seemed a hard and tough result to achieve, i &#8230; <a href="http://bugflux.org/blog/en/1523:my-own-hdr-tutorial/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>in the past, before owning a camera, i&#8217;d seen some samples of <a title="hdr ppol @ flickr.com" href="http://www.flickr.com/groups/hdr/pool/">hdr art</a>. everyone likes it, there&#8217;s something about all that fake colors that makes us dream.</p>
<p>well, but it seemed a hard and tough result to achieve, i had read some tutorials for photoshop and gimp, and it looked like a pain in the arse. well, not anymore. i&#8217;m going to guide you through a few easy steps in order to achieve those amazing results!<span id="more-1523"></span></p>
<h2>step one:</h2>
<p>get luminance hdr: <a href="http://qtpfsgui.sourceforge.net/">http://qtpfsgui.sourceforge.net/</a></p>
<h2>step two:</h2>
<p>use it!</p>
<h2>result:</h2>
<p>this is <a title="summer rise @ flickr.com" href="http://www.flickr.com/photos/bugflux/5820870840/in/photostream/lightbox/">my first experience</a>. i barely looked in the viewfinder, i just downloaded luminance hdr and ran out to get this scene. one of the main reasons i didn&#8217;t get the d3100 instead of this d7000 was the stupid absence of automatic bracketing&#8230; even at 5fps the scene, or my hand, moves, so having to change the exposure automatically and align the images must be really boring&#8230; yeah, i don&#8217;t own a tripod, yet. neither i would carry it at all times, even if i had&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://bugflux.org/blog/en/1523:my-own-hdr-tutorial/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>wohoa, bada gets phonegap!</title>
		<link>http://bugflux.org/blog/1510:wohoa-bada-gets-phonegap/</link>
		<comments>http://bugflux.org/blog/1510:wohoa-bada-gets-phonegap/#comments</comments>
		<pubDate>Mon, 02 May 2011 22:17:57 +0000</pubDate>
		<dc:creator>nDray</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[en]]></category>
		<category><![CDATA[science]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://bugflux.org/?p=1510</guid>
		<description><![CDATA[nice!! https://github.com/phonegap/phonegap/tree/master/Bada]]></description>
			<content:encoded><![CDATA[<p>nice!!</p>
<p><a href="https://github.com/phonegap/phonegap/tree/master/Bada">https://github.com/phonegap/phonegap/tree/master/Bada</a></p>
]]></content:encoded>
			<wfw:commentRss>http://bugflux.org/blog/1510:wohoa-bada-gets-phonegap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>problemacia descontornável</title>
		<link>http://bugflux.org/blog/1471:problemacia-descontornavel/</link>
		<comments>http://bugflux.org/blog/1471:problemacia-descontornavel/#comments</comments>
		<pubDate>Sun, 23 Jan 2011 13:21:24 +0000</pubDate>
		<dc:creator>nDray</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[personal]]></category>
		<category><![CDATA[pt]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://bugflux.org/?p=1471</guid>
		<description><![CDATA[numa tentativa infantil de erradicar os problemas da minha ligação adsl durante a noite, vi-me forçado a configurar novamente o mutt e msmtp para enviar mensagens periódicas aos serviços de apoio da sapo e pt. o problema, efectivamente, tem a &#8230; <a href="http://bugflux.org/blog/1471:problemacia-descontornavel/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>numa tentativa infantil de erradicar os problemas da minha ligação adsl durante a noite, vi-me forçado a configurar novamente o <a title="mutt.org" href="http://www.mutt.org/" target="_blank">mutt</a> e <a title="msmtp @ sf.net" href="http://msmtp.sourceforge.net/" target="_blank">msmtp</a> para enviar mensagens periódicas aos serviços de apoio da <a title="net @ sapo.pt" href="http://net.sapo.pt/" target="_blank">sapo</a> e pt.</p>
<p>o problema, efectivamente, tem a ver com quebras de ligação a todo o minuto a partir das 18 horas, por exemplo, e até ser hora de deitar. na verdade a ligação não cai com frqeuência, é mais ao contrário. fica frequentemente desligada e liga-se momentaneamente. como não conseguem garantir-me os débitos de uns miseros 4MB a ligação tenta ressincronizar a uma taxa inferior, mas volta a falhar de qualquer modo. no ano passado baixaram-me o downstream para 3MB, mas este ano a ligação conseguiu ficar ainda pior.</p>
<p>if you ask me, someone has ever more clients, but no hardware upgrade concerns.</p>
<p><span id="more-1471"></span></p>
<p>executado no arranque do gnome (que efectivamente me liga à internet), <strong>.mailnetcommand.sh:</strong></p>
<pre class="brush: bash; title: ; notranslate">
#!/bin/bash

while :
do
	mutt -s &quot;Problemacia descontornável&quot; -- mail16200@telecom.pt &lt; $HOME/.mailnetbody.txt
	mutt -s &quot;Problemacia descontornável&quot; -- suporte@acesso.sapo.pt &lt; $HOME/.mailnetbody.txt
#	rm $HOME/sent
	sleep $((900+$RANDOM%900)) # repeat after 15 to 30 minutes
done &amp;
</pre>
<p><strong>.muttrc:</strong></p>
<pre class="brush: plain; title: ; notranslate">
set sendmail=&quot;/usr/bin/msmtp&quot;
set from=myname@myserver.tld﻿</pre>
<p><strong>.msmtprc:</strong></p>
<pre class="brush: plain; title: ; notranslate">
account default
host mail.myserver.tld
from myname@myserver.tld

auth on
user myname@myserver.tld
password mypassword
tls on
tls_certcheck off # who cares?﻿</pre>
<p><strong>.mailnetbody.txt</strong></p>
<pre class="brush: plain; title: ; notranslate">
&lt;insert intended puns here&gt;
...
Reenviarei esta mensagem sempre que achar conveniente,
e até considerar o problema resolvido.
</pre>
<p>sou capaz de ter problemas também com o &#8220;myserver.tld&#8221; por causa de estar sempre a enviar e-mails para o mesmo sítio, mas hão-de ser enviadas mensagens suficientes para dar um ar de cliente aborrecido&#8230;</p>
<p>care: \_/</p>
]]></content:encoded>
			<wfw:commentRss>http://bugflux.org/blog/1471:problemacia-descontornavel/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>all work, no play</title>
		<link>http://bugflux.org/blog/1418:all-work-no-play/</link>
		<comments>http://bugflux.org/blog/1418:all-work-no-play/#comments</comments>
		<pubDate>Sat, 13 Nov 2010 14:49:09 +0000</pubDate>
		<dc:creator>nDray</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[en]]></category>
		<category><![CDATA[personal]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://bugflux.org/?p=1418</guid>
		<description><![CDATA[i finally went around buying a new computer. i actually waited a couple of days to start writing this in the new laptop and, my god, this keyboard is an absolute delight to type on&#8230; i scanned the market a &#8230; <a href="http://bugflux.org/blog/1418:all-work-no-play/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>i finally went around buying a new computer. i actually waited a couple of days to start writing this in the new laptop and, my god, this keyboard is an absolute delight to type on&#8230;</p>
<p>i scanned the market a lot, as always. at first i was hoping to buy a <a title="macbook pro @ apple.com" href="http://www.apple.com/macbookpro/" target="_blank">macbook pro</a>. the pros were battery life, operating system, and good design/construction. the problem is that, more than that, i always look for a good performance/cost compromise. current 13&#8221; mbps aren&#8217;t the case, and i&#8217;d have to wait more than a couple more months for a then-outdated spec list.<span id="more-1418"></span></p>
<p>so, having crossed macbooks off the list, i started looking everywhere else, even leaving <a title="laptop reliability @ gizmodo.com" href="http://gizmodo.com/5406415/laptop-reliability-study-asus-and-toshiba-come-out-on-top" target="_blank">brand prejudice</a> aside. i was very glad to read about the new <a title="new dell studio xps @ dell.com" href="http://www.dell.com/us/p/xps-14/pd.aspx" target="_blank">dell xps powerhouses</a>. i wanted the 14 incher, but then, as they were (and still are) taking too long to arrive to portugal, i gave the laptop a lot of thought and ended giving up on it. (and it was actually pretty difficult to get in touch with portuguese dell to find out. i couldn&#8217;t find such information on almost 20 minutes of calls). it just wasn&#8217;t right for my present/future concerns.</p>
<p>why? i started giving less and less importance to graphics and multimedia capabilities to prefer mobility and business-oriented service. that&#8217;s when i put the <a title="portégé r700 @ toshiba.com" href="http://us.toshiba.com/computers/laptops/portege/R700" target="_blank">toshiba r700</a> and the <a title="elitebook 8440p @ hp.com" href="http://h10010.www1.hp.com/wwpc/uk/en/sm/WF06b/321957-321957-64295-3955549-3955549-4095872-4156585.html" target="_blank">hp elitebook 8440p</a> on the table. i&#8217;m now typing on the latter, due to the first being slightly less spec&#8217;ed for a higher price, although it tops this one easily in the mobility department.</p>
<p>this laptop is the absolute category winner. what i needed to replace my old one, now soon-to-be stationed back home, was a bump in memory, storage and processor speed. this laptop provides all that on top of an excellent accessory list. it is a 4-thread (2-core) <a title="core i7 620m @ intel.com" href="http://ark.intel.com/Product.aspx?id=43560" target="_blank">620m intel processor</a>, an almost outdated <a title="nvs @ nvidia.com" href="http://www.nvidia.com/object/nvs_techspecs.html" target="_blank">nvs 3100</a> cuda enabled nvidia graphics card, <a title="momentus xt @ seagate.com" href="http://www.seagate.com/www/en-us/products/laptops/laptop-hdd" target="_blank">320gb momentus xt</a> hybrid drive (home upgrade), 4gb ram. all of this on top of a perfectly linux compatible docking station. at the end the boxes went for almost as much as i had paid for my previous <a title="a8js @ asus.com" href="http://www.asus.com/product.aspx?P_ID=pNLoBhyc0e3u6osr" target="_blank">a8js</a>. it&#8217;s not just the performance increase, it&#8217;s the service quality:</p>
<p>a nicely rugged laptop. the aluminum feels cold and solid. the laptop does feel a bit light for what it looks like, but it&#8217;s by no means light, it is almost as heavy as my previous one, and almost doubles the r700&#8242;s mark. not that i care. besides the solid feel, i am entitled to a 3-year (battery included!) next business day on site repairs with toll-free 24&#215;7 phone support. <span style="text-decoration: line-through;">this is not a <a title="boston-power.com" href="http://www.boston-power.com/" target="_blank">boston technology</a> battery (i guess, i have to check the papers more carefully), so the warranty is only one year.<br />
</span></p>
<p>i had only troubles trying to boot archlinux from a pen, the bios would freeze. that was with a dd&#8217;ed hybrid image. it worked when i flashed the stick with universal usb installer, so i might just be headed for a <a title="bugs @ archlinux.org" href="https://bugs.archlinux.org/" target="_blank">flyspray bug report</a>.</p>
<p>many people whined about this touchpad. it is not a good one, it&#8217;s small and a bit too much sunk, and i can&#8217;t two-finger-scroll in linux, though it is possible in windows. the buttons are hinged. i didn&#8217;t even know what that meant until i clicked them, but i don&#8217;t see why that&#8217;s bad, i actually like it. the point-stick (or clitoris, as it is more widely known) isn&#8217;t very much usable for me, and it sometimes gets in the way of typing, but that could be just me.</p>
<p>the keys have a _very_ good response, a long and solid stroke, but with a smooth feeling. this is a very good keyboard and though i haven&#8217;t used a thinkpad&#8217;s before, i think they don&#8217;t provide the smooth feeling with the solid stroke combo. this is really nice. i&#8217;m portuguese, but i could only get a decent deal on this with a gbr layout. not that i care, it might actually help me work, and so far didn&#8217;t get in the way of typing with the portuguese layout.</p>
<p>battery-life-wise, i have been writing and browsing for a almost an hour with low brightness and a powersave cpu frequency governor (booted and browsed a few minutes with ondemand and maximum brightness), and the battery is now around 70%. it&#8217;s not spectacular, but it&#8217;s more than i could ever expect from my previous laptop, and i will use it mostly as a power failure backup mechanism, so that&#8217;s a good mark. (mind that the newly installed hard-drive drains a few more watts than the original momentus shipped inside).</p>
<p>i can&#8217;t tell if the momentus xt is paying its dues. some applications do feel faster to go up, but the new processor and memory coupled with an anyway 7200rpm hard drive certainly make the difference compared to the previous machine.</p>
<p><strong>edit:</strong></p>
<p>sorry, i forgot to mention the keyboard flex&#8230; oh, wait: no, i didn&#8217;t!</p>
<p><strong>edit 2:</strong></p>
<p>this _is_ the hp long life 6 cell 51 whr li-ion battery! so yes: boston technology, 3 year warranty. boy, am i glad/lucky!!</p>
<p><strong>a couple of things i did forget to mention:</strong></p>
<p>this momentus xt is fairly noisy. i haven&#8217;t had laptop with a 7200rpm before, so i&#8217;m not sure if this was true for the shipped drive as well.</p>
<p>but, most important, the screen. the contrast sucks, there&#8217;s no other way to put it. it can&#8217;t be used for image/video work. it isn&#8217;t very bright and the colors might surprise you in the output. but the truth is that a bad matte screen is easily better for me than a reasonable glossy one. i see no reflections here, and this is a very good point on this screen.</p>
]]></content:encoded>
			<wfw:commentRss>http://bugflux.org/blog/1418:all-work-no-play/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>sign here, here, and here</title>
		<link>http://bugflux.org/blog/1412:sign-here-here-and-here/</link>
		<comments>http://bugflux.org/blog/1412:sign-here-here-and-here/#comments</comments>
		<pubDate>Sat, 30 Oct 2010 20:15:19 +0000</pubDate>
		<dc:creator>nDray</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[en]]></category>
		<category><![CDATA[personal]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://bugflux.org/?p=1412</guid>
		<description><![CDATA[a few days ago i sold my soul to the institute of telecommunications, here in aveiro. this means a couple of months of android, for starters. i remember saying something about how stupidly android handles applications, compared to bada. well, &#8230; <a href="http://bugflux.org/blog/1412:sign-here-here-and-here/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>a few days ago i sold my soul to the <a title="it.pt" href="http://www.it.pt/" target="_self">institute of telecommunications</a>, here in aveiro. this means a couple of months of android, for starters. i remember saying something about how stupidly android handles applications, compared to bada. well, yesterday i was reading some stuff about it and, my god, this all makes a whole lot of sense to me. it&#8217;s a little different approach to the concept of applications. android might just be the next best thing to search, from google. it&#8217;s a shame that this is java (i&#8217;d still like to see some efficiency data compared to c++, or other <em>real language</em>) and google can&#8217;t sell (remember google wave? buzz, what&#8217;s that?).</p>
]]></content:encoded>
			<wfw:commentRss>http://bugflux.org/blog/1412:sign-here-here-and-here/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>comment</title>
		<link>http://bugflux.org/blog/1400:comment/</link>
		<comments>http://bugflux.org/blog/1400:comment/#comments</comments>
		<pubDate>Mon, 04 Oct 2010 22:22:37 +0000</pubDate>
		<dc:creator>nDray</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[pt]]></category>
		<category><![CDATA[economy]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://bugflux.org/?p=1400</guid>
		<description><![CDATA[só porque não tenho nada que fazer, e me lembrei de rever esta tendência, e como se acentuou&#8230; =)]]></description>
			<content:encoded><![CDATA[<p>só porque não tenho nada que fazer, e me lembrei de rever esta tendência, e como se acentuou&#8230; =)</p>
<p><a href="http://bugflux.org/wp/wp-content/uploads/2010/10/rapid.png"><img class="aligncenter size-full wp-image-1401" title="rapid" src="http://bugflux.org/wp/wp-content/uploads/2010/10/rapid.png" alt="" width="592" height="222" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://bugflux.org/blog/1400:comment/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>na crista da onda: anfíbio</title>
		<link>http://bugflux.org/blog/1317:na-crista-da-onda-anfibio/</link>
		<comments>http://bugflux.org/blog/1317:na-crista-da-onda-anfibio/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 11:24:05 +0000</pubDate>
		<dc:creator>nDray</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[pt]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://bugflux.org/?p=1317</guid>
		<description><![CDATA[depois do fracasso e do sucesso parcial do desenvolvimento para bada, procurei descobrir como seria desenvolver um widget para o telemóvel. surpresa! os widgets não passam de páginas web! apesar de já ter confessado não gostar de programação por eventos, &#8230; <a href="http://bugflux.org/blog/1317:na-crista-da-onda-anfibio/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>depois do <a title="na crista da onda @ bugflux.org" href="/?p=1208" target="_self">fracasso</a> e do <a title="na crista da onda: parte 2 @ bugflux.org" href="/?p=1211" target="_self">sucesso parcial</a> do desenvolvimento para bada, procurei descobrir como seria desenvolver um <em>widget</em> para o <a title="uma nova onda @ bugflux.org" href="/?p=1087" target="_self">telemóvel</a>. surpresa! os widgets não passam de páginas web! apesar de já ter confessado não gostar de programação por eventos, por algum motivo, javascript e html são coisas totalmente diferentes, para mim. talvez por associar <em>scripting</em> tão potente a linguagem de marcação de forma tão simples. não sei, mas gosto!</p>
<p><span id="more-1317"></span>uma coisa que dava jeito era poder ter no ecrã principal atalhos para aplicações. más notícias. para a maioria, não é possível. a samsung implementa uma api <a title="bondi @ omtp.org" href="http://bondi.omtp.org/default.aspx" target="_blank">bondi</a>, mas esta permite o acesso a escassas aplicações. claro que a samsung tem acesso a todas, com widgets até para aceder à aplicação da loja, que nem sequer consta na <a title="samsung widget api reference @ innovator.samsungmobile.com" href="http://innovator.samsungmobile.com/cms/cnts/knowledge.detail.view.do?platformId=12&amp;cntsId=6720" target="_self">documentação</a>. para as aplicações que interessa não deixam aceder&#8230;</p>
<p>além de aceder ao telemóvel, também seria interessante o acesso directo à web. é muito fácil criar pequenos atalhos no ecrã, estilo bookmarks. tive a ideia de ir mais longe, procurando poupar espaço comparativamente a essa solução. um pequeno widget do estilo da google, que vem no telemóvel, mas com botões configuráveis, e potencialmente ilimitados. surge o <a title="all terrain search @ bugflux.org" href="/dev/all-terrain-search/" target="_blank">All Terrain Search</a>:</p>
<p>a ideia é simples. uma caixa de texto e botões. se existir texto nessa caixa, o botão faz uma pesquisa no site. se a caixa estiver em branco, o botão redirecciona para a homepage. 4 botões não são lá grande coisa, portanto um scroll permite ver mais 4, e mais 4, e mais 4, tantos quanto inserir.</p>
<p>a ideia foi estruturar o código de maneira a que fosse simples adicionar novos motores. numa pasta individual colocam-se os ícones dos motores. qualquer que seja o tamanho da imagem, será sempre apresentada a 84&#215;84 pixels. é recomendável redimensionar antes, uma vez que o rendering do browser estraga um pouco a qualidade das imagens.</p>
<p>as imagens são depois usadas num ficheiro javascript, onde o utilizador deve mexer para configurar a seu gosto. a lista de motores não passa de um array de variáveis com 3 propriedades: a homepage, a string para pesquisa e a localização da imagem. se o tamanho do array exceder o número de motores visíveis de uma vez, as restantes serão acedidas por scoll.</p>
<p>não queria usar um botão adicional e desperdiçar espaço, queria que um drag vertical no widget mudasse a lista de motores. o drag horizontal também seria interessante, mas esse será sempre apanhado primeiro pelo home screen, para mudar entre ecrãs. o scroll foi a maior perda de tempo. a samsung tem uma <a title="touch table @ quirksmode.org" href="http://www.quirksmode.org/mobile/tableTouch.html" target="_blank">má implementação</a> dos eventos touch no seu browser. a única coisa que me permitiu gerir com eficiência foi o evento <strong>onmousewheel</strong>, lançado aquando de arrastamentos do dedo. não funcionando como num computador, no entanto, o <strong>Event</strong> associado não tem a propriedade <strong>wheelDelta</strong>, que normalmente devolve a extensão/direcção do scroll. não consigo sequer saber se o scroll é para baixo ou para cima, só sei que houve scroll. ainda para mais, um arrastamento contínuo lança diversos eventos, o que provoca scrolls a mais, acidentais.</p>
<p>para solucionar os dois problemas, o scroll não faz bem scroll, mas faz <em>cycle</em> entre as páginas de motores. para evitar o lançamento consecutivo de vários scroll, quando capturo um primeiro deixo de ouvir o evento para só ouvir um quinto de segundo mais tarde:</p>
<pre class="brush: jscript; title: ; notranslate">scroll = function(e) { /* more like cycle through */
	page = (page + 1) % Math.ceil(engines.length / visibleEngines);

	/* disable scroll for a fifth of a sec */
	document.onmousewheel = null;
	setTimeout('document.onmousewheel = scroll', 200);

	changePage(page);
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://bugflux.org/blog/1317:na-crista-da-onda-anfibio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>na crista da onda: parte 2</title>
		<link>http://bugflux.org/blog/1211:na-crista-da-onda-parte-2/</link>
		<comments>http://bugflux.org/blog/1211:na-crista-da-onda-parte-2/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 21:57:33 +0000</pubDate>
		<dc:creator>nDray</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[pt]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://bugflux.org/?p=1211</guid>
		<description><![CDATA[o flash é uma tarefa impossível, mas nada motivo para baixar os braços. outra aplicação que me interessou desenvolver consistia em procurar routers nas redondezas e, com base em vulnerabilidades conhecidas, ligar-se a eles. claro que os algoritmos sobre as &#8230; <a href="http://bugflux.org/blog/1211:na-crista-da-onda-parte-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://bugflux.org/wp/wp-content/uploads/2010/07/WifiSmith.png"><img class="alignleft size-thumbnail wp-image-1303" title="WifiSmith" src="http://bugflux.org/wp/wp-content/uploads/2010/07/WifiSmith-150x150.png" alt="" width="150" height="150" /></a>o flash é uma <a title="na crista da onda @ bugflux.org" href="/?p=1208" target="_self">tarefa impossível</a>, mas nada motivo para baixar os braços. outra aplicação que me interessou desenvolver consistia em procurar routers nas redondezas e, com base em vulnerabilidades conhecidas, ligar-se a eles. claro que os algoritmos sobre as vulnerabilidades não são meus, não tenho a destreza para esse trabalho, mas é uma boa maneira de iniciar interfaces. chamei-lhe Wi-Fi Smith. =)</p>
<p><span id="more-1211"></span>desta vez custou um pouco mais começar, pois foi preciso ler um pouco sobre controlos e containers. no fundo não há muita diferença relativamente a outros toolkits gráficos. comparando com gtk, que foi o último que usei, para o bada também tenho duas hipóteses: posso programar e colocar os controlos todos no sítio com código, ou posso desenhar no ide e depois, no código, pedir para que sejam colocados no sítio e obter o handle. nada de especial.</p>
<p>o problema que há com este modo de programação do bada, para mim, é que as callbacks para os módulos geradores de eventos não são passadas explicitamente. o que é passado é uma classe que implemente (herde, em c++) uma interface IModuleEventListener. além disto não podemos definir argumentos para passar a essas funções. resultado: torna-se complicado gerir a partilha de recursos a serem utilizados na rotina de atendimento. o que é que eu fiz? o módulo principal herda tudo&#8230; felizmente não há colisões, mas neste caso não vi que fizesse sentido criar módulos diferentes. uma vez que vou tratar de eventos wifi, e da interface, bem como os genéricos das aplicações, isto é a classe criada:</p>
<pre class="brush: cpp; first-line: 18; title: ; notranslate">class WifiSmith :
	public Osp::App::Application,
	public Osp::System::IScreenEventListener,
	public Osp::Ui::IActionEventListener,
	public Osp::Net::Wifi::IWifiManagerEventListener,
	public Osp::Ui::IItemEventListener
{</pre>
<p>em vez de dar uma caixa de texto e um botão &#8220;do the magic&#8221; achei que seria mais interessante (e até mais simples) limitar-me a pegar no wi-fi, obter uma lista das redes disponíveis e listá-las. isto foi muito fácil de fazer. ao construir o manifest.xml no site, tive de adicionar privilégio WIFI. isto permite fazer todas as operações com o módulo wi-fi, excepto Connect(). para ligar é necessário permissões WIFI_MANAGER. infelizemente, só parceiros da samsung podem pertencer a este grupo, pois é necessário um nível de acesso SYSTEM. uma parvoíce, a meu ver. qualquer que seja a parte da api, não vejo motivo para que alguém que pague (ou receba?) tenha acesso e os outros não. no entanto esta limitação apenas impede publicação na loja; o grupo pode ser adicionado manualmente no ficheiro xml, mas a aplicação será certamente rejeitada na loja:</p>
<pre class="brush: xml; first-line: 6; title: ; notranslate">&lt;Privileges&gt;
	&lt;Privilege&gt;
		&lt;Name&gt;WIFI&lt;/Name&gt;
	&lt;/Privilege&gt;
	&lt;Privilege&gt;
		&lt;Name&gt;WIFI_MANAGER&lt;/Name&gt;
	&lt;/Privilege&gt;
&lt;/Privileges&gt;</pre>
<p>para compilar com permissões especiais é preciso, com frequência, adicionar uma biblioteca para linkagem, neste caso FNet. verdade para o simulador, para o telemóvel parece-me estar tudo na mesma biblioteca, FOsp.</p>
<p><a href="http://bugflux.org/wp/wp-content/uploads/2010/07/FNet-library.png"><img class="aligncenter size-full wp-image-1287" title="FNet-library" src="http://bugflux.org/wp/wp-content/uploads/2010/07/FNet-library.png" alt="" width="662" height="594" /></a></p>
<p>a interface da aplicação é muito simples. dois botões em baixo, um &#8220;refresh&#8221; e outro &#8220;back&#8221;. gosto das aplicações que têm botão de saída no ecrã, não gosto de usar o físico. no editor visual: as duas SOFTKEY activas e uma List que ocupa todo o ecrã. a List permite scroll se os elementos excederem o espaço reservado. a SlidableList serve para listas grandes, e alocação dinâmica dos elementos que interessam ver num dado momento apenas. no início desenho esta estrutura, associo as callbacks, e inicializo as variáveis necessárias:</p>
<pre class="brush: cpp; first-line: 31; title: ; notranslate">bool
WifiSmith::OnAppInitializing(AppRegistry&amp; appRegistry)
{
	// draw the form
	MainForm *pMainForm = new MainForm();
	pMainForm-&gt;Construct(L&quot;IDF_FORM1&quot;);
	Frame *pFrame = GetAppFrame()-&gt;GetFrame();
	pFrame-&gt;AddControl(*pMainForm);
	pFrame-&gt;SetCurrentForm(*pMainForm);
	pMainForm-&gt;SetSoftkeyActionId(SOFTKEY_1, SOFTKEY_1);
	pMainForm-&gt;AddSoftkeyActionListener(SOFTKEY_1, *this); // register back button event
	pMainForm-&gt;SetSoftkeyActionId(SOFTKEY_0, SOFTKEY_0);
	pMainForm-&gt;AddSoftkeyActionListener(SOFTKEY_0, *this); // register refresh button event
	pMainForm-&gt;RequestRedraw();

	// set the wifimanager
	pWifiManager.Construct(*this);

	// get the essid list control
	pEssidListControl = (List*)pMainForm-&gt;GetControl(&quot;IDC_LIST1&quot;);
	pEssidListControl-&gt;AddItemEventListener(*this);

	return true;
}</pre>
<p>que no fim liberto:</p>
<pre class="brush: cpp; first-line: 56; title: ; notranslate">bool
WifiSmith::OnAppTerminating(AppRegistry&amp; appRegistry, bool forcedTermination)
{
	// decided to use dynamic allocation for the WifiManager and the list of WifiBssInfo (networks)
	delete pEssidListControl;

	return true;
}</pre>
<p>sair da aplicação faz-se chamando o método Application::Terminate(). este método parece só estar acessível no módulo principal. tentei mesmo Application::GetInstance()-&gt;Terminate() noutros módulos, mas nem assim consegui compilar. azelhice minha, talvez. a cada refresh limpa-se e volta-se a preencher a lista de redes disponíveis:</p>
<pre class="brush: cpp; first-line: 136; title: ; notranslate">void
WifiSmith::OnWifiActivated(result r)
{
	pWifiManager.Scan();
}</pre>
<pre class="brush: cpp; first-line: 86; title: ; notranslate"> // SOFTKEYs
void
WifiSmith::OnActionPerformed(const Osp::Ui::Control &amp;source, int actionId)
{
	// SOFTKEY_0 is just the actionId I associated with it on line 42, it's not really the key.
	if(actionId == SOFTKEY_0) // refresh
	{
		RefreshList();
	}
	else
	{
		Application::Terminate();
	}
}</pre>
<pre class="brush: cpp; first-line: 163; title: ; notranslate">void
WifiSmith::RefreshList()
{
	// clear the essid list
	pEssidListControl-&gt;RemoveAllItems();
	pEssidListControl-&gt;RequestRedraw();

	// turn on wifi, if off
	if(!pWifiManager.IsActivated())
	{
		MessageBox vMessageBox;
		vMessageBox.Construct(&quot;Action required!&quot;, &quot;WiFi needs to be ON for scanning! Turn on?&quot;, MSGBOX_STYLE_YESNO, 0);
		int modalResult;
		vMessageBox.ShowAndWait(modalResult);

		if(modalResult == MSGBOX_RESULT_YES)
		{
			pWifiManager.Activate();
		}
		else
		{
			Application::Terminate();
		}
	}
	else
	{
		// get the available networks
		OnWifiActivated(E_SUCCESS);
	}
}</pre>
<p>quando o wi-fi está desligado é na função refresh que pergunto ao utilizador se pretende activar, com uma MessageBox. se não o fizer, a aplicação termina. faria sentido chamar a RefreshList() na inicialização. no entanto há um problema de concorrência. enquanto a aplicação está a arrancar é mostrada uma &#8220;imagem splash&#8221;. por algum motivo a aplicação bloqueia nesse splash se tentar abrir uma MessageBox algures na função OnAppInitializing(). provavelmente funcionaria na função OnForeground(), mas nesse caso tinha de controlar o estado da aplicação com uma nova variável, pois a função OnForeground() é chamada sempre que se volta ao foreground, e não apenas da primeira vez. continuo a achar que o problema é do sistema operativo, algo diferente devia acontecer.</p>
<p>findo o Scan(), preenche-se novamente a lista:</p>
<pre class="brush: cpp; first-line: 102; title: ; notranslate">
void
WifiSmith::OnWifiScanCompletedN(const Osp::Base::Collection::IList *pWifiBssInfoList, result r)
{
	pNetworkList.RemoveAll();
	pNetworkList.AddItems(*pWifiBssInfoList);

	for(int r = 0; r &lt; pNetworkList.GetCount(); r++)
	{
		WifiBssInfo *currentBssInfo = (WifiBssInfo*)pNetworkList.GetAt(r);
		pEssidListControl-&gt;AddItem(&amp;currentBssInfo-&gt;GetSsid(), null, null, null, r);
	}
	pEssidListControl-&gt;RequestRedraw(true);
}</pre>
<p>para quem não viu até aqui, é fácil perceber que não há muito tratamento de erros. esta função, por exemplo, indica com a variável r se o Scan() teve ou não sucesso. no entanto pouca diferença faz para o código que escrevi. mais, por motivos de eficiência, o mecanismo de controlo de excepções do c++ foi completamente ignorado pela samsung, não existem excepções no bada. o compilador até me avisou que, na linha 111, estou a passar um endereço de uma variável temporária. como nunca me deu problemas, não senti necessidade de copiar os nomes para uma lista.</p>
<p>depois de listadas as redes, é possível ver a listagem no telemóvel. clicando em qualquer rede, tenta-se ligar:</p>
<pre class="brush: cpp; first-line: 149; title: ; notranslate">void
WifiSmith::OnItemStateChanged(const Osp::Ui::Control &amp;source, int index, int itemId, Osp::Ui::ItemStatus status)
{
	WifiBssInfo *pWifiBssInfo = (WifiBssInfo*)pNetworkList.GetAt(itemId);
	const WifiSecurityInfo *pWifiSecurityInfo = pWifiBssInfo-&gt;GetSecurityInfo();

	// if open and no encryption, go right ahead!
	if(pWifiSecurityInfo-&gt;GetAuthenticationType() == WIFI_AUTHENTICATION_OPEN
			&amp;&amp; pWifiSecurityInfo-&gt;GetEncryptionType() == WIFI_ENCRYPTION_NONE)
	{
		pWifiManager.Connect(*pWifiBssInfo);
	}
}</pre>
<p>lembre-se que, na linha 111, dei um itemId a cada elemento da List igual ao índice dessa rede na lista de redes. no fim da tentativa de ligação à rede, posso informar o utilizador:</p>
<pre class="brush: cpp; first-line: 116; title: ; notranslate">void
WifiSmith::OnWifiConnected(const Osp::Base::String &amp;ssid, result r)
{
	MessageBox vMessageBox;
	int modalResult;

	if(r == E_SUCCESS)
	{
		vMessageBox.Construct(&quot;Connected:&quot;, ssid, MSGBOX_STYLE_OK, 0);
	}
	else
	{
		vMessageBox.Construct(&quot;Unable to connect:&quot;, ssid, MSGBOX_STYLE_OK, 0);
	}

	vMessageBox.ShowAndWait(modalResult);
}</pre>
<p>por vários motivos, neste código só me ligo a redes abertas. o primeiro é o facto de ainda não ter tratado disso. o segundo é que, quando fui a testar o caso dos routers thomson, por exemplo, acabei por descobrir que a resolução das chaves é um tanto ou quanto probabilística, e nem sequer funcionou para alguns casos que testei. o terceiro motivo é o facto de subscrever um aditivo internet, como faz todo o sentido, com este telemóvel, e até porque não frequento sítios atulhados de redes vulneráveis.</p>
<p>no entanto acrescentar esta funcionalidade, para mim, faz-se do seguinte modo: começa-se por criar uma classe que recebe um WifiBssInfo e, com essa informação (provavelmente só ssi e bssid), identifica o tipo de router com que está a lidar e devolve, de acordo, a chave a utilizar. pode ainda disponibilizar um método booleano do tipo CanSolve() o que permitirá, no tempo da listagem, mostrar apenas as redes com que é possível lidar. por último, uma vez que alguns algoritmos devolvem mais que uma chave, a função OnWifiConnected() deve implementar uma máquina de estados que permita tentar a chave seguinte para a mesma rede, caso a ligação tenha falhado, e até que não existam mais chaves. nada mais!</p>
<p>algumas capturas:</p>
<p style="text-align: center;"><a href="http://bugflux.org/wp/wp-content/uploads/2010/07/20100716205002.jpg"><img class="alignnone size-thumbnail wp-image-1294" title="20100716205002" src="http://bugflux.org/wp/wp-content/uploads/2010/07/20100716205002-150x150.jpg" alt="" width="150" height="150" /></a> <a href="http://bugflux.org/wp/wp-content/uploads/2010/07/20100716205019.jpg"><img class="alignnone size-thumbnail wp-image-1296" title="20100716205019" src="http://bugflux.org/wp/wp-content/uploads/2010/07/20100716205019-150x150.jpg" alt="" width="150" height="150" /></a> <a href="http://bugflux.org/wp/wp-content/uploads/2010/07/20100716205009.jpg"><img class="alignnone size-thumbnail wp-image-1295" title="20100716205009" src="http://bugflux.org/wp/wp-content/uploads/2010/07/20100716205009-150x150.jpg" alt="" width="150" height="150" /></a></p>
<p>(uau, this sucks! é preciso mesmo clicar nas imagens, parece que os thumbnails do wordpress cortam a imagem&#8230;)</p>
]]></content:encoded>
			<wfw:commentRss>http://bugflux.org/blog/1211:na-crista-da-onda-parte-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

