<?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>gouranga &#187; cpp</title>
	<atom:link href="http://www.gouranga.me/tag/cpp/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gouranga.me</link>
	<description>ein wenig von fast allem</description>
	<lastBuildDate>Fri, 24 Jun 2011 12:07:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Weisheiten des Projektalltags</title>
		<link>http://www.gouranga.me/2011/01/16/weisheiten-des-projektalltags/</link>
		<comments>http://www.gouranga.me/2011/01/16/weisheiten-des-projektalltags/#comments</comments>
		<pubDate>Sat, 15 Jan 2011 23:26:44 +0000</pubDate>
		<dc:creator>Steffen</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[cpp]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[weisheiten]]></category>

		<guid isPermaLink="false">http://www.gouranga.me/?p=775</guid>
		<description><![CDATA[Identität In C, you merely shoot yourself in the foot. In C++, you accidentally create a dozen instances of yourself and shoot them all in the foot. Providing emergency medical care is impossible, because you can&#8217;t tell which are bitwise &#8230; <a href="http://www.gouranga.me/2011/01/16/weisheiten-des-projektalltags/">Weiterlesen <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h3>Identität</h3>
<blockquote><p>In C, you merely shoot yourself in the foot.</p>
<p>In C++, you accidentally create a dozen instances of yourself and shoot them all in the foot. Providing emergency medical care is impossible, because you can&#8217;t tell which are bitwise copies and which are just pointing at others and saying, &#8220;That&#8217;s me, over there.&#8221;</p></blockquote>
<h3>Führung</h3>
<blockquote><p>I wish i had said this, but it was said by asd@asd.com in comp.software-eng.</p>
<p>Leaders:</p>
<ul>
<li>lead by example</li>
<li>don&#8217;t ask anything of anyone they wouldn&#8217;t do themselves</li>
<li>are called on to make difficult and unpopular decisions</li>
<li>keep the team focused</li>
<li>reward/support their team in whatever they do</li>
<li>keep/clear unnecessary crap out of the way of the team</li>
</ul>
<p>Consensus is great. If it lasts for the project lifecycle, consider yourself blessed. I&#8217;ve been on a couple projects where two engineers just blantantly disagreed! They were always:</p>
<p>Programmer #1 says &#8221; x = 1&#8243;<br />
Programmer #2 says &#8221; x != 1&#8243;</p>
<p>That&#8217;s when a Project Leader is required. Unless you want to flip a coin.</p>
<p>Oh yah &#8211; one more thing. Project leaders: TAKE the blame when things go wrong and SHARE the credit when things go right.</p>
<p>Ain&#8217;t easy &#8211; but it&#8217;s the way I try to run my life</p></blockquote>
<h3>Akzeptieren von Ideen</h3>
<ul>
<blockquote>
<li>It&#8217;s impossible.</li>
<li>Maybe it&#8217;s possible, but it&#8217;s weak and uninteresting.</li>
<li>It is true and I told you so.</li>
<li>I thought of it first.</li>
<li>How could it be otherwise.</li>
</blockquote>
</ul>
<ul><em>If you come to objects with a negative preconception please keep an open mind. You may still conclude objects are bunk, but there&#8217;s a road you must follow to accept something different. Allow yourself to travel it for a while.</em></ul>
<h3>Phasen eines Projektes</h3>
<ul>
<blockquote>
<li>Enthusiasm</li>
<li>Disillusionment</li>
<li>Panic</li>
<li>A Search for the Guilty</li>
<li>The Punishment of the Innocent</li>
<li>Praise and Honor for the Non-Participants</li>
</blockquote>
</ul>
<p>Quellen:</p>
<ul>
<li><a href="http://www.possibility.com/Cpp/CppCodingStandard.html">http://www.possibility.com/Cpp/CppCodingStandard.html</a></li>
<li><a href="http://www.possibility.com/Cpp/const.html">http://www.possibility.com/Cpp/const.html</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.gouranga.me/2011/01/16/weisheiten-des-projektalltags/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XML RPC mit Qt 4.6 und OpenSSL</title>
		<link>http://www.gouranga.me/2010/03/09/xml-rpc-mit-qt-4-6-und-openssl/</link>
		<comments>http://www.gouranga.me/2010/03/09/xml-rpc-mit-qt-4-6-und-openssl/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 19:11:06 +0000</pubDate>
		<dc:creator>Steffen</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[cpp]]></category>
		<category><![CDATA[qt]]></category>
		<category><![CDATA[rpc]]></category>
		<category><![CDATA[sipgate]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.gouranga.me/?p=695</guid>
		<description><![CDATA[In einem Projekt möchte ich mit Qt auf die XML Rpc Schnittstelle von Sipgate Team zugreifen. Nach meiner Internetrecherche hat sich folgendes herrausgestellt: Qt bringt keine eigene XML Rpc Librarys mit. SOAP ist mit Qt übrings kein Problem. Mit geringem &#8230; <a href="http://www.gouranga.me/2010/03/09/xml-rpc-mit-qt-4-6-und-openssl/">Weiterlesen <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In einem Projekt möchte ich mit Qt auf die<a href="http://en.wikipedia.org/wiki/XML-RPC"> XML Rpc</a> Schnittstelle von Sipgate Team zugreifen.</p>
<p>Nach meiner Internetrecherche hat sich folgendes herrausgestellt:</p>
<ul>
<li>Qt bringt keine eigene XML Rpc Librarys mit. SOAP ist mit Qt übrings kein Problem.</li>
<li>Mit geringem Aufwand lässt sich aus den Qt Modulen QtNetwork und QtXML eine eigene XML RPC Lib zusammenschustern.</li>
<li>Sebastian Wiedenroth und Karl Gratz haben uns mit <a href="http://wiedi.frubar.net/blog/2008/03/08/libmaia-xml-rpc-with-qt4/">LibMaia </a>schon einen Großteil der Arbeit abgenommen.</li>
<li>Für meine Zwecke musste ich nurnoch einige Anpassungen vornehmen (SSL und Auth)</li>
</ul>
<h4>Vorraussetzungen</h4>
<ul>
<li><a href="http://qt.nokia.com/downloads">Qt 4.6.2</a></li>
<li>OpenSSL  (Ich verwende <a href="http://www.slproweb.com/products/Win32OpenSSL.html">OpenSSL 0.9.8l als fertige Win32 Kompilat mit libs und includes</a>)</li>
<li><a href="http://wiedi.frubar.net/blog/2008/03/08/libmaia-xml-rpc-with-qt4/">LibMaia</a></li>
</ul>
<p>Ich entwickele unter Windows 7 mit VS2005. Eine <a href="http://fakguen.wordpress.com/2008/07/14/qt-440-visual-studio-integration/">Anleitung zu Qt und VS2005 findet man bei Ferhat Akgün</a>.</p>
<h4>Qt mit OpenSSL Support kompilieren</h4>
<p>Nachdem OpenSSL installiert ist müssen wir Qt mit OpenSSL Support backen. Dazu rufen wir configure zusätzliche mit folgenden Flags auf:</p>
<p><code>-openssl -I pfad_zu_openssl_includes -L pfad_zu_openssl_libs</code></p>
<p>Bei mir sieht das so aus:<br />
<code>configure -platform win32-msvc2005 -no-qt3support -qt-sql-odbc -qt-sql-sqlite -qt-zlib -qt-libpng -openssl -I C:\OpenSSL\include -L C:\OpenSSL\lib -qt-sql-mysql -opensource -I C:\mysql-5.1.44-win32\include -L C:\mysql-5.1.44-win32\lib\opt -l libmysql </code></p>
<h4>LibMaia</h4>
<p>Nachdem wir uns ein Checkout von LibMaia besorgt haben (<code>svn co <a href="http://websvn.frubar.net/listing.php?repname=libmaia&amp;path=%2Ftrunk%2F#_trunk_">https://svn.frubar.net/svn/libmaia/trunk/</a></code>) kompilieren wir das ganze mit</p>
<p><code>qmake &amp;&amp; nmake</code></p>
<p>Ich empfehle, einen Unterordner wie 3rdparty im Qt Verzeichnis (in der Ebene ,in der auch die Ordner mit eueren Qt Versionen liegen) zu erstellen und dort 3rd-Party Libs wie LibMaia abzulegen.</p>
<p>Macht euerem Projekt jetzt den Include Path mit den Headern sowieso euerem Linker den Include Path mit den Libs und im speziellen maia.lib bekannt. (Wenn ihr wollt könnt ihr natürlich auch die *.h und *.cpps von LibMaia direkt euerem Projekt hinzufügen und euch den vorherigen Schritt sparen)</p>
<h4>Frisch ans Werk</h4>
<p>Weist zunächst Qt an, die Module QtNetwork und QtXml mitzuladen.</p>
<p>Erstellt jetzt eine Klasse die folgende Slots enthält:<br />
<code><br />
public slots:;<br />
void myFaultResponse(int, const QString &amp;);<br />
void myResponse(QVariant&amp;);</code></p>
<p>Diese werden benötigt, um auf die asynchronen Antworten der XML RPC API zu reagieren.</p>
<p>In euerer .cpp inkludiert ihr &#8220;maiaXmlRpcClient.h&#8221;. Ich werde jetzt meinen ersten Testcode benutzen, um euch das weitere vorgehen zu erklären:</p>
<p><code><br />
#include "xmlrpc.h"<br />
// Client Includes<br />
#include "maiaXmlRpcClient.h"<br />
xmlrpc::xmlrpc(QWidget *parent, Qt::WFlags flags) : QMainWindow(parent, flags)<br />
{<br />
ui.setupUi(this);<br />
// API Url. Kann auch pro Call übergeben oder mit rpcClient-&gt;setUrl gesetzt werden.<br />
QUrl targetUrl = QUrl("https://api.sipgate.net/RPC2");<br />
targetUrl.setUserName("euere@sipgate.kontaktdaten");<br />
targetUrl.setPassword("euerpasswort");<br />
// Erstellt den Client. Der zweite Parameter ist ein QObjekt als Parent für die automatische<br />
// Objektzerstörung, wie bei Qt üblich<br />
MaiaXmlRpcClient* rpcClient = new MaiaXmlRpcClient(targetUrl, this);<br />
// Ein  erstellen, wie von der Sipgate Api für ClientIdentify verlangt<br />
QVariantMap clientArgs;<br />
clientArgs["ClientName"] = QString("AWinKD Sipgate Plugin");<br />
clientArgs["ClientVersion"] = QString("0.1");<br />
clientArgs["ClientVendor"] = QString("Steffen Görtz");<br />
// In ein  packen<br />
QVariantList args;<br />
args &lt;&lt; clientArgs;<br />
// Methode samurai.ClientIdentify ausführen und Antwort sowieso Errormethode connecten<br />
rpcClient-&gt;call("samurai.ClientIdentify", args,<br />
this, SLOT(myResponse(QVariant&amp;)), this, SLOT(myFaultResponse(int, const QString &amp;)));<br />
}<br />
void xmlrpc::myFaultResponse(int errorCode, const QString &amp;errorMsg) {<br />
qDebug() &lt;&lt; "Fehler (" &lt;&lt; errorCode &lt;&lt; ") :" &lt;&lt; errorMsg;<br />
}<br />
void xmlrpc::myResponse(QVariant &amp;response) {<br />
;<br />
}<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gouranga.me/2010/03/09/xml-rpc-mit-qt-4-6-und-openssl/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Qt &#8211; Über Ordner und Resourcen iterieren</title>
		<link>http://www.gouranga.me/2009/10/02/qt-uber-ordner-und-resourcen-iterieren/</link>
		<comments>http://www.gouranga.me/2009/10/02/qt-uber-ordner-und-resourcen-iterieren/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 19:03:46 +0000</pubDate>
		<dc:creator>Steffen</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[cpp]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[qt]]></category>

		<guid isPermaLink="false">http://www.gouranga.me/?p=676</guid>
		<description><![CDATA[Wer in Qt schnell über eine Verzeichnisstruktur iterieren will, der nutzt dazu QDirIterator. Die Qt Dokumentation meint dazu: QDirIterator it("/etc", QDirIterator::Subdirectories); while (it.hasNext()) { qDebug() &#60;&#60; it.next(); // /etc/. // /etc/.. // /etc/X11 // /etc/X11/fs // ... } Nichts besonders, &#8230; <a href="http://www.gouranga.me/2009/10/02/qt-uber-ordner-und-resourcen-iterieren/">Weiterlesen <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Wer in Qt schnell über eine Verzeichnisstruktur iterieren will, der nutzt dazu QDirIterator.<br />
Die Qt Dokumentation meint dazu:</p>
<pre lang="cpp" escaped="true"> QDirIterator it("/etc", QDirIterator::Subdirectories);
 while (it.hasNext()) {
     qDebug() &lt;&lt; it.next();

     // /etc/.
     // /etc/..
     // /etc/X11
     // /etc/X11/fs
     // ...
 }</pre>
<p>Nichts besonders, sowas kann heutzutage jedes Framework &#8211; und Java von Haus aus.</p>
<p>Jetzt wirds awesome: QDirIterator greift nicht direkt auf das Dateisystem zu (Architekturbedingt macht das bei einem plattformunabhängigen Framework auch keinen Sinn), sondern über Ableitungen von QAbstractFileEngineIterator. Und so ermöglicht QDirIterator auch den Zugriff auf in die Applikation kompilierte Resourcen:</p>
<pre lang="cpp" escaped="true">QDirIterator it(":/subitems");
 while (it.hasNext()) {
     qDebug() &lt;&lt; it.next();

    // :/subitems/globe.png
    // :/subitems/pin.png
    // :/subitems/light_bulb.png
     // ...
 }</pre>
<p>Awesome!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gouranga.me/2009/10/02/qt-uber-ordner-und-resourcen-iterieren/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

