<?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>sqlite &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/sqlite/</link>
	<description>Feed of posts on WordPress.com tagged "sqlite"</description>
	<pubDate>Sun, 29 Nov 2009 10:16:05 +0000</pubDate>

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

<item>
<title><![CDATA[We call it OPA]]></title>
<link>http://dutherenverseauborddelatable.wordpress.com/2009/11/28/we-call-it-opa/</link>
<pubDate>Sat, 28 Nov 2009 19:15:55 +0000</pubDate>
<dc:creator>yoric</dc:creator>
<guid>http://dutherenverseauborddelatable.wordpress.com/2009/11/28/we-call-it-opa/</guid>
<description><![CDATA[Web applications are nice. They&#8217;re useful, they&#8217;re cross-platform, users need no install]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p style="text-align:justify;">Web applications are nice. They&#8217;re useful, they&#8217;re cross-platform, users need no installation, no upgrades, no maintenance, not even the computing or storage power to which they are used. As weird as it may sound, I&#8217;ve even seen announcements for web applications supposed to run your games on distant high-end computers so that you can actually play on low-end computers. Go web application!</p>
<p style="text-align:justify;">Of course, there are a few downsides to web applications. Firstly, they require a web connexion. Secondly, they are largely composed of <em>plumbing</em>. Finally, ensuring their security is a constant fight.</p>
<p><!--more--></p>
<h3>How many pipes do you need?</h3>
<p style="text-align:justify;">If you have ever developed a web application, you know what I mean by plumbing: just writing an online TODO list &#8212; the equivalent of maybe twenty minutes of work in Visual Basic, in Python, Java or Objective-C &#8212; requires mixing an insane amount of languages, to define your user interface (HTML, JavaScript, CSS), to define your storage (DDL, DML, DCL, plus possibly an ORM language), to get your server and your client to communicate (XML, more JavaScript, PHP or one of its competitors, as well as some HTTP and a little MIME configuration), to launch your application (whichever configuration languages are used by your server). Of course, if your application is a bit more complex and requires something like compatibility with smartphones, or like distant storage, or distributed computing, or backups, or modularity (in the world of the web, it&#8217;s called &#8220;web services&#8221;)&#8230; well, you will probably require a few additional languages.</p>
<p style="text-align:justify;">All of this is just <em>plumbing</em>. Only once you have written it can you concentrate on the core of the application. And once the application is written, the pain is just starting, because chances are that your application can be attacked by hijacking the link between your user interface and the core (cross-site scripting) or between the core and the storage (SQL injection) or by keeping the user interface and replacing the application core (man-in-the-middle attacks) or by replacing the user interface by a malicious client or by taking the place of a currently connected user to steal some of its credentials (rebinding) or by taking advantage of low-level bugs (buffer over/underflows), etc.</p>
<p style="text-align:justify;">None of this is a show-stopper, of course &#8212; just take a look at the web and you will see thousands of web applications. Just like the complexity of Software Development Kits in the early days of Windows, MacOS or X didn&#8217;t stop adventurous hackers from developing desktop applications. But of course, if twenty-five years of desktop application development have taught us one thing, it is that the life of developers can be made easier. Nowadays, a few generations of SDKs later, Windows developers have .Net, C# and Visual Studio, Macintosh developers have Cocoa, Objective-C and XCode, while X-based developers have the libraries of Gnome/KDE, Python and a variety of programming environments. The growing popularity (and libraries) of Haskell, F#, OCaml, Scala and other functional programming languages could mean that one of the next generations of SDKs will increase safety and security.</p>
<p style="text-align:justify;">The web hasn&#8217;t quite reached that stage yet. Even the state-of-the-art in web frameworks only provides features slightly more advanced than early Windows/Mac/X SDKs: low-level bindings for low-level mechanisms, designed to ensure low-level properties. Or, rephrased differently, in the current state of web development, GMail, Google Maps or Facebook are still considered complicated applications, although they are conceptually quite simple and should therefore be equally simple to implement.</p>
<p style="text-align:justify;">We can do better. How? By removing the need for plumbing. By providing automated mechanisms for ensuring high-level security properties. By providing language support for common patterns.</p>
<h3>Enter OPA</h3>
<p style="text-align:justify;">Let me introduce OPA. OPA, or One Pot Application, is a complete development platform for web applications and web services. Development in OPA requires no plumbing. Applications developed with OPA are automatically checked for safety and security before they are executed. Applications developed with OPA are automatically (and provably) immune to cross-site scripting, to SQL injections and to most existing forms of attacks. And OPA provides language support for storage, communication between client and server (Ajax and Comet), concurrency, distribution, mobility, etc.</p>
<p style="text-align:justify;">With OPA, we intend to skip several generations of SDKs and provide right now a high-level and modern programming platform. OPA has been 6 years in the making: 4 years of sketches, mockups and prototypes as part of academic research projects and 2 years of actual implementation at <a href="http://www.mlstate.com">MLstate</a>. A few days ago, OPA has officially entered <em>demonstrable</em> status. Not quite ready for prime time, but definitely usable for development. Do you want to write an online note-taking application? That&#8217;s about 20 lines of code, from scratch. A minimal chat? About 30 lines. A multi-channel, distributed chat? About 80 lines. A minesweeper? About 100. We&#8217;re using it to develop utilities, content management systems, tools for administrations and games.</p>
<p style="text-align:justify;">Pre-alpha builds of OPA have been distributed to selected partners. A public version will be made available within a few weeks, as well as commercial applications developed with OPA. In the meantime, we are busy improving the syntax, completing the standard library, making error messages intelligible, fixing the bugs and extending the range of safety and security checks.</p>
<p style="text-align:justify;">In the meantime, you can take a look at <a href="http://vidiowiki.com/watch/t53c29y/">a video</a> recorded during ICFP presenting OPA and MLstate.</p>
<p style="text-align:justify;">Stay tuned.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Multi-table example in C using Sqlite3]]></title>
<link>http://sreenivasprabhu.wordpress.com/2009/11/28/multi-table-example-in-c-using-sqlite3/</link>
<pubDate>Sat, 28 Nov 2009 11:28:20 +0000</pubDate>
<dc:creator>sreenivasprabhu</dc:creator>
<guid>http://sreenivasprabhu.wordpress.com/2009/11/28/multi-table-example-in-c-using-sqlite3/</guid>
<description><![CDATA[Objective: The aim of this write-up is to show how easy it is to create table in sqlite table in C. ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><strong>Objective:</strong><br />
The aim of this write-up is to show how easy it is to create table in sqlite table in C. The  example below show how you can create/ open a DB file, create multiple table, Insert &#38; retrieve records.</p>
<p><strong>Getting Started:</strong></p>
<p><strong></strong>Libraies you might require<br />
libslqite3-development package<br />
In ubuntu you could install it with the help of apt-get<br />
<strong>CMD</strong>:    sudo apt-get install libsqlite3-dev</p>
<p>To view the Db file you can use sqlitebrowser<br />
<strong>CMD:</strong> sudo apt-get install sqlitebrowser</p>
<p><strong></strong><strong>Quick Summary:</strong><br />
a. Line 49 Show how to open/create a DB file<br />
b. Line 65, 76 create new table UserMenu &#38; SettingsMenu<br />
c. Line 80-84 , 86-90 Show how to insert into the database.<br />
d. Line 104-133 : Sow how to reteve the data<br />
f. Line 136: Finaly, show how to close the DB.</p>
<p><strong>Source</strong></p>
<pre><a name="line1">  1</a> <span style="color:#444444;"><em>/******************************************************************************
<a name="line2">  2</a>  *  To Compile:                                                               *
<a name="line3">  3</a>  *  !gcc -o sql_multitable_sample sql_multitable_sample.c  -Wall -W           *
<a name="line4">  4</a>  *                                 -O2 -Wl,-R/usr/local/lib -lsqlite3         *
<a name="line5">  5</a>  *  Create multiple tables in a file and adding new rows to the table.        *
<a name="line6">  6</a>  *  Added callback function for the sql exec function to handle the query     *
<a name="line7">  7</a>  *  results.                                                                  *
<a name="line8">  8</a>  ******************************************************************************/</em></span>
<a name="line9">  9</a>
<a name="line10"> 10</a>
<a name="line11"> 11</a> <span style="color:#0000ff;"><strong>#include<span style="color:#008000;">&#60;stdio.h&#62;</span></strong></span>
<a name="line12"> 12</a> <span style="color:#0000ff;"><strong>#include<span style="color:#008000;">&#60;sqlite3.h&#62;</span></strong></span>
<a name="line13"> 13</a> <span style="color:#0000ff;"><strong>#include<span style="color:#008000;">&#60;stdlib.h&#62;</span></strong></span>
<a name="line14"> 14</a>
<a name="line15"> 15</a> <span style="color:#444444;">/* Callback called when the query is exceuted */</span>
<a name="line16"> 16</a> <strong>static</strong> <strong>int</strong> <span style="color:#2040a0;">callback</span><span style="color:#4444ff;">(</span><strong>void</strong> <span style="color:#4444ff;">*</span><span style="color:#2040a0;">NotUsed</span>, <strong>int</strong> <span style="color:#2040a0;">argc</span>, <strong>char</strong> <span style="color:#4444ff;">*</span><span style="color:#4444ff;">*</span><span style="color:#2040a0;">argv</span>, <strong>char</strong> <span style="color:#4444ff;">*</span><span style="color:#4444ff;">*</span><span style="color:#2040a0;">azColName</span><span style="color:#4444ff;">)</span>
<a name="line17"> 17</a> <span style="color:#4444ff;"><strong>{</strong></span>
<a name="line18"> 18</a> 	<span style="color:#2040a0;">printf</span> <span style="color:#4444ff;">(</span><span style="color:#008000;">"<span style="color:#77dd77;">\n</span> ******** Inside Callback<span style="color:#77dd77;">\n</span>"</span><span style="color:#4444ff;">)</span><span style="color:#4444ff;">;</span>
<a name="line19"> 19</a> 	<strong>int</strong> <span style="color:#2040a0;">i</span><span style="color:#4444ff;">;</span>
<a name="line20"> 20</a> 	<strong>int</strong> <span style="color:#2040a0;">rowpr</span><span style="color:#4444ff;">=</span><span style="color:#2040a0;">argc</span><span style="color:#4444ff;">-</span><span style="color:#ff0000;">1</span><span style="color:#4444ff;">;</span>
<a name="line21"> 21</a> 	<span style="color:#2040a0;">NotUsed</span><span style="color:#4444ff;">=</span><span style="color:#ff0000;">0</span><span style="color:#4444ff;">;</span>
<a name="line22"> 22</a> 	<span style="color:#2040a0;">printf</span><span style="color:#4444ff;">(</span><span style="color:#008000;">"<span style="color:#77dd77;">\n</span> %s "</span>,<span style="color:#2040a0;">__FUNCTION__</span><span style="color:#4444ff;">)</span><span style="color:#4444ff;">;</span>
<a name="line23"> 23</a> 	<strong>for</strong><span style="color:#4444ff;">(</span><span style="color:#2040a0;">i</span><span style="color:#4444ff;">=</span><span style="color:#ff0000;">0</span><span style="color:#4444ff;">;</span> <span style="color:#2040a0;">i</span><span style="color:#4444ff;">&#60;</span><span style="color:#2040a0;">rowpr</span><span style="color:#4444ff;">;</span> <span style="color:#2040a0;">i</span><span style="color:#4444ff;">+</span><span style="color:#4444ff;">+</span><span style="color:#4444ff;">)</span>
<a name="line24"> 24</a> 		<span style="color:#2040a0;">printf</span><span style="color:#4444ff;">(</span><span style="color:#008000;">"%s "</span>,<span style="color:#2040a0;">azColName</span><span style="color:#4444ff;">[</span><span style="color:#2040a0;">i</span><span style="color:#4444ff;">]</span><span style="color:#4444ff;">)</span><span style="color:#4444ff;">;</span>
<a name="line25"> 25</a>
<a name="line26"> 26</a> 	<span style="color:#2040a0;">printf</span><span style="color:#4444ff;">(</span><span style="color:#008000;">"%s<span style="color:#77dd77;">\n</span>"</span>,<span style="color:#2040a0;">azColName</span><span style="color:#4444ff;">[</span><span style="color:#2040a0;">rowpr</span><span style="color:#4444ff;">]</span><span style="color:#4444ff;">)</span><span style="color:#4444ff;">;</span>
<a name="line27"> 27</a>
<a name="line28"> 28</a>
<a name="line29"> 29</a>
<a name="line30"> 30</a> 	<strong>for</strong><span style="color:#4444ff;">(</span><span style="color:#2040a0;">i</span><span style="color:#4444ff;">=</span><span style="color:#ff0000;">0</span><span style="color:#4444ff;">;</span> <span style="color:#2040a0;">i</span><span style="color:#4444ff;">&#60;</span><span style="color:#2040a0;">rowpr</span><span style="color:#4444ff;">;</span> <span style="color:#2040a0;">i</span><span style="color:#4444ff;">+</span><span style="color:#4444ff;">+</span><span style="color:#4444ff;">)</span><span style="color:#4444ff;"><strong>{</strong></span>
<a name="line31"> 31</a> 		<span style="color:#2040a0;">printf</span><span style="color:#4444ff;">(</span><span style="color:#008000;">"%s "</span>,  <span style="color:#2040a0;">argv</span><span style="color:#4444ff;">[</span><span style="color:#2040a0;">i</span><span style="color:#4444ff;">]</span> ? <span style="color:#2040a0;">argv</span><span style="color:#4444ff;">[</span><span style="color:#2040a0;">i</span><span style="color:#4444ff;">]</span> <span style="color:#4444ff;">:</span> <span style="color:#008000;">"NULL"</span><span style="color:#4444ff;">)</span><span style="color:#4444ff;">;</span>
<a name="line32"> 32</a>
<a name="line33"> 33</a> 	<span style="color:#4444ff;"><strong>}</strong></span>
<a name="line34"> 34</a> 	<span style="color:#2040a0;">printf</span><span style="color:#4444ff;">(</span><span style="color:#008000;">"%s<span style="color:#77dd77;">\n</span>"</span>,  <span style="color:#2040a0;">argv</span><span style="color:#4444ff;">[</span><span style="color:#2040a0;">rowpr</span><span style="color:#4444ff;">]</span> ? <span style="color:#2040a0;">argv</span><span style="color:#4444ff;">[</span><span style="color:#2040a0;">rowpr</span><span style="color:#4444ff;">]</span> <span style="color:#4444ff;">:</span> <span style="color:#008000;">"NULL"</span><span style="color:#4444ff;">)</span><span style="color:#4444ff;">;</span>
<a name="line35"> 35</a>
<a name="line36"> 36</a> 	<strong>return</strong> <span style="color:#ff0000;">0</span><span style="color:#4444ff;">;</span>
<a name="line37"> 37</a> <span style="color:#4444ff;"><strong>}</strong></span>
<a name="line38"> 38</a>
<a name="line39"> 39</a> <strong>int</strong> <span style="color:#2040a0;">main</span><span style="color:#4444ff;">(</span><span style="color:#4444ff;">)</span>
<a name="line40"> 40</a> <span style="color:#4444ff;"><strong>{</strong></span>
<a name="line41"> 41</a> 	//<strong>return</strong> <span style="color:#2040a0;">value</span>
<a name="line42"> 42</a> 	<strong>int</strong> <span style="color:#2040a0;">retval</span><span style="color:#4444ff;">;</span>
<a name="line43"> 43</a>
<a name="line44"> 44</a> 	<strong>int</strong> <span style="color:#2040a0;">q_cnt</span> <span style="color:#4444ff;">=</span> <span style="color:#ff0000;">10</span>,<span style="color:#2040a0;">q_size</span> <span style="color:#4444ff;">=</span> <span style="color:#ff0000;">150</span>,<span style="color:#2040a0;">ind</span> <span style="color:#4444ff;">=</span> <span style="color:#ff0000;">0</span><span style="color:#4444ff;">;</span>
<a name="line45"> 45</a> 	<strong>char</strong> <span style="color:#4444ff;">*</span><span style="color:#4444ff;">*</span><span style="color:#2040a0;">queries</span> <span style="color:#4444ff;">=</span> <span style="color:#2040a0;">malloc</span><span style="color:#4444ff;">(</span><strong>sizeof</strong><span style="color:#4444ff;">(</span><strong>char</strong><span style="color:#4444ff;">)</span> <span style="color:#4444ff;">*</span> <span style="color:#2040a0;">q_cnt</span> <span style="color:#4444ff;">*</span> <span style="color:#2040a0;">q_size</span><span style="color:#4444ff;">)</span><span style="color:#4444ff;">;</span>
<a name="line46"> 46</a> 	// <span style="color:#2040a0;">Creating</span> <span style="color:#2040a0;">statment</span> <span style="color:#4444ff;">&#38;</span> <span style="color:#2040a0;">opening</span> <span style="color:#2040a0;">new</span> <span style="color:#2040a0;">DB</span>
<a name="line47"> 47</a> 	<span style="color:#2040a0;">sqlite3_stmt</span> <span style="color:#4444ff;">*</span><span style="color:#2040a0;">stmt</span><span style="color:#4444ff;">;</span>
<a name="line48"> 48</a> 	<span style="color:#2040a0;">sqlite3</span> <span style="color:#4444ff;">*</span><span style="color:#2040a0;">handle</span><span style="color:#4444ff;">;</span>
<a name="line49"> 49</a> 	<span style="color:#2040a0;">retval</span> <span style="color:#4444ff;">=</span> <span style="color:#2040a0;">sqlite3_open</span><span style="color:#4444ff;">(</span><span style="color:#008000;">"FirstDB.sqlite3"</span>,<span style="color:#4444ff;">&#38;</span><span style="color:#2040a0;">handle</span><span style="color:#4444ff;">)</span><span style="color:#4444ff;">;</span>
<a name="line50"> 50</a> 	<strong>if</strong><span style="color:#4444ff;">(</span><span style="color:#2040a0;">retval</span><span style="color:#4444ff;">)</span>
<a name="line51"> 51</a> 	<span style="color:#4444ff;"><strong>{</strong></span>
<a name="line52"> 52</a> 		// <span style="color:#2040a0;">If</span> <span style="color:#2040a0;">connection</span> <span style="color:#2040a0;">failed</span>, <span style="color:#2040a0;">handle</span> <span style="color:#2040a0;">returns</span> <span style="color:#2040a0;">NULL</span>
<a name="line53"> 53</a> 		<span style="color:#2040a0;">printf</span><span style="color:#4444ff;">(</span><span style="color:#008000;">"Database connection failed<span style="color:#77dd77;">\n</span>"</span><span style="color:#4444ff;">)</span><span style="color:#4444ff;">;</span>
<a name="line54"> 54</a> 		<strong>return</strong> <span style="color:#4444ff;">-</span><span style="color:#ff0000;">1</span><span style="color:#4444ff;">;</span>
<a name="line55"> 55</a> 	<span style="color:#4444ff;"><strong>}</strong></span>
<a name="line56"> 56</a> 	<span style="color:#2040a0;">printf</span><span style="color:#4444ff;">(</span><span style="color:#008000;">"Connection successful<span style="color:#77dd77;">\n</span>"</span><span style="color:#4444ff;">)</span><span style="color:#4444ff;">;</span>
<a name="line57"> 57</a>
<a name="line58"> 58</a> 	// <span style="color:#2040a0;">creating</span> <span style="color:#2040a0;">a</span> <span style="color:#2040a0;">multilple</span> <span style="color:#2040a0;">tables</span>
<a name="line59"> 59</a> 	<strong>char</strong> <span style="color:#2040a0;">create_table</span><span style="color:#4444ff;">[</span><span style="color:#4444ff;">]</span> <span style="color:#4444ff;">=</span> <span style="color:#008000;">"CREATE TABLE IF NOT EXISTS UsersMenu (uname TEXT PRIMARY KEY,pass TEXT NOT NULL,activated INTEGER)"</span><span style="color:#4444ff;">;</span>
<a name="line60"> 60</a> 	<strong>char</strong> <span style="color:#2040a0;">create_table1</span><span style="color:#4444ff;">[</span><span style="color:#4444ff;">]</span> <span style="color:#4444ff;">=</span> <span style="color:#008000;">"CREATE TABLE IF NOT EXISTS SettingsMenu (app_id TEXT PRIMARY KEY,gconf_path TEXT NOT NULL,activated INTEGER)"</span><span style="color:#4444ff;">;</span>
<a name="line61"> 61</a>
<a name="line62"> 62</a>
<a name="line63"> 63</a> 	<strong>char</strong> <span style="color:#4444ff;">*</span><span style="color:#2040a0;">errmsg</span> <span style="color:#4444ff;">=</span> <span style="color:#2040a0;">NULL</span><span style="color:#4444ff;">;</span>
<a name="line64"> 64</a> 	// <span style="color:#2040a0;">Execute</span> <span style="color:#2040a0;">the</span> <span style="color:#2040a0;">query</span>
<a name="line65"> 65</a> 	<span style="color:#2040a0;">retval</span> <span style="color:#4444ff;">=</span> <span style="color:#2040a0;">sqlite3_exec</span><span style="color:#4444ff;">(</span><span style="color:#2040a0;">handle</span>,<span style="color:#2040a0;">create_table1</span>,<span style="color:#2040a0;">callback</span>,<span style="color:#2040a0;">handle</span>,<span style="color:#4444ff;">&#38;</span><span style="color:#2040a0;">errmsg</span><span style="color:#4444ff;">)</span><span style="color:#4444ff;">;</span>
<a name="line66"> 66</a> 	<strong>if</strong><span style="color:#4444ff;">(</span><span style="color:#2040a0;">retval</span> <span style="color:#4444ff;">!</span><span style="color:#4444ff;">=</span> <span style="color:#2040a0;">SQLITE_OK</span><span style="color:#4444ff;">)</span>
<a name="line67"> 67</a> 	<span style="color:#4444ff;"><strong>{</strong></span>
<a name="line68"> 68</a> 		<strong>if</strong><span style="color:#4444ff;">(</span><span style="color:#2040a0;">errmsg</span> <span style="color:#4444ff;">!</span><span style="color:#4444ff;">=</span> <span style="color:#2040a0;">NULL</span><span style="color:#4444ff;">)</span>
<a name="line69"> 69</a> 		<span style="color:#4444ff;"><strong>{</strong></span>
<a name="line70"> 70</a> 			<span style="color:#2040a0;">printf</span><span style="color:#4444ff;">(</span><span style="color:#008000;">"<span style="color:#77dd77;">\n</span>@@Exec err:%s<span style="color:#77dd77;">\n</span>"</span>,<span style="color:#2040a0;">errmsg</span><span style="color:#4444ff;">)</span><span style="color:#4444ff;">;</span>
<a name="line71"> 71</a> 			<span style="color:#2040a0;">sqlite3_free</span><span style="color:#4444ff;">(</span><span style="color:#2040a0;">errmsg</span><span style="color:#4444ff;">)</span><span style="color:#4444ff;">;</span>
<a name="line72"> 72</a> 		<span style="color:#4444ff;"><strong>}</strong></span>
<a name="line73"> 73</a>
<a name="line74"> 74</a> 	<span style="color:#4444ff;"><strong>}</strong></span>
<a name="line75"> 75</a> 	<span style="color:#2040a0;">printf</span> <span style="color:#4444ff;">(</span><span style="color:#008000;">"<span style="color:#77dd77;">\n</span>---&#62; create_table1 retvalue %d %s <span style="color:#77dd77;">\n</span>"</span>,<span style="color:#2040a0;">retval</span>, <span style="color:#2040a0;">sqlite3_errmsg</span><span style="color:#4444ff;">(</span><span style="color:#2040a0;">handle</span><span style="color:#4444ff;">)</span><span style="color:#4444ff;">)</span><span style="color:#4444ff;">;</span>
<a name="line76"> 76</a> 	<span style="color:#2040a0;">retval</span> <span style="color:#4444ff;">=</span> <span style="color:#2040a0;">sqlite3_exec</span><span style="color:#4444ff;">(</span><span style="color:#2040a0;">handle</span>,<span style="color:#2040a0;">create_table</span>,<span style="color:#2040a0;">callback</span>,<span style="color:#ff0000;">0</span>,<span style="color:#ff0000;">0</span><span style="color:#4444ff;">)</span><span style="color:#4444ff;">;</span>
<a name="line77"> 77</a> 	<span style="color:#2040a0;">retval</span> <span style="color:#4444ff;">=</span> <span style="color:#ff0000;">0</span><span style="color:#4444ff;">;</span>
<a name="line78"> 78</a> 	<span style="color:#2040a0;">printf</span> <span style="color:#4444ff;">(</span><span style="color:#008000;">"<span style="color:#77dd77;">\n</span> ---&#62; create_table retvalue %d %s <span style="color:#77dd77;">\n</span>"</span>,<span style="color:#2040a0;">retval</span>, <span style="color:#2040a0;">sqlite3_errmsg</span><span style="color:#4444ff;">(</span><span style="color:#2040a0;">handle</span><span style="color:#4444ff;">)</span> <span style="color:#4444ff;">)</span><span style="color:#4444ff;">;</span>
<a name="line79"> 79</a>
<a name="line80"> 80</a> 	// <span style="color:#2040a0;">now</span> <span style="color:#2040a0;">Insert</span> <span style="color:#2040a0;">rows</span> <span style="color:#2040a0;">into</span> <span style="color:#2040a0;">table</span> <span style="color:#2040a0;">UsersMenu</span>
<a name="line81"> 81</a> 	<span style="color:#2040a0;">queries</span><span style="color:#4444ff;">[</span><span style="color:#2040a0;">ind</span><span style="color:#4444ff;">+</span><span style="color:#4444ff;">+</span><span style="color:#4444ff;">]</span> <span style="color:#4444ff;">=</span> <span style="color:#008000;">"INSERT INTO UsersMenu VALUES('Speaker','Creative',1)"</span><span style="color:#4444ff;">;</span>
<a name="line82"> 82</a> 	<span style="color:#2040a0;">retval</span> <span style="color:#4444ff;">=</span> <span style="color:#2040a0;">sqlite3_exec</span><span style="color:#4444ff;">(</span><span style="color:#2040a0;">handle</span>,<span style="color:#2040a0;">queries</span><span style="color:#4444ff;">[</span><span style="color:#2040a0;">ind</span><span style="color:#4444ff;">-</span><span style="color:#ff0000;">1</span><span style="color:#4444ff;">]</span>,<span style="color:#2040a0;">callback</span>,<span style="color:#ff0000;">0</span>,<span style="color:#ff0000;">0</span><span style="color:#4444ff;">)</span><span style="color:#4444ff;">;</span>
<a name="line83"> 83</a> 	<span style="color:#2040a0;">queries</span><span style="color:#4444ff;">[</span><span style="color:#2040a0;">ind</span><span style="color:#4444ff;">+</span><span style="color:#4444ff;">+</span><span style="color:#4444ff;">]</span> <span style="color:#4444ff;">=</span> <span style="color:#008000;">"INSERT INTO UsersMenu VALUES('Mouse','Logitech',0)"</span><span style="color:#4444ff;">;</span>
<a name="line84"> 84</a> 	<span style="color:#2040a0;">retval</span> <span style="color:#4444ff;">=</span> <span style="color:#2040a0;">sqlite3_exec</span><span style="color:#4444ff;">(</span><span style="color:#2040a0;">handle</span>,<span style="color:#2040a0;">queries</span><span style="color:#4444ff;">[</span><span style="color:#2040a0;">ind</span><span style="color:#4444ff;">-</span><span style="color:#ff0000;">1</span><span style="color:#4444ff;">]</span>,<span style="color:#2040a0;">callback</span>,<span style="color:#ff0000;">0</span>,<span style="color:#ff0000;">0</span><span style="color:#4444ff;">)</span><span style="color:#4444ff;">;</span>
<a name="line85"> 85</a>
<a name="line86"> 86</a> 	// <span style="color:#2040a0;">now</span> <span style="color:#2040a0;">Insert</span> <span style="color:#2040a0;">rows</span> <span style="color:#2040a0;">into</span> <span style="color:#2040a0;">table</span> <span style="color:#2040a0;">SettingsMenu</span>
<a name="line87"> 87</a> 	<span style="color:#2040a0;">queries</span><span style="color:#4444ff;">[</span><span style="color:#2040a0;">ind</span><span style="color:#4444ff;">+</span><span style="color:#4444ff;">+</span><span style="color:#4444ff;">]</span> <span style="color:#4444ff;">=</span> <span style="color:#008000;">"INSERT INTO SettingsMenu VALUES('media_player','$HOME/media',1)"</span><span style="color:#4444ff;">;</span>
<a name="line88"> 88</a> 	<span style="color:#2040a0;">retval</span> <span style="color:#4444ff;">=</span> <span style="color:#2040a0;">sqlite3_exec</span><span style="color:#4444ff;">(</span><span style="color:#2040a0;">handle</span>,<span style="color:#2040a0;">queries</span><span style="color:#4444ff;">[</span><span style="color:#2040a0;">ind</span><span style="color:#4444ff;">-</span><span style="color:#ff0000;">1</span><span style="color:#4444ff;">]</span>,<span style="color:#2040a0;">callback</span>,<span style="color:#ff0000;">0</span>,<span style="color:#ff0000;">0</span><span style="color:#4444ff;">)</span><span style="color:#4444ff;">;</span>
<a name="line89"> 89</a> 	<span style="color:#2040a0;">queries</span><span style="color:#4444ff;">[</span><span style="color:#2040a0;">ind</span><span style="color:#4444ff;">+</span><span style="color:#4444ff;">+</span><span style="color:#4444ff;">]</span> <span style="color:#4444ff;">=</span> <span style="color:#008000;">"INSERT INTO SettingsiMenu VALUES('picture_viewer','$HOME/pic',0)"</span><span style="color:#4444ff;">;</span>
<a name="line90"> 90</a> 	<span style="color:#2040a0;">retval</span> <span style="color:#4444ff;">=</span> <span style="color:#2040a0;">sqlite3_exec</span><span style="color:#4444ff;">(</span><span style="color:#2040a0;">handle</span>,<span style="color:#2040a0;">queries</span><span style="color:#4444ff;">[</span><span style="color:#2040a0;">ind</span><span style="color:#4444ff;">-</span><span style="color:#ff0000;">1</span><span style="color:#4444ff;">]</span>,<span style="color:#2040a0;">callback</span>,<span style="color:#ff0000;">0</span>,<span style="color:#ff0000;">0</span><span style="color:#4444ff;">)</span><span style="color:#4444ff;">;</span>
<a name="line91"> 91</a>
<a name="line92"> 92</a> 	// <span style="color:#2040a0;">select</span> <span style="color:#2040a0;">query</span> <span style="color:#2040a0;">from</span> <span style="color:#2040a0;">the</span> <span style="color:#2040a0;">table</span>
<a name="line93"> 93</a> 	<span style="color:#2040a0;">queries</span><span style="color:#4444ff;">[</span><span style="color:#2040a0;">ind</span><span style="color:#4444ff;">+</span><span style="color:#4444ff;">+</span><span style="color:#4444ff;">]</span> <span style="color:#4444ff;">=</span> <span style="color:#008000;">"SELECT * from UsersMenu"</span><span style="color:#4444ff;">;</span>
<a name="line94"> 94</a> 	<span style="color:#2040a0;">retval</span> <span style="color:#4444ff;">=</span> <span style="color:#2040a0;">sqlite3_prepare_v2</span><span style="color:#4444ff;">(</span><span style="color:#2040a0;">handle</span>,<span style="color:#2040a0;">queries</span><span style="color:#4444ff;">[</span><span style="color:#2040a0;">ind</span><span style="color:#4444ff;">-</span><span style="color:#ff0000;">1</span><span style="color:#4444ff;">]</span>,<span style="color:#4444ff;">-</span><span style="color:#ff0000;">1</span>,<span style="color:#4444ff;">&#38;</span><span style="color:#2040a0;">stmt</span>,<span style="color:#ff0000;">0</span><span style="color:#4444ff;">)</span><span style="color:#4444ff;">;</span>
<a name="line95"> 95</a> 	<strong>if</strong><span style="color:#4444ff;">(</span><span style="color:#2040a0;">retval</span><span style="color:#4444ff;">)</span>
<a name="line96"> 96</a> 	<span style="color:#4444ff;"><strong>{</strong></span>
<a name="line97"> 97</a> 		<span style="color:#2040a0;">printf</span><span style="color:#4444ff;">(</span><span style="color:#008000;">"Selecting data from DB Failed<span style="color:#77dd77;">\n</span>"</span><span style="color:#4444ff;">)</span><span style="color:#4444ff;">;</span>
<a name="line98"> 98</a> 		<strong>return</strong> <span style="color:#4444ff;">-</span><span style="color:#ff0000;">1</span><span style="color:#4444ff;">;</span>
<a name="line99"> 99</a> 	<span style="color:#4444ff;"><strong>}</strong></span>
<a name="line100">100</a>
<a name="line101">101</a> 	// <span style="color:#2040a0;">Read</span> <span style="color:#2040a0;">the</span> <span style="color:#2040a0;">number</span> <span style="color:#2040a0;">of</span> <span style="color:#2040a0;">rows</span> <span style="color:#2040a0;">fetched</span>
<a name="line102">102</a> 	<strong>int</strong> <span style="color:#2040a0;">cols</span> <span style="color:#4444ff;">=</span> <span style="color:#2040a0;">sqlite3_column_count</span><span style="color:#4444ff;">(</span><span style="color:#2040a0;">stmt</span><span style="color:#4444ff;">)</span><span style="color:#4444ff;">;</span>
<a name="line103">103</a> 	<strong>int</strong> <span style="color:#2040a0;">col</span> <span style="color:#4444ff;">=</span><span style="color:#ff0000;">0</span><span style="color:#4444ff;">;</span>
<a name="line104">104</a> 	<strong>while</strong><span style="color:#4444ff;">(</span><span style="color:#ff0000;">1</span><span style="color:#4444ff;">)</span>
<a name="line105">105</a> 	<span style="color:#4444ff;"><strong>{</strong></span>
<a name="line106">106</a> 		// <span style="color:#2040a0;">fetch</span> <span style="color:#2040a0;">a</span> <span style="color:#2040a0;">row</span>'<span style="color:#2040a0;">s</span> <span style="color:#2040a0;">status</span>
<a name="line107">107</a> 		<span style="color:#2040a0;">retval</span> <span style="color:#4444ff;">=</span> <span style="color:#2040a0;">sqlite3_step</span><span style="color:#4444ff;">(</span><span style="color:#2040a0;">stmt</span><span style="color:#4444ff;">)</span><span style="color:#4444ff;">;</span>
<a name="line108">108</a>
<a name="line109">109</a> 		<strong>if</strong><span style="color:#4444ff;">(</span><span style="color:#2040a0;">retval</span> <span style="color:#4444ff;">=</span><span style="color:#4444ff;">=</span> <span style="color:#2040a0;">SQLITE_ROW</span><span style="color:#4444ff;">)</span>
<a name="line110">110</a> 		<span style="color:#4444ff;"><strong>{</strong></span>
<a name="line111">111</a> 			// <span style="color:#2040a0;">SQLITE_ROW</span> <span style="color:#2040a0;">means</span> <span style="color:#2040a0;">fetched</span> <span style="color:#2040a0;">a</span> <span style="color:#2040a0;">row</span>
<a name="line112">112</a>
<a name="line113">113</a> 			// <span style="color:#2040a0;">sqlite3_column_text</span> <span style="color:#2040a0;">returns</span> <span style="color:#2040a0;">a</span> <strong>const</strong> <strong>void</strong><span style="color:#4444ff;">*</span> , <span style="color:#2040a0;">typecast</span> <span style="color:#2040a0;">it</span> <span style="color:#2040a0;">to</span> <strong>const</strong> <strong>char</strong><span style="color:#4444ff;">*</span>
<a name="line114">114</a> 			<strong>for</strong><span style="color:#4444ff;">(</span> <span style="color:#2040a0;">col</span><span style="color:#4444ff;">=</span><span style="color:#ff0000;">0</span> <span style="color:#4444ff;">;</span> <span style="color:#2040a0;">col</span><span style="color:#4444ff;">&#60;</span><span style="color:#2040a0;">cols</span><span style="color:#4444ff;">;</span><span style="color:#2040a0;">col</span><span style="color:#4444ff;">+</span><span style="color:#4444ff;">+</span><span style="color:#4444ff;">)</span>
<a name="line115">115</a> 			<span style="color:#4444ff;"><strong>{</strong></span>
<a name="line116">116</a> 				<strong>const</strong> <strong>char</strong> <span style="color:#4444ff;">*</span><span style="color:#2040a0;">val</span> <span style="color:#4444ff;">=</span> <span style="color:#4444ff;">(</span><strong>const</strong> <strong>char</strong><span style="color:#4444ff;">*</span><span style="color:#4444ff;">)</span><span style="color:#2040a0;">sqlite3_column_text</span><span style="color:#4444ff;">(</span><span style="color:#2040a0;">stmt</span>,<span style="color:#2040a0;">col</span><span style="color:#4444ff;">)</span><span style="color:#4444ff;">;</span>
<a name="line117">117</a> 				<span style="color:#2040a0;">printf</span><span style="color:#4444ff;">(</span><span style="color:#008000;">"%s = %s<span style="color:#77dd77;">\t</span>"</span>,<span style="color:#2040a0;">sqlite3_column_name</span><span style="color:#4444ff;">(</span><span style="color:#2040a0;">stmt</span>,<span style="color:#2040a0;">col</span><span style="color:#4444ff;">)</span>,<span style="color:#2040a0;">val</span><span style="color:#4444ff;">)</span><span style="color:#4444ff;">;</span>
<a name="line118">118</a> 			<span style="color:#4444ff;"><strong>}</strong></span>
<a name="line119">119</a> 			<span style="color:#2040a0;">printf</span><span style="color:#4444ff;">(</span><span style="color:#008000;">"<span style="color:#77dd77;">\n</span>"</span><span style="color:#4444ff;">)</span><span style="color:#4444ff;">;</span>
<a name="line120">120</a> 		<span style="color:#4444ff;"><strong>}</strong></span>
<a name="line121">121</a> 		<strong>else</strong> <strong>if</strong><span style="color:#4444ff;">(</span><span style="color:#2040a0;">retval</span> <span style="color:#4444ff;">=</span><span style="color:#4444ff;">=</span> <span style="color:#2040a0;">SQLITE_DONE</span><span style="color:#4444ff;">)</span>
<a name="line122">122</a> 		<span style="color:#4444ff;"><strong>{</strong></span>
<a name="line123">123</a> 			// <span style="color:#2040a0;">All</span> <span style="color:#2040a0;">rows</span> <span style="color:#2040a0;">finished</span>
<a name="line124">124</a> 			<span style="color:#2040a0;">printf</span><span style="color:#4444ff;">(</span><span style="color:#008000;">"All rows fetched<span style="color:#77dd77;">\n</span>"</span><span style="color:#4444ff;">)</span><span style="color:#4444ff;">;</span>
<a name="line125">125</a> 			<strong>break</strong><span style="color:#4444ff;">;</span>
<a name="line126">126</a> 		<span style="color:#4444ff;"><strong>}</strong></span>
<a name="line127">127</a> 		<strong>else</strong>
<a name="line128">128</a> 		<span style="color:#4444ff;"><strong>{</strong></span>
<a name="line129">129</a> 			// <span style="color:#2040a0;">Some</span> <span style="color:#2040a0;">error</span> <span style="color:#2040a0;">encountered</span>
<a name="line130">130</a> 			<span style="color:#2040a0;">printf</span><span style="color:#4444ff;">(</span><span style="color:#008000;">"Some error encountered<span style="color:#77dd77;">\n</span>"</span><span style="color:#4444ff;">)</span><span style="color:#4444ff;">;</span>
<a name="line131">131</a> 			<strong>return</strong> <span style="color:#4444ff;">-</span><span style="color:#ff0000;">1</span><span style="color:#4444ff;">;</span>
<a name="line132">132</a> 		<span style="color:#4444ff;"><strong>}</strong></span>
<a name="line133">133</a> 	<span style="color:#4444ff;"><strong>}</strong></span>
<a name="line134">134</a>
<a name="line135">135</a> 	// <span style="color:#2040a0;">Close</span> <span style="color:#2040a0;">the</span> <span style="color:#2040a0;">handle</span> <span style="color:#2040a0;">to</span> <span style="color:#2040a0;">free</span> <span style="color:#2040a0;">memory</span>
<a name="line136">136</a> 	<span style="color:#2040a0;">sqlite3_close</span><span style="color:#4444ff;">(</span><span style="color:#2040a0;">handle</span><span style="color:#4444ff;">)</span><span style="color:#4444ff;">;</span>
<a name="line137">137</a> 	<strong>return</strong> <span style="color:#ff0000;">0</span><span style="color:#4444ff;">;</span>
<a name="line138">138</a> <span style="color:#4444ff;"><strong>}</strong></span>
</pre>
<p><strong>How to build &#38; run</strong><br />
Issue the command build the source<br />
<strong>CMD:</strong> gcc -o sql_multitable_sample sql_multitable_sample.c  -Wall -W -O2 -Wl,-R/usr/local/lib -lsqlite3<br />
<strong>To run</strong> excecute ./sql_multitable_sample.</p>
<p>Output: A DB file <strong><em>FirstDB.sqlite3</em></strong> will be create in the current directory.</p>
<p>Now, view  the DB file with SqliteBrowser<br />
Issue <strong>CMD: </strong> sqlitebrowser FirstDB.sqlite3</p>
<p><a href="http://sreenivasprabhu.wordpress.com/files/2009/11/sql-firstdb-sqlite3.png"><img class="alignnone size-thumbnail wp-image-27" title="sql-FirstDB.sqlite3" src="http://sreenivasprabhu.wordpress.com/files/2009/11/sql-firstdb-sqlite3.png?w=150" alt="" width="150" height="122" /></a></p>
<p>Enjoy playing around with Sqlite &#8230;  it really nice!!</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[การใช้ฐานข้อมูล SQLite กับ Lazarus ในเบื้องต้น (ตอนที่ 2)]]></title>
<link>http://priabroy.wordpress.com/2009/11/20/%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b9%83%e0%b8%8a%e0%b9%89%e0%b8%90%e0%b8%b2%e0%b8%99%e0%b8%82%e0%b9%89%e0%b8%ad%e0%b8%a1%e0%b8%b9%e0%b8%a5-sqlite-%e0%b8%81%e0%b8%b1%e0%b8%9a-lazarus-%e0%b9%83%e0%b8%99-2/</link>
<pubDate>Thu, 19 Nov 2009 17:12:02 +0000</pubDate>
<dc:creator>prajuab riabroy</dc:creator>
<guid>http://priabroy.wordpress.com/2009/11/20/%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b9%83%e0%b8%8a%e0%b9%89%e0%b8%90%e0%b8%b2%e0%b8%99%e0%b8%82%e0%b9%89%e0%b8%ad%e0%b8%a1%e0%b8%b9%e0%b8%a5-sqlite-%e0%b8%81%e0%b8%b1%e0%b8%9a-lazarus-%e0%b9%83%e0%b8%99-2/</guid>
<description><![CDATA[ตอนที่แล้วผม post ตัวโค๊ดทั้งหมด มาดูคำอธิบายตรงสาระที่สำคัญ Declare ตัวแปรสำหรับ SQLite ที่ class ข]]></description>
<content:encoded><![CDATA[ตอนที่แล้วผม post ตัวโค๊ดทั้งหมด มาดูคำอธิบายตรงสาระที่สำคัญ Declare ตัวแปรสำหรับ SQLite ที่ class ข]]></content:encoded>
</item>
<item>
<title><![CDATA[การใช้ฐานข้อมูล SQLite กับ Lazarus ในเบื้องต้น (ตอนที่ 1)]]></title>
<link>http://priabroy.wordpress.com/2009/11/18/%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b9%83%e0%b8%8a%e0%b9%89%e0%b8%90%e0%b8%b2%e0%b8%99%e0%b8%82%e0%b9%89%e0%b8%ad%e0%b8%a1%e0%b8%b9%e0%b8%a5-sqlite-%e0%b8%81%e0%b8%b1%e0%b8%9a-lazarus-%e0%b9%83%e0%b8%99/</link>
<pubDate>Wed, 18 Nov 2009 16:29:49 +0000</pubDate>
<dc:creator>prajuab riabroy</dc:creator>
<guid>http://priabroy.wordpress.com/2009/11/18/%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b9%83%e0%b8%8a%e0%b9%89%e0%b8%90%e0%b8%b2%e0%b8%99%e0%b8%82%e0%b9%89%e0%b8%ad%e0%b8%a1%e0%b8%b9%e0%b8%a5-sqlite-%e0%b8%81%e0%b8%b1%e0%b8%9a-lazarus-%e0%b9%83%e0%b8%99/</guid>
<description><![CDATA[ตอนก่อนหน้านี้ผมพูดเรื่อง SQLite พร้อมทั้ง tools สำหรับ admin ที่หาได้ในวินโดส์ พร้อมทั้งการ Pump ข้]]></description>
<content:encoded><![CDATA[ตอนก่อนหน้านี้ผมพูดเรื่อง SQLite พร้อมทั้ง tools สำหรับ admin ที่หาได้ในวินโดส์ พร้อมทั้งการ Pump ข้]]></content:encoded>
</item>
<item>
<title><![CDATA[QCiPhone 1.6 beta 4 is now available.]]></title>
<link>http://tetontech.wordpress.com/2009/11/17/qciphone-1-6-beta-4-is-now-available/</link>
<pubDate>Tue, 17 Nov 2009 06:55:22 +0000</pubDate>
<dc:creator>tetontech</dc:creator>
<guid>http://tetontech.wordpress.com/2009/11/17/qciphone-1-6-beta-4-is-now-available/</guid>
<description><![CDATA[A new beta of QC 1.6, beta 4, is now available on sourceforge.  I has the following fixes and change]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>A new beta of QC 1.6, beta 4, is now available on sourceforge.  I has the following fixes and changes</p>
<ol>
<li>DBScript can now be used with native databases.</li>
<li>All examples shipping in the download of the beta are now converted to the 1.6 file structure.  A few of the examples have not been ported yet and so I have not included them yet.  I&#8217;ll put them in the next beta.</li>
<li>ServerAccessObject timeout defect fixed that triggered multiple calls to VCO&#8217;s</li>
<li>Cleaned up DataAccessObject batch method (a support method for DBScript.  Don&#8217;t use it directly).  Simplified batch completion checking.</li>
<li>Fixed DataAccessObject transaction handling that caused transactions not to appear to fail if database constraints were violated.</li>
<li>SQLite updated to version 3.6.20 with support for FTS3 query syntax added</li>
<li> Added missing NativeFooter Example</li>
<li>Fixed failure to hide native footer defect</li>
<li>Added new JQTouch example showing the JQTouch developer demo</li>
</ol>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Revista linux +: Curso de Gambas]]></title>
<link>http://jsbsan.wordpress.com/2009/11/15/revista-linux-curso-de-gambas/</link>
<pubDate>Sun, 15 Nov 2009 15:39:57 +0000</pubDate>
<dc:creator>jsbsan</dc:creator>
<guid>http://jsbsan.wordpress.com/2009/11/15/revista-linux-curso-de-gambas/</guid>
<description><![CDATA[En la siguiente direccion linux + podeis descargaros la revista linux +, en formato PDF. En el nº de]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>En la siguiente direccion <a href="http://lpmagazine.org/es"><strong>linux +</strong></a> </p>
<p><a href="http://jsbsan.wordpress.com/files/2009/11/linuxplus.png"><img src="http://jsbsan.wordpress.com/files/2009/11/linuxplus.png" alt="linuxplus" title="linuxplus" width="500" height="546" class="alignnone size-full wp-image-984" /></a></p>
<p>podeis descargaros la revista linux +, en formato PDF. En el nº de  <a href="http://lpmagazine.org/es/article/9603-descarga-gratuitamente-el-numero-de-verano-de-linux+-seguridad-y-ethical-hacking">56</a>, aparece un articulo dedicado al Acceso a Bases de Datos SQLITE, de Jorge Emanuel Capurro (paginas 72 a la 82)</p>
<p><a href="http://jsbsan.wordpress.com/files/2009/11/revista-linux1.png"><img src="http://jsbsan.wordpress.com/files/2009/11/revista-linux1.png" alt="revista linux1" title="revista linux1" width="494" height="522" class="alignnone size-full wp-image-983" /></a></p>
<p>Espero que os guste, un saludo</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[نظرة بسيطة على SQLite .]]></title>
<link>http://snix.wordpress.com/2009/11/13/%d9%86%d8%b8%d8%b1%d8%a9-%d8%a8%d8%b3%d9%8a%d8%b7%d8%a9-%d8%b9%d9%84%d9%89-sqlite/</link>
<pubDate>Fri, 13 Nov 2009 20:45:10 +0000</pubDate>
<dc:creator>snix</dc:creator>
<guid>http://snix.wordpress.com/2009/11/13/%d9%86%d8%b8%d8%b1%d8%a9-%d8%a8%d8%b3%d9%8a%d8%b7%d8%a9-%d8%b9%d9%84%d9%89-sqlite/</guid>
<description><![CDATA[الترم هذا عندي كورس عن Database systems الكورس حلو الصراحه من زمان وانا ودي اتعامل مع قواعد البيانات]]></description>
<content:encoded><![CDATA[الترم هذا عندي كورس عن Database systems الكورس حلو الصراحه من زمان وانا ودي اتعامل مع قواعد البيانات]]></content:encoded>
</item>
<item>
<title><![CDATA[Computer Science Project for Indian Engineering Colleges]]></title>
<link>http://manishtech.wordpress.com/2009/11/13/computer-science-project-for-indian-engineering-colleges/</link>
<pubDate>Thu, 12 Nov 2009 19:32:25 +0000</pubDate>
<dc:creator>Manish</dc:creator>
<guid>http://manishtech.wordpress.com/2009/11/13/computer-science-project-for-indian-engineering-colleges/</guid>
<description><![CDATA[How many times you put your best effort in making a project only to be ridiculed during the presenta]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>How many times you put your best effort in making a project only to be ridiculed during the presentation with words like &#8220;This is shit&#8221;.&#8221;WTF is this&#8221; by the teachers.  OK OK! I am exaggerating, but it is a truth that students who put their best don&#8217;t get their reward. Most of such students put their sincere effort just because they like their work and not just for marks. To add insult to injury, those who copy-paste the projects get great reviews.</p>
<p>The situation is no different in Computer Science branch too. We loose hundreds of such talents students just because they became de-moralized after poor feedback for their project by the faculty. They should realize that hard-work in college hardly pays off. They should put their coding efforts in competitions like &#8220;Google Code Jam&#8221;, &#8220;CodeChef&#8221; or some open-source projects.</p>
<p>Now the million dollar question is &#8220;How to handle the college projects&#8221;? Let me explain with an example.</p>
<p><!--more--></p>
<p><strong>Project</strong>: Create a source Control Management or Revision Control System for efficient code management for single person project.</p>
<p><strong>Technology</strong>: Python with SQLite for client.</p>
<p><strong>Additional Information</strong>: There need not be a central repo to push the changes, local commits are enough. The name of the binary should be <strong>srcs</strong> or &#8220;<em>Simple Revision Control System</em>&#8220;</p>
<p><strong>Creating the Project</strong>:</p>
<p>In real world development, people would ask you to make tons of documents like SRS, Technical Specification etc before moving on to coding. These things simply don&#8217;t exist in colleges. All you need to do for your project to be ready is shown below.</p>
<p>You need to run the following commands on any Debian based distro (probably Ubuntu)</p>
<pre style="padding-left:30px;">$ sudo apt-get install bzr</pre>
<pre style="padding-left:30px;">$ sudo ln -s /usr/bin/bzr /usr/bin/srcs</pre>
<p>&#8230;.. and it&#8217;s done. Now let&#8217;s start using it</p>
<p><strong>Creating the repository</strong></p>
<pre style="padding-left:30px;">$ cd ~ &#38;&#38; mkdir code &#38;&#38; cd code</pre>
<pre style="padding-left:30px;">$ srcs init</pre>
<p><strong>Creating files</strong></p>
<pre style="padding-left:30px;">$ touch file1.c</pre>
<pre style="padding-left:30px;">$ touch README</pre>
<p><strong>Adding and committing</strong></p>
<pre style="padding-left:30px;">$ srcs add file1.c README</pre>
<pre style="padding-left:30px;">$ srcs commit file1.c README -m "First Commit"</pre>
<p>So your project part is complete. Now come let&#8217;s handle the typical vivas</p>
<p><strong>Conversation 1:</strong></p>
<p style="padding-left:30px;">Teacher: Why have you used Python?</p>
<p style="padding-left:30px;">You: Python is _______________(put all sorts of Python advocacy here)__________________</p>
<p style="padding-left:30px;">Teacher: What. Explain it clearly!</p>
<p style="padding-left:30px;">You:  So that you can&#8217;t make the head or tail of the codebase.</p>
<p><strong>Conversation 2:</strong></p>
<p style="padding-left:30px;">Teacher: Explain your project briefly!</p>
<p style="padding-left:30px;">You: My project is to create a system to manage the code. Keep revisions, find the differences between two commits</p>
<p style="padding-left:30px;">Teacher: How to keep differences?</p>
<p style="padding-left:30px;">You: I save the code at regular intervals, or say commit it to the repo, so that I can access any file any time if I make a mistake</p>
<p style="padding-left:30px;">Teacher: Why the **** do you need to make such a big software to keep copies. Can&#8217;t you just use &#8220;<strong>Save As(s)</strong>&#8221; every time you need revision of a file?</p>
<p style="padding-left:30px;">You: *Facepalm*</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Android - Using sqlite]]></title>
<link>http://vkroz.wordpress.com/2009/11/12/android-using-sqlite/</link>
<pubDate>Thu, 12 Nov 2009 13:35:13 +0000</pubDate>
<dc:creator>vkroz</dc:creator>
<guid>http://vkroz.wordpress.com/2009/11/12/android-using-sqlite/</guid>
<description><![CDATA[Using shell to access sqlite $ adb [-s &lt;AVD name&gt;] shell # sqlite3 /data/data/&lt;application ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><h2><strong>Using shell to access sqlite </strong></h2>
<pre><strong></strong>$ adb [-s <span style="color:#ff0000;"><strong>&#60;AVD name&#62;]</strong></span> shell
# sqlite3 /data/data/<span style="color:#ff0000;"><strong>&#60;application package name&#62;</strong></span>/databases/<span style="color:#ff0000;"><strong>&#60;database name&#62;</strong></span>

<span style="color:#ff0000;"><span style="color:#000000;"><strong><span style="text-decoration:underline;">Example:</span></strong></span></span>
<span style="color:#ff0000;"><strong><span style="color:#000000;font-weight:normal;">&#62;adb shell</span></strong></span>
$ sqlite3 /data/data/com.kroz.app/databases/mydatabase.db
<span style="color:#000080;">sqlite3 /data/data/com.kroz.app/databases/mydatabase.db
SQLite version 3.5.9
Enter ".help" for instructions
sqlite&#62;</span>

<span style="color:#000080;">
</span></pre>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Onze softwares gratuitos para cuidar da gestão da sua empresa]]></title>
<link>http://almalivre.wordpress.com/2009/11/05/onze-softwares-gratuitos-para-cuidar-da-gestao-da-sua-empresa/</link>
<pubDate>Thu, 05 Nov 2009 15:06:09 +0000</pubDate>
<dc:creator>stellarium</dc:creator>
<guid>http://almalivre.wordpress.com/2009/11/05/onze-softwares-gratuitos-para-cuidar-da-gestao-da-sua-empresa/</guid>
<description><![CDATA[Mais uma matéria muito interessante da PC World. Nela o autor sugere uma lista de dez softwares livr]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Mais uma matéria muito interessante da PC World. Nela o autor sugere uma lista de dez softwares livres para gerenciamento do negócio, gerenciamento de conteúdo e fluxo de informações.</p>
<p>É bom lembrar que, por exemplo, um ERP é composto de aplicativos e bancos de dados. Quando a empresa investe num ERP comercial, ela necessita adequar a infraestrutura de TI adquirindo novos servidores, sistemas operacionais, gerenciadores de bancos de dados, os pacotes do ERP, as licenças de uso, horas de consultoria de implantação e treinamento. Com o software livre, as licenças de uso, os sistemas operacionais, os aplicativos e os bancos de dados podem ser abatidos do custo. Parte desse custo será direcionado para as horas de consultoria e treinamento. Entretanto, após esse investimento inicial, restará apenas as manutenções periódicas dos bancos de dados e do desenvolvimento de aplicativos customizados. As atualizações serão gratuitas e, você pode mudar de fornecedor quando quiser, se não estiver satisfeito com o seu.</p>
<p>Ao contrário de soluções proprietárias, se você mudar de fornecedor, terá de mudar todo o sistema, também.</p>
<p>Se você é empresário e está buscando uma solução efetiva sem obrigar sua empresa a depender de um único fornecedor nem de uma tecnologia, pesquise por empresas de suporte que façam a implantação de softwares de gestão em código aberto.</p>
<p>Leia a matéria em: <a title="11 softwares gratuitos para gerenciar sua empresa" href="http://pcworld.uol.com.br/dicas/2009/11/04/onze-softwares-gratuitos-para-cuidar-da-gestao-da-sua-empresa/" target="_blank">http://pcworld.uol.com.br/dicas/2009/11/04/onze-softwares-gratuitos-para-cuidar-da-gestao-da-sua-empresa</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Trac - Fixing the SQLite DB ]]></title>
<link>http://almeidamike.wordpress.com/2009/11/05/trac-fixing-the-sqlite-db/</link>
<pubDate>Thu, 05 Nov 2009 10:15:23 +0000</pubDate>
<dc:creator>almeidamike</dc:creator>
<guid>http://almeidamike.wordpress.com/2009/11/05/trac-fixing-the-sqlite-db/</guid>
<description><![CDATA[Thanks to http://www.otterbook.com/blog/2009/08/fixing-the-sqlite-db-for-a-trac-instance/ , I found ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Thanks to <a href="http://www.otterbook.com/blog/2009/08/fixing-the-sqlite-db-for-a-trac-instance/">http://www.otterbook.com/blog/2009/08/fixing-the-sqlite-db-for-a-trac-instance/</a> , I found out how to fix a Trac instance when I got the message</p>
<p>&#8220;DatabaseError: database disk image is malformed”</p>
<p>Here it is:</p>
<p>$ cd /path/to/trac-sqlite-db-directory # find the trac.db file<br />
$ su www-data   # switch to the owner of the db file<br />
$ mv trac.db trac.db.damaged<br />
$ sqlite3 trac.db.damaged .dump&#124;sqlite3 trac.db</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Read/Write data on the iPhone: Property Lists, SQLite, or Core Data? | Tapity]]></title>
<link>http://catchxxtwo.wordpress.com/2009/11/04/readwrite-data-on-the-iphone-property-lists-sqlite-or-core-data-tapity/</link>
<pubDate>Wed, 04 Nov 2009 20:51:06 +0000</pubDate>
<dc:creator>catchxxtwo</dc:creator>
<guid>http://catchxxtwo.wordpress.com/2009/11/04/readwrite-data-on-the-iphone-property-lists-sqlite-or-core-data-tapity/</guid>
<description><![CDATA[Read/Write data on the iPhone: Property Lists, SQLite, or Core Data? | Tapity. Plists, SQLite, or Co]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a href="http://tapity.com/iphone-app-development/readwrite-data-on-the-iphone-property-lists-sqlite-or-core-data/">Read/Write data on the iPhone: Property Lists, SQLite, or Core Data? &#124; Tapity</a>.</p>
<p>Plists, SQLite, or Core Data&#8230;which is best for persistent data in my iPhone app?</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[QuickConnectiPhone 1.6 beta 3 now available]]></title>
<link>http://tetontech.wordpress.com/2009/10/31/quickconnectiphone-1-6-beta-3-now-available/</link>
<pubDate>Sat, 31 Oct 2009 21:57:05 +0000</pubDate>
<dc:creator>tetontech</dc:creator>
<guid>http://tetontech.wordpress.com/2009/10/31/quickconnectiphone-1-6-beta-3-now-available/</guid>
<description><![CDATA[QCiPhone 1.6 beta 3 includes: All new Xcode apps created using the 1.6 beta 2 or later Xcode templat]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>QCiPhone 1.6 beta 3 includes:</p>
<ul>
<li>All new Xcode apps created using the 1.6 beta 2 or later Xcode template will auto-update to a new version of QCiPhone when you run the QCFamily installer</li>
<li>A fix for the permission build error in beta 2</li>
<li>In application maps.  This feature allows you to drop any number of pins as well as show the current location of the device.</li>
<li>A new object, DBScript, that allows you to do bulk updates to the SQLite database in a transactionally safe fashion (in-browser only for now.  Will work for native databases in the next beta.</li>
</ul>
<p>Examples for both the in-app maps (MapExample) and DBScript (BrowserDBScript) exist in the iPhone Examples directory of the download.</p>
<p>The post just previous to this one shows how to use the DBScript object.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[SQLite bulk data update or insert]]></title>
<link>http://tetontech.wordpress.com/2009/10/31/sqlite-bulk-data-update-or-insert/</link>
<pubDate>Sat, 31 Oct 2009 21:02:14 +0000</pubDate>
<dc:creator>tetontech</dc:creator>
<guid>http://tetontech.wordpress.com/2009/10/31/sqlite-bulk-data-update-or-insert/</guid>
<description><![CDATA[I just added SQLite bulk updates for in-browser databases (native databases coming soon) to the Quic]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I just added SQLite bulk updates for in-browser databases (native databases coming soon) to the QuickConnect iPhone framework (1.6 beta 3).  I did this by creating and adding to the framework an object called DBScript.  It is transactionally safe.  If one of your updates in the script fails all changes are rolled back.</p>
<p>It is also easy to use.  The code below comes from the databaseDefinition.js file of the new BrowserDBScript dashcode example.  In it a link to the database is established using the DataAccessObject.  Then the DBScript object is created and a series of SQL statements are added to the script.  Lastly, the script is executed.  Notice that the script object works for both standard and prepared statements.</p>
<p>If you are using this after a data pull from a network resource or after querying the user for information to insert, make sure you use a prepared statement type call to avoid SQL insertion attacks.</p>
<p><span style="font-family:Menlo, 'Times New Roman', 'Bitstream Charter', Times, serif;color:#008526;font-size:small;"><span style="line-height:normal;"> </span></span></p>
<p><span style="font-family:Menlo, 'Times New Roman', 'Bitstream Charter', Times, serif;color:#008526;font-size:small;"> </span></p>
<p style="font:11px Menlo;color:#008526;margin:0;">/*</p>
<p style="font:11px Menlo;color:#008526;margin:0;">* An example of how to use the DBScript object to populate a database.</p>
<p style="font:11px Menlo;color:#008526;margin:0;">* This will be done as a single transaction and is transactionally safe.</p>
<p style="font:11px Menlo;color:#008526;margin:0;">* This means that all changes will be rolled back if any</p>
<p style="font:11px Menlo;color:#008526;margin:0;">* database error happens.</p>
<p style="font:11px Menlo;color:#008526;margin:0;">*/</p>
<p style="font:11px Menlo;min-height:13px;margin:0;">
<p style="font:11px Menlo;min-height:13px;margin:0;">
<p style="font:11px Menlo;min-height:13px;margin:0;">
<p style="font:11px Menlo;color:#008526;margin:0;"><span style="color:#000000;"> </span>//create or connect to the in-UIWebView database</p>
<p style="font:11px Menlo;margin:0;"><span style="color:#c70000;">var</span> database = <span style="color:#c70000;">new</span> DataAccessObject(<span style="color:#a400c5;">&#8220;WelcomeExample&#8221;</span>, <span style="color:#a400c5;">&#8220;1.0&#8243;</span>, <span style="color:#a400c5;">&#8220;Welcome example&#8221;</span>, <span style="color:#3200ff;">20</span>);</p>
<p style="font:11px Menlo;min-height:13px;margin:0;">
<p style="font:11px Menlo;color:#008526;margin:0;"><span style="color:#000000;"> </span>//create the script object</p>
<p style="font:11px Menlo;margin:0;"><span style="color:#c70000;">var</span> bulkInsertScript = <span style="color:#c70000;">new</span> DBScript(database);</p>
<p style="font:11px Menlo;min-height:13px;margin:0;">
<p style="font:11px Menlo;color:#008526;margin:0;"><span style="color:#000000;"> </span>//add all statements to the script object</p>
<p style="font:11px Menlo;color:#a400c5;margin:0;"><span style="color:#000000;"> bulkInsertScript.addStatement(</span>&#8220;CREATE TABLE IF NOT EXISTS names (id INTEGER UNIQUE, name TEXT)&#8221;<span style="color:#000000;">);</span></p>
<p style="font:11px Menlo;min-height:13px;margin:0;">
<p style="font:11px Menlo;color:#a400c5;margin:0;"><span style="color:#000000;"> bulkInsertScript.addStatement(</span>&#8220;INSERT INTO names VALUES(1,&#8217;Bob&#8217;)&#8221;<span style="color:#000000;">);</span></p>
<p style="font:11px Menlo;color:#a400c5;margin:0;"><span style="color:#000000;"> bulkInsertScript.addStatement(</span>&#8220;INSERT INTO names VALUES(2,&#8217;Sue&#8217;)&#8221;<span style="color:#000000;">);</span></p>
<p style="font:11px Menlo;color:#008526;margin:0;"><span style="color:#000000;"> </span>//and example of using a prepared statement</p>
<p style="font:11px Menlo;margin:0;">bulkInsertScript.addStatement(<span style="color:#a400c5;">&#8220;INSERT INTO names VALUES(?,?)&#8221;</span>,[<span style="color:#3200ff;">3</span>,<span style="color:#a400c5;">"Jose"</span>]);</p>
<p style="font:11px Menlo;color:#a400c5;margin:0;"><span style="color:#000000;"> bulkInsertScript.addStatement(</span>&#8220;INSERT INTO names VALUES(4,&#8217;Bjorn&#8217;)&#8221;<span style="color:#000000;">);</span></p>
<p style="font:11px Menlo;color:#a400c5;margin:0;"><span style="color:#000000;"> bulkInsertScript.addStatement(</span>&#8220;INSERT INTO names VALUES(5,&#8217;Jean&#8217;)&#8221;<span style="color:#000000;">);</span></p>
<p style="font:11px Menlo;color:#a400c5;margin:0;"><span style="color:#000000;"> bulkInsertScript.addStatement(</span>&#8220;INSERT INTO names VALUES(6,&#8217;Gustav&#8217;)&#8221;<span style="color:#000000;">);</span></p>
<p style="font:11px Menlo;min-height:13px;margin:0;">
<p style="font:11px Menlo;color:#008526;margin:0;"><span style="color:#000000;"> </span>//execute all statements within a transaction</p>
<p style="font:11px Menlo;margin:0;">bulkInsertScript.executeSetDataScript();</p>
<p>&#160;</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[แนะนำการใช้ฐานข้อมูล SQLite กับ Lazarus]]></title>
<link>http://priabroy.wordpress.com/2009/10/30/%e0%b9%81%e0%b8%99%e0%b8%b0%e0%b8%99%e0%b8%b3%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b9%83%e0%b8%8a%e0%b9%89%e0%b8%90%e0%b8%b2%e0%b8%99%e0%b8%82%e0%b9%89%e0%b8%ad%e0%b8%a1%e0%b8%b9%e0%b8%a5-sqlite-%e0%b8%81/</link>
<pubDate>Fri, 30 Oct 2009 10:06:54 +0000</pubDate>
<dc:creator>prajuab riabroy</dc:creator>
<guid>http://priabroy.wordpress.com/2009/10/30/%e0%b9%81%e0%b8%99%e0%b8%b0%e0%b8%99%e0%b8%b3%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b9%83%e0%b8%8a%e0%b9%89%e0%b8%90%e0%b8%b2%e0%b8%99%e0%b8%82%e0%b9%89%e0%b8%ad%e0%b8%a1%e0%b8%b9%e0%b8%a5-sqlite-%e0%b8%81/</guid>
<description><![CDATA[ข้อดีของ SQLite พัฒนาโดย D. Richard Hipp ด้วยภาษา C จำนวนโค๊ดรวมๆแล้วประมาณสามหมื่นกว่าบรรทัด ซึ่งผู]]></description>
<content:encoded><![CDATA[ข้อดีของ SQLite พัฒนาโดย D. Richard Hipp ด้วยภาษา C จำนวนโค๊ดรวมๆแล้วประมาณสามหมื่นกว่าบรรทัด ซึ่งผู]]></content:encoded>
</item>
<item>
<title><![CDATA[Detect Duplicates in sqlite]]></title>
<link>http://lburgy.wordpress.com/2009/10/28/detect-duplicates-in-sqlite/</link>
<pubDate>Wed, 28 Oct 2009 15:45:55 +0000</pubDate>
<dc:creator>lburgy</dc:creator>
<guid>http://lburgy.wordpress.com/2009/10/28/detect-duplicates-in-sqlite/</guid>
<description><![CDATA[If we&#8217;re looking for duplicates inside the same table: select (refLocation, macroName) FROM ma]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>If we&#8217;re looking for duplicates inside the same table:</p>
<pre>select (refLocation, macroName)
FROM macrosMD5
GROUP BY refLocation
HAVING( COUNT(refLocation)&#62;1);;
</pre>
<p>In this case we&#8217;re looking for macros with the same refLocation</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Тестируем SQLite3 в PHP5.3.0]]></title>
<link>http://xezzus.wordpress.com/2009/10/28/%d1%82%d0%b5%d1%81%d1%82%d0%b8%d1%80%d1%83%d0%b5%d0%bc-sqlite3-%d0%b2-php5-3-0/</link>
<pubDate>Wed, 28 Oct 2009 08:19:38 +0000</pubDate>
<dc:creator>xezzus</dc:creator>
<guid>http://xezzus.wordpress.com/2009/10/28/%d1%82%d0%b5%d1%81%d1%82%d0%b8%d1%80%d1%83%d0%b5%d0%bc-sqlite3-%d0%b2-php5-3-0/</guid>
<description><![CDATA[PHP код для проверки &lt;?php $db = new SQLite3('test.db'); if(!is_file('test.db')) $db-&gt;exec("CR]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><strong>PHP код для проверки</strong></p>
<p><code>&#60;?php<br />
$db = new SQLite3('test.db');<br />
if(!is_file('test.db')) $db-&#62;exec("CREATE TABLE i_s (id INTEGER PRIMARY KEY AUTOINCREMENT,data TEXT)");</p>
<p>$time[1] = microtime(1);<br />
// $db-&#62;exec("BEGIN");<br />
for($i=0;$i&#60;=1000;$i++){<br />
$db-&#62;exec("INSERT INTO i_s (data) VALUES ('".microtime(1)."')");<br />
}<br />
// $db-&#62;exec("COMMIT");<br />
$time[2] = microtime(1);</p>
<p>$time[3] = $time[2]-$time[1];</p>
<p>print_r($time);<br />
?&#62;</code></p>
<p><strong>Общие сведения</strong></p>
<p>Таблица    : CREATE TABLE i_s (id INTEGER PRIMARY KEY AUTOINCREMENT,data TEXT);<br />
Запись    : INSERT INTO i_s (data) VALUES (&#8216;&#8221;.microtime(1).&#8221;&#8216;)</p>
<p><strong>Типы тестирования</strong></p>
<p>SQLite3::exec() -&#62; без commit, 1000 строк на запись<br />
59.185881853104 сек<br />
SQLite3::exec() -&#62; с commit, 1000 строк на запись<br />
0.21351504325867 сек<br />
SQLite3::query() -&#62; без commit, 1000 строк на запись<br />
56.950169086456<br />
SQLite3::query() -&#62; с commit, 1000 строк на запись<br />
0.26426601409912</p>
<p><strong>Тестируем запросы с commit, увеличив количество записей до 100 000</strong></p>
<p>SQLite3::exec() -&#62; с commit, 100 000 строк на запись<br />
14.51909995079<br />
SQLite3::query() -&#62; с commit, 100 000 строк на запись<br />
14.552824020386</p>
<p><strong>Тестируем запросы с commit, увеличив количество записей до 100 000 000</strong></p>
<p>SQLite3::exec() -&#62; с commit, 100 000 000 строк на запись<br />
не проверено<br />
SQLite3::query() -&#62; с commit, 100 000 000 строк на запись<br />
не проверено</p>
<p><strong>Замеченные детали</strong></p>
<p>При использовании COMMIT идет нагрузка на процессор.<br />
Если не использовать COMMIT то нагруска идет на жесткий диск.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[How to make Sqlite Faster ?]]></title>
<link>http://lburgy.wordpress.com/2009/10/27/how-to-make-sqlite-faster/</link>
<pubDate>Tue, 27 Oct 2009 19:15:26 +0000</pubDate>
<dc:creator>lburgy</dc:creator>
<guid>http://lburgy.wordpress.com/2009/10/27/how-to-make-sqlite-faster/</guid>
<description><![CDATA[We can use transactions, nothing really fancy Actually, SQLite will easily do 50,000 or more INSERT ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>We can use transactions, nothing really fancy</p>
<blockquote><p>Actually, SQLite will easily do 50,000 or more <a href="http://www.sqlite.org/lang_insert.html">INSERT</a> statements per second   on an average desktop computer.  But it will only do a few dozen transactions   per second.  Transaction speed is limited by the rotational speed of   your disk drive.  A transaction normally requires two complete rotations   of the disk platter, which on a 7200RPM disk drive limits you to about   60 transactions per second.Transaction speed is limited by disk drive speed because (by default)   SQLite actually waits until the data really is safely stored on the disk   surface before the transaction is complete.  That way, if you suddenly lose   power or if your OS crashes, your data is still safe.  For details,    read about <a href="http://www.sqlite.org/atomiccommit.html">atomic commit in SQLite.</a>.</p></blockquote>
<p>Another solution is to set the synchronous pragma to false</p>
<blockquote><p>ith synchronous OFF (0), SQLite continues without pausing     as soon as it has handed data off to the operating system.     If the application running SQLite crashes, the data will be safe, but     the database might become corrupted if the operating system     crashes or the computer loses power before that data has been written     to the disk surface.  On the other hand, some     operations are as much as 50 or more times faster with synchronous OFF.</p></blockquote>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[jHolidays project]]></title>
<link>http://tillias.wordpress.com/2009/10/25/jholidays-project/</link>
<pubDate>Sun, 25 Oct 2009 15:21:51 +0000</pubDate>
<dc:creator>tillias</dc:creator>
<guid>http://tillias.wordpress.com/2009/10/25/jholidays-project/</guid>
<description><![CDATA[Some time ago I&#8217;ve decided to create a small utility which will be able to create ICal calenda]]></description>
<content:encoded><![CDATA[Some time ago I&#8217;ve decided to create a small utility which will be able to create ICal calenda]]></content:encoded>
</item>
<item>
<title><![CDATA[Gears - La navigation hors ligne]]></title>
<link>http://mnam.wordpress.com/2009/10/25/gears-la-navigation-hors-ligne/</link>
<pubDate>Sun, 25 Oct 2009 02:00:13 +0000</pubDate>
<dc:creator>Guillaume</dc:creator>
<guid>http://mnam.wordpress.com/2009/10/25/gears-la-navigation-hors-ligne/</guid>
<description><![CDATA[Gears est un prototype logiciel proposé par Google pour permettre l&#8217;accès hors-ligne à des ser]]></description>
<content:encoded><![CDATA[Gears est un prototype logiciel proposé par Google pour permettre l&#8217;accès hors-ligne à des ser]]></content:encoded>
</item>
<item>
<title><![CDATA[SQLite + C# + Billy Oposto = será que dá jogo ?]]></title>
<link>http://mcunha98.wordpress.com/2009/10/24/sqlite-c-billy-oposto/</link>
<pubDate>Sat, 24 Oct 2009 21:33:52 +0000</pubDate>
<dc:creator>mcunha98</dc:creator>
<guid>http://mcunha98.wordpress.com/2009/10/24/sqlite-c-billy-oposto/</guid>
<description><![CDATA[A idéia de abandonar o arquivo XML já vem me azucrinando a cabeça não é de hoje. Estudei um pouco só]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>A idéia de abandonar o arquivo XML já vem me azucrinando a cabeça não é de hoje. Estudei um pouco só para fazer a implementação do driver SQLite dentro do Visual Studio, graças à um bom esforço da comunidade, hoje o SQLite <em>fala</em> com o Server Explorer do Visual Studio, isso ajuda muito no desenho e desenvolvimento das tabelas que serão empregadas.</p>
<p>Vou começar a guardar estados do cenário, como já comentei, com classes estáticas (por enquanto) estou guardando o estado de moedas, mas o mapa é algo complexo, pois se você visitar um determinado <em>portal </em>ou seja, entrar por exemplo na estação de água e voltar para o cenário existe algumas regras que devem ser seguidas.</p>
<p>O cenário já suporta mudanças de estado, isso ajuda bastante, mas ainda assim, existem mais coisas para se fazer. Por exemplo, se <em>eu já abri um baú</em> ele deve voltar ao cenário no estado aberto e não ter mais possibilidade de ser aberto (isso é estado do objeto e não do cenário).</p>
<p>Aqui está um pequeno (bem pequeno pra ser sincero) teste que fiz, ele vai possibilitar gerenciar os estados através de um tabela SQLite.</p>
<p><a href="http://mcunha98.wordpress.com/files/2009/10/sqlite-billy-1.png"><img class="aligncenter size-full wp-image-1257" title="sqlite-billy-1" src="http://mcunha98.wordpress.com/files/2009/10/sqlite-billy-1.png" alt="sqlite-billy-1" width="500" height="256" /></a>Eu me empolguei em falar do SQLite e esqueci de algo básico. Estou implementando marcadores de retorno (vide o &#8220;R&#8221; nas imagens), este objeto vai fazer que você volte automaticamente para um determinado ponto do jogo, e não mais apareça somente no posicionamento do WorldSpawn (o primeiro <em>ponto de retorno</em> que foi criado no jogo).</p>
<p><a href="http://mcunha98.wordpress.com/files/2009/10/sqlite-billy-2.png"><img class="aligncenter size-full wp-image-1258" title="sqlite-billy-2" src="http://mcunha98.wordpress.com/files/2009/10/sqlite-billy-2.png" alt="sqlite-billy-2" width="500" height="392" /></a></p>
<p>Neste exemplo, o <strong>P</strong> é o portal que vai te levar para o cenário da estação de água, já o <strong>R</strong> fará com que você ao sair do cenário da estação de água, retorno para o ponto mais próximo do portal.</p>
<p>Ainda precisa de ajustes, mas em breve deverá estar ok, aí sim, virá uma fase dificil realmente, que é migrar o XML para o SQLite, o processo hoje no XML é bom, mas via SQLite será bem melhor (não acredito que seja mais rápido, mas me abre mais possibilidades e me dará mais segurança).</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Easy Databasing with SQLite]]></title>
<link>http://webtech.wordpress.com/2009/10/20/easy-databasing-with-sqlite/</link>
<pubDate>Tue, 20 Oct 2009 20:26:06 +0000</pubDate>
<dc:creator>webtech</dc:creator>
<guid>http://webtech.wordpress.com/2009/10/20/easy-databasing-with-sqlite/</guid>
<description><![CDATA[Easy Databasing with SQLite | Build Internet!.]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a href="http://buildinternet.com/2009/10/easy-databasing-with-sqlite/">Easy Databasing with SQLite &#124; Build Internet!</a>.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Browsing the Lightroom Catalog]]></title>
<link>http://bkkphotographer.wordpress.com/2009/10/20/browsing-the-lightroom-catalog/</link>
<pubDate>Tue, 20 Oct 2009 04:45:18 +0000</pubDate>
<dc:creator>bkkphotographer</dc:creator>
<guid>http://bkkphotographer.wordpress.com/2009/10/20/browsing-the-lightroom-catalog/</guid>
<description><![CDATA[I have not given up on my quest to be able to generate reports on my Lightroom database catalog. I t]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I have not given up on my quest to be able to generate reports on my Lightroom database catalog. I talked about my reasons for it <a title="What I've Been Working On" href="http://bkkphotographer.wordpress.com/2009/07/06/what-ive-been-working-on/" target="_blank">here</a> and <a title="Lightroom Enhancement Requests" href="http://bkkphotographer.wordpress.com/2009/08/24/my-lightroom-library-top-10-enhancement-requests/" target="_blank">here</a>.</p>
<p>The imaginatively named <a title="SQLite Database Browser" href="http://sqlitebrowser.sourceforge.net/" target="_blank">SQLite Database Browser</a> I found at sourceforge.net is very slow.</p>
<div id="attachment_2311" class="wp-caption alignnone" style="width: 460px"><a href="http://bkkphotographer.wordpress.com/files/2009/10/sqlite-database-browser-about.jpg"><img class="size-full wp-image-2311" title="SQLite Database Browser About" src="http://bkkphotographer.wordpress.com/files/2009/10/sqlite-database-browser-about.jpg" alt="SQLite Database Browser About" width="450" height="193" /></a><p class="wp-caption-text">SQLite Database Browser About</p></div>
<p>But yesterday a <a title="Useful Comments" href="http://bkkphotographer.wordpress.com/2009/09/17/the-case-of-the-ever-changing-status/#comments" target="_blank">poster to this blog</a> recommended a better one. It&#8217;s called SQLite Spy. It&#8217;s free for non-commercial use. I like free! You can download it <a title="SQLite Spy" href="http://www.yunqa.de/delphi/doku.php/products/sqlitespy/index" target="_blank">here</a>.</p>
<div id="attachment_2313" class="wp-caption alignnone" style="width: 460px"><a href="http://bkkphotographer.wordpress.com/files/2009/10/sqlitespy-about.jpg"><img class="size-full wp-image-2313" title="SQLiteSpy About" src="http://bkkphotographer.wordpress.com/files/2009/10/sqlitespy-about.jpg" alt="SQLiteSpy About" width="450" height="411" /></a><p class="wp-caption-text">SQLiteSpy About</p></div>
<p>It is very fast &#8211; even when examining my 1GB main Lightroom Catalog. (I am living in fear that it will break soon. I&#8217;m approaching 50,000 pictures catalogued. See <a title="All photos in one catalog" href="http://bkkphotographer.wordpress.com/2009/08/06/why-i-want-all-my-pictures-in-one-lightroom-catalog/" target="_blank">here</a> and <a title="Lightroom Lab" href="http://bkkphotographer.wordpress.com/2009/08/03/optimizing-lightroom-for-best-performance-top-ten-lightroom-speed-tips-thelightroomlab-com-written-by-scott-rouse/" target="_blank">here</a>.)</p>
<p>Here&#8217;s the SQLiteSpy display of the table &#8220;Adobe_images&#8221; that has one row for every photo (or virtual copy) catalogued by Lightroom.</p>
<div id="attachment_2314" class="wp-caption alignnone" style="width: 460px"><a href="http://bkkphotographer.wordpress.com/files/2009/10/sqlitespy-adobe_images.jpg"><img class="size-full wp-image-2314" title="SQLiteSpy Adobe_images" src="http://bkkphotographer.wordpress.com/files/2009/10/sqlitespy-adobe_images.jpg" alt="SQLiteSpy Adobe_images - click to see full sized" width="450" height="281" /></a><p class="wp-caption-text">SQLiteSpy Adobe_images - click to see full sized</p></div>
<p>Of course, this is an extremely powerful tool. I must be very careful, especially with my &#8220;production&#8221; catalog. I read a cautionary tale <a title="Lightroom Cautionary Tale" href="http://forums.adobe.com/thread/418962" target="_blank">here</a> about how a Lightroom user / database geek made Lightroom behave very strangely by making a change to the database using SQL.</p>
<p>He deleted references to some sidecar files by replacing the contents of the field with NULL. But Lightroom started acting strangely and would not display thumbnails consistently. It turned out that he should have used an empty string rather than NULL.</p>
<p>That distinction is a classic database programming error but it is very obscure to most people. Try explaining the difference between NULL and an empty string to a child! Actually, I thought that using NULL was better programming practice as database are optimized for NULL checks. But the Adobe engineer who wrote that part of Lightroom used an empty string and never imagined that anybody would mess with her tables.</p>
<p>I should spend the time to reverse-engineer the Lightroom Catalog schema. That&#8217;s the database geek word for the tables and most importantly the relationships between them. But my database knowledge is rusty and it would take me weeks. Adobe will release Lightroom 3.0 before I&#8217;m satisfied.</p>
<p>Also &#8230;</p>
<p>The ability to execute arbitrary SQL on the database is useful and it may save me from some problems that cannot be fixed using the Lightroom client. Maybe there&#8217;s something wrong with the database that causes my &#8220;<a title="Lightroom Ever Changing Status" href="http://bkkphotographer.wordpress.com/2009/09/17/the-case-of-the-ever-changing-status/" target="_blank">Ever Changing Status</a>&#8221; problem. Every time <a title="My First Lightroom Crash" href="http://bkkphotographer.wordpress.com/2009/06/30/my-first-lightroom-crash/" target="_blank">Lightroom crashes</a> I worry the catalog will be corrupted.</p>
<p>But &#8211; it isn&#8217;t what I want. I have yet to find a fully functional <a title="ODBC Driver for Lightroom SQLLite" href="http://bkkphotographer.wordpress.com/2009/07/06/what-ive-been-working-on/" target="_blank">ODBC driver</a> that will allow me to attach SQLite tables to Microsoft Access. Then I can do the database reports that I crave. There&#8217;s so much good information in my metadata but I cannot present it as I would like.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Sqlite Developer v3.5.2.418]]></title>
<link>http://rvsload.wordpress.com/2009/10/12/sqlite-developer-v3-5-2-418/</link>
<pubDate>Mon, 12 Oct 2009 02:45:00 +0000</pubDate>
<dc:creator>rvsload</dc:creator>
<guid>http://rvsload.wordpress.com/2009/10/12/sqlite-developer-v3-5-2-418/</guid>
<description><![CDATA[Sqlite Developer v3.5.2.418 / 10.99 Mb Sqlite Developer, a effective database manager thgat pleasure]]></description>
<content:encoded><![CDATA[Sqlite Developer v3.5.2.418 / 10.99 Mb Sqlite Developer, a effective database manager thgat pleasure]]></content:encoded>
</item>
<item>
<title><![CDATA[دو روش يكپارچه سازي تاريخچه فايرفاكس براي كارائي بهتر]]></title>
<link>http://egza.wordpress.com/2009/10/10/optimize-firefox-sqlite-manager-database-speedyfox-portable-inifox/</link>
<pubDate>Sat, 10 Oct 2009 15:55:00 +0000</pubDate>
<dc:creator>egza</dc:creator>
<guid>http://egza.wordpress.com/2009/10/10/optimize-firefox-sqlite-manager-database-speedyfox-portable-inifox/</guid>
<description><![CDATA[از نسخه فايرفاكس 3.0 به يعد بوكماركها ، هيستوري ، ليست دانلودها و اطلاعاتي از اين دست در ديتابيس هاي]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>از نسخه فايرفاكس 3.0 به يعد بوكماركها ، هيستوري ، ليست دانلودها و اطلاعاتي از اين دست در ديتابيس هاي sqlite&#160; ذخيره شدند كه مزايا و معايبي دارد به مرور زمان و با توجه به عادت وبگرديتان اين ديتابيس ها داراي اطلاعات مفيد و حجيمي خواهد شد مثلا نوار آدرس هوشمند فايرفاكس 3 با توجه به تعداد دفعات بازديد، عنوان و… پايگاه داده سايتهاي بازديد شده رو جستجو كرده و ليستي از آدرسها را پيشنهاد ميده كه اكثر اوقات بسيار مفيد است. فايرفاكس حدود ده ديتابيس SQLite دارد:content-prefs.sqlite, cookies.sqlite, downloads.sqlite, formhistory.sqlite, places.sqlite, permissions.sqlite, search.sqlite, signons.sqlite, urlclassifier3.sqlite and webappsstore.sqlite</p>
<p>SQLite مانند هر پايگاه‌داده‌ي ديگري بعد از مدتي داراي فضاي خالي بين داده ها و گسيختگي شده و نياز به دفرگ و مرتب سازي پيدا ميكند از آنجاييكه هيچ برنامه اي براي چك كردن و بهينه سازي پايگاه داده به طور پبش فرض در نظر گرفته نشده است افزايش حجم پايگاه داده سبب كاهش كارايي ، افزايش زمان جستجو و لود شدن برنامه و… ميشود.</p>
<p><strong>يك كليك تا بهينه سازي فايرفاكس با SpeedyFox</strong></p>
<p>SpeedyFox برنامه كوچك و جديد براي بهينه سازي و رفع مشكلات فايرفاكس فقط با يك كليك است بعد از اجراي نرم افزار سرعت فايرفاكس به طور قابل توجهي بيشتر شده و استفاده از فايرفاكس لذت بخش تر خواهد شد اين نرم‌افزار پوشه پروفايل را تشخيص داده و در ليستي نمايش ميدهد و تنها كاري كه نياز است انجام دهيد فشردن دكمه Speed Up My Firefox! است.</p>
<p><a href="http://egza.files.wordpress.com/2009/10/image.png"><img title="image" style="display:block;float:none;margin-left:auto;margin-right:auto;" height="273" alt="image" src="http://egza.files.wordpress.com/2009/10/image_thumb.png?w=447&#038;h=273" width="447" border="0" /></a> فرآيند بهينه سازي ميتواند به نسبت حجم تاريخچه فايرفاكس چند دقيقه طول بكشد. SpeedyFox فعلا فقط براي ويندوز منتشر شده است <a href="http://www.crystalidea.com/speedyfox">صفحه دانلود</a></p>
<p><strong></strong></p>
<p><strong></strong></p>
<p><strong>يكپارچه سازي بانكهاي اطلاعاتي فايرفاكس با نرم افزار SQLite Manager:</strong><a href="http://egza.files.wordpress.com/2009/10/firefox_bomb.gif"><strong><img title="firefox_bomb" style="display:inline;margin-left:0;margin-right:0;" height="96" alt="firefox_bomb" src="http://egza.files.wordpress.com/2009/10/firefox_bomb_thumb.gif?w=200&#038;h=96" width="200" align="left" border="0" /></strong></a></p>
<p>1-SQLite Manager را از <a href="http://www.sqlite.org/download.html">اينجا</a> دانلود كنيد (<a href="http://www.sqlite.org/sqlite-3_6_18.zip">لينك مستقيم دانلود جديدترين نسخه ويندوز</a>) </p>
<p>2-فايل دانلود شده را از حالت فشرده خارج كرده و در پوشه پروفايل فايرفاكس كه فايلهاي .sqlite قرار دارند كپي كنيد <a href="http://kb.mozillazine.org/Profile_folder#For_Windows_2000_and_XP_users">(مسير پوشه پروفايل</a> يا از سرچ *.sqlite استفاده كنيد) كپي كنيد</p>
<p>3- مطمئن باشيد فايرفاكس در حال اجرا نباشد و از خط فرمان دستور <strong>sqlite3.exe SQLiteDatabase VACUUM</strong> كه SQLiteDatabase را با نام ديتابيس جايگزين كنيد به عنوان مثال <strong>sqlite3.exe places.sqlite VACUUM</strong></p>
<p>فايل موقتي با اسم places.sqlite-journal ايجاد شده و ديتابيس مرتب در آن&#160; ساخته ميشود.</p>
<p>در ويندوز براي دفرگ كردن همه ديتابيسها ميتوان از دستور زير استفاده كرد:</p>
<p align="left"><strong>for %a in (*.sqlite) do (sqlite3 %a vacuum)&#160; </strong></p>
<p>&#160;</p>
<p>نتيجه چند تست:</p>
<table cellspacing="0" cellpadding="2" width="571" border="0">
<tbody>
<tr>
<td valign="top" width="174">
<p align="right">حجم places.sqlite قبل از دفرگ</p>
</td>
<td valign="top" width="132">
<p align="right">حجم places.sqlite بعد از دفرگ</p>
</td>
<td valign="top" width="124">
<p align="center">زمان استارت آپ قبل از دفرگ</p>
</td>
<td valign="top" width="139">
<p align="center">زمان استارت آپ بعد از دفرگ</p>
<p align="center">
</td>
</tr>
<tr>
<td valign="top" width="178">
<p align="center">10 مگابايت</p>
</td>
<td valign="top" width="143">
<p align="center">9 مگابايت</p>
</td>
<td valign="top" width="129">
<p align="center">11 ثانيه</p>
</td>
<td valign="top" width="140">
<p align="center">8 ثاينه</p>
</td>
</tr>
<tr>
<td valign="top" width="176">
<p align="center">40 مگابايت</p>
</td>
<td valign="top" width="149">
<p align="center">27 مگابايت</p>
</td>
<td valign="top" width="131">
<p align="center">10 ثانيه</p>
</td>
<td valign="top" width="139">
<p align="center">7 ثانيه</p>
</td>
</tr>
</tbody>
</table>
<p>ميتوان دستور دفرگ شدن ديتابيس هاي فايرفاكس را در ليست برنامه هايي كه به طور خودكار با ويندوز اجرا ميشوند گذاشت تا با هر بار شروع ويندوز فايرفاكس بهينه شود</p>
<p>روش ساده تر براي كاربران ويندوز استفاده از IniFox v 1.2 است كه با يك اسكريپت محل پروفايل را يافته و تمام ديتابيس‌هاي فايرفاكس رو دفرگ ميكند در اين روش نيازي به دستورات خط فرمان نيست و خيلي ساده تر است. دانلود IniFox <a href="http://www.infospyware.com/herramientas/inifox/">+</a></p>
<p>در تصوير زير ميتوانيد حجم فايلهاي ديتابيس فايرفاكس را قبل و بعد&#160; از اجراي SpeedyFox&#160; مقايسه كنيد سرعت اين نسخه از فايرفاكس كه استفاده ميكنم به طرز قابل توجهي افزايش يافت.</p>
<p><a href="http://egza.files.wordpress.com/2009/10/image1.png"><img title="image" style="border-right:0;border-top:0;display:block;float:none;margin-left:auto;border-left:0;margin-right:auto;border-bottom:0;" height="433" alt="image" src="http://egza.files.wordpress.com/2009/10/image_thumb1.png?w=472&#038;h=433" width="472" border="0" /></a></p>
<p>&#160;</p>
<p>منايع:</p>
<h6 align="left"><a title="Easily Optimize Firefox SQLite Databases with SpeedyFox Portable" href="http://www.raymond.cc/blog/archives/2009/09/01/easily-optimize-firefox-sqlite-databases-with-speedyfox-portable/">Easily Optimize Firefox SQLite Databases </a><a title="Easily Optimize Firefox SQLite Databases with SpeedyFox Portable" href="http://www.raymond.cc/blog/archives/2009/09/01/easily-optimize-firefox-sqlite-databases-with-speedyfox-portable/">with SpeedyFox Portable</a></h6>
<h6 align="left"><a title="http://mozillalinks.org/wp/2009/07/vacuum-your-firefox-databases-for-better-performance" href="http://mozillalinks.org/wp/2009/07/vacuum-your-firefox-databases-for-better-performance">http://mozillalinks.org/wp/2009/07/vacuum-your-firefox-databases-for-better-performance</a></h6>
</div>]]></content:encoded>
</item>

</channel>
</rss>
