<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>David on Laptop - Home</title>
  <id>tag:www.davidlauzon.net,2010:mephisto/</id>
  <generator uri="http://mephistoblog.com" version="0.8.0">Mephisto Drax</generator>
  <link href="http://www.davidlauzon.net/feed/atom.xml" rel="self" type="application/atom+xml"/>
  <link href="http://www.davidlauzon.net/" rel="alternate" type="text/html"/>
  <updated>2010-02-27T08:25:36Z</updated>
  <entry xml:base="http://www.davidlauzon.net/">
    <author>
      <name>david</name>
    </author>
    <id>tag:www.davidlauzon.net,2010-02-27:45</id>
    <published>2010-02-27T08:03:00Z</published>
    <updated>2010-02-27T08:25:36Z</updated>
    <category term="eclipse"/>
    <category term="subclipse"/>
    <category term="svn"/>
    <link href="http://www.davidlauzon.net/2010/2/27/use-svn-with-eclipse-galileo-on-ubuntu-9-10" rel="alternate" type="text/html"/>
    <title>Use svn with Eclipse Galileo on Ubuntu 9.10</title>
<content type="html">
            After wasting a lot  of time myself, I thought this could serve some other people...
&lt;br /&gt;&lt;br /&gt;

So here's how I did it :
&lt;br /&gt;
&lt;br /&gt;


&lt;ul&gt;
&lt;li&gt;First install the Subclipse plugin&lt;/li&gt;
  &lt;ol&gt;
    &lt;li&gt;Run sudo eclipse (that will install plugins system-wide)&lt;/li&gt;
    &lt;li&gt;Eclipse &gt; Install new software &gt; Add&lt;/li&gt;
    &lt;li&gt;Name = &quot;whatever&quot;&lt;/li&gt;
    &lt;li&gt;Location = &lt;b&gt;http://subclipse.tigris.org/update_1.6.x&lt;/b&gt;&lt;/li&gt;
    &lt;li&gt;OK&lt;/li&gt;
    &lt;li&gt;Work with: &quot;whatever&quot;&lt;/li&gt;
    &lt;li&gt;Select these to install :
      &lt;ul&gt;
        &lt;li&gt;CollabNet Merge Client&lt;/li&gt;
        &lt;li&gt;Subclipse&lt;/li&gt;
        &lt;li&gt;Subclipse Integration for Mylyn 3.x&lt;/li&gt;
        &lt;li&gt;Subversion Client Adapter&lt;/li&gt;
        &lt;li&gt;Subversion JavaHL Native Library Adapter&lt;/li&gt;
        &lt;li&gt;Subversion Revision Graph&lt;/li&gt;
      &lt;/ul&gt;
    &lt;/li&gt;
    &lt;li&gt;If you get a &quot;Subversion 1.6 contains a bug that causes Eclipse to crash .... GNOME keyring ... we recommand ... &quot;, choose OK.&lt;/li&gt;
  &lt;/ol&gt;
&lt;li&gt;Next install the Java bindings for SVN
  &lt;ol&gt;
    &lt;li&gt;sudo  apt-get install libsvn-java&lt;/li&gt;
    &lt;li&gt;Eclipse &gt; Window &gt; Preferences &gt; Team &gt; SVN&lt;/li&gt;
    &lt;li&gt;If that triggers a &quot;Failed to load JavaHL Library.&quot; error, you need to add libsvnjavahl-1 in the Eclipse path : &lt;/li&gt;
    &lt;li&gt;Just throw a symlink into one of the path in the error message :&lt;/li&gt;
    &lt;li&gt;
      &lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;         sudo ln -s /usr/lib/jni/libsvnjavahl-1.so /usr/lib/libsvnjavahl-1.so&lt;tt&gt;
&lt;/tt&gt;         sudo ln -s /usr/lib/jni/libsvnjavahl-1.so.0.0.0 /usr/lib/libsvnjavahl-1.so.0.0.0&lt;tt&gt;
&lt;/tt&gt;      &lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;

     &lt;/li&gt;
    &lt;li&gt;Restart eclipse and step 3 should be solved.&lt;/li&gt;
  &lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Perhaps you want to use SVN with existing checkout project ?
  &lt;ol&gt;
    &lt;li&gt;Right-click on your project in Eclipse&lt;/li&gt;
    &lt;li&gt;Team &gt; Share Project &gt; svn &gt; Validate Conneciton on Finish &gt; Finish&lt;/li&gt;
  &lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://subclipse.tigris.org/servlets/ProjectProcess?pageID=rr1TIx&quot;&gt;Screenshots of what you can do with Subclipse&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
          </content>  </entry>
  <entry xml:base="http://www.davidlauzon.net/">
    <author>
      <name>david</name>
    </author>
    <id>tag:www.davidlauzon.net,2010-02-21:44</id>
    <published>2010-02-21T22:06:00Z</published>
    <updated>2010-02-21T22:43:35Z</updated>
    <category term="howto"/>
    <category term="jambi"/>
    <category term="java"/>
    <category term="qt"/>
    <link href="http://www.davidlauzon.net/2010/2/21/how-to-use-qt-jambi-from-within-eclipse" rel="alternate" type="text/html"/>
    <title>How to use QT Jambi from within Eclipse</title>
<content type="html">
            This article is part 2/2 of using QT Jambi within Eclipse. &lt;a href=&quot;/2010/2/21/getting-started-with-qt-jambi-on-linux&quot;&gt;Click here to read the first part of this article, &quot;Getting started with QT Jambi on Linux&quot;&lt;/a&gt;.
&lt;br /&gt;&lt;br /&gt;

The present article you will learn how to design forms within eclipse and structure your QT code using the MVC pattern :
&lt;br /&gt;
&lt;br /&gt;

&lt;ol&gt;

&lt;li&gt;File &gt; New &gt; Other &gt; Qt Jambi Project (Using Designer Form)
&lt;/li&gt;
&lt;li&gt;Name it JambiWeb&lt;/li&gt;
&lt;li&gt;Add a new QT Jambi Designer Form and ajust settings like on screenshot.

&lt;/li&gt;
&lt;li&gt;This will create 3 files :
&lt;table&gt;
&lt;tr&gt;FileDescription&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;src/views/WebView.jui&lt;/code&gt;&lt;/td&gt;&lt;td&gt;XML used by the Designer&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;src/views/WebView.java&lt;/code&gt;&lt;/td&gt;&lt;td&gt; This is the view from the MVC concept, it displays the widgets contained in Ui_WebView.java&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;src/ui/views/Ui_WebView.java&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Java file generated from the XML (you should not edit this file because it will be automatically replaced when you make changes to the form in the Designer). This file is more like a container for the widgets in the form, it does *not* displays the elements.&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;/li&gt;
&lt;li&gt;Now in order to respect the MVC pattern, the view should not display itself, but rather we should have a controller to trigger the display of the view. Add WebController class in the controllers package and insert this code :
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;12&lt;tt&gt;
&lt;/tt&gt;13&lt;tt&gt;
&lt;/tt&gt;14&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;15&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;16&lt;tt&gt;
&lt;/tt&gt;17&lt;tt&gt;
&lt;/tt&gt;18&lt;tt&gt;
&lt;/tt&gt;19&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;20&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;21&lt;tt&gt;
&lt;/tt&gt;22&lt;tt&gt;
&lt;/tt&gt;23&lt;tt&gt;
&lt;/tt&gt;24&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;25&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;26&lt;tt&gt;
&lt;/tt&gt;27&lt;tt&gt;
&lt;/tt&gt;28&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;kw&quot;&gt;package&lt;/span&gt; controllers;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;kw&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;ic&quot;&gt;views.WebView&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;kw&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;ic&quot;&gt;com.trolltech.qt.gui.QApplication&lt;/span&gt;;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;di&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;ty&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;WebController&lt;/span&gt; {&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;di&quot;&gt;private&lt;/span&gt; WebView webView;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;di&quot;&gt;private&lt;/span&gt; Ui_WebView ui() { &lt;span class=&quot;kw&quot;&gt;return&lt;/span&gt; webView.ui(); }&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;di&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;di&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;ty&quot;&gt;void&lt;/span&gt; main(&lt;span class=&quot;ty&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;ty&quot;&gt;[]&lt;/span&gt; args) {&lt;tt&gt;
&lt;/tt&gt;        &lt;span class=&quot;kw&quot;&gt;new&lt;/span&gt; WebController(args);&lt;tt&gt;
&lt;/tt&gt;    }&lt;tt&gt;
&lt;/tt&gt;  &lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;di&quot;&gt;public&lt;/span&gt; WebController(&lt;span class=&quot;ty&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;ty&quot;&gt;[]&lt;/span&gt; args) {&lt;tt&gt;
&lt;/tt&gt;        QApplication.initialize(args);&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;        webView = &lt;span class=&quot;kw&quot;&gt;new&lt;/span&gt; WebView(&lt;span class=&quot;kw&quot;&gt;null&lt;/span&gt;);&lt;tt&gt;
&lt;/tt&gt;        webView.show();&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;        initEvents();&lt;tt&gt;
&lt;/tt&gt;        &lt;tt&gt;
&lt;/tt&gt;        QApplication.exec();&lt;tt&gt;
&lt;/tt&gt;    }&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;di&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;ty&quot;&gt;void&lt;/span&gt; initEvents() {&lt;tt&gt;
&lt;/tt&gt;    }&lt;tt&gt;
&lt;/tt&gt;}&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/li&gt;
&lt;li&gt;Now delete the main() method in views/WebView.java, and the contents should be as follow:&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;12&lt;tt&gt;
&lt;/tt&gt;13&lt;tt&gt;
&lt;/tt&gt;14&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;15&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;16&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;kw&quot;&gt;package&lt;/span&gt; views;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;kw&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;ic&quot;&gt;com.trolltech.qt.gui&lt;/span&gt;.*;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;di&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;ty&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;WebView&lt;/span&gt; &lt;span class=&quot;di&quot;&gt;extends&lt;/span&gt; QMainWindow {&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;di&quot;&gt;private&lt;/span&gt; Ui_WebView ui = &lt;span class=&quot;kw&quot;&gt;new&lt;/span&gt; Ui_WebView();&lt;tt&gt;
&lt;/tt&gt;    &lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;di&quot;&gt;public&lt;/span&gt; Ui_WebView ui() { &lt;span class=&quot;kw&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;lv&quot;&gt;this&lt;/span&gt;.ui; }&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;di&quot;&gt;public&lt;/span&gt; WebView(QWidget parent) {&lt;tt&gt;
&lt;/tt&gt;        &lt;span class=&quot;lv&quot;&gt;super&lt;/span&gt;(parent);&lt;tt&gt;
&lt;/tt&gt;        ui.setupUi(&lt;span class=&quot;lv&quot;&gt;this&lt;/span&gt;);&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;        setWindowTitle(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;A custom browser for your application&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;);&lt;tt&gt;
&lt;/tt&gt;    }&lt;tt&gt;
&lt;/tt&gt;}&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/li&gt;

&lt;li&gt;Next let's design our interface&lt;/li&gt;
&lt;li&gt;Open on views/WebView.jui and choose the &quot;QT Designer UI Perspective&quot;. This perspective should bring you a 3-tabbed panel on the right side of Eclipse view.&lt;/li&gt;
&lt;li&gt;So choose &quot;QT Object Inspector&quot; tab and right click on your QMainWindow item and choose &quot;add toolbar&quot;.

&lt;/li&gt;

&lt;li&gt;At the bottom of the screen, choose the &quot;QT Action Editor&quot; tab, and 2 actions (Reload, Stop), and drag &amp; drop them unto the toolbar you are designing.&lt;/li&gt;

&lt;li&gt;Next choose &quot;QT Widget Box&quot; tab.&lt;/li&gt;

&lt;li&gt;Add a QWebView widget and name it &quot;browser&quot; (using QT Object Inspector tab)&lt;/li&gt;

&lt;li&gt;Add a QLineEdit widget anywhere in the window - we'll add it to the toolbar manually.&lt;/li&gt;

&lt;li&gt;Your view should be looking like this :

&lt;/li&gt;

&lt;li&gt;Save WebView.jui and go back to the Java perspective to add these lines to views/WebView.java :
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;12&lt;tt&gt;
&lt;/tt&gt;13&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;    &lt;span class=&quot;di&quot;&gt;public&lt;/span&gt; WebView(QWidget parent) {&lt;tt&gt;
&lt;/tt&gt;        &lt;span class=&quot;c&quot;&gt;// ...&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;        ui.toolBar.addWidget( ui.urlEdit );&lt;tt&gt;
&lt;/tt&gt;        ui.toolBar.setFloatable(&lt;span class=&quot;kw&quot;&gt;false&lt;/span&gt;);&lt;tt&gt;
&lt;/tt&gt;        ui.toolBar.setMovable(&lt;span class=&quot;kw&quot;&gt;false&lt;/span&gt;);&lt;tt&gt;
&lt;/tt&gt;    }&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;   &lt;span class=&quot;di&quot;&gt;public&lt;/span&gt; Signal0 closed = &lt;span class=&quot;kw&quot;&gt;new&lt;/span&gt; Signal0(); &lt;tt&gt;
&lt;/tt&gt;   &lt;tt&gt;
&lt;/tt&gt;   &lt;span class=&quot;at&quot;&gt;@Override&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;di&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;ty&quot;&gt;void&lt;/span&gt; closeEvent(QCloseEvent event) {&lt;tt&gt;
&lt;/tt&gt;         &lt;span class=&quot;lv&quot;&gt;this&lt;/span&gt;.closed.emit();&lt;tt&gt;
&lt;/tt&gt;    }&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/li&gt;

&lt;li&gt;And let's add code to handle the events in controllers/WebController.java :
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;12&lt;tt&gt;
&lt;/tt&gt;13&lt;tt&gt;
&lt;/tt&gt;14&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;15&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;16&lt;tt&gt;
&lt;/tt&gt;17&lt;tt&gt;
&lt;/tt&gt;18&lt;tt&gt;
&lt;/tt&gt;19&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;20&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;21&lt;tt&gt;
&lt;/tt&gt;22&lt;tt&gt;
&lt;/tt&gt;23&lt;tt&gt;
&lt;/tt&gt;24&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;25&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;26&lt;tt&gt;
&lt;/tt&gt;27&lt;tt&gt;
&lt;/tt&gt;28&lt;tt&gt;
&lt;/tt&gt;29&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;30&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;31&lt;tt&gt;
&lt;/tt&gt;32&lt;tt&gt;
&lt;/tt&gt;33&lt;tt&gt;
&lt;/tt&gt;34&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;35&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;36&lt;tt&gt;
&lt;/tt&gt;37&lt;tt&gt;
&lt;/tt&gt;38&lt;tt&gt;
&lt;/tt&gt;39&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;40&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;41&lt;tt&gt;
&lt;/tt&gt;42&lt;tt&gt;
&lt;/tt&gt;43&lt;tt&gt;
&lt;/tt&gt;44&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;45&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;46&lt;tt&gt;
&lt;/tt&gt;47&lt;tt&gt;
&lt;/tt&gt;48&lt;tt&gt;
&lt;/tt&gt;49&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;50&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;51&lt;tt&gt;
&lt;/tt&gt;52&lt;tt&gt;
&lt;/tt&gt;53&lt;tt&gt;
&lt;/tt&gt;54&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;55&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;  &lt;span class=&quot;di&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;ty&quot;&gt;void&lt;/span&gt; initEvents() {&lt;tt&gt;
&lt;/tt&gt;        ui().actionReload.triggered.connect(&lt;span class=&quot;lv&quot;&gt;this&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;onReloadClicked()&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;);&lt;tt&gt;
&lt;/tt&gt;        ui().actionStop.triggered.connect(&lt;span class=&quot;lv&quot;&gt;this&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;onStopClicked()&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;);&lt;tt&gt;
&lt;/tt&gt;    &lt;tt&gt;
&lt;/tt&gt;        ui().urlEdit.returnPressed.connect(&lt;span class=&quot;lv&quot;&gt;this&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;onUrlEditReturnPressed()&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;);&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;        ui().browser.loadStarted.connect(&lt;span class=&quot;lv&quot;&gt;this&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;onLoadStarted()&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;);&lt;tt&gt;
&lt;/tt&gt;        ui().browser.loadProgress.connect(&lt;span class=&quot;lv&quot;&gt;this&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;onLoadProgress(int)&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;);&lt;tt&gt;
&lt;/tt&gt;        ui().browser.loadFinished.connect(&lt;span class=&quot;lv&quot;&gt;this&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;onLoadDone()&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;);&lt;tt&gt;
&lt;/tt&gt;        ui().browser.urlChanged.connect(&lt;span class=&quot;lv&quot;&gt;this&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;onUrlChanged(QUrl)&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;);&lt;tt&gt;
&lt;/tt&gt;        &lt;tt&gt;
&lt;/tt&gt;        webView.closed.connect(&lt;span class=&quot;lv&quot;&gt;this&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;onClosed()&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;);&lt;tt&gt;
&lt;/tt&gt;    }&lt;tt&gt;
&lt;/tt&gt;  &lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;di&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;ty&quot;&gt;void&lt;/span&gt; openURL() {&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;ty&quot;&gt;String&lt;/span&gt; text = ui().urlEdit.text();&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;        &lt;span class=&quot;kw&quot;&gt;if&lt;/span&gt; (text.indexOf(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;://&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;) &amp;lt; &lt;span class=&quot;i&quot;&gt;0&lt;/span&gt;)&lt;tt&gt;
&lt;/tt&gt;            text = &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;http://&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; + text;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;        ui().browser.load(&lt;span class=&quot;kw&quot;&gt;new&lt;/span&gt; QUrl(text));&lt;tt&gt;
&lt;/tt&gt;  }&lt;tt&gt;
&lt;/tt&gt;  &lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;di&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;ty&quot;&gt;void&lt;/span&gt; onReloadClicked() {&lt;tt&gt;
&lt;/tt&gt;    ui().browser.reload();&lt;tt&gt;
&lt;/tt&gt;  }&lt;tt&gt;
&lt;/tt&gt;  &lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;di&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;ty&quot;&gt;void&lt;/span&gt; onStopClicked() {&lt;tt&gt;
&lt;/tt&gt;    ui().browser.stop();&lt;tt&gt;
&lt;/tt&gt;  }&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;di&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;ty&quot;&gt;void&lt;/span&gt; onUrlEditReturnPressed() {&lt;tt&gt;
&lt;/tt&gt;        openURL();&lt;tt&gt;
&lt;/tt&gt;    }&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;di&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;ty&quot;&gt;void&lt;/span&gt; onUrlChanged(QUrl url) {&lt;tt&gt;
&lt;/tt&gt;        ui().urlEdit.setText(url.toString());&lt;tt&gt;
&lt;/tt&gt;    }&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;di&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;ty&quot;&gt;void&lt;/span&gt; onLoadStarted() {&lt;tt&gt;
&lt;/tt&gt;        ui().statusbar.showMessage(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Starting to load: &lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; + ui().urlEdit.text());&lt;tt&gt;
&lt;/tt&gt;    }&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;di&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;ty&quot;&gt;void&lt;/span&gt; onLoadDone() {&lt;tt&gt;
&lt;/tt&gt;      ui().statusbar.showMessage(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Loading done...&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;);&lt;tt&gt;
&lt;/tt&gt;    }&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;di&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;ty&quot;&gt;void&lt;/span&gt; onLoadProgress(&lt;span class=&quot;ty&quot;&gt;int&lt;/span&gt; x) {&lt;tt&gt;
&lt;/tt&gt;      ui().statusbar.showMessage(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Loading: &lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; + x + &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt; %&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;);&lt;tt&gt;
&lt;/tt&gt;    }&lt;tt&gt;
&lt;/tt&gt;    &lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;di&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;ty&quot;&gt;void&lt;/span&gt; onClosed() {&lt;tt&gt;
&lt;/tt&gt;      ui().browser.loadProgress.disconnect(&lt;span class=&quot;lv&quot;&gt;this&lt;/span&gt;);&lt;tt&gt;
&lt;/tt&gt;        ui().browser.loadFinished.disconnect(&lt;span class=&quot;lv&quot;&gt;this&lt;/span&gt;);&lt;tt&gt;
&lt;/tt&gt;    }&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;

&lt;/li&gt;

&lt;li&gt;In the code above you have an exemple of a custom signal (QT's observer/observable pattern). Here is how it works : when &lt;code&gt;QMainWindow::closeEvent()&lt;/code&gt; is triggered by QT when the user closes the app, we then delegates the information to the WebController via the signal &lt;code&gt;WebView::closed&lt;/code&gt;. For more details refer to &lt;a href=&quot;http://qt.nokia.com/doc/qtjambi-4.5.2_01/com/trolltech/qt/qtjambi-signalsandslots.html&quot;&gt;QT Jambi article on signals &amp; slots&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;

But wait a minute! Cool application use icons not text in the toolbar! Yes you can!

&lt;ol&gt;
&lt;li&gt;Download these two images ( , ) and save them in a directory named &quot;images&quot; in your eclipse project.&lt;/li&gt;
&lt;li&gt;Next add your images directory in your classpath: Project &gt; Properties &gt; Java Build Path &gt; Librairies &gt; Add Class Folder = &quot;images&quot;&lt;/li&gt;
&lt;li&gt;Add set the icon manually in &lt;code&gt;views/WebView.java&lt;/code&gt; :
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;    &lt;span class=&quot;di&quot;&gt;public&lt;/span&gt; WebView(QWidget parent) {&lt;tt&gt;
&lt;/tt&gt;        &lt;span class=&quot;c&quot;&gt;// ...&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;        ui.actionReload.setIcon(&lt;span class=&quot;kw&quot;&gt;new&lt;/span&gt; QIcon(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;classpath:/refresh32.png&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;));&lt;tt&gt;
&lt;/tt&gt;        ui.actionStop.setIcon(&lt;span class=&quot;kw&quot;&gt;new&lt;/span&gt; QIcon(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;classpath:/stop32.png&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;));&lt;tt&gt;
&lt;/tt&gt;    }&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;

&lt;/li&gt;
&lt;li&gt;Read on the &lt;a href=&quot;http://qt.nokia.com/doc/qtjambi-4.5.2_01/com/trolltech/qt/qtjambi-resourcesystemoverview.html&quot;&gt;QT Resource system&lt;/a&gt; to understand how this works.&lt;/li&gt;
&lt;/ol&gt;

Here you go! I hope this article will be usefull to someone!

&lt;br /&gt;

&lt;h2&gt;Source code&lt;/h2&gt;
&lt;a href=&quot;/assets/2010/2/21/JambiWeb.zip&quot;&gt;final source code for this application&lt;/a&gt;

&lt;h2&gt;Credits&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://qt.nokia.com/doc/qtjambi-4.5.2_01/com/trolltech/qt/qtjambi-hellowebkit-code.html&quot; /&gt;http://qt.nokia.com/doc/qtjambi-4.5.2_01/com/trolltech/qt/qtjambi-hellowebkit-code.html&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://qt.nokia.com/doc/qtjambi-4.5.2_01/com/trolltech/qt/qtjambi-resourcesystem.html&quot; /&gt;http://qt.nokia.com/doc/qtjambi-4.5.2_01/com/trolltech/qt/qtjambi-resourcesystem.html&lt;/li&gt;
&lt;/ul&gt;
          </content>  </entry>
  <entry xml:base="http://www.davidlauzon.net/">
    <author>
      <name>david</name>
    </author>
    <id>tag:www.davidlauzon.net,2010-02-21:43</id>
    <published>2010-02-21T18:27:00Z</published>
    <updated>2010-02-21T22:46:01Z</updated>
    <category term="Linux"/>
    <category term="howto"/>
    <category term="jambi"/>
    <category term="java"/>
    <category term="linux"/>
    <category term="qt"/>
    <category term="ubuntu"/>
    <link href="http://www.davidlauzon.net/2010/2/21/getting-started-with-qt-jambi-on-linux" rel="alternate" type="text/html"/>
    <title>Getting started with QT Jambi on Linux</title>
<content type="html">
            In this article I'll explain how to install QT Jambi and write your first Hello world program.

&lt;ol&gt;
&lt;li&gt;Installation of QT Jambi SDK&lt;/li&gt;
&lt;li&gt;Quick Overview of the SDK&lt;/li&gt;
&lt;li&gt;Integration with Eclipse&lt;/li&gt;
&lt;li&gt;Your first Jambi Program&lt;/li&gt;
&lt;li&gt;Jambi Links&lt;/li&gt;
&lt;/ol&gt;


&lt;h2&gt;Installation of QT Jambi SDK&lt;/h2&gt;

First, you need to download the &quot;Qt Jambi - Java bindings Binaries&quot; for your OS (about 100MB), get it from &lt;a href=&quot;http://qt.nokia.com/downloads&quot;&gt;here&lt;/a&gt;. Since I am using Ubuntu, the following instructions will be for Linux. You can extract the archive where you want, but remember the path because we'll need it later on - I'll refer to ita s JAMBI_PATH (&lt;code&gt;/usr/local/lib/qtjambi-linux32-lgpl-4.5.2_01&lt;/code&gt; in this example).

&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;tar -xzf qtjambi-linux32-lgpl-4.5.2_01.tar.gz&lt;tt&gt;
&lt;/tt&gt;sudo mv qtjambi-linux32-lgpl-4.5.2_01 /usr/local/lib/&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;


Next we need to create a script to get QT Designer to generate .jui files for Java (instead QT/C++ .ui files). Name it jambi-designer.sh and insert the following code:

&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;  cd JAMBI_PATH&lt;tt&gt;
&lt;/tt&gt;  export CLASSPATH=`pwd`/qtjambi-4.5.2_01.jar:`pwd`/qtjambi-examples-4.5.2_01.jar:`pwd`/qtjambi-linux32-gcc-4.5.2_01.jar&lt;tt&gt;
&lt;/tt&gt;  export JAVADIR=/usr/lib/jvm/java-6-sun/jre&lt;tt&gt;
&lt;/tt&gt;  ./designer.sh&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;


Make it executable and make it available in your path. Copy also the juic (jambi user interface compiler) which is used to convert the files generated by the Designer to java code.

&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;sudo chmod a+x jambi-designer.sh&lt;tt&gt;
&lt;/tt&gt;sudo ln -s /JAMBI_PATH/jambi-designer.sh  /usr/local/bin/jambi-designer&lt;tt&gt;
&lt;/tt&gt;cp bin/juic /usr/local/bin/&lt;tt&gt;
&lt;/tt&gt;# try it :&lt;tt&gt;
&lt;/tt&gt;jambi-designer  &amp;amp;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;




&lt;h2&gt;Quick Overview of the SDK&lt;/h2&gt;

So here you go you got the SDK installed. Now what are these files, do i need to install this huge file on every computer my program will run unto?? Obviously not!
&lt;br /&gt;&lt;br /&gt;

Well here, you to remember that when you'll distribute your application, you'll need to bundle it with the Jambi core package (&lt;code&gt;qtjambi-4.5.2_01.jar&lt;/code&gt;) and the jambi os-dependant package (&lt;code&gt;qtjambi-linux32-gcc-4.5.2_01.jar&lt;/code&gt;). That's it!
&lt;br /&gt;&lt;br /&gt;

If you want the application to run on Windows as well, you only need to add one jar file per os (you'll need to download the whole sdk just to get the .jar your need for each os).
&lt;br /&gt;&lt;br /&gt;

What else am I getting?

&lt;table&gt;
&lt;tr&gt;Directory / fileDetails&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;bin/&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Designer and UI Compiler binaries&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;com/trolltech/&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Jambi Core &amp; Examples Source code&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;doc/&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Jambi HTML Documentation (use your browser)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;code&gt;qtjambi.sh&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Execute this script to view the numeros code samples&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;

&lt;a href=&quot;/assets/2010/2/21/jambi_examples.jpg&quot;&gt;&lt;/a&gt;
&lt;br /&gt;&lt;br /&gt;


&lt;h2&gt;Integration with Eclipse&lt;/h2&gt;
So you want code auto-completion for Jambi classes in Eclipse? You're dreaming! Nope, actually you can! Just download the &quot;eclipse integration package&quot; and extract it in the plugin directory of your Eclipse installation.
&lt;br /&gt;&lt;br /&gt;

Note : I haven't been able to install the integration plugin with default Eclipse package in Kubuntu 9.10 because it does not allow you to add plugins as root. So to get around this, just uninstall it from the package manager and install it manually (get &lt;a href=&quot;http://www.eclipse.org/downloads/&quot;&gt;eclipse here&lt;/a&gt;).

&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;tar -xzf eclipse-java-galileo-SR1-linux-gtk.tar.gz&lt;tt&gt;
&lt;/tt&gt;sudo mv eclipse /opt/eclipse-3.5.1&lt;tt&gt;
&lt;/tt&gt;cd /opt/eclipse-3.5.1&lt;tt&gt;
&lt;/tt&gt;sudo tar -xzf /path/to/qtjambi-eclipse-integration-linux32-4.5.2_01.tar.gz&lt;tt&gt;
&lt;/tt&gt;./eclipse -clean&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;


Next on  Eclipse restart, go to Window &gt; Preferences &gt; QT Jambi Preference Page and use these settings :
&lt;ul&gt;
&lt;li&gt;Jambi Location = where you installed the first archive  (JAMBI_PATH)&lt;/li&gt;
&lt;li&gt;Generate files in separate folder = src/ui&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;



&lt;h2&gt;Your first Jambi Program&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Click on File &gt; New &gt; Other &gt; QT Jambi Project.&lt;/li&gt;
&lt;li&gt;Add a new class named &quot;HelloWorld&quot; and insert this code:&lt;/li&gt;
&lt;li&gt;&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;12&lt;tt&gt;
&lt;/tt&gt;13&lt;tt&gt;
&lt;/tt&gt;14&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;15&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;16&lt;tt&gt;
&lt;/tt&gt;17&lt;tt&gt;
&lt;/tt&gt;18&lt;tt&gt;
&lt;/tt&gt;19&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;20&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;21&lt;tt&gt;
&lt;/tt&gt;22&lt;tt&gt;
&lt;/tt&gt;23&lt;tt&gt;
&lt;/tt&gt;24&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;25&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;26&lt;tt&gt;
&lt;/tt&gt;27&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;kw&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;ic&quot;&gt;com.trolltech.qt.gui&lt;/span&gt;.*;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;di&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;ty&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;cl&quot;&gt;HelloWorld&lt;/span&gt; &lt;span class=&quot;di&quot;&gt;extends&lt;/span&gt; QWidget{&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;di&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;di&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;ty&quot;&gt;void&lt;/span&gt; main(&lt;span class=&quot;ty&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;ty&quot;&gt;[]&lt;/span&gt; args) {&lt;tt&gt;
&lt;/tt&gt;        &lt;span class=&quot;c&quot;&gt;// Instanciates a Jambi Application and pass it the command-line arguments to allow the QApplication&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;        &lt;span class=&quot;c&quot;&gt;// static instance to handle the arguments it recognizes, such as -font and -style.&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;        QApplication.initialize(args);&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;        &lt;span class=&quot;c&quot;&gt;// Creates an instance of our QWidget (could be also a QMainWindow, QDialog, etc.)&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;        &lt;span class=&quot;c&quot;&gt;// and set the parent to null&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;        HelloWorld helloWorld = &lt;span class=&quot;kw&quot;&gt;new&lt;/span&gt; HelloWorld(&lt;span class=&quot;kw&quot;&gt;null&lt;/span&gt;);&lt;tt&gt;
&lt;/tt&gt;        &lt;tt&gt;
&lt;/tt&gt;        &lt;span class=&quot;c&quot;&gt;// Create a new label and sets its parent to our view.&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;        QLabel label = &lt;span class=&quot;kw&quot;&gt;new&lt;/span&gt; QLabel(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Ping World!&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, helloWorld);&lt;tt&gt;
&lt;/tt&gt;        &lt;tt&gt;
&lt;/tt&gt;        &lt;span class=&quot;c&quot;&gt;// Show our view&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;        helloWorld.show();&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;        &lt;span class=&quot;c&quot;&gt;// Execute Jambi Application&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;        QApplication.exec();&lt;tt&gt;
&lt;/tt&gt;    }&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;    &lt;span class=&quot;di&quot;&gt;public&lt;/span&gt; HelloWorld(QWidget parent){&lt;tt&gt;
&lt;/tt&gt;        &lt;span class=&quot;lv&quot;&gt;super&lt;/span&gt;(parent);&lt;tt&gt;
&lt;/tt&gt;    }&lt;tt&gt;
&lt;/tt&gt;}&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;

&lt;h2&gt;Jambi Links&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://qt.nokia.com/doc/qtjambi-4.5.2_01/com/trolltech/qt/qtjambi-index.html&quot;&gt;Jambi Documentation&lt;/a&gt; (&quot;Signals and Slots&quot; is a recommanded reading)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://qt.nokia.com/doc/qtjambi-4.5.2_01/index.html&quot;&gt;Jambi Classes javadoc&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a&gt;file:///usr/local/lib/qtjambi-linux32-lgpl-4.5.2_01/doc/html/index.html&lt;/a&gt;  (same as above but on your computer)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://doc.trolltech.com/4.5/index.html&quot;&gt;C++ QT Documentation&lt;/a&gt; (the API is the same and sometimes you find more information than on Jambi)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.informit.com/articles/article.aspx?p=1405564&quot;&gt;Getting Started Article by Jasmin Blanchette&lt;/a&gt; (including a part on how to integrate C++ components with QT Jambi)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://qt.nokia.com/doc/qtjambi-4.5.2_01/com/trolltech/qt/qtjambi-examples.html&quot;&gt;Jambi Examples&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
          </content>  </entry>
  <entry xml:base="http://www.davidlauzon.net/">
    <author>
      <name>david</name>
    </author>
    <id>tag:www.davidlauzon.net,2009-02-18:41</id>
    <published>2009-02-18T22:31:00Z</published>
    <updated>2009-02-18T23:27:01Z</updated>
    <category term="php"/>
    <category term="sqlserver"/>
    <category term="vista"/>
    <link href="http://www.davidlauzon.net/2009/2/18/ms-sql-server-2008-with-php" rel="alternate" type="text/html"/>
    <title>MS SQL Server 2008 with PHP</title>
<content type="html">
            I personally choose not to use Micro$oft products when it is possible, but sometimes the choice is not given.

For these unfortunate who have to deal with SQL Server 2008 (or 2005), here is how to get around without too many swear words and avoid licensing costs.

&lt;h4&gt;Requirements&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Windows Vista (Win XP should do also)&lt;/li&gt;
&lt;li&gt;.Net Framework 3.5 SP1&lt;/li&gt;
&lt;li&gt;Windows Installer 4.5&lt;/li&gt;
&lt;li&gt;Windows PowerShell 1.0&lt;/li&gt;
&lt;li&gt;MS Core XML Services (MSXML) 6.0&lt;/li&gt;
&lt;/ul&gt;

Note: You need to have genuine windows copy to download PowerShell from Microsoft website; however it is possible to find it elsewhere if you google around.

&lt;h4&gt;Setup SQL Server&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;Download and install &lt;a href=&quot;http://www.microsoft.com/downloads/details.aspx?FamilyId=B5D1B8C3-FDA5-4508-B0D0-1311D670E336&amp;amp;displaylang=en&quot;&gt;MS SQL Server Express 2008 with Advanced Services&lt;/a&gt; and choose the following options:&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Single instance&lt;/b&gt; Install (not clustered !)&lt;/li&gt;
&lt;li&gt;Name the instance &quot;SQLExpress&quot;&lt;/li&gt;
&lt;li&gt;In the options box choose &quot;SQL Server&quot;, and &quot;&lt;b&gt;Management Studio&lt;/b&gt;&quot; (do not install full-text search, as it requires clustering)&lt;/li&gt;
&lt;li&gt;Set the &lt;b&gt;Server Service Account Name&lt;/b&gt; to &quot;NT AUTHORITY\NETWORK SERVICE&quot;, auto&lt;/li&gt;
&lt;li&gt;Set the &lt;b&gt;SQL Server Browser&lt;/b&gt; to &quot;NT AUTHORITY\NETWORK SERVICE&quot;, manual&lt;/li&gt;
&lt;li&gt;Choose &lt;b&gt;mixed mode authentication&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Set SQL Server to listen on TCP port.
&lt;ol&gt;
&lt;li&gt;Start &quot;SQL Server Configuration Manager&quot;&lt;/li&gt;
&lt;li&gt;Network Configuration -&gt; Protocols : &lt;b&gt;enable &quot;Named Pipes&quot; and &quot;TCP/IP&quot;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Right-click &quot;TCP/IP&quot; -&gt; Listen All = Yes&quot;&lt;/li&gt;
&lt;li&gt;In tab &quot;IP addresses&quot; -&gt; Section IPAll -&gt; &lt;b&gt;TCP Dynamic Ports = 1433&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Repeat these steps for SQL Native Client.&lt;/li&gt;
&lt;li&gt;Restart SQL Server&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Create your database and set the owner to user 'sa', and change the user sa password.&lt;/li&gt;
&lt;/ol&gt;


&lt;h4&gt;Setup PHP&lt;/h4&gt;
This assumes you have wamp installed, otherwise just change the path.
&lt;ol&gt;
&lt;li&gt;Download the good version of &lt;a href=&quot;http://webzila.com/dll/1/ntwdblib.zip&quot;&gt;ntwdblib.dll (2000.80.194.0)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Overwrite C:\wamp\bin\apache\apache2.2.8\bin\ntwdblib.dll&lt;/li&gt;
&lt;li&gt;Overwrite C:\wamp\bin\php\php5.2.6\ntwdblib.dll&lt;/li&gt;
&lt;li&gt;Enable &lt;b&gt;php_mssql.dll&lt;/b&gt; in php.ini&lt;/li&gt;
&lt;li&gt;Restart Apache&lt;/li&gt;
&lt;li&gt;&lt;pre&gt;
$server = 'BANGKOK\SQLEXPRESS';  // The format is &quot;HOST\SERVERNAME[,PORT]&quot;
$username = 'sa';
mssql_connect($server, $username, $password);
&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;


&lt;h4&gt;Debugging&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;You can test if SQL Server is listening on port 1433 by using &lt;a href=&quot;http://nmap.org/download.html&quot;&gt;NMap/Zenmap for Windows&lt;/a&gt; to do an &quot;Intense scan, all TCP ports&quot; on localhost, and you should see port 1433 open.&lt;/li&gt;
&lt;li&gt;When trying to log within PHP you should see an entry in the log file:
&lt;pre&gt;c:\program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\Log\ERRORLOG&lt;/pre&gt;&lt;/li&gt;
&lt;/ul&gt;

I hope this will save you some time and swears!

&lt;/code&gt;
&lt;ol&gt;
          </content>  </entry>
  <entry xml:base="http://www.davidlauzon.net/">
    <author>
      <name>david</name>
    </author>
    <id>tag:www.davidlauzon.net,2008-06-30:2</id>
    <published>2008-06-30T23:36:00Z</published>
    <updated>2009-04-10T10:03:52Z</updated>
    <category term="Linux"/>
    <category term="Ruby on Rails"/>
    <category term="capistrano"/>
    <category term="dreamhost"/>
    <category term="linux"/>
    <category term="rubyonrails"/>
    <link href="http://www.davidlauzon.net/2008/6/30/capistrano-2-recipe-for-dreamhost-shared-hosting-and-mod_rails" rel="alternate" type="text/html"/>
    <title>Capistrano 2 Recipe for Dreamhost Shared Hosting and mod_rails</title>
<content type="html">
            

&lt;h4&gt;Introduction&lt;/h4&gt;
&lt;p&gt;I could not find an updated documentation on how to setup properly a rails application on Dreamhost, so I thought I'd share the information I gathered.. First off, thanks to the Phusion team, with &lt;a href=&quot;http://www.modrails.com/&quot;&gt;Passenger (a.k.a. mod_rails)&lt;/a&gt;, it's now very convenient, easy, and cheap to run a rails application on Dreamhost.&lt;/p&gt;

&lt;p&gt;Also, special thanks to &lt;a href=&quot;http://gabrito.com/&quot;&gt;Todd Huss&lt;/a&gt; for discovering   the &lt;a href=&quot;http://gabrito.com/post/ruby-on-rails-dreamhost-plugin&quot;&gt;multi dreamhost user hack&lt;/a&gt;. Basically, you need to run each of your rails application on Dreamhost under a different shell user. Their process monitor, will start killing your processes when the total memory per user exceeds 200 MB of virtual memory (VSZ).&lt;/p&gt;

&lt;p&gt;So here's the guide, even perfect newbees and skript-kiddies should be able to follow :&lt;/p&gt;


&lt;h4&gt;The complete step by step&lt;/h4&gt;
&lt;p&gt;&lt;b&gt;INFO&lt;/b&gt; :  Let Capistrano create the directory structure on the server BEFORE you set the public dir of your application in the edit domain section of the Control Panel. This will avoid you conflicts when Capistrano attemps to create the symlinks.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;p&gt;First, configure your new rails application using Dreamhost Control Panel :

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Create a new repository for your application (&lt;a href=&quot;/assets/2008/6/30/dreamhost_create_repository.jpg&quot;&gt;screenshot&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a new shell / SSH user (read why &lt;a href=&quot;http://gabrito.com/post/ruby-on-rails-dreamhost-plugin&quot;&gt;here&lt;/a&gt;) with the same name as your application  (&lt;a href=&quot;/assets/2008/6/30/dreamhost_create_user.jpg&quot;&gt;screenshot&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a new database (&lt;a href=&quot;/assets/2008/6/30/dreamhost_create_database.jpg&quot;&gt;screenshot&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;Add your application to your repository&lt;/li&gt;
&lt;ol&gt;
&lt;li&gt;Create your rails skeleton (if it's done yet), on your local machine (assuming you use *nix, but should be similar on Windows)
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; rails myrailsapp --freeze&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/li&gt;
&lt;li&gt;Add your application to the repository
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; cd myrailsapp&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; svn mkdir http&lt;span class=&quot;sy&quot;&gt;:/&lt;/span&gt;/svn.myrailsappdomain/myrails/trunk&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; svn checkout http&lt;span class=&quot;sy&quot;&gt;:/&lt;/span&gt;/svn.myrailsappdomain/myrails/trunk ./&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; svn add  *&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; svn commit&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/li&gt;

&lt;li&gt;Exclude database configuration, temporary files, and any user upload directory from the source control :
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;12&lt;tt&gt;
&lt;/tt&gt;13&lt;tt&gt;
&lt;/tt&gt;14&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; svn copy config/database.yml config/database.yml.example&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; svn remove config/database.yml -f&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; svn propset svn&lt;span class=&quot;sy&quot;&gt;:ignore&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;database.yml&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; config/&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; svn remove tmp/*&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; svn propset svn&lt;span class=&quot;sy&quot;&gt;:ignore&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; tmp/&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# If you need to share unversionned user-uploaded files, between deploys :&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; mkdir public/uploads&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; svn add public/uploads&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; svn propset svn&lt;span class=&quot;sy&quot;&gt;:ignore&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; public/uploads/&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; svn remove log/*&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; svn propset svn&lt;span class=&quot;sy&quot;&gt;:ignore&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; log/&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; svn remove db/*.sqlite3&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; svn propset svn&lt;span class=&quot;sy&quot;&gt;:ignore&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;*.sqlite3&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; db/&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; svn commit&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;li&gt;Next, create the Capistrano recipe :
&lt;ol&gt;
&lt;li&gt;Create recipe skeleton :
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; cd &lt;span class=&quot;rx&quot;&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;/&lt;/span&gt;&lt;/span&gt;to/your/myrailsapp&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; capify .&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;er&quot;&gt;[&lt;/span&gt;add] writing &lt;span class=&quot;sh&quot;&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;./Capfile'&lt;tt&gt;
&lt;/tt&gt;[add] writing &lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;`&lt;/span&gt;&lt;/span&gt;./config/deploy.rb&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;&lt;tt&gt;
&lt;/tt&gt;[done] capified!&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/li&gt;

&lt;li&gt;Replace the content of config/deploy.rb with the following :
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;12&lt;tt&gt;
&lt;/tt&gt;13&lt;tt&gt;
&lt;/tt&gt;14&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;15&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;16&lt;tt&gt;
&lt;/tt&gt;17&lt;tt&gt;
&lt;/tt&gt;18&lt;tt&gt;
&lt;/tt&gt;19&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;20&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;21&lt;tt&gt;
&lt;/tt&gt;22&lt;tt&gt;
&lt;/tt&gt;23&lt;tt&gt;
&lt;/tt&gt;24&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;25&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;26&lt;tt&gt;
&lt;/tt&gt;27&lt;tt&gt;
&lt;/tt&gt;28&lt;tt&gt;
&lt;/tt&gt;29&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;30&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;31&lt;tt&gt;
&lt;/tt&gt;32&lt;tt&gt;
&lt;/tt&gt;33&lt;tt&gt;
&lt;/tt&gt;34&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;35&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;36&lt;tt&gt;
&lt;/tt&gt;37&lt;tt&gt;
&lt;/tt&gt;38&lt;tt&gt;
&lt;/tt&gt;39&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;40&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;41&lt;tt&gt;
&lt;/tt&gt;42&lt;tt&gt;
&lt;/tt&gt;43&lt;tt&gt;
&lt;/tt&gt;44&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;45&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;46&lt;tt&gt;
&lt;/tt&gt;47&lt;tt&gt;
&lt;/tt&gt;48&lt;tt&gt;
&lt;/tt&gt;49&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;50&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;51&lt;tt&gt;
&lt;/tt&gt;52&lt;tt&gt;
&lt;/tt&gt;53&lt;tt&gt;
&lt;/tt&gt;54&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;c&quot;&gt;#############################################################&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;## General&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;#############################################################&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;set &lt;span class=&quot;sy&quot;&gt;:application&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;myrailsapp&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;#############################################################&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;## Servers &lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;#############################################################&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;set &lt;span class=&quot;sy&quot;&gt;:use_sudo&lt;/span&gt;, &lt;span class=&quot;pc&quot;&gt;false&lt;/span&gt;    &lt;span class=&quot;c&quot;&gt;# Dreamhost does not support sudo&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;set &lt;span class=&quot;sy&quot;&gt;:user&lt;/span&gt;, application  &lt;span class=&quot;c&quot;&gt;# Dreamhost SSH User&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;set &lt;span class=&quot;sy&quot;&gt;:domain&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;myrailsapp.domain.com&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;server domain, &lt;span class=&quot;sy&quot;&gt;:app&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:web&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;role &lt;span class=&quot;sy&quot;&gt;:db&lt;/span&gt;, domain, &lt;span class=&quot;sy&quot;&gt;:primary&lt;/span&gt; =&amp;gt; &lt;span class=&quot;pc&quot;&gt;true&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;#############################################################&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;## Subversion&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;#############################################################&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;set &lt;span class=&quot;sy&quot;&gt;:scm&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:subversion&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;set &lt;span class=&quot;sy&quot;&gt;:scm_user&lt;/span&gt;, application   &lt;span class=&quot;c&quot;&gt;# Sets 'my_svn_user' instead, if you are using different name than your app.&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;set &lt;span class=&quot;sy&quot;&gt;:scm_auth_cache&lt;/span&gt;, &lt;span class=&quot;pc&quot;&gt;true&lt;/span&gt;  &lt;span class=&quot;c&quot;&gt;# Prompts for password once&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;set &lt;span class=&quot;sy&quot;&gt;:scm_password&lt;/span&gt;, &lt;span class=&quot;co&quot;&gt;Proc&lt;/span&gt;.new { &lt;span class=&quot;co&quot;&gt;Capistrano&lt;/span&gt;::&lt;span class=&quot;co&quot;&gt;CLI&lt;/span&gt;.password_prompt(&lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;SCM password for &lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;scm_user&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;) }&lt;tt&gt;
&lt;/tt&gt;set &lt;span class=&quot;sy&quot;&gt;:repository&lt;/span&gt;,  &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;http://svn.myrailsappdomain/&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;application&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/trunk&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;set &lt;span class=&quot;sy&quot;&gt;:deploy_to&lt;/span&gt;, &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/home/&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;user&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;domain&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;# keeps a local checkout of the repository on the server to get faster deployments&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;set &lt;span class=&quot;sy&quot;&gt;:deploy_via&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:remote_cache&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;#############################################################&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;## Tasks&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;c&quot;&gt;#############################################################&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;namespace &lt;span class=&quot;sy&quot;&gt;:deploy&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  desc &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Restart Application (using tmp/restart.txt)&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  task &lt;span class=&quot;sy&quot;&gt;:restart_passenger&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    run &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;touch &lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;current_path&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/tmp/restart.txt&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;  desc &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Restarts your application.&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  task &lt;span class=&quot;sy&quot;&gt;:restart&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    restart_passenger&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;  desc &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;Link shared files&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;c&quot;&gt;#task :before_symlink do&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  before &lt;span class=&quot;sy&quot;&gt;:symlink&lt;/span&gt; &lt;span class=&quot;r&quot;&gt;do&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    run &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;rm -drf &lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;release_path&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/public/uploads&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    run &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;ln -s &lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;shared_path&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/uploads &lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;release_path&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/public/uploads&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    run &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;rm -f &lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;release_path&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/config/database.yml&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;    run &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;ln -s &lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;shared_path&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/database.yml &lt;/span&gt;&lt;span class=&quot;il&quot;&gt;&lt;span class=&quot;idl&quot;&gt;#{&lt;/span&gt;release_path&lt;span class=&quot;idl&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/config/database.yml&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;  &lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;span class=&quot;r&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/li&gt;
&lt;/ol&gt;


&lt;li&gt;Then, prepare the directory structure on the server :
&lt;ol&gt;
&lt;li&gt;Create the Capistrano structure (releases/, shared/), by typing this on your local machine :
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; cap deploy&lt;span class=&quot;sy&quot;&gt;:setup&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/li&gt;

&lt;li&gt;Login to your server to manually create your shared directories and files (if any)
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; ssh myrailsapp.domain.com&lt;tt&gt;
&lt;/tt&gt;[tootsie]&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; cd myrailsapp/shared&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/li&gt;

&lt;li&gt;Configure your database on the server (you don't want this file in your repository) :
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;12&lt;tt&gt;
&lt;/tt&gt;13&lt;tt&gt;
&lt;/tt&gt;14&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;15&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;16&lt;tt&gt;
&lt;/tt&gt;17&lt;tt&gt;
&lt;/tt&gt;18&lt;tt&gt;
&lt;/tt&gt;19&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;20&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;c&quot;&gt;# config/database.yml&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;development:&lt;tt&gt;
&lt;/tt&gt;  adapter: sqlite3&lt;tt&gt;
&lt;/tt&gt;  database: db/development.sqlite3&lt;tt&gt;
&lt;/tt&gt;  timeout: &lt;span class=&quot;i&quot;&gt;5000&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;test:&lt;tt&gt;
&lt;/tt&gt;  adapter: sqlite3&lt;tt&gt;
&lt;/tt&gt;  database: db/test.sqlite3&lt;tt&gt;
&lt;/tt&gt;  timeout: &lt;span class=&quot;i&quot;&gt;5000&lt;/span&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;production:&lt;tt&gt;
&lt;/tt&gt;  adapter: mysql&lt;tt&gt;
&lt;/tt&gt;  encoding: utf8&lt;tt&gt;
&lt;/tt&gt;  database: myrailsapp&lt;tt&gt;
&lt;/tt&gt;  username: myrailsapp&lt;tt&gt;
&lt;/tt&gt;  password: [your_db_password]&lt;tt&gt;
&lt;/tt&gt;  host: mysql.&lt;span class=&quot;er&quot;&gt;[&lt;/span&gt;myrailsapp.domain].com&lt;tt&gt;
&lt;/tt&gt;  timeout: &lt;span class=&quot;i&quot;&gt;5000&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/li&gt;

&lt;li&gt;Create your upload directory (OPTIONAL) :
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;[tootsie]&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; mkdir uploads&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/li&gt;
&lt;/ol&gt;


&lt;li&gt;Deploy your application. Note : it will only prompt for your SVN password at the first deploy.
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;er&quot;&gt;$&lt;/span&gt; cap deploy&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/li&gt;

&lt;li&gt;And finally the most important, configure your domain like this :

&lt;/li&gt;
&lt;/ol&gt;


&lt;h4&gt;[UPDATE 2008/07/01] &lt;/h4&gt;
&lt;p&gt;If you need to install custom gems on your account, you can find more info &lt;a href=&quot;http://wiki.dreamhost.com/index.php/RubyGems&quot; title=&quot;Dreamhost Wiki : Installing your own gems and RubyGems&quot;&gt;here&lt;/a&gt;, &lt;a href=&quot;http://nateclark.com/articles/2006/10/20/dreamhost-your-own-packages-and-gems&quot; title=&quot;installing your own packages and gems&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;http://rails.dreamhosters.com/&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h4&gt;References&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;http://labs.peritor.com/webistrano/wiki/ConfigurationParameter&quot;&gt;http://labs.peritor.com/webistrano/wiki/ConfigurationParameter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://groups.google.ca/group/capistrano/browse_thread/thread/6ef7c7c212547eab&quot;&gt;http://groups.google.ca/group/capistrano/browse_thread/thread/6ef7c7c212547eab (for scm_password)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://groups.google.com/group/capistrano/browse_thread/thread/ae7b16a16abf4e5d&quot;&gt;http://groups.google.com/group/capistrano/browse_thread/thread/ae7b16a16abf4e5d (for task hookups with namespaces)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://groups.google.com/group/capistrano/web/deploying-on-dreamhost&quot;&gt;http://groups.google.com/group/capistrano/web/deploying-on-dreamhost&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://gabrito.com/post/ruby-on-rails-dreamhost-plugin&quot;&gt;http://gabrito.com/post/ruby-on-rails-dreamhost-plugin&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.railsforum.com/viewtopic.php?id=8118&quot;&gt;http://www.railsforum.com/viewtopic.php?id=8118&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://wiki.dreamhost.com/Capistrano&quot;&gt;Dreamhost Wiki : Capistrano&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://wiki.dreamhost.com/Ruby_on_Rails&quot;&gt;Dreamhost Wiki : Ruby_on_Rails&lt;/a&gt;&lt;li&gt;
&lt;li&gt;&lt;a href=&quot;http://manuals.rubyonrails.com/read/chapter/97&quot;&gt;Capistrano Manual&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
          </content>  </entry>
  <entry xml:base="http://www.davidlauzon.net/">
    <author>
      <name>david</name>
    </author>
    <id>tag:www.davidlauzon.net,2008-06-02:1</id>
    <published>2008-06-02T21:29:00Z</published>
    <updated>2008-06-18T21:31:15Z</updated>
    <link href="http://www.davidlauzon.net/2008/6/2/hello" rel="alternate" type="text/html"/>
    <title>Hello !</title>
<content type="html">
            I am David Lauzon, a freelance web developer since February 2005. I am usually based in Montréal (QC, Canada), but I will be blogging from &lt;a href=&quot;http://maps.google.com/maps?f=q&amp;amp;hl=en&amp;amp;q=Chang+Moi,+Thailand&amp;amp;sll=18.798581,98.991451&amp;amp;sspn=0.03697,0.063257&amp;amp;ie=UTF8&amp;amp;cd=2&amp;amp;geocode=0,18.795565,98.998720&amp;amp;ll=18.798418,98.997717&amp;amp;spn=0.03697,0.063257&amp;amp;z=14&amp;amp;iwloc=addr&quot;&gt;Chiang Mai&lt;/a&gt; (Thailand) for the following months.&lt;br /&gt;
&lt;br /&gt;
I will be writing about Ruby on Rails, Web 2.0, Linux, and general IT developments. I also will be releasing open source code here, so stay tuned !
          </content>  </entry>
</feed>
