<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>delphi &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/delphi/</link>
	<description>Feed of posts on WordPress.com tagged "delphi"</description>
	<pubDate>Mon, 23 Nov 2009 21:25:36 +0000</pubDate>

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

<item>
<title><![CDATA[Delphi y Bases de Datos]]></title>
<link>http://danielluyo.wordpress.com/2009/11/23/delphi-y-bases-de-datos/</link>
<pubDate>Mon, 23 Nov 2009 18:17:54 +0000</pubDate>
<dc:creator>danielluyo</dc:creator>
<guid>http://danielluyo.wordpress.com/2009/11/23/delphi-y-bases-de-datos/</guid>
<description><![CDATA[Delphi ha sido tradicionalmente una herramienta excepional para trabajo con bases de datos, su propi]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a href="http://danielluyo.wordpress.com/files/2009/11/1259000082_database.png"><img class="alignright size-full wp-image-22" title="1259000082_database" src="http://danielluyo.wordpress.com/files/2009/11/1259000082_database.png" alt="" width="128" height="128" /></a></p>
<p>Delphi ha sido tradicionalmente una herramienta excepional para trabajo con bases de datos, su propio nombre fué elejido como la herramienta para trabajar con Oracle (The Oracle at Delphi), de esto yá hace muchísmos años.</p>
<p>A lo largo del tiempo la forma en que Delphi trabaja con Bases de Datos ha ido variando.  La tecnología que Delphi promueve actualmente para su uso en desarrollo es DBX (dbExpress). Sin embargo no es la única ya que también soporta componentes de conexión nativos (conexiones directas a la BD o usando el protocolo nativo de la BD), ODBC y ADO.</p>
<p>Desde la época de Borland, Delphi viene con Interbase siendo esta la BD por default.  Interbase tiene en <a title="Firebird" href="www.firebirdsql.org/">Firebird </a>a su vástago OpenSpurce. Interbase/Firebird es una BD madura de nivel comercial que lleva varios años de delantera sobre muchas BD usadas en la actualidad (incluídos mySql, Postgres).</p>
<p>Delphi puede usarse con una amplia variedad de Bases de Datos comerciales y libres que se usan en la actualidad por ejemplo:</p>
<ul>
<li>Interbase/Firebird:  IBX (incluído), <a title="IBObjects" href="http://www.ibobjects.com/">IBObjects</a>, <a title="ZeosLib" href="http://sourceforge.net/projects/zeoslib/">ZeosLib</a>, dbExpress (incluído)</li>
<li>MS SQL Server: dbExpress, dbGo (ADO),  <a title="DevArt SDAC" href="http://www.devart.com/sdac/">SDAC</a>, <a title="ZeosLib" href="http://sourceforge.net/projects/zeoslib/">ZeosLib</a></li>
<li>Access: dbGo (ADO)</li>
<li>Oracle: dbExpress, <a title="DevArt ODAC" href="http://www.devart.com/odac/">ODAC</a>, <a title="ZeosLib" href="http://sourceforge.net/projects/zeoslib/">ZeosLib</a></li>
<li>MySql: dbExpress,  <a title="DevArt MyDac" href="http://www.devart.com/mydac/">MyDAC</a>, <a title="ZeosLib" href="http://sourceforge.net/projects/zeoslib/">ZeosLib</a>, <a title="MicroOLAP DAC for MySQL" href="http://www.microolap.com/products/connectivity/mysqldac/">DAC for MySQL</a>, <a title="ZeosLib" href="http://sourceforge.net/projects/zeoslib/">ZeosLib</a></li>
<li>Postgres: dbExpress, <a title="DevArt PgDAC" href="http://www.devart.com/pgdac/">PgDAC</a>, <a title="MicroOLAP PostgresDAC" href="http://www.microolap.com/products/connectivity/postgresdac/">PostgresDAC</a>, <a title="ZeosLib" href="http://sourceforge.net/projects/zeoslib/">ZeosLib</a></li>
<li>Sybase: dbExpress, from <a title="Sybase" href="http://www.sybase.com/products/databasemanagement/advantagedatabaseserver/delphi-components">Sybase</a>, <a title="ZeosLib" href="http://sourceforge.net/projects/zeoslib/">ZeosLib</a></li>
<li>DB2: dbExpress</li>
</ul>
<p>Además existen motores de bases de datos embebidos (incrustados) que pueden usarse con Delphi. Esotos motores pueden usarse para replicación local en aplicaciones Cliente/Servidor, para almacenamiento temporal, o cuando se requiera aplicaciones autocontenidas sin dependencias externas. Entre los más conocidos tenemos:</p>
<ul>
<li><a title="SQLLite" href="www.sqlite.org/">SQLLite</a> , usando la dll propia de SQLLite, existe tambien ports completos a Delphi</li>
<li><a title="NexusDB" href="www.nexusdb.com/">NexusDB</a>, compila directamente en el EXE.</li>
<li><a title="elevate software" href="http://www.elevatesoft.com/">elevatedb</a>,  compila directamente en el EXE.</li>
<li><a title="Absolute Database" href="http://www.componentace.com/bde_replacement_database_delphi_absolute_database.htm">Absolute Database</a>, compila directamente en el EXE.</li>
<li>Firebird, usando una dll.</li>
<li><a title="AidAim Software" href="http://www.accuracer.com/client_server_single-file_bde_replacement_delphi_database_embedded_database.htm">Accuracer Database</a>,  compila directamente en el EXE.</li>
</ul>
<p>Otra forma de manejar datos es usando tablas en memoria (Memory tables), muy útil para datos temporales:</p>
<ul>
<li>ClientDataset de Delphi puede usarse para este fin.</li>
<li><a title="DevArt Virtual Table" href="http://www.devart.com/vtable/">VirtualTable</a></li>
<li><a title="AidAim Software" href="http://www.aidaim.com/in-memory_sql_database_delphi.htm">SQLMemTable</a></li>
<li><a title="NexusDB" href="www.nexusdb.com/">NexusDB</a>, incluye un componente para tablas en memoria, que se puede usar en conjunto con la BD normal.</li>
<li><a title="Components 4 developers" href="http://www.components4programmers.com/products/kbmmemtable/">kbmmemtable</a></li>
</ul>
<p>Como se ve Delphi posee un arsenal muy completo para atacar el desarrollo de aplicaciones de Base de Datos, tal es así que algunas herrmientas para BD están desarrollados en Delphi, por ejemplo:</p>
<ul>
<li> <a title="Quest TOAD" href="http://www.quest.com/toad-for-oracle/">TOAD </a>(para MS SQLServer, Oracle, MySQL, DB2),</li>
<li><a title="MySQL GUI Tools" href="http://dev.mysql.com/downloads/gui-tools/5.0.html">MySQL Administrator</a>,</li>
<li><a title="PL/SQL Developer" href="http://www.allroundautomations.com/plsqldev.html">PL/SQL Developer</a>,</li>
<li><a title="EMS SQL Manager Studio" href="http://www.sqlmanager.net/">EMS SQL Manager</a></li>
</ul>
<p>&#160;</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Criando MediaPlayer com o Delphi 2009 – 4ª Parte - Salvando lista de reprodução.]]></title>
<link>http://ewalflor.wordpress.com/2009/11/22/criando-mediaplayer-com-o-delphi-2009-%e2%80%93-4%c2%aa-parte/</link>
<pubDate>Sun, 22 Nov 2009 18:22:42 +0000</pubDate>
<dc:creator>ewalflor</dc:creator>
<guid>http://ewalflor.wordpress.com/2009/11/22/criando-mediaplayer-com-o-delphi-2009-%e2%80%93-4%c2%aa-parte/</guid>
<description><![CDATA[1. Adicione ao form 2 TSpeedButton (Palette additional). Na propriedade caption do primeiro speedbut]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>1. Adicione ao form 2 TSpeedButton (Palette additional). Na propriedade caption do primeiro speedbutton escreva &#8216;Minha lista de reprodução&#8217; e no segundo speedbutton &#8216;Salvar lista de reprodução&#8217;.</p>
<p>2. Adicione mais uma coluna no ListView1 e  trabalhe o listview como segue:</p>
<p><a href="http://ewalflor.wordpress.com/files/2009/11/screenhunter_03-nov-22-15-58.jpg"><img class="alignnone size-full wp-image-324" title="ScreenHunter_03 Nov. 22 15.58" src="http://ewalflor.wordpress.com/files/2009/11/screenhunter_03-nov-22-15-58.jpg" alt="" width="124" height="159" /></a></p>
<p>3. No primeito item (TListColumn), altere a propriedade width para 20. Em &#8216;Tempo&#8217; width=50 e em &#8216;Músicas&#8217; width=550.</p>
<p>4. Chame o código do botão adicionar música  a lista de reprodução (btadicionar) e faça a seguinte alteração:</p>
<p>Declare em <strong>var</strong> a variável <strong><em>nome:string</em></strong>;</p>
<p><img src="/Users/Emily/AppData/Local/Temp/moz-screenshot-1.png" alt="" /></p>
<p><strong>begin</strong><br />
for x := 0 to FileListBox1.Items.Count-1 do<br />
if FileListBox1.Selected[x] then<br />
begin<br />
arquivo:= DirectoryListBox1.Directory+&#8217;\'+FileListBox1.Items.Strings[x];<br />
nome:= FileListBox1.Items.Strings[x];<br />
ListView1.AddItem(arquivo,ListView1);<br />
ListView1.Items.Item[ListView1.Items.Count-1].SubItems.Add(TMusicas(arquivo));<br />
<em><strong>ListView1.Items.Item[ListView1.Items.Count-1].SubItems.Add(nome);</strong></em><br />
ListView1.Items.Item[ListView1.Items.Count-1].Checked := true;<br />
end;</p>
<p>5. Selecione o speedbutton &#8216;Salvar lista de reprodução&#8217; e no evento OnClick adicione o seguinte código:</p>
<p><strong>procedure TFmediaplayer.SpeedButton2Click(Sender: TObject);<br />
var</strong>//<em>declare as variáveis</em><br />
I,J : Integer;<br />
Lista : TStringList;<br />
<strong>begin</strong><br />
Lista:= TStringList.Create;<br />
try<br />
for I := 0 to ListView1.Items.Count-1 do<br />
begin<br />
//salvando a lista<br />
Lista.Add(ListView1.Items[I].Caption);<br />
// salvando os subitens<br />
for J:= 0 to ListView1.Items[I].SubItems.Count-1 do<br />
Lista.Add(#9+ListView1.Items[I].SubItems[J]);<br />
end;<br />
Lista.SaveToFile (ExtractFilePath(Application.ExeName)+ &#8216;lista de reproducao.txt&#8217;);<br />
finally<br />
Lista.Free;<br />
end;<br />
<strong>end;</strong></p>
<p>Neste código salvamos os itens do Listview em um arquivo txt na pasta do programa,ou seja, do projeto.</p>
<p>6. Selecione o speedbutton &#8216;Minha lista de reprodução&#8217; e no evento OnClick, adicone o código abaixo:</p>
<p><strong>procedure TFmediaplayer.SpeedButton1Click(Sender: TObject);<br />
var</strong><br />
Lista : TStringList;<br />
NewItem : TListItem;<br />
I : integer;<br />
begin<br />
NewItem := nil;<br />
// chamar os items<br />
Listview1.Items.Clear;<br />
Lista:= TStringList.Create;<br />
try<br />
Lista.LoadFromFile(ExtractFilePath(Application.ExeName)+ &#8216;lista de reproducao.txt&#8217;);<br />
for I := 0 to Lista.Count &#8211; 1 do<br />
if lista[I][1]=#9then<br />
NewItem.SubItems.Add(Trim(Lista[I]))<br />
else<br />
begin<br />
// novo item<br />
Newitem:= Listview1.Items.Add;<br />
NewItem.Caption := Lista[I];<br />
end;<br />
finally<br />
Lista.Free;<br />
end;<br />
<strong>end;</strong></p>
<p>No código acima, chamamos os itens salvos no arquivo txt.</p>
<p><strong>Importante:</strong> Crie com o bloco de notas um arquivo txt com o nome  <strong>&#8216;lista de reproducao&#8217;</strong> e salve-o na pasta do projeto em estudo.</p>
<p>7. Se  desejar,  que ao abrir o programa o listview mostre  a lista de reprodução salva, selecione o form e adicone o código acima (SpeedButton1) no evento OnShow do form.</p>
<p>Imagem do programa em execução:</p>
<p><img src="/Users/Emily/AppData/Local/Temp/moz-screenshot.png" alt="" /></p>
<p><a href="http://ewalflor.wordpress.com/files/2009/11/screenhunter_02-nov-22-15-48.jpg"><img class="alignnone size-full wp-image-323" title="ScreenHunter_02 Nov. 22 15.48" src="http://ewalflor.wordpress.com/files/2009/11/screenhunter_02-nov-22-15-48.jpg" alt="" width="551" height="277" /></a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Hagia Sophia: place where the 'East' meets the 'West', Istanbul in Turkey]]></title>
<link>http://raggne.wordpress.com/2009/11/22/hagia-sophia-place-where-the-east-meets-the-west-istanbul-in-turkey/</link>
<pubDate>Sat, 21 Nov 2009 23:46:08 +0000</pubDate>
<dc:creator>raggne</dc:creator>
<guid>http://raggne.wordpress.com/2009/11/22/hagia-sophia-place-where-the-east-meets-the-west-istanbul-in-turkey/</guid>
<description><![CDATA[  Di dalam Hagia Sofia, Istanbul, Turki, Juni 1994 Hagia Sophia, bahasa Arab: آيا صوفيا , (bahasa Tu]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p> <a href="Hagia-Sofia-Int-01s.jpg"><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/a/ac/Hagia-Sofia-Int-01s.jpg/225px-Hagia-Sofia-Int-01s.jpg" alt="" width="225" height="347" /></a></p>
<div>
<div>Di dalam Hagia Sofia, Istanbul, Turki, Juni 1994</div>
<div><strong>Hagia Sophia</strong>, <a title="Bahasa Arab" href="/wiki/Bahasa_Arab">bahasa Arab</a>: آيا صوفيا , (<a title="Bahasa Turki" href="/wiki/Bahasa_Turki">bahasa Turki</a>: <em>Aya Sofya</em>; <a title="Bahasa Yunani" href="/wiki/Bahasa_Yunani">bahasa Yunani</a>: Aγια Σοφία, &#8220;Kebijaksanaan Suci&#8221;), <strong>Sancta Sophia</strong> dalam <a title="Latin" href="/wiki/Latin">bahasa Latin</a> atau <strong>Aya Sofya</strong> dalam <a title="Bahasa Turki" href="/wiki/Bahasa_Turki">bahasa Turki</a>, adalah sebuah bangunan bekas <a title="Basilika" href="/wiki/Basilika">basilika</a>, <a title="Masjid" href="/wiki/Masjid">masjid</a>, dan sekarang <a title="Museum" href="/wiki/Museum">museum</a>, di <a title="Istanbul" href="/wiki/Istanbul">Istanbul</a>.</div>
<div>-</div>
<div>Popularly known as the strategic place where the &#8216;East&#8217; meets the &#8216;West&#8217;, Istanbul in Turkey, is a historic and fascinating city, which bridges the continents of Europe and Asia. Situated on the west of the Bosporus strait, which is responsible for joining the Black sea and the Sea of Marmara, Istanbul has a diverse history that is packed with tradition and ethnicity of its various conquerors.</div>
<p>Istanbul is supposed to have been inhabited right from the primitive times, and excavations conducted in that place have unearthed several evidences, that date it somewhere between 5500 BC and 3500 BC. Records also point to the fact that the modern Istanbul was actually a small Thracian fishing village called Semista in 1000BC, which also had a port by name of Lygos.</p>
</div>
<p><a href="http://www.google.co.id/imgres?imgurl=http://www.awesomeplanet.org/wp-content/uploads/2009/01/hagia-sophia-02.jpg&#38;imgrefurl=http://www.awesomeplanet.org/&#38;h=335&#38;w=500&#38;sz=71&#38;tbnid=wQwHlYZ3FjRX2M:&#38;tbnh=87&#38;tbnw=130&#38;prev=/images%3Fq%3Dhagia%2Bsophia&#38;hl=id&#38;usg=__TPNxsNGWV3eE6XJI77WxMUUITj8=&#38;ei=rfIHS-XbNoyTkAWDteHeCQ&#38;sa=X&#38;oi=image_result&#38;resnum=1&#38;ct=image&#38;ved=0CAoQ9QEwAA"></a><a href="http://www.google.co.id/imgres?imgurl=http://biblicalpaths.files.wordpress.com/2009/08/hagia_sophia_interior.jpg&#38;imgrefurl=http://biblicalpaths.wordpress.com/2009/08/14/hagia-sophia-diving-into-the-secrets/&#38;h=533&#38;w=740&#38;sz=130&#38;tbnid=Jc6EAdrksMbK7M:&#38;tbnh=102&#38;tbnw=141&#38;prev=/images%3Fq%3Dhagia%2Bsophia&#38;hl=id&#38;usg=__u2mWyK8aIw4fOS4FKBB3BP6_Kfw=&#38;ei=rfIHS-XbNoyTkAWDteHeCQ&#38;sa=X&#38;oi=image_result&#38;resnum=2&#38;ct=image&#38;ved=0CAwQ9QEwAQ"></a><a href="http://www.google.co.id/imgres?imgurl=http://www.dailyistanbultours.com/images/photo-gallery/hagia_sophia_1.jpg&#38;imgrefurl=http://www.dailyistanbultours.com/default.asp%3Fpid%3D7%26lng%3D2&#38;h=683&#38;w=1024&#38;sz=128&#38;tbnid=yqGTHSUOIiNfkM:&#38;tbnh=100&#38;tbnw=150&#38;prev=/images%3Fq%3Dhagia%2Bsophia&#38;hl=id&#38;usg=__nqvsT5WAymbJh8JW4yMUs_BJLtI=&#38;ei=rfIHS-XbNoyTkAWDteHeCQ&#38;sa=X&#38;oi=image_result&#38;resnum=3&#38;ct=image&#38;ved=0CA4Q9QEwAg"></a><a href="http://www.google.co.id/imgres?imgurl=http://www.barber.org.uk/coins/coinimgs/hagia-sophia.jpg&#38;imgrefurl=http://www.barber.org.uk/coins/537.html&#38;h=350&#38;w=411&#38;sz=29&#38;tbnid=l61-hM9QKz8MRM:&#38;tbnh=106&#38;tbnw=125&#38;prev=/images%3Fq%3Dhagia%2Bsophia&#38;hl=id&#38;usg=__nkw1qko6CdNiB_AF742R2bwbwME=&#38;ei=rfIHS-XbNoyTkAWDteHeCQ&#38;sa=X&#38;oi=image_result&#38;resnum=4&#38;ct=image&#38;ved=0CBAQ9QEwAw"></a></p>
<p><img src="http://biblicalpaths.files.wordpress.com/2009/08/hagia_sophia_interior.jpg?w=300&#038;h=216#38;h=216" alt="" width="300" height="216" /></p>
<p>By 667 BC, a Greek ruler by name of Byzas, from Megara, established his kingdom here, on the advice of an oracle of Delphi, and named it Byzantium. But it was besieged by the Romans in AD 196, and became part of the Roman Empire. The ravaged city was rebuilt by the Roman Emperor, Septimus Severus, and temporarily given the name of &#8216;Augusta Antonina&#8217;. But in 306 AD, Emperor Constantine the Great made Byzantium the capital of the entire Roman Empire, and from then on, the city was called Constantinople. The Byzantium Empire was more or less influenced by Greek culture, and was also a hub of Greek Orthodox Christianity, which resulted in the construction of several magnificent Christian architectural wonders, the prominent among them being the Hagia Sophia, which remained the world&#8217;s largest cathedral till 1850.</p>
<p>The Roman Empire passed through much turmoil due to attack from various sources, especially the Barbarians, not to mention their internal problems, and finally, in 532 AD, during the reign of Justinian I, the city was totally destroyed due to anti government riots. Though much favored for its ideal location, that made trade and transport between continents an easy affair, this very factor also proved to be the doom of Constantinople. For several hundred years hence, it had to face a lot of assault from the Arabs, Nomadic, Persians, as well as the Fourth crusaders, who periodically occupied it.</p>
<p>At last, in 1453, Constantinople was attacked and conquered by the courageous Ottoman Turks led by Sultan Mehmet II, who renamed it Istanbul. It continued to function not just as an important cultural, political and commercial hub, but also as their main centre for military operations too, till World War I, after which it was occupied by the Allies.</p>
<p>Sultan Mehmet II was supposed to have given the city a cosmopolitan social outlook. After deporting the remaining Byzantine population, a great many changes were made to the existing architecture in general. The old world Christian city was gradually transformed into a Muslim conurbation as the Emperor started rebuilding all churches so as to convert them to mosques. The great mosque and the Fatih College were built on the old burial grounds of the erstwhile Byzantine Emperors at the Church of the Holy Apostles. The Hagia Sophia too was converted to a mosque. But to his credit, the Sultan held a cosmopolitan outlook and for the greater part, allowed people of all faiths to settle in the vast city, and made effective use of their varied skills. Tolerance was a great virtue that was practiced by Sultan Mehmet II, and it was reflected all over the empire.Istanbul acquired a status of great importance in the eyes of all Muslims, after the conquest of Egypt, and its glory increased from leaps and bounds in the hands of its various rulers, many of whom were great patrons of art and architecture.</p>
<p>Although the capital of Turkey was changed from Istanbul to Ankara by Kemal Ataturk, in 1923, Istanbul still retained its attractions and continued to expand majestically. But gradually, due to the mass exodus of the various nationalities, especially after the war between Greece and Turkey, it became a prominent Muslim nation.</p>
<p><img src="http://www.awesomeplanet.org/wp-content/uploads/2009/01/hagia-sophia-02.jpg" alt="" /></p>
<p>The many historic monuments of yesteryears, that are to be found there, like the various museums, castles, palaces, mosques, churches, etc contribute greatly to the increase in the tourism industry today. In fact, many of its historic architectures have been added to the UNESCO&#8217;s list of world heritage sites. Though no more a capital city, Istanbul, which is considered to be Turkey&#8217;s cultural and financial center, still retains its old world attraction and continues to generate its own individual history through out the ages.</p>
<p>sumber: <a href="http://www.hagia-sophia.net/history.htm">http://www.hagia-sophia.net/history.htm</a></p>
<p><a href="http://id.wikipedia.org/wiki/Hagia_Sophia">http://id.wikipedia.org/wiki/Hagia_Sophia</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Anonimous methods in unit testing]]></title>
<link>http://sergworks.wordpress.com/2009/11/21/anonimous-methods-in-unit-testing/</link>
<pubDate>Sat, 21 Nov 2009 20:25:54 +0000</pubDate>
<dc:creator>Serg</dc:creator>
<guid>http://sergworks.wordpress.com/2009/11/21/anonimous-methods-in-unit-testing/</guid>
<description><![CDATA[Anonimous methods (aka Closures) are rare visitors in Delphi code. I have upgraded to Delphi 2009 a ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Anonimous methods (aka Closures) are rare visitors in Delphi code. I have upgraded to Delphi 2009 a year before and never used the anonimous methods. But last week it finally happened.<br />
I was writing the unit tests for fast fourier transform code. The idea of some tests was to compare the results of fast fourier trasform and discrete fourier transform of arbitrary function, and it appeared that the anonimous method is the best way to pass the function to the test.</p>
<pre class="brush: delphi;">
type
  TRealFunc = reference to function(N: Integer): Extended;

type
  TTestFFT = class(TTestCase)
  private
    procedure TestRealFunc(Func: TRealFunc; Count: Integer);
  published
    procedure TestRealFFT00;
    ...
  end;
</pre>
<p>All checks are done within TestRealFunc procedure. It receives a function to transform as an argument, makes fourier transform of the function using two different methods and compares the results:</p>
<pre class="brush: delphi;">
procedure TTestFFT.TestRealFunc(Func: TRealFunc; Count: Integer);
var
  FFTData: array of Extended;
  DFTData: array of TksComplex;
  M, N: Integer;
  Arg: TksComplex;

begin
  SetLength(FFTData, Count);
  SetLength(DFTData, Count);
  for M:= 0 to Count - 1 do begin
    FFTData[M]:= Func(M);

// discrete Fourier transform;
    DFTData[M]:= 0;
    for N:= 0 to Count - 1 do begin
      Arg.Re:= 0;
      Arg.Im:= (2 * Pi * N * M) / Count;
      DFTData[M]:= DFTData[M] + Func(N) * TksComplex.Exp(Arg);
    end;
  end;

// fast Fourier transform
  RealFFT(@FFTData[0], Count, False);

  CheckEquals(FFTData[0], DFTData[0].Re, 1E-15);
  CheckEquals(FFTData[1], DFTData[Count shr 1 - 1].Re, 1E-15);
  CheckEquals(0, DFTData[0].Im, 1E-15);
  CheckEquals(0, DFTData[Count shr 1 - 1].Im, 1E-15);
  for N:= 1 to Count shr 1 - 1 do begin
    CheckEquals(FFTData[2 * N], DFTData[N].Re, 1E-15);
    CheckEquals(FFTData[2 * N + 1], DFTData[N].Im, 1E-15);
    CheckEquals(FFTData[2 * N], DFTData[Count - N].Re, 1E-15);
    CheckEquals(FFTData[2 * N + 1], - DFTData[Count - N].Im, 1E-15);
  end;
end;
</pre>
<p>The test procedures themselves just calls the TestRealFunc with different arguments. For example,</p>
<pre class="brush: delphi;">
procedure TTestFFT.TestRealFFT00;
begin
  TestRealFunc(
    function(N: Integer): Extended
    begin
      Result:= Sin(pi / 4 * N) + 0.5 * Sin(pi / 2 * N + 3 * pi / 4);
    end,
    8
  );
end;
</pre>
<p>Though the syntax looks cumbersome, the solution based on anonimous methods is very logical.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Delphi, Indiana]]></title>
<link>http://sharpandkeen.wordpress.com/2009/11/20/delphi-indiana/</link>
<pubDate>Fri, 20 Nov 2009 19:04:44 +0000</pubDate>
<dc:creator>ktelaine</dc:creator>
<guid>http://sharpandkeen.wordpress.com/2009/11/20/delphi-indiana/</guid>
<description><![CDATA[Erica and I have a tradition of visiting small towns in Indiana. During my two years there, we went ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Erica and I have a tradition of visiting small towns in Indiana.  During my two years there, we went on outings to communities like Crawfordsville, Kokomo, Frankfort, and even Otterbein.  So when Erica asked me what I wanted to do on my visit, I answered without hesitation that I really wanted to visit a random small town.  We decided on Logansport.  Delphi was just a bonus. </p>
<p>On the way into town, Erica told me about how the community had raised money to create a replica of an old canal boat, <a href="http://www.journalgazette.net/apps/pbcs.dll/article?AID=/20090131/NEWS07/901319937/1002/LOCAL">and then it was burned down by an old man</a>.  We had heard that another one was built, so we tried to find it.  The closes we got, though, was this playground. </p>
<p><a href="http://sharpandkeen.wordpress.com/files/2009/11/canal-boat.jpg"><img src="http://sharpandkeen.wordpress.com/files/2009/11/canal-boat.jpg" alt="" title="canal boat" width="600" height="400" class="alignnone size-full wp-image-586" /></a></p>
<p>Looks like they are building some sort of interpretive center in the park though.  Maybe on future visits to Delphi (it might happen), I can check it out.  </p>
<p>Meanwhile, there are lots of other sites to check out in Delphi&#8230; like old buildings! </p>
<p><a href="http://sharpandkeen.wordpress.com/files/2009/11/round-and-square-windows.jpg"><img src="http://sharpandkeen.wordpress.com/files/2009/11/round-and-square-windows.jpg" alt="" title="round and square windows" width="600" height="408" class="alignnone size-full wp-image-596" /></a></p>
<p><a href="http://sharpandkeen.wordpress.com/files/2009/11/storefronts.jpg"><img src="http://sharpandkeen.wordpress.com/files/2009/11/storefronts.jpg" alt="" title="storefronts" width="600" height="384" class="alignnone size-full wp-image-598" /></a></p>
<p><a href="http://sharpandkeen.wordpress.com/files/2009/11/opera-house.jpg"><img src="http://sharpandkeen.wordpress.com/files/2009/11/opera-house.jpg" alt="" title="opera house" width="600" height="400" class="alignnone size-full wp-image-594" /></a></p>
<p><a href="http://sharpandkeen.wordpress.com/files/2009/11/clock-tower.jpg"><img src="http://sharpandkeen.wordpress.com/files/2009/11/clock-tower.jpg" alt="" title="clock tower" width="600" height="391" class="alignnone size-full wp-image-588" /></a></p>
<p>And some newer buildings:</p>
<p><a href="http://sharpandkeen.wordpress.com/files/2009/11/johns-liquor.jpg"><img src="http://sharpandkeen.wordpress.com/files/2009/11/johns-liquor.jpg" alt="" title="johns liquor" width="600" height="392" class="alignnone size-full wp-image-593" /></a></p>
<p>And some old buildings attempting to look newer:</p>
<p><a href="http://sharpandkeen.wordpress.com/files/2009/11/very-different-approaches.jpg"><img src="http://sharpandkeen.wordpress.com/files/2009/11/very-different-approaches.jpg" alt="" title="very different approaches" width="600" height="397" class="alignnone size-full wp-image-599" /></a></p>
<p>Or just this awesome Chinese restaurant. </p>
<p><a href="http://sharpandkeen.wordpress.com/files/2009/11/chinese-food.jpg"><img src="http://sharpandkeen.wordpress.com/files/2009/11/chinese-food.jpg" alt="" title="chinese food" width="600" height="818" class="alignnone size-full wp-image-587" /></a></p>
<p>With very bright bricks!</p>
<p><a href="http://sharpandkeen.wordpress.com/files/2009/11/bricks.jpg"><img src="http://sharpandkeen.wordpress.com/files/2009/11/bricks.jpg" alt="" title="bricks" width="600" height="400" class="alignnone size-full wp-image-585" /></a></p>
<p>There is, of course, the town War Memorial, but this one looks more threatening than most. </p>
<p><a href="http://sharpandkeen.wordpress.com/files/2009/11/war-memorials.jpg"><img src="http://sharpandkeen.wordpress.com/files/2009/11/war-memorials.jpg" alt="" title="war memorials" width="600" height="900" class="alignnone size-full wp-image-600" /></a></p>
<p>What with the pointy guns on each corner and all.  </p>
<p>But the best place to visit in Delphi?  The Stone House Bakery.</p>
<p><a href="http://sharpandkeen.wordpress.com/files/2009/11/stone-house-bakery.jpg"><img src="http://sharpandkeen.wordpress.com/files/2009/11/stone-house-bakery.jpg" alt="" title="stone house bakery" width="600" height="715" class="alignnone size-full wp-image-597" /></a></p>
<p>It&#8217;s the kind of place where you can sit at the counter and enjoy some baked goods in peace. </p>
<p><a href="http://sharpandkeen.wordpress.com/files/2009/11/inside-stonehouse.jpg"><img src="http://sharpandkeen.wordpress.com/files/2009/11/inside-stonehouse.jpg" alt="" title="inside stonehouse" width="600" height="450" class="alignnone size-full wp-image-592" /></a></p>
<p>Or meet up with an old girlfriend (or possibly your mom) and enjoy a slice of pie. </p>
<p><a href="http://sharpandkeen.wordpress.com/files/2009/11/having-pie.jpg"><img src="http://sharpandkeen.wordpress.com/files/2009/11/having-pie.jpg" alt="" title="having pie" width="600" height="450" class="alignnone size-full wp-image-591" /></a></p>
<p>Or where the display of cookies looks so tempting that you say, &#8220;I&#8217;ll take one of each!&#8221;</p>
<p><a href="http://sharpandkeen.wordpress.com/files/2009/11/cookies.jpg"><img src="http://sharpandkeen.wordpress.com/files/2009/11/cookies.jpg" alt="" title="cookies!" width="600" height="400" class="alignnone size-full wp-image-589" /></a></p>
<p>Apparently they are re-routing the major highway so it won&#8217;t go through Delphi anymore, but the cookies are worth the extra miles. </p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Una mirada a Delphi 2010]]></title>
<link>http://danielluyo.wordpress.com/2009/11/19/una-mirada-a-delphi-2010/</link>
<pubDate>Thu, 19 Nov 2009 20:55:44 +0000</pubDate>
<dc:creator>danielluyo</dc:creator>
<guid>http://danielluyo.wordpress.com/2009/11/19/una-mirada-a-delphi-2010/</guid>
<description><![CDATA[Aún no he usado mucho Delphi 2010 pero se ve bastante bueno y más sólido que las últimas versiones ,]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Aún no he usado mucho Delphi 2010 pero se ve bastante bueno y más sólido que las últimas versiones , bueno teniedo en cuenta que la versión que uso en el día a día es el venerable Delphi 7!!!!</p>
<p>Cosas interesantes (con respecto a Delphi 7, muchas de estas cosas ya habian creo que desde la 2005) son por ejemplo:</p>
<ul>
<li>Agrupamiento de las unidades según el directorio donde se encuentran.  Fundamental para nosotros ya que manejamos diversos directorios.</li>
<li>La disstribución de las ventanas es algo a lo me tendré que acostumbrar, por que preferia las ventans flotantes de Delphi 7.</li>
<li>Hay una opción de <strong>debug </strong>para crear tus propios visores de variables, esto esta SUPER!!! y lo vamos a usar bastante.</li>
<li>La parte de <strong>modelamiento </strong>parece que ya está más pulida.</li>
<li><strong>IDE Insigth</strong>, es un buscador dentro del IDE que encuentra de todo!!!, se ve prometedor.</li>
<li>El parser de <strong>XML </strong>que usabamos (OpenXML) viene incluído, más adelante haré un post sobre este tema.</li>
<li>El <strong>OTA </strong>es ahora mucho más abierto, ya sueño con mis propios diseñadores, visualizadores y herramientas para aligerarnos el trabajo.</li>
<li>El <strong>RTTI </strong>ha sido extendido, ahora no sólo se pueden ver las propiedades <strong>published</strong>, si no prácticamente todo, mmm podemos usarlo.</li>
<li>Ahora que Embarcadero soporta Firebird, puedo ver mistablas desde la IDE.</li>
<li>Soporte para <strong>Generics </strong>y <strong>Argumentos</strong>, <strong>Closures </strong>y otras cosas que todavia tengo que ver como sacarles provecho ya que requieren un cambio en la concepcion mental de las cosas.</li>
<li>El <strong>Help </strong>está mejor que en versiones previas en las que no había nada!</li>
</ul>
<p>Finalmente una imágen vale más que mil palabras&#8230;.</p>
<p><a href="http://danielluyo.wordpress.com/files/2009/11/d2010.png"><img class="alignnone size-full wp-image-16" title="Delphi 2010 IDE" src="http://danielluyo.wordpress.com/files/2009/11/d2010.png" alt="" width="450" height="338" /></a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[y paso 2009 y ya casi pasa el 2010]]></title>
<link>http://danielluyo.wordpress.com/2009/11/19/y-paso-2009-y-ya-casi-pasa-el-2010/</link>
<pubDate>Thu, 19 Nov 2009 20:25:54 +0000</pubDate>
<dc:creator>danielluyo</dc:creator>
<guid>http://danielluyo.wordpress.com/2009/11/19/y-paso-2009-y-ya-casi-pasa-el-2010/</guid>
<description><![CDATA[Jaja no escribo nada desde el 2008, y claro y es que nadie me lee jiji. Bueno para que quede registr]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Jaja no escribo nada desde el 2008, y claro y es que nadie me lee jiji.</p>
<p>Bueno para que quede registrado mi último post fue en espera al Delphi 2009 (a.k.a. Tiburón). Finalmente ya salió el Delphi 2010.</p>
<p>Ahora estoy haciendo pruebas de migración a Delphi 2010 y mis pesadillas con esta nueva versión ppor el soporte de Unicode, poco a poco se han ido desvaneciendo.</p>
<p>Sin embargo aún no esta todo dicho, y sin embargo so far so good.</p>
<p>Mi principal pesadilla era la migración de los componentes que usamos, la mayoria tiene versión para 2010, y los otros han compilado casi sin despeinarse. Despues de haber leido tantos blogs con historias de terror sobre la materia, parece que no hay mucho.</p>
<p>La verdad de la milanesa aún esta por descubrirse, por que el que compile no es seguridad de que corra&#8230;., pero primero que compile por lo menos.</p>
<p>Para el manejo del protocolo y nuestro framework de persistencia de objetos, creo que la cosa está peluda, ya que usamos mucho char y arimética de punteros. Tenemos que analizar como vamos a manejar nuestra premisa de usar el mínimo espacio posible en el protocolo, ahi vislumbro problemas en el horizonte.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Review of Delphi 2010 in TechRepublic]]></title>
<link>http://theroadtodelphi.wordpress.com/2009/11/19/review-of-delphi-2010-in-techrepublic/</link>
<pubDate>Thu, 19 Nov 2009 17:13:37 +0000</pubDate>
<dc:creator>Rodrigo</dc:creator>
<guid>http://theroadtodelphi.wordpress.com/2009/11/19/review-of-delphi-2010-in-techrepublic/</guid>
<description><![CDATA[You can read a nice review of Delphi 2010 in TechRepublic. Summary If you want to do Windows develop]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>You can read a nice review of <a href="http://www.embarcadero.com/products/delphi">Delphi 2010</a> in <a href="http://blogs.techrepublic.com.com/programming-and-development/?p=1924&#38;tag=leftCol;post-1924">TechRepublic</a>.</p>
<h2>Summary</h2>
<blockquote><p>If you want to do Windows development, and you want to work with native code in a native style, I think that Delphi 2010 is a very productive tool. It combines a lot that really saves time (such as DataSnap and IDE Insight) with the power and flexibility of native code. If you need support for certain functionality (especially touch-related items), it is the only shipping product on the market that does these things.</p>
<p><!--[if gte mso 9]&#62;  Normal 0     false false false  EN-US X-NONE X-NONE              MicrosoftInternetExplorer4              &#60;![endif]--><!--[if gte mso 9]&#62;                                                                                                                                            &#60;![endif]-->Every time I work with the Embarcadero team, I feel like they are writing the tools that they would love to use; they really are “developers’ developers,” and they understand the development process very well and implement it as tools quite nicely.</p>
<p>If you don’t mind learning a new system, a new language, and a new way of doing things, Delphi 2010 is worth a long look for .NET and Visual C++ developers.</p></blockquote>
<div id="_mcePaste" style="overflow:hidden;position:absolute;left:-10000px;top:0;width:1px;height:1px;">
<h1>Delphi 2010</h1>
</div>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Alternando a cor das linhas num DBGrid]]></title>
<link>http://sodelphi.wordpress.com/2009/11/19/alternando-a-cor-das-linhas-num-dbgrid/</link>
<pubDate>Thu, 19 Nov 2009 11:09:37 +0000</pubDate>
<dc:creator>reginaldorubens</dc:creator>
<guid>http://sodelphi.wordpress.com/2009/11/19/alternando-a-cor-das-linhas-num-dbgrid/</guid>
<description><![CDATA[A exemplo do que postei anteriorment sobre colorir as linhas de um StringGrid, é possível definir a ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>A exemplo do que postei anteriorment sobre colorir as linhas de um StringGrid, é possível definir a cor das linhas de um DBGrid, o que além de melhorar a estética do componente, também melhora sua ergonomia, já que a alternância das cores, facilita a leitura das inoformações linha a linha.<br />
Pois bem, para colorir as linhas de um DBGrid, basta incluir no evento <strong>OnDrawColumnCell </strong>do DBGrid o seguinte código:</p>
<pre><code>
If Odd(TDBGrid(Sender).DataSource.DataSet.RecNo) then begin
   // Cor para linhas ímpares
   TDBGrid(Sender).Canvas.Brush.Color:= clWhite;
end
else begin
   // Cor para linhas pares
   TDBGrid(Sender).Canvas.Brush.Color:= $00EFEFEF;
end;

// Testa se o registro da linha atual está selecionado
If gdSelected in State Then Begin
   // Cor de fundo do registro selecionado
   TDBGrid(Sender).Canvas.Brush.Color:= clNavy;
   // Cor do texto para o registro selecionado
   TDBGrid(Sender).Canvas.Font.Color:= clYellow;
End
Else
   // Cor do texto para registros não selecionados
   TDBGrid(Sender).Canvas.Font.Color:= clBlack; 

   // Desenha o retângulo da célula
   TDBGrid(Sender).Canvas.FillRect(Rect);
   // Apresenta o texto da célula
   TDBGrid(Sender).Canvas.TextRect(Rect, Rect.Left + 2,
      Rect.Top, Column.Field.DisplayText);
</code></pre>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Conectando TADOConnection (Delphi) com MS-Access 2007]]></title>
<link>http://andylopes.wordpress.com/2009/11/19/conectando-tadoconnection-delphi-com-ms-access-2007/</link>
<pubDate>Thu, 19 Nov 2009 10:33:02 +0000</pubDate>
<dc:creator>Anderson Lopes</dc:creator>
<guid>http://andylopes.wordpress.com/2009/11/19/conectando-tadoconnection-delphi-com-ms-access-2007/</guid>
<description><![CDATA[Buenas! Mas uma dica, que surgiu da necessidade de um professor da faculdade; como conectar o TADOCo]]></description>
<content:encoded><![CDATA[Buenas! Mas uma dica, que surgiu da necessidade de um professor da faculdade; como conectar o TADOCo]]></content:encoded>
</item>
<item>
<title><![CDATA[Apollon?]]></title>
<link>http://teddy97.wordpress.com/2009/11/19/apollon/</link>
<pubDate>Thu, 19 Nov 2009 08:34:58 +0000</pubDate>
<dc:creator>Herr Teddy</dc:creator>
<guid>http://teddy97.wordpress.com/2009/11/19/apollon/</guid>
<description><![CDATA[Apollon (griechisch Ἀπόλλων, lateinisch Apollo, deutsch Apoll) war in der griechischen und römischen]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Apollon (griechisch Ἀπόλλων, lateinisch Apollo, deutsch Apoll) war in der griechischen und römischen Mythologie der Gott des Lichts, der Heilung, des Frühlings, der sittlichen Reinheit und Mäßigung sowie der Weissagung und der Künste, insbesondere der Musik, der Dichtkunst und des Gesanges. Als Sohn des Zeus und der Göttin Leto gehörte er wie seine Zwillingsschwester Artemis zu den zwölf Hauptgöttern des griechischen Pantheons. Das Heiligtum in Delphi, die bedeutendste Orakelstätte der Antike, war ihm geweiht.</p>
<p>Das Foto habe ich im Sudermann-Park in Blankensee aufgenommen und habe leider nur die Information, das es sich um einen griechischen oder römischen Gott handeln soll. Da die Büste auf einem Buch ruht, hatte ich die Idee, das es sich vielleicht um Apollo/Apollon handeln könnte.</p>
<p>&#160;</p>
<p><a href="http://teddy97.wordpress.com/files/2009/11/cimg3144.jpg"><img class="aligncenter size-full wp-image-1863" title="CIMG3144" src="http://teddy97.wordpress.com/files/2009/11/cimg3144.jpg" alt="" width="600" height="807" /></a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Mengecek Alamat Email dengan Delphi]]></title>
<link>http://sabdowaluyo.wordpress.com/2009/11/19/mengecek-alamat-email-dengan-delphi/</link>
<pubDate>Thu, 19 Nov 2009 04:54:32 +0000</pubDate>
<dc:creator>sabdowaluyo</dc:creator>
<guid>http://sabdowaluyo.wordpress.com/2009/11/19/mengecek-alamat-email-dengan-delphi/</guid>
<description><![CDATA[Tips &amp; Trik Delphi, Tips Belajar Delphi, Belajar Delphi Online unit CekMail; &nbsp; interface ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><table border="1" cellspacing="0" cellpadding="5" width="474" bgcolor="black">
<tbody>
<tr valign="middle">
<td style="text-align:center;"><span style="color:#ffffff;"><strong>Tips &#38; Trik Delphi, Tips Belajar Delphi, Belajar Delphi Online</strong></span><strong><br />
</strong></td>
<td align="right"></td>
</tr>
</tbody>
</table>
<table border="1" cellspacing="0" cellpadding="5" width="474" bgcolor="#ffff99">
<tbody>
<tr valign="middle">
<td>unit <strong>CekMail</strong>;</p>
<p>&#160;</p>
<p><strong>interface</strong></p>
<p>&#160;</p>
<p><strong>uses</strong></p>
<p>Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,</p>
<p>StdCtrls;</p>
<p><strong>type</strong></p>
<p>TForm1 = <strong>class</strong>(TForm)</p>
<p>Button1: TButton;</p>
<p>Edit1: TEdit;</p>
<p>Label1: TLabel;</p>
<p>procedure Button1Click(Sender: TObject);</p>
<p><strong>private</strong></p>
<p><span style="color:#0000ff;">{ Private declarations }</span></p>
<p><strong>public</strong></p>
<p><span style="color:#0000ff;">{ Public declarations }</span></p>
<p><strong>end;</strong></p>
<p><strong>var</strong></p>
<p>Form1: TForm1;</p>
<p><strong>implementation</strong></p>
<p>{$R *.DFM}</p>
<p><strong>function</strong> CekEMail(EMail: String): Boolean;</p>
<p><strong>var</strong></p>
<p>s: String;</p>
<p>posisi: Integer;</p>
<p><strong>begin</strong></p>
<p>posisi:= pos(&#8216;@&#8217;, EMail);</p>
<p>if posisi &#62; 1 then</p>
<p><strong>begin</strong></p>
<p>s:= copy(EMail,posisi+1,Length(EMail));</p>
<p>if (pos(&#8216;.&#8217;, s) &#62; 1) and (pos(&#8216;.&#8217;, s) &#60; length(s)) then</p>
<p>Result:= true else Result:= false;</p>
<p><strong>end</strong></p>
<p><strong>else</strong></p>
<p>Result:= false;</p>
<p><strong>end;</strong></p>
<p><strong>procedure</strong> TForm1.Button1Click(Sender: TObject);</p>
<p><strong>begin</strong></p>
<p>if CekEmail(Edit1.Text) then</p>
<p><strong>begin</strong></p>
<p>ShowMessage(&#8216;<span style="color:#0000ff;">Format e-mail sudah benar</span>&#8216;);</p>
<p><strong>end</strong></p>
<p><strong>else</strong></p>
<p><strong>begin</strong></p>
<p>ShowMessage(&#8216;<span style="color:#0000ff;">Cek kembali</span>&#8216;);</p>
<p><strong>end</strong></p>
<p><strong>end;</strong></p>
<p><strong>end.</strong></td>
</tr>
</tbody>
</table>
<table border="1" cellspacing="0" cellpadding="5" width="474" bgcolor="black">
<tbody>
<tr valign="middle">
<td style="text-align:center;"><span style="color:#ffffff;"><strong>TransCODE Software</strong></span><strong><br />
</strong></td>
<td align="right"></td>
</tr>
</tbody>
</table>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Short Story Break: Heinlein &amp; Tiptree]]></title>
<link>http://awthome.wordpress.com/2009/11/18/short-story-break-heinlein-tiptree/</link>
<pubDate>Thu, 19 Nov 2009 01:10:08 +0000</pubDate>
<dc:creator>Bonnie Norman</dc:creator>
<guid>http://awthome.wordpress.com/2009/11/18/short-story-break-heinlein-tiptree/</guid>
<description><![CDATA[Delilah and the Space-Rigger by Robert A. Heinlein Part of the The Green Hills of Earth anthology Ma]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a href="http://www.indiebound.org/book/978-0671578534?aff=BonnieBelle"><img src="http://awthome.wordpress.com/files/2009/11/green-hills-of-earth.jpg?w=176" alt="" title="green hills of earth" width="176" height="300" class="alignleft size-medium wp-image-778" /></a><strong>Delilah and the Space-Rigger</strong> by Robert A. Heinlein<br />
Part of the <strong>The Green Hills of Earth</strong> anthology<br />
Mass Market Paperback: 288 pages<br />
Publisher: Baen Books; Reprint edition (February 1, 2000)<br />
ISBN-13: 978-0671578534</p>
<p>It&#8217;s a well known fact that women are a serious and often dangerous distraction on high risk jobs, such as constructing a space station. At least, that&#8217;s the attitude held by Tiny Larsen, the crew chief in charge of building Space Station One. He works with an all-male crew, trying to get this monumental task accomplished while maintaining order among the men. That all seems to be in jeopardy when G. Brooks McNye is sent up to the station to replace a man who was fired. </p>
<p>Gloria Brooks McNye is the first and currently only woman on a space station crewed entirely by men. Larsen fears for her safety and the respectfulness of his men, as loudly and obnoxiously as he possibly can. He goes completely out of his way to try and keep her sequestered from the rest of the crew while he hustles to get a male replacement sent up. </p>
<p>This is a humorous story poking fun at the sheer ridiculousness of judging competence and character based on gender. McNye sets out to prove from the beginning that she can do anything boys can do, and in some cases, better. It&#8217;s up to her and rest of the crew to convince Larsen that women have as much right to help build this huge undertaking for as men do. It&#8217;s a funny story, and I recommend it and the rest of <strong>The Green Hills of Earth</strong> for any Heinlein lovers and any newbies alike. </p>
<p>*****************************************************************<br />
<a href="http://awthome.wordpress.com/files/2009/11/hugo-winners-3.jpg"><img src="http://awthome.wordpress.com/files/2009/11/hugo-winners-3.jpg?w=212" alt="" title="Hugo Winners 3" width="212" height="300" class="alignright size-medium wp-image-779" /></a><strong>The Girl Who Was Plugged In</strong> by James Tiptree, Jr.<br />
Part of <strong>The Hugo Winners: Volume 3</strong> anthology<br />
Hardcover: 603 pages<br />
Publisher: Doubleday (January 1, 1977)</p>
<p>P. Burke is a social pariah, deformed in body and in possession of not much mind. The near-future society in which she lives is utterly devoted to the worship of beautiful people. They are seen as gods, striding above the rest of the population on a wave of adoration. Every holocam is pointed in their direction. Burke cannot even hope to be noticed by such people and in the end, her existence becomes too much to bear. She tries to kill herself. And is miraculously offered the chance of a lifetime while recovering in the hospital. </p>
<p>Become a Remote for a new god. No one will ever know that P. Burke is really the brain running the beautiful doll body of lovely little Delphi, the newest splash on the celebrity scene. Burke sits five hundred feet below ground, hooked up to wires and controls and circuits, her own body nearly lifeless, and lives the life of Delphi. But why would she be offered such a chance? What&#8217;s the catch?</p>
<p>A set of stringent laws called the Huckster Laws have banned nearly all forms of advertising. The only way you are allowed to advertise is either on or in your product, or during an in-store demonstration. No more billboards, no more TV commercials, no more painted buses. And that just doesn&#8217;t work for the corporate men. So they&#8217;ve found a way around it. Create celebrities beloved by all, and have them showcase select products in their &#8220;everyday&#8221; lives. The millions of people who watch their broadcasts won&#8217;t fail to notice what brand of toothpaste or what kind of shoes their living gods are wearing. </p>
<p>P. Burke and her alter-ego, Delphi, will be a living advertisement. But when Burke/Delphi falls in love and grows a conscience about breaking the ad laws, her life is irreparably changed.  </p>
<p>Tiptree&#8217;s deft hand in this story is wonderful to read. The narrative style is great, and the descriptions of corporate life, evil machinations, and the desire to simply be loved for who and what you are, are absolutely captivating. This is a fantastic peek at where are own world could be headed, with our reality TV shows and the incessant consumer culture we live in. Read this story, and weep for Delphi. Then break your TV.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Ligando objetos de negócio aos campos de um fomulário via RTTI]]></title>
<link>http://deividfae.wordpress.com/2009/11/18/ligando-objetos-de-negocio-aos-campos-de-um-fomulario-via-rtti/</link>
<pubDate>Wed, 18 Nov 2009 23:58:19 +0000</pubDate>
<dc:creator>deividfae</dc:creator>
<guid>http://deividfae.wordpress.com/2009/11/18/ligando-objetos-de-negocio-aos-campos-de-um-fomulario-via-rtti/</guid>
<description><![CDATA[O Delphi 2010 tem muitos novos recursos que provam que a ferramenta está evoluindo muito. Uma nova f]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>O Delphi 2010 tem muitos novos recursos que provam que a ferramenta está evoluindo muito. Uma nova feature que eu estou achando muito interessante é a nova RTTI e os novos recursos adicionados a ela.</p>
<p>A RTTI existe deste as primeiras versões do Delphi porém era muito mais complexo utilizar e dava um bom trabalho pois o uso de ponteiro a meu ver era exagerado.</p>
<p>Agora ficou mais fácil procurar campo ou propriedades em classes, chamar métodos em Run time e várias coisas legais.</p>
<p>Eu estava procurando na internet achei um blog muito bom do <a href="http://sourcecodeadventures.wordpress.com/">Cobus Kruger</a> que é desenvolvedor em Delphi há muito tempo e postou um artigo interessante e bem prático mostrando como fazer a ligação entre um objeto de negócio e os campos de um formulário neste<a title="Artigo sobre ligação de objetos de negócio aos campos de um formulário" href="http://sourcecodeadventures.wordpress.com/2009/11/18/inducing-the-great-divide/"> link.</a></p>
<p>Com o exemplo mostrado no post podemos separar as regras de negócio da camada visual em nossa aplicação, deixando nosso código mais modularizado e mais fácil de reutilizar nossa camada de negócio.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Inducing The Great Divide]]></title>
<link>http://sourcecodeadventures.wordpress.com/2009/11/18/inducing-the-great-divide/</link>
<pubDate>Wed, 18 Nov 2009 21:36:01 +0000</pubDate>
<dc:creator>Cobus Kruger</dc:creator>
<guid>http://sourcecodeadventures.wordpress.com/2009/11/18/inducing-the-great-divide/</guid>
<description><![CDATA[One of the most important principles in building complex software systems, is detaching&#160; the bu]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>One of the most important principles in building complex software systems, is detaching&#160; the business logic from the screens that allow users to view and edit information.</p>
<p>You’ll notice I said “most important” and not “most popular.” Sad but true – all modern IDEs make it so easy for a programmer to simply whack together a bunch of user interface controls, that there are probably far more forms with embedded business logic than without.</p>
<p>The fact is that for simple systems, this can often be convenient and harmless. But for more complex ones, it nearly always spells disaster (or at least chronic pain). The gold standard for these kinds of systems is to have a set of business objects and a set of screens that merely displays and edits them.</p>
<p>Building a proper business object framework is a complex topic all of its own, but Delphi (and all the other modern languages) give us more than enough riches in the object model to implement what we need in this regard.</p>
<p>What environments like Delphi don’t do very well, is give developers the tools to build a form that can capably display and edit business objects <em>without knowing too much about them</em>. And very generic entry forms only work well for very generic data. Invariably, specialised data require specialised forms that give the user appropriate functionality and a sensible layout.</p>
<p>So you end up with lots and lots of code like this:</p>
<pre>
<pre class="brush: delphi;">
procedure TCustomerForm.LoadForm(Customer: TCustomer);
begin
  NameEdit.Text := Customer.Name;
  EmailEdit.Text := Customer.Email;
end; 

procedure TCustomerForm.PostForm(Customer: TCustomer);
begin
  Customer.Name := NameEdit.Text;
  Customer.Email := EmailEdit.Text;
end; </pre>
</pre>
<p>And this kind of boiler-plate code is yet another reason while lots of programmers throw structure to the hounds and just integrate the business logic into the form.</p>
<p>Well, no need.</p>
<p>Delphi’s RTTI framework has always allowed one to access and manipulate all the published properties and fields on an object and I have been using a framework based on that for over ten years now. Simply publish all the properties you want to represent on the form and you can match object properties to screen controls by name and type.</p>
<p>Delphi 2010 has of course overhauled the RTTI framework completely and I quickly adapted my code to use that instead. Truth be told, the new RTTI is a little finicky and brittle, but it is also far richer in functionality and I found it well worth the effort to overhaul my classes.</p>
<p>What I am about to present here is not based in any way on the framework in our system, but illustrates very nicely how that works. Having said that, what I will show here is also simplified to the point that you will definitely want to extend it a little before you go gold with it.</p>
<h3>Exploring The Cliff Faces</h3>
<p>There is no real limit to the data types that you can have on your business object, but VCL controls almost all use simpler types to represent their values. So the first thing you’ll need is some sort of mapping of how you will want to represent information. </p>
<p>Here is a quick table of reasonable mappings:</p>
<table border="0" cellspacing="0" cellpadding="2" width="400">
<tbody>
<tr>
<td valign="top" width="200"><strong>Business Object Property</strong></td>
<td valign="top" width="200"><strong>Possbile VCL Controls</strong></td>
</tr>
<tr>
<td valign="top" width="200">string, TObject</td>
<td valign="top" width="200">TEdit, TComboBox, TLabel</td>
</tr>
<tr>
<td valign="top" width="200">Boolean</td>
<td valign="top" width="200">TCheckBox</td>
</tr>
<tr>
<td valign="top" width="200">Integer</td>
<td valign="top" width="200">TEdit, TUpDown, TTrackBar</td>
</tr>
<tr>
<td valign="top" width="200">Double</td>
<td valign="top" width="200">TEdit</td>
</tr>
<tr>
<td valign="top" width="200">TDateTime</td>
<td valign="top" width="200">TDateTimePicker</td>
</tr>
<tr>
<td valign="top" width="200">Enumerated type</td>
<td valign="top" width="200">TComboBox, TListBox</td>
</tr>
<tr>
<td valign="top" width="200">Set type</td>
<td valign="top" width="200">TCheckListBox</td>
</tr>
</tbody>
</table>
<p>I’m sure you can think of a few more and probably disagree with me on a few, but you get to pick your own.</p>
<p>The plan is to have a completely autonomous business object and a very simple screen that can display and modify the business object without knowing much about it.</p>
<p>Here is the business object I am going to use:</p>
<pre>
<pre class="brush: delphi;">
TPerson = class
private
  FName: string;
  FAge: Integer;
  FOccupation: string;
public
  property Name: string read FName write FName;
  property Age: Integer read FAge write FAge;
  property Occupation: string read FOccupation write FOccupation;
end;
</pre>
</pre>
<p>And my form is as simple as they get too:</p>
<p><a href="http://sourcecodeadventures.files.wordpress.com/2009/11/image.png"><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://sourcecodeadventures.files.wordpress.com/2009/11/image_thumb.png?w=244&#038;h=169" width="244" height="169" /></a> </p>
<p>The load button predictably loads the content of a TPerson instance into the form, the Save button does the reverse and Clear Form… well OK.</p>
<p>Here is the code for the Load and Save buttons:</p>
<pre>
<pre class="brush: delphi;">
procedure TCustomerForm.LoadButtonClick(Sender: TObject);
begin
  Binding.Load;
end;

procedure TCustomerForm.SaveButtonClick(Sender: TObject);
begin
  Binding.Save;
end;
</pre>
</pre>
<p>That is about as simple as it gets, right? An obvious enhancement is to make the form validate the values before assigning them to the form, but let’s not get ahead of ourselves.</p>
<p>The Binding variable above is of the TObjectBinding class which links together any TWinControl and any object. Before I show that – here are a few things you probably know, but let’s cover them anyway:</p>
<ol>
<li>All controls placed on a form at design time get their own published fields. This lets the streaming system know what should go into the form file and what shouldn’t. </li>
<li>Not all public properties on your business object necessarily need to be displayed on the form. And none of those properties that you want to display will be published unless you made them so. </li>
<li>Properties have names. So do screen controls. They may even match, but lots of programmers prefer to have their controls named something like AgeEdit or EdtAge instead of just Age. </li>
<li>Not all properties are writeable. In fact, you could (probably shouldn’t) even create properties that can be written to but not read. </li>
</ol>
<p>Clearly then, we can find the relevant controls by using Delphi’s new RTTI framework to iterate the published fields that are controls. Finding the relevant business object fields can be as simple as grabbing all the public and published properties or it can involve checking attributes. Or only properties with an even-length name. My class has a method to pick out valid fields and another to pick out valid properties. Modify these to your heart’s content.</p>
<p>And in production code you may want to pick up some of the form’s properties as well. Works well when you need to override some of the basic functionality.</p>
<h2>Building The Narrow Bridge</h2>
<p>Here is the class declaration – I’ll discuss the methods as we go along:</p>
<pre>
<pre class="brush: delphi;">TObjectBinding = class
private
  // Quick way to get from the object
  // field to its screen control.
  PropFieldMapping: TDictionary&#60;TRttiProperty, TRttiField&#62;;
  // Needed for RTTI.
  Context: TRttiContext;
  ControlType: TRttiType;
  ObjType: TRttiType;
  // The control (normally form) and
  // the object it represents.
  Control: TWinControl;
  Obj: TObject;
  // Finds the object properties that have corresponding
  // fields and stores them in the dictionary.
  procedure CreateMappings;
  function FindField(Prop: TRttiProperty; out Field: TRttiField): Boolean;
  function FieldClass(Field: TRttiField): TClass;
  // Modify these to change the rules about what
  // should be matched.
  function IsValidField(Field: TRttiField): Boolean;
  function IsValidProp(Prop: TRttiProperty): Boolean;
  // Modify these to change the mappings of property type
  // to VCL control class.
  procedure AssignField(Prop: TRttiProperty; Field: TRttiField);
  procedure AssignProp(Prop: TRttiProperty; Field: TRttiField);
  // Used from AssignField/AssignProp. Extend these to
  // support a wider range of properties.
  function GetPropText(Prop: TRttiProperty): string;
  procedure SetPropText(Prop: TRttiProperty; const Text: string);
public
  procedure Load;
  procedure Save;

  constructor Create(Control: TWinControl; Obj: TObject);
  destructor Destroy; override;
end;
</pre>
</pre>
<p>Load and Save can easily be supplemented here with Validate, which will use attributes specified on the business object properties to decide whether the current screen values are valid. If not, we don’t call Save at all.</p>
<p>The constructor and destructor do what you expect. They create and destroy the objects held in those private fields. The constructor also calls CreateMappings, which is where a lot of the fun stuff happens.</p>
<pre>
<pre class="brush: delphi;">
constructor TObjectBinding.Create(Control: TWinControl; Obj: TObject);
begin
  inherited Create;

  Self.Control := Control;
  Self.Obj := Obj;
  Context := TRttiContext.Create;
  ControlType := Context.GetType(Control.ClassInfo);
  ObjType := Context.GetType(Obj.ClassInfo);
  PropFieldMapping := TDictionary&#60;TRttiProperty, TRttiField&#62;.Create;
  CreateMappings;
end;

destructor TObjectBinding.Destroy;
begin
  PropFieldMapping.Free;
  ObjType.Free;
  ControlType.Free;
  Context.Free;

  inherited;
end;

procedure TObjectBinding.CreateMappings;
var
  Props: TArray&#60;TRttiProperty&#62;;
  Prop: TRttiProperty;
  Field: TRttiField;
begin
  Props := ObjType.GetProperties;
  for Prop in Props do
    if IsValidProp(Prop) and FindField(Prop, Field) then
      PropFieldMapping.Add(Prop, Field);
end;
</pre>
</pre>
<p>CreateMappings scans through all the properties on the business object and attempts to find fields on the form to match them to. If a match is found, they are stored in the PropFieldMapping dictionary for future reference.</p>
<p>Notice the IsValidProp function. That is where you should impose any additional rules about whether or not a property should be taken into account. The default implementation simply grabs all the public and published properties.</p>
<pre>
<pre class="brush: delphi;">
function TObjectBinding.IsValidProp(Prop: TRttiProperty): Boolean;
begin
  Result := Prop.Visibility &#62;= mvPublic;
end;
</pre>
</pre>
<p>Also, there is a FindField function. This little guy does a bit more than just grab all the published fields. Again, there is an IsValidField function for you to toy with. But it first attempts to find a control with a name that matches exactly with that of an approved property. If not, it also checks for a few common variants of the name (AgeEdit and EdtAge as mentioned before). This list will obviously need to grow if you support many more controls.</p>
<pre>
<pre class="brush: delphi;">
function TObjectBinding.FieldClass(Field: TRttiField): TClass;
begin
  Result := GetTypeData(Field.FieldType.Handle).ClassType;
end;

function TObjectBinding.IsValidField(Field: TRttiField): Boolean;
begin
  Result := (Field &#60;&#62; nil) and (Field.Visibility = mvPublished) and
    (Field.FieldType.TypeKind = tkClass) and
    (FieldClass(Field).InheritsFrom(TControl));
end;

function TObjectBinding.FindField(Prop: TRttiProperty; out Field: TRttiField): Boolean;
const
  Embelishments: array [0..5] of string =
    ('Edt', 'Edit', 'Combo', 'ComboBox', 'Lookup', 'Lkp');
var
  Emb: string;
begin
  Field := ControlType.GetField(Prop.Name);
  if IsValidField(Field) then
    Exit(True)
  else for Emb in Embelishments do
  begin
    Field := ControlType.GetField(Prop.Name + Emb);
    if not IsValidField(Field) then
      Field := ControlType.GetField(Emb + Prop.Name);
    if IsValidField(Field) then
      Exit(True);
  end;
  Result := False;
end;
</pre>
</pre>
<p>Now that we have a dictionary of business object properties and the screen fields that we want to link them to, we can take a look at the very similar-looking Load and Save methods.</p>
<pre>
<pre class="brush: delphi;">
procedure TObjectBinding.Load;
var
  Prop: TRttiProperty;
begin
  for Prop in PropFieldMapping.Keys do
    AssignField(Prop, PropFieldMapping[Prop]);
end;

procedure TObjectBinding.Save;
var
  Prop: TRttiProperty;
begin
  for Prop in PropFieldMapping.Keys do
    AssignProp(Prop, PropFieldMapping[Prop]);
end;
</pre>
</pre>
<p>AssignProp and AssignField are probably the two most difficult functions to write in this entire class. The problem is that Delphi’s TValue structure used in the new RTTI framework makes no attempt whatsoever to convert data. Instead, you need to do any conversions yourself and assign to the exact type you need. That isn’t too much of a problem, but it means lots of individually-crafted conversion blocks. </p>
<p>To keep my example manageable, I opted to convert everything to strings and back using GetPropText and SetPropText. And I only support string, Integer, Double and TDateTime. I didn’t use Double and TDateTime on my TPerson business object, but they do require a special trick that I wanted to show.</p>
<pre>
<pre class="brush: delphi;">
procedure TObjectBinding.AssignField(Prop: TRttiProperty; Field: TRttiField);
var
  NestedControl: TControl;
  PropText: string;
begin
  NestedControl := Field.GetValue(Control).AsObject as TControl;

  PropText := GetPropText(Prop);
  if NestedControl is TCustomEdit then
    TCustomEdit(NestedControl).Text := PropText
  else if NestedControl is TCustomComboBox then
    TComboBox(NestedControl).Text := PropText;
end;

procedure TObjectBinding.AssignProp(Prop: TRttiProperty; Field: TRttiField);
var
  NestedControl: TControl;
  FieldText: string;
begin
  NestedControl := Field.GetValue(Control).AsObject as TControl;

  if NestedControl is TCustomEdit then
    FieldText := TCustomEdit(NestedControl).Text
  else if NestedControl is TCustomComboBox then
    FieldText := TComboBox(NestedControl).Text
  else
    FieldText := '';

  SetPropText(Prop, FieldText);
end;

procedure TObjectBinding.SetPropText(Prop: TRttiProperty; const Text: string);
var
  V: TValue;
begin
  case Prop.PropertyType.TypeKind of
    tkInteger: V := StrToIntDef(Text, 0);
    tkFloat:
      if Prop.PropertyType.Handle = TypeInfo(TDateTime) then
        V := StrToDateDef(Text, 0)
      else
        V := StrToFloatDef(Text, 0);
    tkUString: V := Text;
    // And other types handled in similar ways
  else
    Exit; // Or some reasonable default action
  end;

  Prop.SetValue(Obj, V);
end;

function TObjectBinding.GetPropText(Prop: TRttiProperty): string;
var
  V: TValue;
begin
  V := Prop.GetValue(Obj);
  case Prop.PropertyType.TypeKind of
    tkInteger: Result := IntToStr(V.AsInteger);
    tkFloat:
      if Prop.PropertyType.Handle = TypeInfo(TDateTime) then
        Result := DateToStr(V.AsType&#60;TDateTime&#62;)
      else
        Result := FloatToStr(V.AsType&#60;Double&#62;);
    tkUString: Result := V.AsString;
    // And other types handled in similar ways
  else
    Result := ''; // Or some reasonable default
  end;
end;
</pre>
</pre>
<p>Firstly, the AssignProp and AssignField functions each has a check for every supported VCL control base class. So to support TCheckBox or TCheckListBox this is where you would add the additional support code. </p>
<p>Then take a look at GetPropText and SetPropText. They mirror one another of course, so we can learn what we need by inspecting GetPropText. </p>
<p>First thing to notice is that string properties use the tkUString type and not tkString as in pre-Unicode versions of Delphi. Also, we can simply read TValue.AsInteger when reading an integer value.</p>
<p>The trouble arises when we look at Double and TDateTime. TDateTime is actually a type alias for Double and they both show up as tkFloat. This is why I compare the type info from my property with the type info for TDateTime. The alternative would be to check the type name, but that thought makes me queasy. The same kind of thing will be needed to tell Boolean from other enumerated types.</p>
<p>Also, both Double and TDateTime are incompatible with TValue.AsExtended, which is of course a floating point type of a different size. So taking care of all these type conversions become really cumbersome, but of course you only need to write the code once. </p>
<h2>And that’s it</h2>
<p>Hooking all of this together, you can now have business objects that are completely detached from their editing screens. You’ll find that the screens become really trivial to develop – most cases involve little more than slapping on the controls, naming them and calling Load and Save. And that last bit can be done is a base class.</p>
<p>You also get to take advantage of all the other advantages that come with a proper split. You will find it easier to modify your business rules, easily use the same business logic in other contexts (say a bulk import versus the capture screen) and also be able to validate your business rules using automated tests. Good idea!</p>
<p>I can now show you my super-complex test app in action. Note that the first screen shot shows the names of both edit boxes and the combo box. Despite the different naming conventions, they all link up automatically to the correct properties.</p>
<p>1. Starting up.</p>
<p><a href="http://sourcecodeadventures.files.wordpress.com/2009/11/image1.png"><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://sourcecodeadventures.files.wordpress.com/2009/11/image_thumb1.png?w=244&#038;h=169" width="244" height="169" /></a> </p>
<p>2. Click <em>Load Form</em>.</p>
<p><a href="http://sourcecodeadventures.files.wordpress.com/2009/11/image2.png"><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://sourcecodeadventures.files.wordpress.com/2009/11/image_thumb2.png?w=244&#038;h=169" width="244" height="169" /></a> </p>
<p>3. Mess around with the values and click <em>Save to Object</em>.</p>
<p><a href="http://sourcecodeadventures.files.wordpress.com/2009/11/image3.png"><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://sourcecodeadventures.files.wordpress.com/2009/11/image_thumb3.png?w=244&#038;h=169" width="244" height="169" /></a> </p>
<p>4. Click <em>Clear Form</em>.</p>
<p><a href="http://sourcecodeadventures.files.wordpress.com/2009/11/image4.png"><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://sourcecodeadventures.files.wordpress.com/2009/11/image_thumb4.png?w=244&#038;h=169" width="244" height="169" /></a> </p>
<p>5. And finally, load again.</p>
<p><a href="http://sourcecodeadventures.files.wordpress.com/2009/11/image5.png"><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://sourcecodeadventures.files.wordpress.com/2009/11/image_thumb5.png?w=244&#038;h=169" width="244" height="169" /></a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Microsoft Azure to go live in January]]></title>
<link>http://mikejustin.wordpress.com/2009/11/18/microsoft-azure-to-go-live-in-january/</link>
<pubDate>Wed, 18 Nov 2009 15:22:14 +0000</pubDate>
<dc:creator>Michael Justin</dc:creator>
<guid>http://mikejustin.wordpress.com/2009/11/18/microsoft-azure-to-go-live-in-january/</guid>
<description><![CDATA[(arstechnica.com) Microsoft plans to transition its Windows Azure cloud computing platform from prev]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>(<a href="http://arstechnica.com/microsoft/news/2009/11/microsoft-azure-to-go-live-january-for-pay-february.ars">arstechnica.com</a>) Microsoft plans to transition its <a href="http://www.microsoft.com/windowsazure/">Windows Azure</a> cloud computing platform from preview to full production capacity on January 1 next year, Chief Software Architect Ray Ozzie announced at the annual PDC conference on Tuesday.  The service, currently operating as a free Community Technology Preview (CTP), will remain no-cost throughout January; from February 1 it will start accumulating charges. The cost schedule was <a href="http://arstechnica.com/microsoft/news/2009/07/windows-azure-priced-and-set-for-november-launch.ars">previously announced</a> in July.</p>
<p>Azure will also support PHP and the Java(tm) platform:</p>
<ul>
<li><a href="http://phpazure.codeplex.com/">http://phpazure.codeplex.com/</a></li>
<li><a href="http://www.windowsazure4j.org/">http://www.windowsazure4j.org/</a></li>
</ul>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Client / Server Integrated Chat and Game Tables by Jinxmaster7]]></title>
<link>http://outsourcedjobs.wordpress.com/2009/11/18/client-server-integrated-chat-and-game-tables-by-jinxmaster7/</link>
<pubDate>Wed, 18 Nov 2009 06:31:18 +0000</pubDate>
<dc:creator>ejazazeem</dc:creator>
<guid>http://outsourcedjobs.wordpress.com/2009/11/18/client-server-integrated-chat-and-game-tables-by-jinxmaster7/</guid>
<description><![CDATA[Client / Server Developement ( Chat and Gaming ) ===================================== Client Featur]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Client / Server Developement ( Chat and Gaming )  =====================================    Client Features  &#8212;&#8212;&#8212;&#8212;&#8211;  # Integrated Chat supporting font types and styles.  # Top section of main chat lobby shows the game tables&#8230; (Budget: $750-1500, Jobs: .NET, Delphi, Game Design, Social Networking)<br /> <a href="http://www.getafreelancer.com/projects/mea_553142.html"><b>Bid on this project</b></a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[ Criando MediaPlayer com o Delphi 2009 – 3ª Parte]]></title>
<link>http://ewalflor.wordpress.com/2009/11/17/criando-mediaplayer-com-o-delphi-2009-%e2%80%93-3%c2%aa-parte/</link>
<pubDate>Wed, 18 Nov 2009 01:42:37 +0000</pubDate>
<dc:creator>ewalflor</dc:creator>
<guid>http://ewalflor.wordpress.com/2009/11/17/criando-mediaplayer-com-o-delphi-2009-%e2%80%93-3%c2%aa-parte/</guid>
<description><![CDATA[Instalando o Rxlib no Delphi 2009 1.  Adicione  as Units do  rxLib  no  directory (&#8230;RxLib_2009]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><strong>Instalando o Rxlib no Delphi 2009</strong></p>
<p>1.  Adicione  as Units do  rxLib  no  directory (&#8230;RxLib_2009\Units)</p>
<p>Selecione:</p>
<p>Tools  -&#62; options</p>
<p>- Environment Options</p>
<p>- Delphi Options</p>
<p>- Library &#8211; Win32 &#124; Library Path</p>
<p>2.  Abra o projeto de IDE:</p>
<p>File-&#62;Open: &#8230;\RxLib_2009\packages\Delphi2009\Rxlib.groupproj</p>
<p>3. Compile todos os pacotes (all packages):</p>
<p>Project-&#62; Build All projects</p>
<p>4. Instale  all packages:</p>
<p>Clique com o botão direito do mouse em  dclrxbd120.bpl  no Project Manager.</p>
<p>Selecione:  Install</p>
<p>View -&#62; Project Manager</p>
<p><strong>Download</strong>:</p>
<p><a title="RxLib 2.7.7" href="http://www.megaupload.com/?d=VD66YJLY" target="_self">RxLib   para Delphi 2009 </a></p>
<p><strong>Continuação da linha de código do Projeto MediaPlayer no Delphi 2009</strong></p>
<p>1.  Para configurar  RxTrayIcon, Vá até Object Inspector e em propriedades faça as seguintes alterações:</p>
<p>Active: True<br />
Interval: 150<br />
Name: RxTrayIcon1<br />
PopupMenu: PopupMenu1 (link o RXTrayIcon com o PopupMenu1 do form)</p>
<p>2. Clique na propriedade  Icons do RxTrayIco   e  adicione as imagens de sua preferência.</p>
<p><a href="http://ewalflor.wordpress.com/files/2009/11/screenhunter_06-oct-23-23-38.jpg"><img class="alignnone size-full wp-image-312" title="ScreenHunter_06 Oct. 23 23.38" src="http://ewalflor.wordpress.com/files/2009/11/screenhunter_06-oct-23-23-38.jpg" alt="" width="219" height="182" /></a></p>
<p><a href="http://ewalflor.wordpress.com/files/2009/11/screenhunter_07-oct-23-23-38.jpg"><img class="alignnone size-full wp-image-309" title="ScreenHunter_07 Oct. 23 23.38" src="http://ewalflor.wordpress.com/files/2009/11/screenhunter_07-oct-23-23-38.jpg" alt="" width="358" height="174" /></a></p>
<p>3. Selecione o PopupMenu1 e configure cada item como segue abaixo:</p>
<p><strong>Tocar</strong><br />
<strong>Propriedades</strong><br />
Tag: 1</p>
<p>Name: Play1</p>
<p>ImageIndex: 2</p>
<p><strong>Evento</strong></p>
<p>OnClick: ToolButton1Click</p>
<p><strong>Pausar</strong><br />
<strong>Propriedades</strong><br />
Tag: 2</p>
<p>Name: Pause1</p>
<p>ImageIndex: 3</p>
<p><strong>Evento</strong></p>
<p>OnClick: ToolButton1Click</p>
<p><strong>Stop</strong><br />
<strong>Propriedades</strong><br />
Tag: 3</p>
<p>Name: Stop1</p>
<p>ImageIndex: 6</p>
<p><strong>Evento</strong></p>
<p>OnClick: ToolButton1Click</p>
<p><strong>Next</strong><br />
<strong>Propriedades</strong><br />
Tag: 4</p>
<p>Name: Next1</p>
<p>ImageIndex: 5</p>
<p><strong>Evento</strong></p>
<p>OnClick: ToolButton1Click</p>
<p><strong>Prior</strong><br />
<strong>Propriedades</strong><br />
Tag: 5</p>
<p>Name: Retorna1</p>
<p>ImageIndex: 5</p>
<p><strong>Evento</strong></p>
<p>OnClick: ToolButton1Click</p>
<p>4.  Declare as seguintes funções:</p>
<p><strong>function AcrescentarZero(sender:String;_tam:integer):String;</strong></p>
<p><strong>function TMusicas(sender:string):string;</strong></p>
<p><strong>function TFmediaplayer.AcrescentarZero(sender: string; _tam: Integer):string;</strong></p>
<p><strong>var </strong>//declare as variáveis<strong> </strong></p>
<p>x :integer;</p>
<p><strong>begin</strong></p>
<p>Result := &#8221;;</p>
<p>for x := 1 to _tam-Length(sender) do</p>
<p>Result := Result+&#8217;0&#8242;;</p>
<p>Result := Result+Sender;</p>
<p><strong>end;</strong></p>
<p><strong><br />
</strong></p>
<p><strong>function TFmediaplayer.TMusicas(sender: string):string;</strong></p>
<p><strong>var </strong>//declare as variáveis</p>
<p>mn,ms : double;</p>
<p>MPlayer1 : TMediaPlayer;</p>
<p><strong>begin</strong></p>
<p>MPlayer1 := TMediaPlayer.Create(Self);</p>
<p>MPlayer1.Parent := Self;</p>
<p>MPlayer1.Visible := False;</p>
<p>MPlayer1.close;</p>
<p>MPlayer1.FileName := sender;</p>
<p>MPlayer1.Open;</p>
<p>mn     := (MPlayer1.Frames div 100) div 60;</p>
<p>ms     := (MPlayer1.Frames div 100) mod 60;</p>
<p>result :=  FormatFloat(&#8216;00:00&#8242;, StrToInt(AcrescentarZero(FloatToStr(mn),2)+AcrescentarZero(FloatToStr(ms),2))) ;</p>
<p>FreeAndNil(MPlayer1);</p>
<p><strong>end;</strong></p>
<p><strong><br />
</strong></p>
<p><strong> </strong></p>
<p>5. Selecione o Timer: Musica  e acrescente o seguinte código:</p>
<p><strong>procedure TFmediaplayer.MusicaTimer(Sender: TObject);</strong></p>
<p><strong>var </strong>// declare as variáveis</p>
<p>x,i : integer;</p>
<p>ntempo : ttime;</p>
<p><strong>begin</strong></p>
<p>i := 0;</p>
<p>ntempo := StrtoTime(&#8216;00:00:00&#8242;);</p>
<p>for x := 0 to ListView1.items.Count-1 do</p>
<p>if ListView1.Items.Item[x].Checked then</p>
<p>begin</p>
<p>inc(i);</p>
<p>ntempo := ntempo + StrToTime(&#8216;00:&#8217;+ListView1.Items.Item[x].SubItems.Strings[0]);</p>
<p>end;</p>
<p>lbltempototal.Caption := TimeToStr(ntempo &#8211; StrToTime(&#8216;00:&#8217;+lbltempdecorrido.Caption));</p>
<p><strong>end;</strong></p>
<p><strong><br />
</strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p>6. Selecione o Timer: Tempo e adicione o código que segue:</p>
<p><strong>procedure TFmediaplayer.TempoTimer(Sender: TObject);</strong></p>
<p><strong>var </strong>// declare as varáveis</p>
<p>TheLength: LongInt;</p>
<p>mn,ms : double;</p>
<p><strong>begin</strong></p>
<p>if (MediaPlayer1.Mode = mpPlaying) then</p>
<p><strong> begin</strong></p>
<p>TrackBar1.Max      := MediaPlayer1.Length;</p>
<p>TrackBar1.Position := MediaPlayer1.Position;</p>
<p>mn           := (MediaPlayer1.Frames div 100) div 60;</p>
<p>ms           := (MediaPlayer1.Frames div 100) mod 60;</p>
<p>lblduracao.Caption  := FormatFloat(&#8216;00:00&#8242;, StrToInt(AcrescentarZero(FloatToStr(mn),2)+AcrescentarZero(FloatToStr(ms),2))) ;</p>
<p>mn    := (MediaPlayer1.Position div 1000) div 60;</p>
<p>ms    := (MediaPlayer1.Position div 1000) mod 60;</p>
<p>lbltempdecorrido.Caption       := FormatFloat(&#8216;00:00&#8242;, StrToInt(AcrescentarZero(FloatToStr(mn),2)+AcrescentarZero(FloatToStr(ms),2))) ;</p>
<p>Application.Title := lblmusica.Caption+&#8217; [ '+lbltempdecorrido.Caption+' ]&#8216;;</p>
<p>end;</p>
<p>if not (MediaPlayer1.Mode = mpPlaying) then</p>
<p>begin</p>
<p>Tempo.Enabled := False;</p>
<p>MediaPlayer1.close;</p>
<p>ListView1.Items.Item[Musicas].Checked := false;</p>
<p>if Musicas &#62;= ListView1.Items.Count-1 then</p>
<p>begin</p>
<p>MediaButn(3);</p>
<p>Exit;</p>
<p>end;</p>
<p>MediaButn(4);</p>
<p>end;</p>
<p><strong>end;</strong></p>
<p><strong><br />
</strong></p>
<p><strong> </strong></p>
<p>7. Crie o procedimento MediaButn. Neste procedimento iremos configurar os Buttons para que ao receberem o click executem os comandos de acordo com a funcionalidade de cada Button.</p>
<p><strong>Importante:</strong> Lembre de verificar a propriedade tag dos buttons se você marcou corretamente:</p>
<p>Play: tag=1; Pause: tag:2; Stop: tag=3; Next:  tag=4 e  Prior: tag=5.</p>
<p><strong>procedure TFmediaplayer.MediaButn(Sender:integer);</strong></p>
<p><strong>var </strong> //declare a variável</p>
<p>x: integer;</p>
<p><strong>begin</strong></p>
<p>Tempo.Enabled := False;</p>
<p>//estamos trabalhando com 5 buttons</p>
<p>if Sender  in [0,4,5] then</p>
<p>MediaPlayer1.close</p>
<p>Else if (Sender  in [2])  and (MediaPlayer1.Mode = mpPlaying) then</p>
<p>MediaPlayer1.Pause</p>
<p>Else if (Sender  in [3]) and (MediaPlayer1.Mode = mpPlaying) then</p>
<p>MediaPlayer1.Stop;</p>
<p>Play.Enabled  := Sender in [0,2,3];</p>
<p>Pause.Enabled := Sender in [1,4,5];</p>
<p>Stop.Enabled  := Sender in [1,4,5];</p>
<p>Next.Enabled  := Sender in [1,4,5];</p>
<p>Prior.Enabled := Sender in [1,4,5];</p>
<p>Play1.Enabled  := Sender in [0,2,3];</p>
<p>Pause1.Enabled := Sender in [1,4,5];</p>
<p>Stop1.Enabled  := Sender in [1,4,5];</p>
<p>Next1.Enabled := Sender in [1,4,5];</p>
<p>Retorna1.Enabled := Sender in [1,4,5];</p>
<p>if ListView1.Items.Count &#60;= 0 then</p>
<p>begin</p>
<p>MediaPlayer1.close;</p>
<p>AtualizaLabels;</p>
<p>exit;</p>
<p>end;</p>
<p>if Sender = 3 then</p>
<p>begin</p>
<p>TrackBar1.Max      := 0;</p>
<p>TrackBar1.Position := 0;</p>
<p>AtualizaTempo;</p>
<p>end</p>
<p>Else if Sender = 4 then</p>
<p>begin</p>
<p>inc(Musicas);</p>
<p>if Musicas &#62; ListView1.Items.Count-1 then</p>
<p>Musicas := 0;</p>
<p>end</p>
<p>Else if Sender = 5 then</p>
<p>begin</p>
<p>Dec(Musicas);</p>
<p>if Musicas &#60; 0 then</p>
<p>Musicas := 0;</p>
<p>end;</p>
<p>if Sender  in [1,4,5] then</p>
<p>begin</p>
<p>if (MediaPlayer1.Mode = mpPaused) then</p>
<p>MediaPlayer1.Play</p>
<p>else</p>
<p>begin</p>
<p>if Musicas &#60; 0 then</p>
<p>Musicas := ListView1.ItemIndex;</p>
<p>if ListView1.Items.Item[Musicas].Checked  then</p>
<p>TrackBar1.Max         := 0;</p>
<p>TrackBar1.Position    := 0;</p>
<p>MediaPlayer1.FileName := ListView1.Items.Item[Musicas].Caption;</p>
<p>lblmusica.Caption     := ExtractFileName(ListView1.Items.Item[Musicas].Caption);</p>
<p>MediaPlayer1.Open;</p>
<p>MediaPlayer1.play;</p>
<p>ListView1.ItemIndex := Musicas;</p>
<p>if Fmediaplayer.Active then</p>
<p>if pcprincipal.ActivePageIndex = 0 then</p>
<p>ListView1.SetFocus;</p>
<p>end;</p>
<p>end;</p>
<p>Tempo.Enabled := Sender  in [1,4,5];</p>
<p>RxTrayIcon1.Animated := (MediaPlayer1.Mode = mpPlaying);</p>
<p>if (MediaPlayer1.Mode = mpPaused) then</p>
<p>RxTrayIcon1.Hint := &#8216;Em Pausa&#8217;</p>
<p>else if (MediaPlayer1.Mode = mpPlaying) then</p>
<p>RxTrayIcon1.Hint := &#8216;Em Reprodução &#8211; &#8216;+lblmusica.Caption</p>
<p>else if (MediaPlayer1.Mode = mpStopped) then</p>
<p>RxTrayIcon1.Hint := &#8216;Parado&#8217;</p>
<p>else if (MediaPlayer1.Mode = mpRecording) then</p>
<p>RxTrayIcon1.Hint := &#8216;Gravando&#8217;</p>
<p>Else</p>
<p>RxTrayIcon1.Hint := &#8216;Músicas&#8217;;</p>
<p><strong>end;</strong></p>
<p><strong><br />
</strong></p>
<p>8. Adicione o  código abaixo no evento OnClick do TollButton, lembrando-se de acrescentar o código em todos os Buttons .</p>
<p><strong>proced</strong>ure TFmediaplayer.ToolButton1Click(Sender: TObject);</p>
<p>begin</p>
<p><strong>MediaButn(TToolButton(sender).tag);</strong></p>
<p><strong>end;</strong></p>
<p>Ex:</p>
<p>ToolButton1</p>
<p>Propriedade &#8211; name: Play</p>
<p>Evento   &#8211; OnClick:ToolButton1.Click</p>
<p>ToolButton2</p>
<p>Propriedade &#8211; name: Pause</p>
<p>Evento   &#8211; OnClick:ToolButton1.Click</p>
<p>.</p>
<p>.</p>
<p>.</p>
<p>9. Selecione o RxTrayIcon  e em  Eventos selecione  OnDblClick:</p>
<p><strong> </strong></p>
<p><strong>procedure TFmediaplayer.RxTrayIcon1DblClick(Sender: TObject);</strong></p>
<p><strong>begin</strong></p>
<p>Fmediaplayer.Show;</p>
<p><strong>end;</strong></p>
<p><strong><br />
</strong></p>
<p>10. Selecione o btadicionar (BitBtn do segundo Tabsheet) e adicione o código abaixo:</p>
<p><strong>procedure TFmediaplayer.btadicionarClick(Sender: TObject);</strong></p>
<p><strong>var</strong></p>
<p>arquivo:string;</p>
<p>x:integer;</p>
<p><strong>begin</strong></p>
<p>for x := 0 to FileListBox1.Items.Count-1 do</p>
<p>if FileListBox1.Selected[x] then</p>
<p>begin</p>
<p>arquivo:= DirectoryListBox1.Directory+&#8217;\'+FileListBox1.Items.Strings[x];</p>
<p>ListView1.AddItem(arquivo,ListView1);</p>
<p>ListView1.Items.Item[ListView1.Items.Count-1].SubItems.Add(TMusicas(arquivo));</p>
<p>ListView1.Items.Item[ListView1.Items.Count-1].Checked := true;</p>
<p>end;</p>
<p>//AtuaTempo;</p>
<p>if not (MediaPlayer1.Mode = mpPlaying) then</p>
<p>begin</p>
<p>ListView1.ItemIndex := 0;</p>
<p>MediaButn(0);</p>
<p>end;</p>
<p>end;</p>
<p>11. Selecione o form (pcprincipal) , selecione Eventos e clique em  OnClose para adicionar o código abaixo:</p>
<p><strong>procedure TFmediaplayer.FormClose(Sender: TObject; var Action: TCloseAction);</strong></p>
<p><strong>begin</strong></p>
<p>pcprincipal.ActivePageIndex := 0;</p>
<p>Action := caNone;</p>
<p>Hide;</p>
<p><strong>end;</strong></p>
<p><strong><br />
</strong></p>
<p>12. Ainda em eventos do form, selecione OnCreate e adicione o código que segue:</p>
<p><strong>procedure TFmediaplayer.FormCreate(Sender: TObject);</strong></p>
<p><strong>begin</strong></p>
<p>RxTrayIcon1.ShowDesign := True;</p>
<p>MediaPlayer1 := TMediaPlayer.Create(Self);</p>
<p>MediaPlayer1.Parent := Self;</p>
<p>MediaPlayer1.Visible := False;</p>
<p><strong>end;</strong></p>
<p><strong><br />
</strong></p>
<p>13. Ainda  no component ListView1, selecione o evento OnKeyDown e adicione o código:</p>
<p><strong> </strong></p>
<p><strong>procedure TFmediaplayer.ListView1KeyDown(Sender: TObject; var Key: Word;</strong></p>
<p><strong> Shift: TShiftState);</strong></p>
<p><strong> var</strong></p>
<p>MesmaMusica : bool;</p>
<p>x : integer;</p>
<p><strong>begin</strong></p>
<p>if key = 46 then</p>
<p>begin</p>
<p>MesmaMusica := (lblmusica.Caption = ListView1.Items.Item[Musicas].Caption);</p>
<p>if (MediaPlayer1.Mode = mpPlaying) and (Mesmamusica) then</p>
<p>MediaButn(3);</p>
<p>ListView1.DeleteSelected;</p>
<p>if (MediaPlayer1.Mode = mpStopped) and (Mesmamusica) then</p>
<p>MediaButn(4);</p>
<p>if ListView1.Items.Count = 0 then</p>
<p>Musicas := 0;</p>
<p>end;</p>
<p><strong>end;</strong></p>
<p><strong><br />
</strong></p>
<p>14. Adicione o código abaixo no componente  ListView1 (primeira TabSheet) utilizando o  Evento OnClick .</p>
<p><strong> </strong></p>
<p><strong>procedure TFmediaplayer.ListView1Click(Sender: TObject);</strong></p>
<p><strong>begin</strong></p>
<p>MediaButn(3);</p>
<p>if ListView1.ItemIndex &#62;= 0 then</p>
<p>begin</p>
<p>Musicas := ListView1.ItemIndex ;</p>
<p>MediaButn(1);</p>
<p>end;</p>
<p><strong>end;</strong></p>
<p><strong><br />
</strong></p>
<p>Com o intuito de facilitar o estudo, estou disponibilizando o arquivo do projeto com código fonte  e o compenente RxLib &#8211;  Delphi 2009 para download. Qualquer problema com o link de download , entrem  em contato utilizando o formulário de comentários.</p>
<p><strong>Download:</strong></p>
<p><a title="Projeto MediaPlayer Delphi 2009" href="http://www.megaupload.com/?d=PPD6AZRA" target="_self">Projeto MediaPlayer Delphi 2009</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Delphi coders needed by tinaramika]]></title>
<link>http://outsourcedjobs.wordpress.com/2009/11/17/delphi-coders-needed-by-tinaramika/</link>
<pubDate>Tue, 17 Nov 2009 06:28:55 +0000</pubDate>
<dc:creator>ejazazeem</dc:creator>
<guid>http://outsourcedjobs.wordpress.com/2009/11/17/delphi-coders-needed-by-tinaramika/</guid>
<description><![CDATA[Company is looking for experts in Delphi for single project. Candidates must be fast and had at leas]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Company is looking for experts in Delphi for single project. Candidates must be fast and had at least 3 years of experience. (Budget: $750-1500, Jobs: Delphi)<br /> <a href="http://www.getafreelancer.com/projects/mea_552340.html"><b>Bid on this project</b></a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[GM Reports $1.2B Loss: What's Next for the Volt?]]></title>
<link>http://earth2tech.com/2009/11/16/gm-reports-1-2b-loss-whats-next-for-the-volt/</link>
<pubDate>Mon, 16 Nov 2009 22:46:13 +0000</pubDate>
<dc:creator>Josie Garthwaite</dc:creator>
<guid>http://earth2tech.com/2009/11/16/gm-reports-1-2b-loss-whats-next-for-the-volt/</guid>
<description><![CDATA[General Motors trotted out preliminary financial results for the first time this morning since it sl]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>General Motors trotted out preliminary financial results for the first time this morning since it <a href="http://earth2tech.com/2009/07/10/gm-gets-a-fresh-start-will-green-innovation-rise-from-the-ashes/">sloughed off bad assets to the government and emerged from bankruptcy</a> this summer: GM saw a net loss of $1.15 billion between July 10 and September 30 of this year, but ended the quarter with $42.6 billion in cash on hand (cash and marketable securities), according to <a href="http://media.gm.com/content/media/us/en/news/news_detail.brand_gm.html/content/Pages/news/us/en/2009/Nov/1116_earnings">the company&#8217;s reporting</a>, which has not been audited and <a href="http://www.forbes.com/2009/11/16/general-motors-debt-business-autos-gm.html">does not comply with GAAP standards</a>.</p>
<p>Much of GM&#8217;s cash reserves have been earmarked for existing expenses, including payments to parts supplier Delphi, but as David Welch <a href="http://www.businessweek.com/bwdaily/dnflash/content/nov2009/db20091116_872906.htm">notes</a> over on BusinessWeek, the automaker is now &#8220;closer to making money than it has been for years.&#8221; That milestone can&#8217;t come too soon for GM. The extended-range electric Chevy Volt, which GM gave a starring role in its financial viability plans, is now closing in on a <a href="http://www.chevrolet.com/pages/open/default/future/volt.do">late-2010 commercial launch</a> that&#8217;s <a href="http://earth2tech.com/2009/03/31/new-gm-ceo-higher-margins-needed-to-make-next-gen-cars/">likely to be anything but a money-maker</a> in the near term.</p>
<p><img class="alignnone size-full wp-image-45580" title="chevy-volt-sunset" src="http://earth2tech.wordpress.com/files/2009/11/chevy-volt-sunset.jpg" alt="" width="553" height="367" /><!--more--></p>
<p>In addition, having ditched the Hummer, Subaru, Pontiac and Saturn brands, GM is <a href="http://www.autonews.com/apps/pbcs.dll/article?AID=/20091010/ANA02/910109998/1261&#38;AssignSessionID=373364936610754">banking on new models under the Chevrolet nameplate</a> (including the Volt, the 40 MPG Cruze compact and the automaker’s first minicar, the Spark) to help boost sales.</p>
<p>GM said today the company will be able to start repaying government loans in December &#8212; more than five years ahead of schedule. Don&#8217;t expect the company to finish the year with a bang, however: GM <a href="http://media.gm.com/content/media/us/en/news/news_detail.brand_gm.html/content/Pages/news/us/en/2009/Nov/1116_earnings">anticipates</a> negative cash flows in the fourth quarter of this year as it makes payments to Delphi, the governments of Canada, Ontario, the U.S. and Germany and continues restructuring. Plus, <a href="http://money.cnn.com/news/newsfeeds/articles/djf500/200911161222DOWJONESDJONLINE000269_FORTUNE5.htm">Dow Jones Newswires</a> reports that while &#8220;GM&#8217;s spending on marketing and new-product development came to a virtual standstill during its bankruptcy proceedings,&#8221; the automaker plans to ramp up spending on advertising and engineering this year.</p>
<p>Lux Research analyst Jacob Grose told us this summer, on Day 1 of the New GM, he sees an “inherent contradiction” between the company’s very ambitious and expensive push to launch the Volt late next year and its relatively shaky bottom line.</p>
<p>But if the <a href="http://earth2tech.com/2009/08/12/cheat-sheet-truth-about-sky-high-mpg-claims-for-electric-hybrid-and-mini-cars/">pervasive 230 MPG campaign</a> GM rolled out for the Volt earlier this year provides any hints, we can expect the Volt &#8212; already an <a href="http://www.nytimes.com/2008/11/22/business/22volt.html?_r=2&#38;scp=1&#38;sq=Volt&#38;st=cse">estimated billion-plus-dollar</a> investment for the company &#8212; to get a fat slice of the automaker&#8217;s advertising budget in coming months, as it tries to cast a green glow across its lineup and <a href="http://earth2tech.com/2009/10/13/gm-nears-moment-of-truth-for-chevy-volt-as-green-halo/">gain an edge in segments where GM sees some of the highest growth potential</a>: young and environmentally-motivated car buyers.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Quick References Cards]]></title>
<link>http://processolinux.wordpress.com/2009/11/16/quick-references-cards/</link>
<pubDate>Mon, 16 Nov 2009 15:18:21 +0000</pubDate>
<dc:creator>assolan</dc:creator>
<guid>http://processolinux.wordpress.com/2009/11/16/quick-references-cards/</guid>
<description><![CDATA[http://www.cheat-sheets.org/ Site com várias referências rápidas em pdf. O objetivo dos cheat sheets]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a title="http://www.cheat-sheets.org/" href="http://www.cheat-sheets.org/" target="_blank">http://www.cheat-sheets.org/</a></p>
<p>Site com várias referências rápidas em pdf. O objetivo dos <a title="http://en.wikipedia.org/wiki/Cheat_sheet" href="http://en.wikipedia.org/wiki/Cheat_sheet" target="_blank">cheat sheets</a> é criar uma referência rápida de cada linguagem de programação. Há referências para boa parte das linguagens existentes, como: C, C#, C++, Tex, PHP, SQL, VIM, Linux, Delphi entre outros.</p>
<p>Vale a pena dar uma conferida.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Mempercantik Tampilan Form dengan Hint]]></title>
<link>http://sabdowaluyo.wordpress.com/2009/11/16/mempercantik-tampilan-form-dengan-hint/</link>
<pubDate>Mon, 16 Nov 2009 08:52:06 +0000</pubDate>
<dc:creator>sabdowaluyo</dc:creator>
<guid>http://sabdowaluyo.wordpress.com/2009/11/16/mempercantik-tampilan-form-dengan-hint/</guid>
<description><![CDATA[Tips &amp; Trik Delphi, Tips Belajar Delphi, Belajar Delphi Online unit Unit1; &nbsp; interface uses]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><table border="1" cellspacing="0" cellpadding="5" width="474" bgcolor="black">
<tbody>
<tr style="text-align:center;" valign="middle">
<td><span style="color:#ffffff;"><strong>Tips &#38; Trik Delphi, Tips Belajar Delphi, Belajar Delphi Online</strong><strong><br />
</strong></span></td>
<td align="right"></td>
</tr>
</tbody>
</table>
<table border="1" cellspacing="0" cellpadding="5" width="474" bgcolor="#ffff99">
<tbody>
<tr valign="middle">
<td>unit <strong>Unit1;</strong><strong> </strong>
<p>&#160;</p>
<p><strong>interface</strong><br />
<strong><br />
uses</strong><br />
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,<br />
Dialogs, StdCtrls, ComCtrls;</p>
<p><strong>type</strong><br />
TForm1 = <strong>class</strong>(TForm)<br />
Button1: TButton;<br />
Button2: TButton;<br />
Button3: TButton;<br />
Button4: TButton;<br />
Label1: TLabel;<br />
StatusBar1: TStatusBar;<br />
<strong>procedure</strong> FormCreate(Sender: TObject);<br />
<strong>procedure</strong> tampilkanhint(Sender: TObject);<br />
<strong></strong><br />
<strong>private</strong><br />
<span style="color:#ff0000;">{ Private declarations }</span><br />
<strong>public</strong><br />
<span style="color:#ff0000;">{ Public declarations }</span><br />
<strong>end;</strong></p>
<p><strong>var</strong><br />
Form1: TForm1;</p>
<p><strong>implementation</strong></p>
<p><span style="color:#ff0000;">{$R *.dfm}</span></p>
<p><strong>procedure</strong> TForm1.tampilkanhint(Sender: TObject);<br />
<strong>begin</strong><br />
label1.Caption:=application.Hint;<br />
StatusBar1.SimpleText:=application.Hint;<br />
caption:=application.Hint;<br />
<strong>end;</strong><br />
<strong><br />
procedure</strong> TForm1.FormCreate(Sender: TObject);<br />
<strong>begin</strong><br />
application.ShowHint:=true;<br />
application.OnHint:=tampilkanhint;<br />
<strong>end;</strong><br />
<strong><br />
end.</strong></td>
</tr>
</tbody>
</table>
<table border="1" cellspacing="0" cellpadding="5" width="474" bgcolor="black">
<tbody>
<tr style="text-align:center;" valign="middle">
<td><span style="color:#ffffff;"><strong>TransCODE Software<br />
</strong></span></td>
<td align="right"></td>
</tr>
</tbody>
</table>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Coding Untuk Mengosongkan Table di Delphi]]></title>
<link>http://rudisans.wordpress.com/2009/11/16/coding-untuk-mengosongkan-table-di-delphi/</link>
<pubDate>Mon, 16 Nov 2009 04:02:34 +0000</pubDate>
<dc:creator>rudisans</dc:creator>
<guid>http://rudisans.wordpress.com/2009/11/16/coding-untuk-mengosongkan-table-di-delphi/</guid>
<description><![CDATA[Sambil coba share sedikit yang saya tahu, ini merupakan coding delphi untuk mengosongkan/menghapus i]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Sambil coba share sedikit yang saya tahu, ini merupakan coding delphi untuk mengosongkan/menghapus isi table sekaligus. Persiapkan sebuah Form, Table (paradox) yang telah diisi data, DBGRID dan Button. Ini coding selengkapnya.</p>
<p><em>procedure TFrm_SPK.Button3Click(Sender: TObject);<br />
begin<br />
tb_spk_temp.Close;<br />
tb_spk_temp.EmptyTable;<br />
tb_spk_temp.Active:=true;<br />
tb_spk_temp.Refresh;<br />
end;</em></p>
<p>Catatan : agar tidak terjadi error maka program dijalankan pada file executable nya setelah menutup program delphi nya <em><br />
</em></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Descobrindo Senha de Hotmail e Trojan em Delphi]]></title>
<link>http://igluh.wordpress.com/2009/11/15/descobrindo-senha-de-hotmail-e-trojan-em-delphi/</link>
<pubDate>Sun, 15 Nov 2009 20:42:49 +0000</pubDate>
<dc:creator>Marcell</dc:creator>
<guid>http://igluh.wordpress.com/2009/11/15/descobrindo-senha-de-hotmail-e-trojan-em-delphi/</guid>
<description><![CDATA[Gente, achei dois artigos muito interessantes no site invasao.com.br. O primeiro fala como descobrir]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Gente, achei dois artigos muito interessantes no site invasao.com.br. O primeiro fala como descobrir senha do hotmail através de engenharia social e outros métodos, o segundo fala de como montar um trojan em delphi sem conhecimento avançado necessário.</p>
<p>Você pode ler os artigos acima nestes links:</p>
<p>http://www.invasao.com.br/2008/02/17/descobrindo-senha-de-hotmail/</p>
<p>http://www.invasao.com.br/2008/03/08/como-montar-um-trojan-em-delphi-sem-saber-nada/</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Fazendo seu Code Injection]]></title>
<link>http://codersgroup.wordpress.com/2009/11/15/fazendo-seu-code-injection/</link>
<pubDate>Sun, 15 Nov 2009 20:38:45 +0000</pubDate>
<dc:creator>Marcell</dc:creator>
<guid>http://codersgroup.wordpress.com/2009/11/15/fazendo-seu-code-injection/</guid>
<description><![CDATA[Visto que é algo muito util e um pouco complicado estarei postando como fazer passo a passo. Então v]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Visto que é algo muito util e um pouco complicado estarei postando como fazer passo a passo.<br />
Então vamos começar.</p>
<p><strong>Dica:</strong><br />
Para quem não esta acostumado e sequer sabe sobre manipulação de memória recomendo que de uma boa lida em artigos sobre manipulação de memória para que haja uma facilidade de entendimento ao seguir a leitura do tutorial.</p>
<p><strong>O que é Code Injection?<br />
</strong>Code injection nada mais é do que injetar uma DLL e fazer com que o processo remoto execute a tal função.<br />
Para fazer isso precisaremos de uma DLL que a função em seja exportada<br />
Ex:no delphi o fim do código seria</p>
<blockquote><p>exports<br />
FazerExitProcess;
</p></blockquote>
<p>Outro detalhe importante é que precisaremos de privilégios necessários.Para evitar quaisquer eventuais problemas, definiremos o privilégio como o de debug e tambem depois de executada a rotina, não temos mais porque deixar os parametros utilizados na execução da mesma no target, isso só iria ocupar espaço, então nós liberaremos toda a memória escrita no processo remoto.</p>
<p><strong>Preparando um Code Injection<br />
</strong><br />
Antes de mais nada precisaremos de uma estrutura para os parametros do nosso Code Injection então declare<br />
a seguinte type no seu form.</p>
<blockquote><p>type<br />
TInjectParams = record<br />
LoadLibrary: function (lpLibFileName: PAnsiChar): Cardinal; stdcall;<br />
LibName: PAnsiChar;<br />
GetProcAddress: function (hModule: Cardinal; lpProcName: PAnsiChar): Pointer; stdcall;<br />
ProcName: PAnsiChar;<br />
end;<br />
PInjectParams = ^TInjectParams;
</p></blockquote>
<p>Com essa estrutura,o usuário no final do code injection só precisará de pegar o Process ID(PID) do processo,Portanto declare na <strong>uses</strong> da sua unit a biblioteca TlHelp32 e nas funções declare a seguinte função.</p>
<blockquote><p>function GetProcess(proc: string): Cardinal;<br />
var<br />
Snap: THandle;<br />
pe: TProcessEntry32;<br />
begin<br />
Snap:=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);<br />
if Snap = 0 then Exit;<br />
if Process32First(Snap,pe) then<br />
begin<br />
repeat<br />
if proc = pe.szExeFile then<br />
begin<br />
Result:=pe.th32ProcessID;<br />
break;<br />
end;<br />
until not Process32Next(Snap,pe)<br />
end<br />
end;
</p></blockquote>
<p>Como ja foi dito,nos precisaremos de escrever na memória do processo remoto,portanto é necessário alocar a memória para a escrita,para facilitar vamos declarar as funções.</p>
<blockquote><p>function WriteString(Process: Cardinal; s: string): Pointer;<br />
var<br />
bytes: Cardinal;<br />
begin<br />
Result:=VirtualAllocEx(Process, nil, length(s) + 1, MEM_COMMIT or MEM_RESERVE, PAGE_EXECUTE_READWRITE);<br />
WriteProcessMemory(Process, Result , pchar(s), length(s) + 1, bytes);<br />
end;<br />
function WriteData(Process, dwSize: Cardinal; RemoteData: pointer): pointer;<br />
var<br />
bytes: Cardinal;<br />
begin<br />
Result:=VirtualAllocEx(Process, nil, dwSize, MEM_COMMIT or MEM_RESERVE, PAGE_EXECUTE_READWRITE);<br />
WriteProcessMemory(Process, Result, RemoteData, dwSize, bytes);<br />
end;
</p></blockquote>
<p>Com quase tudo pronto nós precisaremos de uma função para executar o código no processo remoto então declare mais essa função também.</p>
<blockquote><p>procedure RemoteFunction(Parametros: PInjectParams); stdcall;<br />
var<br />
proc: procedure; stdcall;<br />
begin<br />
proc:=Parametros^.GetProcAddress(Parametros^.LoadLibrary(Parametros^.LibName),Parametros^.ProcName);<br />
proc;<br />
end;
</p></blockquote>
<p>Agora precisaremos de um método para saber o tamanho dessa rotina descrita acima, pois na hora de escrevê-la no target é necessário por o tamanho. Para isso faremos outro método logo abaixo desse, e depois é só pegar o endereço dele e subtrair do endereço da rotina “RemoteFunction”.<br />
Então declare o procedimento :</p>
<blockquote><p>procedure RemoteFunctionEnd; stdcall;<br />
begin;<br />
end;
</p></blockquote>
<p>E como ja foi dito nos preciaremos de privilégios de DEBUG então declare a função.</p>
<blockquote><p>procedure ChangePrivilege(szPrivilege: PChar; fEnable: Boolean);<br />
var<br />
NewState: TTokenPrivileges;<br />
luid: TLargeInteger;<br />
hToken: THandle;<br />
ReturnLength: DWord;<br />
begin<br />
OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, hToken);<br />
LookupPrivilegeValue(nil, szPrivilege, luid);</p>
<p>NewState.PrivilegeCount := 1;<br />
NewState.Privileges[0].Luid := luid;<br />
if (fEnable) then<br />
NewState.Privileges[0].Attributes := SE_PRIVILEGE_ENABLED<br />
else<br />
NewState.Privileges[0].Attributes := 0;</p>
<p>AdjustTokenPrivileges(hToken, False, NewState, SizeOf(NewState), nil, ReturnLength);<br />
CloseHandle(hToken);<br />
end;
</p></blockquote>
<p>Pronto, agora só falta montar a função final, mas depois de tudo isso, para quem realmente entendeu a lógica fica fácil.</p>
<blockquote><p>pprocedure Inject(process, dll, code: string);<br />
var<br />
PID, hProcess, ThreadId, ThreadHandle: Cardinal;<br />
RemoteData,RemoteFunc,LibFileName,ProcName: pointer;<br />
Parametros: TInjectParams;<br />
begin<br />
//Pega o Handle do processo<br />
PID:=GetProcess(Process);<br />
//Seta o privilégio de debug<br />
ChangePrivilege(’SeDebugPrivilege’, True);</p>
<p>//Abre o processo<br />
hProcess := OpenProcess(PROCESS_ALL_ACCESS, False, PID);</p>
<p>//Define os parâmetros que serão usados para executar a procedure<br />
LibFileName:=WriteString(hProcess, dll);<br />
ProcName:=WriteString(hProcess, code);<br />
Parametros.LoadLibrary:=GetProcAddress(GetModuleHandle(’kernel32′), ‘LoadLibraryA’);<br />
Parametros.LibName:=LibFileName;<br />
Parametros.GetProcAddress:=GetProcAddress(GetModuleHandle(’kernel32′), ‘GetProcAddress’);<br />
Parametros.ProcName:=ProcName;</p>
<p>//Abre um novo espaço de memória para guardar os parâmetros<br />
RemoteData:=WriteData(hProcess, sizeof(Parametros), @Parametros);</p>
<p>//Abre um novo espaço de memória para guardar a procedure<br />
RemoteFunc:=WriteData(hProcess, integer(@RemoteFunctionEnd) – integer(@RemoteFunction), @RemoteFunction);</p>
<p>//Cria a thread que executará a procedure<br />
ThreadHandle:=CreateRemoteThread(hProcess, nil, 0, RemoteFunc, RemoteData, 0, ThreadId);<br />
WaitForSingleObject(ThreadHandle, 3000);</p>
<p>//Libera as alocações de memórias criadas<br />
VirtualFreeEx(hProcess,LibFileName,0,MEM_RELEASE);<br />
VirtualFreeEx(hProcess,ProcName,0,MEM_RELEASE);<br />
VirtualFreeEx(hProcess,RemoteFunc,0,MEM_RELEASE);<br />
VirtualFreeEx(hProcess,RemoteData,0,MEM_RELEASE);<br />
end;
</p></blockquote>
<p>Agora chegou a parte que você ira realizar o code injection.<br />
Como ja foi dito precisaremos de uma DLL com uma função que seja exportada então salve todo o seu projeto e crie um novo projeto de DLL.vou mostrar como ficou a minha dll de testes</p>
<blockquote><p>library testdll;<br />
uses<br />
Windows,<br />
SysUtils,<br />
Classes;</p>
<p>{$R *.res}</p>
<p>procedure MsgBox;<br />
begin<br />
MessageBox(0,’Funcionou’,&#8217;Code Injection bem sucedido’,MB_OK+MB_ICONINFORMATION);<br />
end;<br />
exports<br />
MsgBox;<br />
begin<br />
end.
</p></blockquote>
<p>Então agora é só no seu projeto do Injector você usar a função.</p>
<blockquote><p>Inject(&#8216;notepad.exe&#8217;,'C:\Dev\CodeInjection\testdll\testdll.dll&#8217;,'MsgBox&#8217;);
</p></blockquote>
<p>Agora pra quem não entendeu direito,ou não quer nem ler e quer tudo pronto eu coloquei um link com a source do injector e da testdll<br />
http://www.4shared.com/file/101714263/63913ea/CodeInjection.html</p>
<p><em>Créditos: R0DR1G0.</em></p>
</div>]]></content:encoded>
</item>

</channel>
</rss>
