<?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>esdrasbeleza.com &#187; Tools</title>
	<atom:link href="http://www.esdrasbeleza.com/category/tools/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.esdrasbeleza.com</link>
	<description>Só mais um blog do WordPress</description>
	<lastBuildDate>Fri, 13 Jan 2012 14:14:19 +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>The first tips you&#8217;ll need before start programming for Symbian using Qt</title>
		<link>http://www.esdrasbeleza.com/2012/01/13/the-first-tips-youll-need-before-start-programming-for-symbian-using-qt/</link>
		<comments>http://www.esdrasbeleza.com/2012/01/13/the-first-tips-youll-need-before-start-programming-for-symbian-using-qt/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 03:08:48 +0000</pubDate>
		<dc:creator>Esdras Beleza</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Mobile phones]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.esdrasbeleza.com/?p=313</guid>
		<description><![CDATA[Last weekend I made my first Qt/Symbian mobile application. It was a very simple project, and its only purpose was to learn how to program for Symbian platform. I made a small application to search information about movies in TheMovieDb, and its source code is available at my github profile. A Qt/Symbian app is something very [...]]]></description>
			<content:encoded><![CDATA[<p>Last weekend I made my first Qt/Symbian mobile application. It was a very simple project, and its only purpose was to learn how to program for Symbian platform. I made a small application to search information about movies in <a href="http://www.themoviedb.org/">TheMovieDb</a>, and <a href="https://github.com/esdrasbeleza/BlzMovies">its source code is available at my github profile</a>.</p>
<p>A Qt/Symbian app is something very close to a normal Qt-based application for desktop, but there are some little differences that can make you confused and some tips you may need, here are my advices for some pitfalls I&#8217;ve found.</p>
<h2>Instead of showing widgets, add them to a QStackedWidget</h2>
<p><em>(that&#8217;s the best solution I&#8217;ve found, but it seems to have other solutions)</em></p>
<p>In desktop Qt, you create a new <em>QWidget</em> and call <em>show()</em> to create a new window containing that widget. <strong>This won&#8217;t work with Symbian</strong>. When you do that, all you&#8217;ll get is a small, transparent widget at the corner of your screen.</p>
<p>The solution is to get the <a href="http://developer.qt.nokia.com/doc/qt-4.8/qmainwindow.html">QMainWindow</a> of your application, add a <a href="http://developer.qt.nokia.com/doc/qt-4.8/qstackedwidget.html">QStackedWidget</a> as its central widget and add your new widgets into this QStackedWidget.</p>
<p><img class="aligncenter size-medium wp-image-314" title="How to design your widget stack" src="http://www.esdrasbeleza.com/wp-content/uploads/2012/01/qstackwidget-symbian-300x300.png" alt="" width="300" height="300" /></p>
<p>Every new widget must be added to QStackedWidget. It sounds painful, but Qt documentation <strong>tells us that when a widget is added to a QStackedWidget, the QStackedWidget becomes its parent</strong>.</p>
<p>When you create the first widget and add it to the stack, <strong>our QStackedWidget becomes its parent</strong>. So, to create a second widget and add it to the stack, you create your new widget as you do normally and asks the parent of the first widget – the QStackWidget! – to add it to the stack.</p>
<pre class="brush: cpp; title: ; notranslate">
// Create your widget
QWidget *someWidget = new QWidget(parent());

// Get the reference to our QStackedWidget casting the widget parent
QStackedWidget *stackedWidget = (QStackedWidget*) parent();

// Add the widget
stackedWidget-&gt;addWidget(someWidget);
stackedWidget-&gt;setCurrentWidget(someWidget);
</pre>
<h2>Creating menus and associating to positive and negative buttons</h2>
<p>Nokia cell phones, even the cheaper ones, have options associated to the <em>positive</em> and <em>negative</em> buttons. Take a look on this picture of an old N70:</p>
<p style="text-align: center;"><img class="aligncenter size-medium wp-image-318" title="Nokia N70" src="http://www.esdrasbeleza.com/wp-content/uploads/2012/01/n70-160x300.jpg" alt="" width="160" height="300" /></p>
<p style="text-align: left;">In the picture above, the <em>positive</em> action is <strong>Options</strong>, the <em>negative</em> option is <strong>Back</strong>. Creating options like these for your widget is quite simple.</p>
<p style="text-align: left;">In your widget&#8217;s source code, put the following lines in your constructor. Behold the lines where we use <em>setSoftKeyRole </em>to associate the action to a key. In my example, I have a &#8220;Back&#8221; shortcut and a &#8220;Details&#8221; shortcut, that access some slots.</p>
<pre class="brush: cpp; title: ; notranslate">
// Register the negative action
QAction *backToMainScreenAction = new QAction(&quot;Back&quot;, this);
backToMainScreenAction-&gt;setSoftKeyRole(QAction::NegativeSoftKey);
connect(backToMainScreenAction, SIGNAL(triggered()), SLOT(removeWidget()));
addAction(backToMainScreenAction);

// Register the negative action
QAction *selectResultAction = new QAction(&quot;Details&quot;, this);
selectResultAction-&gt;setSoftKeyRole(QAction::PositiveSoftKey);
connect(selectResultAction, SIGNAL(triggered()), SLOT(showDetailsAboutTheCurrentItem()));
addAction(selectResultAction);
</pre>
<p>This code will register the action of each widget. But to make the options show in the screen, we must make the widget&#8217;s container – the <strong>QStackedWidget</strong>! – register these actions in the menu every time the widget is created. I put the following lines in the same file where&#8217;s my main window containing the QStackedWidget. First we create the following slot:</p>
<pre class="brush: cpp; title: ; notranslate">
// This is a slot!
void MainWindow::updateActions() {
    QWidget *currentWidget = stackedWidget-&gt;currentWidget();
    menuBar()-&gt;clear();
    menuBar()-&gt;addActions(currentWidget-&gt;actions());
}
</pre>
<p>In the class&#8217;s constructor, we connect the stacked widget&#8217;s signals that are emmited when a widget is added or removed to the slot above:</p>
<pre class="brush: cpp; title: ; notranslate">
connect(stackedWidget, SIGNAL(currentChanged(int)), SLOT(updateActions()));
connect(stackedWidget, SIGNAL(widgetRemoved(int)), SLOT(updateActions()));
</pre>
<h2>Don&#8217;t believe the Nokia simulator</h2>
<p><strong>It&#8217;s still experimental.</strong> Sometimes you may think you made a mistake and have a bug, but you don&#8217;t. The simulator sometimes is confused with menus and soft buttons. If you get lost with your code and can&#8217;t find the causes of some obscure bug, try your application with a real device.</p>
<h2>Good luck with the Remote Compiler</h2>
<p><strong>It&#8217;s still experimental too.</strong> When I tried to use it, I got some short error messages whose source I couldn&#8217;t discover. So, if you don&#8217;t use Windows (like me), prepare a virtual machine running Qt SDK on Windows.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.esdrasbeleza.com/2012/01/13/the-first-tips-youll-need-before-start-programming-for-symbian-using-qt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Automator to make your life with Transmission easier</title>
		<link>http://www.esdrasbeleza.com/2011/07/09/using-automator-to-make-your-life-with-transmission-easier/</link>
		<comments>http://www.esdrasbeleza.com/2011/07/09/using-automator-to-make-your-life-with-transmission-easier/#comments</comments>
		<pubDate>Sat, 09 Jul 2011 19:50:49 +0000</pubDate>
		<dc:creator>Esdras Beleza</dc:creator>
				<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Automator]]></category>
		<category><![CDATA[Download]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[torrent]]></category>
		<category><![CDATA[Transmission]]></category>

		<guid isPermaLink="false">http://www.esdrasbeleza.com/?p=294</guid>
		<description><![CDATA[I have two computers: a Macbook with Snow Leopard, that sometimes I carry with me, and a computer at home with an Atom processor and running Linux that is my media server and downloader. If I need to download something that will take too much time, I put this second computer to download: it has [...]]]></description>
			<content:encoded><![CDATA[<p>I have two computers: a Macbook with Snow Leopard, that sometimes I carry with me, and a computer at home with an Atom processor and running Linux that is my media server and downloader. If I need to download something that will take too much time, I put this second computer to download: it has a good connection and it&#8217;s always online.</p>
<p><a href="http://www.esdrasbeleza.com/wp-content/uploads/2011/07/transmission.jpg"><img class="aligncenter size-medium wp-image-295" title="Transmission web interface" src="http://www.esdrasbeleza.com/wp-content/uploads/2011/07/transmission-300x200.jpg" alt="" width="300" height="200" /></a></p>
<p>It has Transmission running with its great web interface activated. If I need to download some torrent file, I open its web interface and upload the .torrent file. Good, but&#8230; it could be easier.</p>
<p>If you download torrent files very often, the easiest way is to use the watch-dir feature from Transmission: every torrent that you put at some directory is automatically downloaded by Transmission. So, all I needed to do was copying the torrent files from my Macbook to my home server, using SFTP.</p>
<p>To configure your Transmission watch-dir, you must stop the Transmission service (I&#8217;m running the transmission-daemon version) and edit the <strong>settings.json</strong> file, inserting the following settings:</p>
<pre class="brush: jscript; title: ; notranslate">
&quot;watch-dir&quot;: &quot;/home/mediaserver/transmission/watch&quot;,
&quot;watch-dir-enabled&quot;: true
</pre>
<p>Remember: you must stop Transmission service, edit the file and start it again!</p>
<p>It works, but&#8230; <strong>It can be even easier</strong>, I thought. And I remembered of <strong>Automator</strong>, a good piece of software that comes with Snow Leopard, and that I knew but never used before.</p>
<p><img class="aligncenter size-full wp-image-299" title="Automator Icon" src="http://www.esdrasbeleza.com/wp-content/uploads/2011/07/Automator_Icon.png" alt="" width="297" height="297" /></p>
<p>The idea was: <em>every time a new .torrent file is written at my laptop&#8217;s download directory, it should be copied to my home server</em>.</p>
<p>So I opened Automator and created a new <strong>Folder Action:</strong></p>
<p><strong></strong><a href="http://www.esdrasbeleza.com/wp-content/uploads/2011/07/Screen-shot-2011-07-09-at-16.24.05.png"><img class="aligncenter size-medium wp-image-300" title="Folder action" src="http://www.esdrasbeleza.com/wp-content/uploads/2011/07/Screen-shot-2011-07-09-at-16.24.05-300x278.png" alt="" width="300" height="278" /></a></p>
<p>At the top of the new workflow, I selected my Downloads folder:</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-301" title="Select folder" src="http://www.esdrasbeleza.com/wp-content/uploads/2011/07/select_folder.png" alt="" width="467" height="36" /></p>
<p style="text-align: left;"> The next step in our flow is to create a script to copy our files via SSH to the computer that&#8217;s running Transmission. Use <strong>Utilities -&gt; Run Shell Script</strong> to make it:</p>
<p style="text-align: center;"><a href="http://www.esdrasbeleza.com/wp-content/uploads/2011/07/run_script.png"><img class="aligncenter size-full wp-image-302" style="border: 1px solid black;" title="Run Shell Script" src="http://www.esdrasbeleza.com/wp-content/uploads/2011/07/run_script.png" alt="" width="380" height="506" /></a></p>
<p style="text-align: left;">Now add the following content as the script&#8217;s source code. To make it work automatically, <a title="SSH without password!" href="http://www.thegeekstuff.com/2008/11/3-steps-to-perform-ssh-login-without-password-using-ssh-keygen-ssh-copy-id/" target="_blank">I allow my SSH server to receive connections using keys, not passwords</a>. Don&#8217;t forget to change the scp&#8217;s destination to your computer&#8217;s host and directory:</p>
<pre class="brush: bash; title: ; notranslate">
for f in &quot;$@&quot;
do
	ext=`basename &quot;$f&quot; | awk -F &quot;.&quot; '{ print $NF }'`
	if [ &quot;$ext&quot; == &quot;torrent&quot; ]; then
		scp &quot;$f&quot; root@myhostname.asdf.com:/home/transmission/watch
	fi
done
</pre>
<p>That&#8217;s it! Save your workflow and test it. Now, every time you click at a torrent file and download it, Transmission will download it automatically.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.esdrasbeleza.com/2011/07/09/using-automator-to-make-your-life-with-transmission-easier/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Listing the packages on Debian/Ubuntu in one line</title>
		<link>http://www.esdrasbeleza.com/2011/02/04/listing-the-packages-on-debianubuntu-in-one-line/</link>
		<comments>http://www.esdrasbeleza.com/2011/02/04/listing-the-packages-on-debianubuntu-in-one-line/#comments</comments>
		<pubDate>Fri, 04 Feb 2011 19:19:10 +0000</pubDate>
		<dc:creator>Esdras Beleza</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.esdrasbeleza.com/?p=262</guid>
		<description><![CDATA[You can use dpkg to list all the packages that are selected on your Debian or Ubuntu system: But today I needed a way to list only the installed packages in just one line, so I could copy their names and use apt-get to install the same packages on another system. So I used the [...]]]></description>
			<content:encoded><![CDATA[<p>You can use dpkg to list all the packages that are selected on your Debian or Ubuntu system:</p>
<pre class="brush: plain; title: ; notranslate"># dpkg --get-selections</pre>
<p>But today I needed a way to list only the installed packages in just one line, so I could copy their names and use apt-get to install the same packages on another system. So I used the following command:</p>
<pre class="brush: plain; title: ; notranslate"># dpkg --get-selections | grep &quot;[ \t]*install$&quot; | sed 's/[ \t]*install$//g' | awk 'BEGIN { packages = &quot;&quot; } { packages = packages &quot; &quot; $1 } END { print packages }'
acpi-support-base acpid adduser apt apt-utils [...] long list of packages [...] xsltproc xz-utils yelp zenity zlib1g zlib1g-dev</pre>
<p>You can use the output above to easily install the same packages on another system using <em>apt-get install &lt;packages&gt;</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.esdrasbeleza.com/2011/02/04/listing-the-packages-on-debianubuntu-in-one-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cool tools to avoid suffering with Windows</title>
		<link>http://www.esdrasbeleza.com/2010/10/11/cool-tools-to-avoid-suffering-with-windows/</link>
		<comments>http://www.esdrasbeleza.com/2010/10/11/cool-tools-to-avoid-suffering-with-windows/#comments</comments>
		<pubDate>Mon, 11 Oct 2010 18:11:43 +0000</pubDate>
		<dc:creator>Esdras Beleza</dc:creator>
				<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[classic shell]]></category>
		<category><![CDATA[notepad++]]></category>
		<category><![CDATA[pidgin]]></category>
		<category><![CDATA[Screenshots]]></category>
		<category><![CDATA[text editor]]></category>
		<category><![CDATA[vídeo]]></category>
		<category><![CDATA[vlc]]></category>
		<category><![CDATA[winamp]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.esdrasbeleza.com/?p=248</guid>
		<description><![CDATA[After two years working only with Linux and Mac OS, I received a new task that requires using Windows for two months (only two months, happily). It&#8217;s hard to get back to this bugful, unstable and confusing world: I do believe Linux and Mac OS are easier to use than Windows, that big world of [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">After two years working only with Linux and Mac OS, I received a new task that requires using Windows for two months (only two months, happily). It&#8217;s hard to get back to this bugful, unstable and confusing world: I do believe Linux and Mac OS are easier to use than Windows, that big world of icons that lead to icons that lead to icons that lead to nowhere, but I&#8217;m doing my best.</p>
<p style="text-align: justify;">I tried to find a set of useful and free (as in &#8220;free beer&#8221; and/or as in &#8220;free speech&#8221;) tools to make my work easier. They are:</p>
<p style="text-align: justify;"><strong><a href="http://classicshell.sourceforge.net/" target="_blank">Classic Shell Setup</a></strong></p>
<p style="text-align: justify;">I don&#8217;t know why Microsoft removed the toolbar from Windows Explorer since Windows Vista, but this application tries to put it back there. It also allows you to get some customisation of Start Menu, and get a simple, fast and useful menu like the Windows 9x/ME/2000 times.</p>
<p><a href="http://www.esdrasbeleza.com/wp-content/uploads/2010/10/classic_shell.png"><img class="aligncenter size-medium wp-image-249" title="Windows 7 with Classic Shell" src="http://www.esdrasbeleza.com/wp-content/uploads/2010/10/classic_shell-300x245.png" alt="" width="300" height="245" /></a></p>
<p style="text-align: justify;"><strong><a href="http://notepad-plus-plus.org/" target="_blank">Notepad++</a></strong></p>
<p style="text-align: justify;">I like <a href="http://projects.gnome.org/gedit/" target="_blank">gedit</a> and <a href="http://kate-editor.org/" target="_blank">kate</a>, and the native alternative for Windows is Notepad++: a good editor for plain text files, like source code.</p>
<p><a href="http://www.esdrasbeleza.com/wp-content/uploads/2010/10/notepad++.png"><img class="aligncenter size-medium wp-image-252" title="Notepad++" src="http://www.esdrasbeleza.com/wp-content/uploads/2010/10/notepad++-300x179.png" alt="" width="300" height="179" /></a></p>
<p style="text-align: justify;"><strong><a href="http://pidgin.im" target="_blank">Pidgin</a></strong></p>
<p style="text-align: justify;">With support for MSN/Live/whatever network, Google Talk, ICQ, etc. Pidgin is one of the best chat clients. I&#8217;d rather use it than the fancy MSN Live Messenger.</p>
<p style="text-align: justify;"><strong><a href="http://www.winamp.com" target="_blank">Winamp</a></strong></p>
<p style="text-align: justify;">Why use iTunes or the suffering Windows Media Player if you can use Winamp? It has a clean interface, a good way to organise library (although it&#8217;s a little bit <em>iTunesy</em>) and a simple playlist, everything in the same screen. I really love the good and old Winamp.</p>
<p><a href="http://www.esdrasbeleza.com/wp-content/uploads/2010/10/winamp.png"><img class="aligncenter size-medium wp-image-251" title="Winamp" src="http://www.esdrasbeleza.com/wp-content/uploads/2010/10/winamp-300x179.png" alt="" width="300" height="179" /></a></p>
<p style="text-align: justify;"><strong><a href="http://www.videolan.org/">VLC</a></strong></p>
<p style="text-align: justify;">Winamp can play some videos, but I think VLC is a better tool for this job. Besides, it has a great support for a huge range  of video formats and features for users with any needs and all experience levels.</p>
<p><a href="http://www.esdrasbeleza.com/wp-content/uploads/2010/10/vlc.png"><img class="aligncenter size-medium wp-image-250" title="VLC" src="http://www.esdrasbeleza.com/wp-content/uploads/2010/10/vlc-300x262.png" alt="" width="300" height="262" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.esdrasbeleza.com/2010/10/11/cool-tools-to-avoid-suffering-with-windows/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Why I chose Qt</title>
		<link>http://www.esdrasbeleza.com/2010/05/13/why-i-chose-qt/</link>
		<comments>http://www.esdrasbeleza.com/2010/05/13/why-i-chose-qt/#comments</comments>
		<pubDate>Thu, 13 May 2010 14:14:39 +0000</pubDate>
		<dc:creator>Esdras Beleza</dc:creator>
				<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[comparison]]></category>
		<category><![CDATA[GTK]]></category>
		<category><![CDATA[gtkmm]]></category>
		<category><![CDATA[Qt]]></category>
		<category><![CDATA[Qt Creator]]></category>

		<guid isPermaLink="false">http://www.esdrasbeleza.com/?p=137</guid>
		<description><![CDATA[A few months ago, I planned to learn some graphic toolkit. As a GNOME user, GTK was my natural choice. Although I&#8217;m a Python lover, I chose C++ because I just wanted to learn a new language and stop being afraid of pointers. So I started to read the gtkmm documentation, like tutorials and API, [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">A few months ago, I planned to learn some graphic toolkit. As a GNOME user, GTK was my natural choice. Although I&#8217;m a Python lover, I chose C++ because I just wanted to learn a new language and stop being afraid of pointers. So I started to read the <a href="http://www.gtkmm.org/">gtkmm</a> documentation, like tutorials and API, and to program a simple music player. I was learning gtkmm and it all seemed okay.</p>
<p style="text-align: center;"><img class="aligncenter" title="Qt" src="http://www.esdrasbeleza.com/wp-content/uploads/2010/05/qt.png" alt="" width="200" height="238" /></p>
<p style="text-align: justify;">But I read a little about Qt and, after talking with some friends about the pros and cons of GTK and Qt, I decided to do with Qt the same things that I&#8217;ve already done with GTK up to that point. So I would know <strong>what choice was better for me</strong>. Notice that I&#8217;m not saying that Qt is better for everybody and that GTK must die, but that Qt looked better <strong>for me and my personal project</strong>. After this disclaimer, and can tell my reasons:</p>
<ul style="text-align: justify;">
<li><strong>Look &amp; feel.</strong> I&#8217;m a look&amp;feel fanatic, and sometimes I move from GNOME to KDE only to check its new features. But I hate how GTK applications look in KDE. You can use <a href="http://code.google.com/p/gtk-qt-engine/">gtk-qt-engine</a>, but you&#8217;ll still notice the differences. You can set GTK to use the excellent <a href="http://kde-look.org/content/show.php/QtCurve+(KDE4,+KDE3,+%26+Gtk2+Theme)?content=40492">QtCurve</a> theme, that have identical versions to Qt and GTK, but you&#8217;ll get tied to a theme. But look what you have if you run a Qt application in GNOME (<a href="http://projects.gnome.org/gedit/">gedit</a> is a GTK-based application and <a href="http://musicbrainz.org/doc/PicardTagger">Picard</a> is a Qt-based application):<br />
<a href="http://www.esdrasbeleza.com/wp-content/uploads/2010/05/gtk_qt_look_and_feel.png"><img class="aligncenter" style="margin-top: 15px; margin-bottom: 15px;" title="GTK vs QT look &amp; feel in GNOME" src="http://www.esdrasbeleza.com/wp-content/uploads/2010/05/gtk_qt_look_and_feel-300x231.png" alt="" width="300" height="231" /></a><br />
Thanks to <a href="http://labs.trolltech.com/blogs/2008/05/13/introducing-qgtkstyle/">QGtkStyle</a>, Qt applications detect if you are in GNOME and your Qt application gets an almost perfect GTK look &amp; feel. And yeah, it includes open and save dialogs.</li>
<li><strong>Documentation. </strong>Qt has a very, very rich and well-organised documentation, with <a href="http://doc.qt.nokia.com/4.6/tutorials.html">tutorials</a>, <a href="http://doc.qt.nokia.com/4.6/index.html">API references</a>, and <a href="http://doc.qt.nokia.com/4.6/examples.html">examples</a>. gtkmm also have all these items, but they didn&#8217;t look very friendly to me. And the documentation of Qt 4.7, still in development, <a href="http://doc.qt.nokia.com/4.7-snapshot/">will be even better</a>.</li>
<li><strong>A simple, but good IDE.</strong> A good programmer must not be dependent on IDEs, but they really help you. I tried to use Anjuta (unstable sometimes), MonoDevelop (very good for .NET platform, but not a good IDE for C/C++ development) and Netbeans as IDE when I was using gtkmm, and I was not satisfied with them. But Qt has its official IDE, <strong>Qt Creator</strong>:<br />
<a href="http://www.esdrasbeleza.com/wp-content/uploads/2010/05/qtcreator.png"><img class="aligncenter size-medium wp-image-139" style="margin-top: 15px; margin-bottom: 15px;" title="Qt Creator" src="http://www.esdrasbeleza.com/wp-content/uploads/2010/05/qtcreator-300x177.png" alt="" width="300" height="177" /></a><br />
Qt Creator is clean, simple, and complete. It has quick access to documentation, breakpoints, project configuration, native support for CVS, Subversion and Git, good code completion, a good GUI designer (like the GTK&#8217;s <a href="http://glade.gnome.org/">Glade</a>), among other features.</li>
<li><strong>Runs well on many platforms.</strong> Qt is smart enough to run well &#8211; and with native look &amp; feel, I really like this &#8211; in Linux, Mac, Windows, and others.</li>
</ul>
<p style="text-align: justify;">But Qt still has some cons:</p>
<ul>
<li>Users should have it installed to run Qt applications, and this is not very usual in Linux environments based on GNOME, neither on Windows systems.</li>
<li>Qt is free only if you&#8217;re using it in a free project. For commercial applications, <a href="http://qt.nokia.com/products/licensing">you must obtain a commercial Qt licence</a>. <strong>Update: </strong>this is not exactly a con. You still can use Qt under LGPL in commercial applications, but if you make any change to Qt you must publish them or purchase a commercial Qt licence <em>(thanks, krok, for the comment)</em>.</li>
</ul>
<p style="text-align: justify;">If you&#8217;re beginning to learn to program for graphical environments or you&#8217;re looking for a good graphical library to use in your project, you really should give Qt a try, implement some examples and feel which option is better for you.</p>
<p style="text-align: justify;"><a href="http://www.esdrasbeleza.com/wp-content/uploads/2010/05/gtk_qt_look_and_feel.png"><br />
</a></p>
<p style="text-align: justify;">
<p style="text-align: justify;">
]]></content:encoded>
			<wfw:commentRss>http://www.esdrasbeleza.com/2010/05/13/why-i-chose-qt/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Conectando o PHP ao Oracle</title>
		<link>http://www.esdrasbeleza.com/2010/04/24/conectando-o-php-ao-oracle/</link>
		<comments>http://www.esdrasbeleza.com/2010/04/24/conectando-o-php-ao-oracle/#comments</comments>
		<pubDate>Sat, 24 Apr 2010 19:02:15 +0000</pubDate>
		<dc:creator>Esdras Beleza</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.esdrasbeleza.com/?p=132</guid>
		<description><![CDATA[Nota: fiz esse tutorial há 3 anos, não garanto que ele continue funcionando! Depois de muito apanhar, aprendi uma maneira fácil de pôr o PHP pra se comunicar com o Oracle. A maioria das soluções que achei envolvia recompilar o PHP, mudar variáveis de ambiente, scripts de inicialização etc. Uma delas até deu certo, mas [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;"><strong><em>Nota:</em></strong><em> fiz esse tutorial há 3 anos, não garanto que ele continue funcionando!</em></p>
<p style="text-align: justify;">Depois de muito apanhar, aprendi uma maneira fácil de pôr o PHP pra se comunicar com o Oracle. A maioria das soluções que achei envolvia recompilar o PHP, mudar variáveis de ambiente, scripts de inicialização etc. Uma delas até deu certo, mas mudar as variáveis de ambiente fez o suporte a LDAP do PHP parar de funcionar, por razões que desconheço.</p>
<p>A solução que explico abaixo faz a mesma coisa, mas sem recompilar pacotes ou fazer gambiarras. Deu certo milagrosamente, após juntar a solução proposta por vários sites. O máximo que será feito é compilar a extensão <em>oci8</em> para o PHP do Debian ou Ubuntu, que é feito automaticamente e em poucos segundos. A parte chata é baixar os arquivos do site do Oracle, que exige criação de conta.</p>
<p>Todos os comandos abaixo são executados como root. Boa sorte! <img src='http://www.esdrasbeleza.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<ol style="text-align: justify;">
<li>No site de <a href="http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxsoft.html" target="_blank">downloads do Oracle para Linux</a>, baixe os arquivos <em>instantclient-basic-linux32-10.2.0.3-20061115.zip</em> e <em>instantclient-sdk-linux32-10.2.0.3-20061115.zip</em>. Você vai precisar criar uma conta no site da Oracle para isso. Após o download, extraia-os para o diretório <em>/usr/local/oracle</em>.</li>
<li>Em <em>/usr/local/oracle</em>, crie o seguinte link: <em># ln -s libclntsh.so.10.1 libclntsh.so</em></li>
<li>Instale os pacotes <em>php5-dev</em> e <em>php5-pear </em>pelo apt-get ou aptitude (<em>aptitude install php5-dev php5-pear</em>). Caso não exista o <em>php5-pear</em>, procure por <em>php-pear</em>.</li>
<li>Agora execute (lembre-se: sempre como root): <em># pecl install oci8</em></li>
<li>Surgirá um prompt perguntando onde estão as bibliotecas do Oracle. Sua resposta será <em>instantclient,/usr/local/oracle </em>, como no exemplo:<em>Please provide the path to ORACLE_HOME dir. Use &#8221;instantclient,/path/to/instant/client/lib&#8221; if you&#8221;re compiling against Oracle Instant Client [autodetect] : instantclient,/usr/local/oracle</em></li>
<li>No diretório<em> /etc/php5/conf.d </em>, crie um arquivo <em>oci8.ini</em>, com o seguinte conteúdo:extension=oci8.so</li>
<li>O PHP deverá estar com suporte a Oracle (extensão oci8). Reinicie o seu servidor web (caso seja o Apache, <em>apache2ctl restart</em>).</li>
</ol>
<p style="text-align: justify;">
Fontes: <a href="http://www.oracle.com/technology/pub/notes/technote_php_instant.html" target="_blank">Installing PHP and the Oracle 10g Instant Client for Linux and Windows</a>; <a href="http://samgerstenzang.com/blog/archives/2006/09/howto-installing-oracle-xe-on-ubuntu-with-php" target="_blank">How to: Installing Oracle XE on Ubuntu with PHP</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.esdrasbeleza.com/2010/04/24/conectando-o-php-ao-oracle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dicas de ffmpeg</title>
		<link>http://www.esdrasbeleza.com/2010/04/11/dicas-de-ffmpeg/</link>
		<comments>http://www.esdrasbeleza.com/2010/04/11/dicas-de-ffmpeg/#comments</comments>
		<pubDate>Sun, 11 Apr 2010 14:35:00 +0000</pubDate>
		<dc:creator>Esdras Beleza</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[edição]]></category>
		<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[vídeo]]></category>

		<guid isPermaLink="false">http://www.esdrasbeleza.com/?p=106</guid>
		<description><![CDATA[Precisei recentemente pegar um vídeo de música, tirar o áudio dele e colocar em outro vídeo. Para o serviço, usei o ffmpeg, o canivete suíço de edição de vídeo em linha de comando. Os três passos foram: 1. Retirar o áudio do primeiro vídeo 2. Acrescentar o áudio retirado do primeiro vídeo no outro vídeo [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Precisei recentemente pegar um vídeo de música, tirar o áudio dele e colocar em outro vídeo. Para o serviço, usei o <strong><a href="http://ffmpeg.org/" target="_blank">ffmpeg</a></strong>, o canivete suíço de edição de vídeo em linha de comando.</p>
<p style="text-align: justify;">Os três passos foram:</p>
<p><strong>1. Retirar o áudio do primeiro vídeo</strong></p>
<pre class="brush: plain; light: true; title: ; wrap-lines: false; notranslate">ffmpeg -i danca_do_gorila.flv -ab 128 -ar 44100 gorila.mp3</pre>
<p><strong>2. Acrescentar o áudio retirado do primeiro vídeo no outro vídeo</strong></p>
<pre class="brush: plain; light: true; title: ; wrap-lines: false; notranslate">ffmpeg -i video1.mp4 -i gorila.mp3 video_gorila.mp4</pre>
<p><strong>3. Selecionar um trecho de um vídeo com 2 minutos, a partir do instante 00:00:02</strong></p>
<pre class="brush: plain; light: true; title: ; wrap-lines: false; notranslate">ffmpeg -i video_gorila.mp4 -ss 00:00:02 -t 00:02:00 video_final.mp4</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.esdrasbeleza.com/2010/04/11/dicas-de-ffmpeg/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>GNOME 2.30</title>
		<link>http://www.esdrasbeleza.com/2010/04/02/gnome-2-30/</link>
		<comments>http://www.esdrasbeleza.com/2010/04/02/gnome-2-30/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 06:28:16 +0000</pubDate>
		<dc:creator>Esdras Beleza</dc:creator>
				<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[nautilus]]></category>
		<category><![CDATA[Screenshots]]></category>
		<category><![CDATA[tema]]></category>

		<guid isPermaLink="false">http://www.esdrasbeleza.com/?p=98</guid>
		<description><![CDATA[O GNOME 2.30 foi lançado nesse 1º de abril, e os pacotes rapidamente foram disponibilizados pro Arch Linux. Assim que atualizei o sistema, aproveitei pra conferir algumas das novidades. A maioria delas, na minha opinião, foram discretas. Talvez a maior exceção seja o Nautilus, de interface renovada. Agora é possível dividir a visualização em duas, [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">O <a href="http://library.gnome.org/misc/release-notes/2.30/" target="_blank">GNOME 2.30 foi lançado nesse 1º de abril</a>, e os pacotes rapidamente foram disponibilizados pro <a href="http://www.archlinux.org/" target="_blank">Arch Linux</a>. <img src='http://www.esdrasbeleza.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Assim que atualizei o sistema, aproveitei pra conferir algumas das novidades. A maioria delas, na minha opinião, foram discretas.</p>
<p style="text-align: justify;">Talvez a maior exceção seja o Nautilus, de interface renovada. Agora é possível dividir a visualização em duas, o que facilita muito a troca de arquivos entre dois locais diferentes. O Konqueror faz isso há alguns anos, e era uma funcionalidade que fazia falta no Nautilus.</p>
<p><a href="http://www.esdrasbeleza.com/wp-content/uploads/2010/04/nautilus.png"><img class="aligncenter size-large wp-image-99" title="Nautilus com 2 pastas abertas" src="http://www.esdrasbeleza.com/wp-content/uploads/2010/04/nautilus-1024x583.png" alt="" width="450" height="256" /></a></p>
<p style="text-align: justify;">Dois bugs que me enchiam o saco há algum tempo também parecem ter sido resolvidos. Ao usar dois monitores, alguns applets trocavam de lugar ao iniciar o GNOME e o papel de parede da área de trabalho era esticado entre os dois monitores. Agora o papel de parede é simplesmente replicado para os dois monitores.</p>
<p style="text-align: justify;"><a href="http://library.gnome.org/misc/release-notes/2.30/" target="_blank">Mais detalhes das mudanças na nova versão </a>estão presentes no site do GNOME. Como todo mundo gosta de screenshots, aqui vai um da minha área de trabalho:</p>
<p><a href="http://www.esdrasbeleza.com/wp-content/uploads/2010/04/desktop_gnome_230.png"><img class="aligncenter size-large wp-image-100" title="desktop_gnome_230" src="http://www.esdrasbeleza.com/wp-content/uploads/2010/04/desktop_gnome_230-1024x640.png" alt="" width="450" height="281" /></a></p>
<ul>
<li>Tema GTK: <a href="http://gnome-look.org/content/show.php/Equinox+Radiance?content=121883" target="_blank">Equinox Radiance</a></li>
<li>Tema do gerenciador de janelas (Metacity): <a href="http://gnome-look.org/content/show.php/Karmic+Lucy+D.?content=120409" target="_blank">karmic Lucy D.</a></li>
<li>Ícones: <a href="http://gnome-look.org/content/show.php/nuoveXT?content=26448">nuoveXT 1.7</a></li>
<li>Painel inferior: <a href="https://launchpad.net/docky">Docky</a></li>
<li>Papel de parede: <a href="http://www.socwall.com/browse/wpDL.php?wp_id=013208" target="_blank">Stop that t-rain</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.esdrasbeleza.com/2010/04/02/gnome-2-30/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Cheat sheets do git</title>
		<link>http://www.esdrasbeleza.com/2010/03/25/cheat-sheets-do-git/</link>
		<comments>http://www.esdrasbeleza.com/2010/03/25/cheat-sheets-do-git/#comments</comments>
		<pubDate>Thu, 25 Mar 2010 21:45:58 +0000</pubDate>
		<dc:creator>Esdras Beleza</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[cheat sheet]]></category>
		<category><![CDATA[controle de versão]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://www.esdrasbeleza.com/?p=91</guid>
		<description><![CDATA[Cheat sheets são as melhores amigas de quem precisa fazer tarefas repetitivas no computador mas não quer perder tempo olhando o tempo todo pra guias de consulta rápida. Pra quem gosta do git (mais pessoas deveriam gostar do git&#8230;), aqui vão duas cheat sheets ótimas. A primeira, de apenas uma folha mas bastante útil, está [...]]]></description>
			<content:encoded><![CDATA[<p>Cheat sheets são as melhores amigas de quem precisa fazer tarefas repetitivas no computador mas não quer perder tempo olhando o tempo todo pra guias de consulta rápida. Pra quem gosta do git (mais pessoas deveriam gostar do git&#8230;), aqui vão duas cheat sheets ótimas.</p>
<p>A primeira, de apenas uma folha mas bastante útil, está disponível <a href="http://zrusin.blogspot.com/2007/09/git-cheat-sheet.html" target="_blank">no site do autor da mesma</a> e <a href="https://git.wiki.kernel.org/index.php/GitCheatSheet" target="_blank">no próprio wiki do git</a>. Ela traz um fluxo de uso do git que pode ser muito útil, que mostra quais passos você efetuar a cada comando do git executado:</p>
<p><img class="aligncenter size-full wp-image-92" title="text13996" src="http://www.esdrasbeleza.com/wp-content/uploads/2010/03/text13996.png" alt="" width="540" height="316" /></p>
<p>A <a href="http://jan-krueger.net/development/git-cheat-sheet-extended-edition" target="_blank">segunda</a>, de duas folhas, também traz um fluxo. Na primeira página traz explicações gerais sobre git e na segunda os comandos que você precisa:</p>
<p><img class="aligncenter size-full wp-image-93" title="git-cheat-sheet1" src="http://www.esdrasbeleza.com/wp-content/uploads/2010/03/git-cheat-sheet1.png" alt="" width="600" height="222" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.esdrasbeleza.com/2010/03/25/cheat-sheets-do-git/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Baixando pacotes pré-compilados no FreeBSD</title>
		<link>http://www.esdrasbeleza.com/2010/03/17/baixando-pacotes-pre-compilados-no-freebsd/</link>
		<comments>http://www.esdrasbeleza.com/2010/03/17/baixando-pacotes-pre-compilados-no-freebsd/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 16:43:03 +0000</pubDate>
		<dc:creator>Esdras Beleza</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Gerenciamento de pacotes]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[Sysadmin]]></category>

		<guid isPermaLink="false">http://www.esdrasbeleza.com/?p=79</guid>
		<description><![CDATA[Após instalar o FreeBSD 8.0 no meu modesto computador para tarefas rotineiras, veio a necessidade de instalar alguns pacotes. O FreeBSD tem duas modalidades de instalação de pacotes: O sistema de ports, que automatiza a tarefa de baixar código-fonte e compilá-lo, além de adaptar alguns pacotes ao seu gosto: o sistema ajuda você a habilitar [...]]]></description>
			<content:encoded><![CDATA[<p>Após instalar o FreeBSD 8.0 no meu <a href="http://www.esdrasbeleza.com/2010/03/13/73/" target="_blank">modesto computador para tarefas rotineiras</a>, veio a necessidade de instalar alguns pacotes. O FreeBSD tem duas modalidades de instalação de pacotes:</p>
<ul>
<li>O sistema de ports, que automatiza a tarefa de baixar código-fonte e compilá-lo, além de adaptar alguns pacotes ao seu gosto: o sistema ajuda você a habilitar ou desabilitar opções de vários pacotes, como suporte a Unicode, X11, bibliotecas adicionais etc.</li>
<li>Pacotes binários pré-compilados, familiares pra quem vem do Linux (como eu).</li>
</ul>
<p>O FreeBSD possui uma ferramenta simpática chamada <strong>pkg_add</strong> que lembra o <strong>apt-get</strong>, <strong>pacman</strong> ou <strong>yum</strong> do Linux, baixando pacotes nos repositórios do FreeBSD. Porém, ao pedir pro pkg_add instalar alguns pacotes, como o Transmission, ele instalou versões mais antigas. Fuçando no FTP do FreeBSD, achei pacotes mais recentes dos pacotes. A próxima briga foi pra fazer o pkg_add usar apenas esses pacotes mais novos (dum diretório amigavelmente chamado <em>Latest</em>).</p>
<p>O truque é simples: quando você executa <em><strong>pkg_add -r nomedopacote</strong></em>, o pkg_add busca por <strong>$PACKAGESITE/nomedopacote.tbz</strong>. Se você fuçar pelos diretórios dos mirrors do FreeBSD vai perceber que os pacotes normalmente se chamam <em>nomedopacote-versão.tbz</em>, exceto os do diretório Latest, que instalam automaticamente a última versão disponível. Nos comandos abaixo, reparem que usei o sistema para arquitetura 64 bits (amd64), se sua instalação for para x86 32 bits, troque <em>amd64</em> por <em>i386</em>.</p>
<p>Assim, pra instalar o vim, usei o seguinte comando no bash:</p>
<pre class="brush: plain; light: true; title: ; wrap-lines: false; notranslate">[root@tinhoso /home/esdras]# export PACKAGESITE=&quot;ftp://ftp4.freebsd.org/pub/FreeBSD/ports/amd64/packages-8-stable/Latest/&quot;
[root@tinhoso /home/esdras]# pkg_add -r vim</pre>
<p>Você pode, ainda, acrescentar o comando do export no seu arquivo <em>~/.profile</em>, o que fará o comando ser executado automaticamente a cada login:</p>
<pre class="brush: plain; light: true; title: ; wrap-lines: false; notranslate">[root@tinhoso ~]# echo export PACKAGESITE=\&quot;ftp://ftp4.freebsd.org/pub/FreeBSD/ports/amd64/packages-8-stable/Latest/\&quot; &amp;gt;&amp;gt; ~/.profile</pre>
<p>Caso você use csh (shell padrão no FreeBSD!), o comando muda:</p>
<pre class="brush: plain; light: true; title: ; wrap-lines: false; notranslate">tinhoso# setenv PACKAGESITE ftp://ftp4.freebsd.org/pub/FreeBSD/ports/amd64/packages-8-stable/Latest/
tinhoso# pkg_add -r nano</pre>
<div>Para tornar a variável permanente, acrescente esse comando no arquivo <em>~/.cshrc:</em></div>
<div><em><br />
</em></div>
<div><em><em>
<pre class="brush: plain; light: true; title: ; wrap-lines: false; notranslate">tinhoso# echo setenv PACKAGESITE ftp://ftp4.freebsd.org/pub/FreeBSD/ports/amd64/packages-8-stable/Latest/ &gt;&gt; ~/.cshrc</pre>
<p></em></em></div>
<h1>Fontes</h1>
<ul>
<li><a href="http://www.freebsd.org/doc/handbook/ports.html" target="_blank">Manua﻿l do FreeBSD</a></li>
<li><a href="http://it.toolbox.com/blogs/bsd-guru/some-freebsd-pkg_add-magic-18897" target="_blank">Some FreeBSD pkg_add magic</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.esdrasbeleza.com/2010/03/17/baixando-pacotes-pre-compilados-no-freebsd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.662 seconds -->

