<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Andreas Happe &#187; Software Development</title>
	<atom:link href="http://snikt.net/index.php/category/programming-stuff/feed" rel="self" type="application/rss+xml" />
	<link>http://snikt.net</link>
	<description>Vi veri ueniversum vivus vici</description>
	<lastBuildDate>Tue, 06 Jul 2010 21:54:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Provenance on Rails</title>
		<link>http://snikt.net/index.php/2010/04/29/provenance-on-rails-2</link>
		<comments>http://snikt.net/index.php/2010/04/29/provenance-on-rails-2#comments</comments>
		<pubDate>Thu, 29 Apr 2010 19:02:10 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Provenance]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[University]]></category>
		<category><![CDATA[master thesis]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://snikt.net/?p=802</guid>
		<description><![CDATA[First of all, what is provenance? The common description is that provenance describes how an object came into its current state. Think of it as versioning on crack: in addition to performed changes it also detects how and by whom those changes were performed. ..but do I need it? Well that depends: do you have [...]]]></description>
			<content:encoded><![CDATA[<h1><span style="font-weight: normal; font-size: 13px;">First of all, what is provenance? The common description is that <em>provenance describes how an object came into its current state</em>. Think of it as versioning on crack: in addition to performed changes it also detects how and by whom those changes were performed.</span></h1>
<h2>..but do I need it?</h2>
<p>Well that depends:</p>
<ul>
<li>do you have any objects in whose alteration history you&#8217;re interested in? Think about any financial or business object.</li>
<li>social network app? think automatic activity feeds..</li>
<li>do you have any analysis workflow that produces a single output from multiple input data points? Provenance can retroactively create the relationships between the input and output datums.</li>
<li>do you want to monitor a given object&#8217;s access patterns temporary? Think debugging.</li>
</ul>
<p>Actually, the longer you think the more use cases appear.</p>
<p>After the break I&#8217;ll talk about my master thesis (that dealt with provenance), the corresponding RoR prototype and future plans w.r.t. provenance within Ruby on Rails.</p>
<p><span id="more-802"></span></p>
<h2>Background Information</h2>
<p>I&#8217;ve spend some time with<a href="http://snikt.net/wp-content/provenance/master_thesis.pdf"> my master thesis</a> focusing on provenance. It&#8217;s academic so do not expect readability or real-world usability. For that there&#8217;s a <a href="http://www.snikt.net/wp-content/provenance/short_paper.pdf">short paper detailing the rails prototype</a>, an additional use case was detailed<a href="http://snikt.net/wp-content/provenance/genesis.pdf"> in another paper</a>. All source code can be found on <a href="http://github.com/andreashappe">github</a>, it might take some days to get the newest versions into the repositories.</p>
<p>My basic idea was that developers do not want to deal with the details of provenance gathering or storage. They should focus upon their domain application. I developed a system that allowed automatic provenance capturing (through a rails plugin), networked storage and dedicated network query facilities.</p>
<p>The prototype did work, unobtrusive provenance capturing is perfectly possible in Ruby on Rails.  Why do I believe that the master thesis prototype is not perfectly suited for real-world applications? Well,</p>
<ul>
<li>storage was done through a separated RDF graph engine, encapsulated within an <a>own RoR application</a>. This is well suited for large academic test applications but I believe that something using an embedded storage solution (thus easier to integrate within existing systems) might be better suited for Rails.</li>
<li>provenance queries had to be done through SPARQL or a special (easy) REST-based interface. An interface directly integrated within Ruby would be preferable.</li>
<li>It&#8217;s all still Rails 2.3 based. I&#8217;ve finished the prototype some time ago and did work the last months mostly on the documentation. So the prototype should be forward-ported to Rails 3.0.0beta3.</li>
</ul>
<h2>Towards a bright new future!</h2>
<p>So I have finally finished my master thesis and would need a embeddable provenance solution for one of my side-projects. I will base it upon the work done during my master thesis but it will differentiate in various points:</p>
<ul>
<li><em>use embedded storage</em>. Application developers should be able to install the plugin, call a rake task and enjoy the benefits of automatic provenance gathering. Does anyone know a good ruby only RDF/graph engine?</li>
<li>no more special query language.. users should not have to learn a new query language nor interfaces. Provenance should be be provided through virtual <em>ActionModel</em> methods and act as &#8216;normal&#8217; object methods.</li>
<li>update the plugin to work with Rails 3.0, investigate <em>Rack</em> and <em>ActionModel</em></li>
<li>keep the plugin as simple as possible.. so other people can play with it too.</li>
</ul>
<p>I&#8217;m not perfectly sure when my side-project will need need that functionality (or if it even gets towards that point), but if you&#8217;re interested in provenance on rails just <a href="http://github.com/andreashappe/provenance-on-rails-sensor">watch the repository</a> or, even better, branch it and get involved..</p>
]]></content:encoded>
			<wfw:commentRss>http://snikt.net/index.php/2010/04/29/provenance-on-rails-2/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Howto use cmake with C/C++ projects</title>
		<link>http://snikt.net/index.php/2010/04/01/howto-use-cmake-with-cc-projects</link>
		<comments>http://snikt.net/index.php/2010/04/01/howto-use-cmake-with-cc-projects#comments</comments>
		<pubDate>Thu, 01 Apr 2010 13:53:04 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://snikt.net/?p=753</guid>
		<description><![CDATA[Writing code ain&#8217;t the end of a C/C++ software developer&#8217;s task, it&#8217;s merely the start of endless compile and debug sessions. Compiling is the build system&#8217;s job: Visual Studio users might just click on the &#8220;Build&#8221; button, UNIX users mostly depend upon Makefiles. The conventional way of creating Makefiles involves GNU&#8217;s autotools. They check the [...]]]></description>
			<content:encoded><![CDATA[<p>Writing code ain&#8217;t the end of a C/C++ software developer&#8217;s task, it&#8217;s merely the start of endless compile and debug sessions. Compiling is the build system&#8217;s job: Visual Studio users might just click on the &#8220;Build&#8221; button, UNIX users mostly depend upon <a href="http://en.wikipedia.org/wiki/Makefile">Makefiles</a>. The conventional way of creating Makefiles involves <a title="GNU autoconf" href="http://www.gnu.org/software/autoconf/">GNU&#8217;s autotools</a>. They check the computer system&#8217;s installed resources (mostly installed libraries and compilers) and generate system-dependant Makfiles. Being fed up with autotools wrt. readability and performance I searched alternatives and found <a title="cross-plattform make" href="http://www.cmake.org/">cmake</a>. The conversation from autotools to cmake did shred away thousands of lines of build code while improving the build performance tremendously. In addition creating distribution-dependent packages gets a lot easier.</p>
<p>Alas I did not find too many introductions so I thought that I&#8217;ll write a bit about my experience with cmake. As I continue to find out more stuff about cmake the post will be updated with new findings.</p>
<p>Read after the fold for an introduction into cmake. We&#8217;ll create a build system capable of creating debian or redhat (RPM) packages. It will include advanced stuff as automatically creating and installing documentation, subversion-derived version numbers and creating optional features.</p>
<h1><span id="more-753"></span>Basic Project Layout</h1>
<p>We have a fairly standard project layout (currently using autotools):</p>
<table>
<tbody>
<tr>
<th>Files</th>
<th>Location</th>
<th>Installed Location</th>
</tr>
<tr>
<td>boilerplate text files (README, LICENSE, etc.)</td>
<td><em>project root</em></td>
<td><em>/usr/share/doc/</em></td>
</tr>
<tr>
<td>Doxygen-generated docs</td>
<td><em>api-doc (after doxygen was called)</em></td>
<td><em>/usr/share/man/man3/</em></td>
</tr>
<tr>
<td>source code for executables</td>
<td><em>bin/*.c</em></td>
<td><em>/usr/bin</em></td>
</tr>
<tr>
<td>support libraries</td>
<td><em>/lib/*.c</em></td>
<td><em>/usr/libs</em></td>
</tr>
<tr>
<td>include files</td>
<td><em>/include/</em></td>
<td><em>/usr/include</em></td>
</tr>
</tbody>
</table>
<p>All files are stored within a <a title="Apache Subversion" href="http://subversion.tigris.org/">subversion software repository</a>. The final package should include the current subversion revision number in their package description (as well as output it from within the executable) to improve bug report&#8217;s quality.</p>
<p>The build system should generate the support library, the binary and utilize Doxygen to generate documentation. All those files need to find their way into automatically build distribution packages (Debian and Redhat packages in our case).</p>
<h1>Basic cmake setup</h1>
<p>We start with a skeleton cmake file that only tests various standard compile flags. We name our project, search for various default libraries (through <em>find_package</em>) and set various compile flags.</p>
<p>The simple boilderplate text files are also installed. At this time the destination directory is hard-coded, this will change in the future.</p>
<pre>project(test-program)
cmake_minimum_required(VERSION 2.6)

# check libs and packages (headers + lib)

# std C libraries
find_package(stdlibs REQUIRED)

# libpthread with pthread.h
find_package(pthread REQUIRED)

check_include_file(argp.h HAVE_ARGP_H)

# additional compiler flags
add_definitions(-Wall -Wextra -pedantic -Werror -std=c99 -D_BSD_SOURCE)

# 'other' documentation files
set(DOC_FILES AUTHORS NEWS README)
set(DOC_PATH "share/doc/testprogram-0.1")
install(FILES ${DOC_FILES}
        DESTINATION ${DOC_PATH})</pre>
<p>So far we have the skeleton outline of a cmake project that just sets some compile information about our project and finally installs some documentation. Let&#8217;s add some &#8220;real&#8221; stuff.</p>
<h1>Adding support libaries</h1>
<p>Our project contains one library that is needed for compilation of the executable file. To build the lib a new <em>CMakeLists.txt</em> was added to <em>/lib</em> and the <em>/lib</em> directory was added to the main CMakeLists.txt by:</p>
<pre>add_subdirectory(lib)</pre>
<p>The cmake library definition is pretty straightforward: we define the needed source files (through the <em>EXAMPLE_LIB_SRC</em> variable) and add a new shared library named &#8216;example-lib&#8217; to the build targets. The only &#8220;weird&#8221; thing is that we have to add the library to the linker flags manually (by setting <em>CMAKE_REQUIRED_LIBRARIES</em>): it would be nice if this could happen automatically.</p>
<pre># sources and linkage

# define the sources
set(EXAMPLE_LIB_SRC  lib_a.c lib_b.c)
add_library(example-lib SHARED ${QKD_APP_SRC})
target_link_libraries(example-lib ${CMAKE_REQUIRED_LIBRARIES})

# additional includes
include_directories(. ..)

# enable gcc specific stuff
if (CMAKE_COMPILER_IS_GNUCC)
    set_source_files_properties(${EXAMPLE_LIB_SRC} PROPERTIES COMPILE_FLAGS "-std=c99 -Werror -Wall -pedantic")
endif ()

set(CMAKE_REQUIRED_LIBRARIES "example-lib;${CMAKE_REQUIRED_LIBRARIES}")

# install
install(TARGETS example-lib LIBRARY DESTINATION lib)</pre>
<h1>Adding executables</h1>
<p>Now we add the executable file to the build. To achieve this we add a CMakeLists.txt to the <em>/bin</em> directory. Within it we define our executeable (consisting of <em>part_a.c</em> and <em>part_b.c</em>) and its compile flags. The <em>include</em> directive states where the compiler should search for header files. With the <em>install</em> command we define it&#8217;s final position when being installed as part of a package.</p>
<p>We also add a manual dependency of example-prog upon example-lib. Cmake now always builds example-lib before it attempts to build example-lib. Alas we still had to manually add the example-lib linker flags to <em>CMAKE_REQUIRED_LIBRARIES</em> at the <em>/lib</em> section</p>
<pre>include_directories(
    .
    ..
    ${CMAKE_CURRENT_BINARY_DIR}
    ${CMAKE_CURRENT_SOURCE_DIR}
    ${CMAKE_SOURCE_DIR}
    ${CMAKE_BINARY_DIR}
    ${CMAKE_SOURCE_DIR}/bin/
   )

# define the sources
set(EXAMPLE_SRC part_a.c part_b.c)

# define executable
add_executable(example-prog ${EXAMPLE_SRC})
target_link_libraries(example-prog ${CMAKE_REQUIRED_LIBRARIES})
add_dependencies(example-prog example-lib)

# compiler switches

# enable gcc specific stuff
if (CMAKE_COMPILER_IS_GNUCC)
    set_source_files_properties(${EXAMPLE_SRC} PROPERTIES COMPILE_FLAGS "-std=c99 -Werror -Wall -pedantic")
endif ()

# install binaries
install(TARGETS example-program RUNTIME DESTINATION bin)</pre>
<h1>Test it</h1>
<p>This would actually be a good time to test our build system. cmake supports two different ways of separating source code from build programs: out-of-tree builds and in-tree builds. With in-tree builds source code and generated files are always stored within the same project directories. This is the way of building that you might know from autotools. With out-of-tree builds all generated files are placed into a separated directory: this keeps your project directory clean (and you can do interesting stuff as speeding up build time by placing the out-of-tree build directory on a ramdrive/tmpfs). So we will try to do an out-of-tree build:</p>
<pre>$ cd $PROJECT_DIRECTORY
$ mkdir build
$ cd build
$ cmake ./..
$ make</pre>
<p>This will build all binaries within the <em>build</em> directory. Partey!</p>
<h1>Create debian and redhat packages</h1>
<p>We won&#8217;t distribute a tar-ball or plain pre-compiled binaries to our users but want distribution-specific packages. They provide a better user experience through features as dependency tracking (which other packages must be installed to run this program) or easy package management (install, reinstall, uninstall packages).</p>
<p>cmake provides <em>CPack</em> for package creation. To enable it our main <em>CMakeLists.txt</em> was adapted in the following way:</p>
<pre>set(CPACK_PACKAGE_DESCRIPTION "Do the example thingie")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A longer description about our example app.")
set(CPACK_PACKAGE_NAME "example-app")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (&gt;= 2.3.6), libgcc1 (&gt;= 1:4.1)")

set(CPACK_PACKAGE_CONTACT "Andreas Happe ")
set(CPACK_PACKAGE_VENDOR "Andreas Happe Inc.")
set(CPACK_PACKAGE_VERSION_MAJOR "0")
set(CPACK_PACKAGE_VERSION_MINOR "0")
set(CPACK_PACKAGE_VERSION_PATCH "1")
set(VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")

set(CPACK_GENERATOR "DEB;RPM;")
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}-${CMAKE_SYSTEM_PROCESSOR}")

include(CPack)</pre>
<p>The variables contain package descriptions and version information that will be converted into the new packages meta-information. <em>CPACK_GENERATOR</em> specifies for which output types the generated packages should have. We have chosen DEB (Debian, Ubuntu) and RPM (Redhat, Suse, Fedora) packages to be generated. They should suffice for the vast majority of installed Linux distributions. We also added some package dependencies for debian distributions: this ensures that libc and libgcc1 will be installed with their correct versions before our package is installed.</p>
<p>To finally build our distribution packages just change into the build directory and enter <em>cpack</em>:</p>
<pre>$ cd build
$ cpack</pre>
<p>The resulting distribution packages will lie within the <em>build</em> directory.</p>
<p>Another advantage is that we can use those cpack variables throughout the whole <em>CMakeLists.txt</em> file. For example: instead of installing documentation files into a fixed directory through:</p>
<pre>set(DOC_PATH "share/doc/testprogram-0.1")</pre>
<p>we can install them into a properly versioned directory:</p>
<pre>set(DOC_PATH "share/doc/${CPACK_PACKAGE_NAME}-${VERSION}")</pre>
<h1>Add include files to distribution package</h1>
<p>Other programs might link against our <em>example-lib</em> but they will need some header files to learn about the lib&#8217;s available (exported) function signatures. To install them we add the &#8220;include&#8221; subdirectory to our build by adding the following to the main <em>CMakeLists.txt</em>:</p>
<pre>add_subdirectory(include)</pre>
<p>Now we need a &#8220;/include/CMakeLists.txt&#8221; that specifies which header files need to be installed into our distribution package. As we want this to happen for all existing header files we just add a catchall install statement:</p>
<pre>install(DIRECTORY example-lib-headers
        DESTINATION include
        FILES_MATCHING PATTERN "*.h"
                       PATTERN ".svn" EXCLUDE
       )</pre>
<p>This installs all &#8220;*.h&#8221; files (ie. header files) from the directory &#8220;/include/example-lib-headers&#8221; into the package&#8217;s <em>include</em> directory (which will later be installed into the system&#8217;s include files directories). Notice the <em>EXCLUDE</em>-pattern: as we are using Subversion as a SCM we do have various internal subversion files lying around in our source code tree. Those include copies of header files. Without this <em>EXCLUDE</em> those copies would also be installed into our distribution package what we do certainly not want.</p>
<h1>Add current subversion revision</h1>
<p>As all programs our example program contains bugs. To improve bug reports we want to include a reference to the exact subversion release this package was build from. This information should be included within the package meta-information as well as within the compiled program itself</p>
<p>First of all we need to gather the subversion revision information. To achieve this we utilize the <em>Subversion</em> module that is installed with cmake (you can find those modules under <em>/usr/share/cmake/modules*</em>, there are lots of useful tools within that directory). It&#8217;s configuration and usage within the main <em>CMakeLists.txt</em> can be seen in the following code snipplet:</p>
<pre>find_package(Subversion)
if(Subversion_FOUND)
  Subversion_WC_INFO(${CMAKE_CURRENT_SOURCE_DIR} ER)
  set(SUBVERSION_REVISION ${ER_WC_REVISION})
endif(Subversion_FOUND)</pre>
<p>Now we have the current subversion revision stored within the <em>SUBVERSION_REVISION</em> variable and can easily use it to set our packages patch level (the patch level is the most insignificant part of the whole package version):</p>
<pre>set(CPACK_PACKAGE_VERSION_PATCH "${SUBVERSION_REVISION}")</pre>
<p>To reference this information from within a compiled program we want a header file that contains a <em>#define</em> that acts as a placeholder for the current subversion revision string. To achieve this we utilize the cmake <em>configure_file</em> directive. The directive states a source and a destination file: the source file is read, processed and stored as the stated destination file. During processing all cmake variables can be accessed and output into the destination file, ie.:</p>
<pre>configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/revision.h.in ${CMAKE_CURRENT_BINARY_DIR}/revision.h)</pre>
<p>With an <em>config.h.in</em> file of:</p>
<pre>#ifndef __REVISION_H
#define __REVISION_H
#define SVN_REVISION "${SUBVERSION_REVISION}"
#endif</pre>
<p>The cmake variable <em>SUBVERSION_REVISION</em> is used as value for the <em>SVN_REVISION</em> #define. The <em>#ifndef</em> guards are just thrown in for good style and are not mandatory.</p>
<h1>Automatically create man pages/documentation with Doxygen</h1>
<p>We can utilize the same <em>configure_file</em>-mechanism to automatically generate documentation through <a href="http://www.doxygen.org/">Doxygen</a>. We already have a doxygen file describing the documentation extraction but need to adapt it to the actual build directory, ie:</p>
<pre>PROJECT_NAME           = ${CPACK_PACKAGE_NAME}
PROJECT_NUMBER         = ${VERSION}
OUTPUT_DIRECTORY       = api-doc
INPUT                  = ${CMAKE_CURRENT_SOURCE_DIR}</pre>
<p>Now we need to include Doxygen within our build configuration. We achieve this through including the following into our main <em>CMakeLists.txt</em>:</p>
<pre># check if doxygen is even installed
find_package(Doxygen)
if (DOXYGEN_FOUND STREQUAL "NO")
    message(FATAL_ERROR "Doxygen not found. Please get a copy http://www.doxygen.org")
endif (DOXYGEN_FOUND STREQUAL "NO")

# prepare doxygen configuration file
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)

# add doxygen as target
add_custom_target(doxygen ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)

# cleanup $build/api-doc on "make clean"
set_property(DIRECTORY APPEND PROPERTY
	     ADDITIONAL_MAKE_CLEAN_FILES api-doc)

# add doxygen as dependency to doc-target
get_target_property(DOC_TARGET doc TYPE)
if(NOT DOC_TARGET)
	add_custom_target(doc)
endif()
add_dependencies(doc doxygen)

# install HTML API documentation and manual pages
set(DOC_PATH "share/doc/${CPACK_PACKAGE_NAME}-${VERSION}")

install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/api-doc/html
         DESTINATION ${DOC_PATH}
       )

# install man pages into packages, scope is now project root..
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/api-doc/man/man3
         DESTINATION share/man/man3/
       )</pre>
<p>First of all we verify that Doxygen is even installed. Afterwards we automatically adopt the Doxygen.in configuration file to our needs (<em>configure_file</em>). This makes sure that generated documentation is always placed within the <em>build</em> directory. To make sure that current documentation is always available we add a custom target called &#8220;doxygen&#8221; and let the &#8220;doc&#8221; target depend upon it. The &#8220;doc&#8221; target will automatically be called after compiling and through the dependence doxygen will be called then too. In addition we add the &#8220;api-doc&#8221; directory (which will contain all generated files as specified within <em>Doxygen.in</em>) to the lsit of files that should be removed after a &#8220;make clean&#8221; run.</p>
<p>This is sufficient to create documentation but we also want it to appear within the generated distribution packages. The two <em>install</em> statements at the end achieve exactly that: they install HTML documentation into the official /usr/share/doc/ directory and generated man pages into their corresponding directories.</p>
<h1>Add some optional parts</h1>
<p>So far our build environment has been pretty monolithic: it always builds everything. Sometimes you do not want that as some features are only needed in special circumstances. As an example we do not want to add header files to the distribution package all the time.</p>
<p>Optional features are supported by <em>cmake</em> through the <em>option</em> statement. An option consists of a variable name and a short description. The user is displayed the option description and if he enables it the option variable is set. A short example illustrates this far better:</p>
<pre>option(ADD_INCLUDE_FILES "Add include files to the generated distribution packages")
if (ADD_INCLUDE_FILES)
    add_subdirectory(include)
else(ADD_INCLUDE_FILES)
    message(WARNING "include files will not be included within the distribution packages")
endif(ADD_INCLUDE_FILES)</pre>
<p>The include directory is only processed if the user selects the option. But how can an user actually enable an option? cmake provides various user interfaces, i prefer the ncurses-based ccmake:</p>
<pre>$ cd build
$ ccmake ./..
# enable the wanted options and build it afterwards..
$ make</pre>
]]></content:encoded>
			<wfw:commentRss>http://snikt.net/index.php/2010/04/01/howto-use-cmake-with-cc-projects/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Generating PDFs from Ruby on Rails</title>
		<link>http://snikt.net/index.php/2010/03/03/generating-pdfs-from-ruby-on-rails</link>
		<comments>http://snikt.net/index.php/2010/03/03/generating-pdfs-from-ruby-on-rails#comments</comments>
		<pubDate>Wed, 03 Mar 2010 12:25:45 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[adobe pdf]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[prawn]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[wicked_pdf]]></category>
		<category><![CDATA[wkthmltopdf]]></category>

		<guid isPermaLink="false">http://snikt.net/?p=491</guid>
		<description><![CDATA[The problem Ruby on Rails provides various helpers for generating dynamic web content but sometimes you need documents that users can easily store and share between them. The ubiquitous file format for this is Adobe PDF nowadays. The common solution fro this problem is Prawn [github, introduction]. Alas it requires a custom DSL for document description, no [...]]]></description>
			<content:encoded><![CDATA[<h2>The problem</h2>
<p><a href="http://rubyonrails.org/">Ruby on Rails</a> provides various helpers for generating dynamic web content but sometimes you need documents that users can easily store and share between them. The ubiquitous file format for this is <a href="http://en.wikipedia.org/wiki/Adobe_PDF">Adobe PDF</a> nowadays.</p>
<p>The common solution fro this problem is Prawn [<a href="http://wiki.github.com/sandal/prawn/">github</a>, <a href="http://railscasts.com/episodes/153-pdfs-with-prawn">introduction</a>]. Alas it requires a custom DSL for document description, no existing Rails views or partials can be reused. An alternative is <a href="http://www.princexml.com/">princeXML</a> which transforms HTML/CSS into pdf through an external binary. This would allow reuse of existing templates and knowledge (think CSS designers) but has the downside of its price tag of $3800.</p>
<h2>The solution</h2>
<p>Enters <a href="http://github.com/mileszs/wicked_pdf">wicked_pdf</a>: it utilizes <a href="http://code.google.com/p/wkhtmltopdf/">wkhtmltopdf</a> to create a PDF document from a Rails HTML template. HTML rendering is done through the well-known webkit-engine. This allows developers to do PDFs in the right way™: define the document&#8217;s structure through a simple HTML document and theme them through CSS. You&#8217;ll get the automatic benefit of themability: exchange the CSS and you have another format. There are also lots of CSS artists out there that can supply you with different designs.</p>
<p><span id="more-491"></span></p>
<p>I&#8217;ve used this solution with a test Ruby on Rails 3.0-beta application, the steps involved were:</p>
<h3>Install <em>wkhtmltopdf:</em></h3>
<p><strong><span style="font-weight: normal; font-size: 13px;">This program will convert the HTML into the PDF format. To make it work you&#8217;ll need at least version 0.9 which isn&#8217;t installed in Ubuntu 9.10 by default. Just download the <a href="http://code.google.com/p/wkhtmltopdf/downloads/list">static compiled version</a> from the <a href="http://code.google.com/p/wkhtmltopdf/downloads/list">wkhtmltopdf website</a> and place it under <em>/usr/local/bin</em>. </span></strong></p>
<h3>Install the wicked_pdf plugin:</h3>
<p>Just install it in the usual Rails way:</p>
<pre>git submodule add ﻿git://github.com/mileszs/wicked_pdf.git vendor/plugins/wicked_pdf</pre>
<p>Additionally a sample configuration file is needed. You could use the plugin&#8217;s generator script for it but alas this didn&#8217;t work for me with Rails 3.0. Let&#8217;s just copy it form the plugin&#8217;s directory into config/initializers.</p>
<pre>$ cp vendor/plugins/wicked_pdf/generators/wicked_pdf/templates/wicked_pdf.rb config/initializers</pre>
<p>and alter the wkhtmltopdf path within it:</p>
<pre>  WICKED_PDF = {
       :exe_path =&gt; '/usr/local/bin/wkhtmltopdf-amd64'
  }</pre>
<h3>﻿﻿Add pdf instructions to your controller..</h3>
<p>For example I&#8217;m using the <em>invoice#index</em> action to render a simple PDF document.</p>
<pre>  format.pdf do
          @example_text = "some text"
          render :pdf =&gt; "file_name",
                 :template =&gt; 'offers/show.pdf.erb',
                 :layout =&gt; 'pdf',
                 :footer =&gt; {
                    :center =&gt; "Center",
                    :left =&gt; "Left",
                    :right =&gt; "Right"
                 }
  end</pre>
<p>We are rendering the view with a predefined footer containing some sample &#8220;center&#8221;, &#8220;left&#8221; and &#8220;right&#8221; strings. The <em>render :pdf</em> call has various options which can be seen on the wicked_pdf homepage.</p>
<h3>.. and create PDF templates</h3>
<p>The other half of the PDF templates is the view code consisting of a special layout and template for pdf generation.</p>
<p>The layout (<em>app/views/layouts/pdf.html.erb</em>) resembles a normal Ruby on Rails layout file:</p>
<pre>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt;
  &lt;head&gt;
    &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
    &lt;%= wicked_pdf_stylesheet_link_tag "pdf" %&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;div id="content"&gt;
      &lt;%= yield %&gt;
    &lt;/div&gt;
  &lt;/body&gt;
&lt;/html&gt;</pre>
<p>The view code should not be too surprising, just place it under <em>app/views/offers/index.pdf.erb</em> :</p>
<pre>&lt;div id="someid"&gt;&lt;%= @example_text %&gt;&lt;/div&gt;</pre>
<p>Lets also create a simple CSS file (<span style="font-style: normal;"><em>public/stylesheets/pdf.css</em></span><span style="font-style: normal;">):</span></p>
<pre>#someid {
  margin-left: 430px;
  display: float;
  height: 150px;
  background-color: green;
  width: 250px;
}</pre>
<p><span style="font-style: normal;"> </span></p>
<p>This is the whole rendering code.</p>
<h3>Reference the PDF view and download it</h3>
<p><span style="font-style: normal;">We still need a reference to the newly created rendernig link, we can easily create this through:</span></p>
<pre><span style="font-style: normal;">link_to 'Create PDF document', invoice_path(@invoice, :format =&gt; :pdf)</span></pre>
<p><span style="font-style: normal;">When the link is clicked a pdf document will be generated and downloaded.</span></p>
<h2>Conclusion</h2>
<p>wicked_pdf allows easy pdf generation in a very Ruby on Rails&#8217; way. It&#8217;s free, it works and is easy to employ..</p>
<p><span style="font-style: normal;">..but not everything is perfect within the wicked_pdf world, especially error handlnig is lacking sometimes. When you&#8217;ve debugging initial problems you can expect the only error feedback to be a HTTP return code of 406. Just start with limited controller (rendering) options and double check that you&#8217;ve referenced the right view and layout paths and you should be fine.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://snikt.net/index.php/2010/03/03/generating-pdfs-from-ruby-on-rails/feed</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>SECOQC: We&#8217;ve done it</title>
		<link>http://snikt.net/index.php/2008/10/12/secoqc-weve-done-it</link>
		<comments>http://snikt.net/index.php/2008/10/12/secoqc-weve-done-it#comments</comments>
		<pubDate>Sun, 12 Oct 2008 19:01:34 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://happiness-is-slavery.net/?p=294</guid>
		<description><![CDATA[Over the last one and a half years I&#8217;ve been involved with the SECOQC project. It&#8217;s goal was to provide a prototype of a quantum key distribution network. Such a system would provide unconditional security, thus wouldn&#8217;t be isn&#8217;t vulnerable to improvements in computing power as traditional cryptography. The final presentation of the prototype happened [...]]]></description>
			<content:encoded><![CDATA[<p>Over the last one and a half years I&#8217;ve been involved with the <a href="http://www.secoqc.net">SECOQC</a> project. It&#8217;s goal was to provide a prototype of a quantum key distribution network. Such a system would provide unconditional security, thus <span style="text-decoration: line-through;">wouldn&#8217;t be</span> isn&#8217;t vulnerable to improvements in computing power as traditional cryptography.</p>
<p>The final presentation of the prototype happened this Wednesday. The last days and nights before that were filled with applying the last fixed but finally it was worth the time. But let the newspapers do the talking: <a href="http://futurezone.orf.at/it/stories/311988/">orf</a>, <a href="http://www.heise.de/newsticker/Erstes-Quantenkryptographie-Netz-in-Wien--/meldung/117082">heise</a>, <a href="http://derstandard.at/?id=1220460265474">der standard</a>, <a href="http://newsticker.sueddeutsche.de/list/id/213783">sueddeutsche</a>, <a href="http://www.telekom-presse.at/channel_computing/news_34403.html">Austrian Telekom News</a>. There was quite good news coverage in german-speaking Europe (and some eastern europe countries) but sadly the news didn&#8217;t seem to have jumped over the pond (at least some American physicists were at the presentation so it got noticed anyway).</p>
<p>Feels strange to know that something that big and cutting-edge is finally successfully finished.. and that I&#8217;m an unemployed student agai</p>
]]></content:encoded>
			<wfw:commentRss>http://snikt.net/index.php/2008/10/12/secoqc-weve-done-it/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby on Rails vs. Java part2</title>
		<link>http://snikt.net/index.php/2008/02/24/ruby-on-rails-vs-java-part2</link>
		<comments>http://snikt.net/index.php/2008/02/24/ruby-on-rails-vs-java-part2#comments</comments>
		<pubDate>Sun, 24 Feb 2008 15:07:00 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://happiness-is-slavery.net/index.php/2008/02/24/ruby-on-rails-vs-java-part2</guid>
		<description><![CDATA[As mentioned in part 1 my task is implementing a mail and campaigning module. I started out with a pure Ruby on Rails application and moved to a mixed Java/Rails applications as Ruby&#8217;s communication libraries where just lacking mandatory features. I choose Java/Hibernate/Spring as the combination should provide me with most needed features through an [...]]]></description>
			<content:encoded><![CDATA[<p>As mentioned in part 1 my task is implementing a mail and campaigning module. I started out with a pure Ruby on Rails application and moved to a mixed Java/Rails applications as Ruby&#8217;s communication libraries where just lacking mandatory features. I choose Java/Hibernate/Spring as the combination should provide me with most needed features through an easily extend- and configurable framework. What are my findings so far?</p>
<p><span id="more-271"></span><strong>Lines of Code comparison</strong></p>
<p>Ruby beats Java if you want an easy and fast web development framework, but as soon as you exit the web user interface niche it looses many of its advantages, still the lines-of-code count in java is around 4 to 6 times as large as Rails&#8217;s. Good for you if you&#8217;re paid by the line of code that you write, bad for you if you want to get things done.</p>
<p>Both frameworks rely on convention over configuration. As I wrote the Java application after the Rail&#8217;s one I had to configure Java to fit Rail&#8217;s way which resulted in lots of configuration which would be unnecessary if I&#8217;d written the application in Java from day one. Much of the simpler code (setter/getter for entity classes) were also auto-generated, so the LOC count should be looked at with a grain of salt.</p>
<p><strong>Readability </strong></p>
<p>The Java code is better readable which surprised me. While the Ruby code is more verbose and beatifuller the Java code tends to be longer, but overall simpler structured. It is a lot easier to debug and as my application will be deployed as a war file in an Java Enterprise container there&#8217;s lot of functionality (e.g. logging) which can easily be tapped. I had some very ugly functions dealing with mime parts in Ruby, those are a lot easier to read because of the static typing. Once again: while duck-typing is perfect for writting an application quick, static typing might come in handy if you want your application to be robust and long-lived.</p>
<p><strong>Different approach to business object authority<br />
</strong></p>
<p>Another difference (and source of increased Java LOCs) is the different approach to business object responsibility. That term describes who is responsible for declaring objects, their content and constraints. Rail&#8217;s ActiveRecord maps the a database table into a business object data type, a row into an object and a attribute into a class member. Each change in the data backend automatically changes your business objects. You can write automatic tests to check if your object model is still sufficient, but those tests are not run automatically when the application starts. Some definitions (i.e. constraints and relationships) are defined on business object level, so you have split definitions between the database and your object model.</p>
<p>With hibernate you write your business objects and add annotations (as you do with Rails) to describe how they are mapped to the database. But the final  authority lies at the application and the business objects. If there&#8217;s a database change no attribute appears or disappears automatically, but an exception is raised on application startup. You have to write more code, but you have all your data definitions (incl. tables, attributes, relations and constraints) in one single conceptional place. You can even generate your database layout from your object model.</p>
<p>The later approach is clearer for me (and does less automagic than the Rails approach), but there&#8217;s also a payoff: you&#8217;ll need many more lines of code to define your business objects. Also if you want to add a change you&#8217;ll have to change your data definitions in the database as well as in your application. This will never happen in Rails with it&#8217;s D-R-Y way (Dont Repeat Yourself). Choose ease and speed of writing code vs. IMHO more safer code as your database format and input is double checked.</p>
<p>The next part will talk about the differences in Rails and Java/Springs exception handling.</p>
]]></content:encoded>
			<wfw:commentRss>http://snikt.net/index.php/2008/02/24/ruby-on-rails-vs-java-part2/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby on Rails vs. Java, part 1</title>
		<link>http://snikt.net/index.php/2008/02/17/ruby-on-rails-vs-java-part-1</link>
		<comments>http://snikt.net/index.php/2008/02/17/ruby-on-rails-vs-java-part-1#comments</comments>
		<pubDate>Sun, 17 Feb 2008 17:05:38 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://happiness-is-slavery.net/index.php/2008/02/17/ruby-on-rails-vs-java-part-1</guid>
		<description><![CDATA[One of the components of the system developed here at Blackwhale is an fairly advanced web mail/campaigning and analytics system. The first iteration of that component was fully implemented in Ruby on Rails. Writing the front end was fairly easy and fast, a perfect opportunity for Rails to display its strengths. On the back end [...]]]></description>
			<content:encoded><![CDATA[<p>One of the components of the system developed here at <a href="http://www.blackwhale.net">Blackwhale</a> is an fairly advanced web mail/campaigning and analytics system. The first iteration of that component was fully implemented in <a href="http://www.rubyonrails.org">Ruby on Rails</a>. Writing the front end was fairly easy and fast, a perfect opportunity for Rails to display its strengths. On the back end and communication part on the other hand I stumbled into various problems:</p>
<ul>
<li>Compared to PHP, Python or Java there are just too few communication libraries. And even the libraries that exist are lacking fundamental features and almost all of them come without useable documentation. That there is no encryption (SSL or TLS) support in the whole Ruby 1.8 mail libraries is an outright shame. The IMAP library is so clumsy that a web company sells their own (still not perfect library) through their online store and they seem to make a good buck with it.
<p>On the Java side is just a completly different picture: Lots of libraries, even documented ones are available. After having to touch the <a href="http://tmail.rubyforge.org/">TMail</a> (rail&#8217;s MIME mail handler library) API using javax.mail is a heavenly gift. And it seems that the TMail generated MIME messages were invalid in a couple of cases. Not the best feature of a support library. Also the chance of finding unsolved known bugs and errors seems to be lot smaller in Java.</li>
<li>This brings me to another point: I might change my opinion on Java&#8217;s constraints on its users. Java tries hard to prevent errors (i.e. the forced exception catching). I always thought that that took too many stylish possibilities away from the user, but by now I must confess that I think that this is exactly what I want from something that I&#8217;m using on the network side. I&#8217;m a lazy programmer, I want to be reminded and forced to write secure and stable code. This is the quite different to Ruby and Rails &#8216;make it easy for the programmer&#8217; attitude.</li>
<li>Background processing is hard. As Ruby on Rails is not multi-thread safe you can&#8217;t just spawn a thread if you need to perform some longer running task. Another disadvantage of using a single-process model is that the long running request will occupy one rails worker (i.e. rails cluster process) until it has finished &#8211; in our case that costs us around 60MB of memory per long running request, even if it is just waiting for some simple SMTP feedback. If you can find a situation where you can delay the execution of a network related task (and if you don&#8217;t you&#8217;re not thinking) for two seconds, 6 requests per seconds will DoS a standard rails cluster.
<p>The only solution that&#8217;s actually usable is <a href="http://backgroundrb.rubyforge.org/">BackgroundRb</a>. But projects that just change their background communication system just don&#8217;t sound to production-grade ready for me. Also the admin start/stop scripts for their background server didn&#8217;t work too well for me.</li>
<li>For a language that interferes it&#8217;s object&#8217;s attribute types directly from the database the ActiveRecord layer is weak. Don&#8217;t get me wrong, I understand that the Simplicity is needed to make it easily usable but I ran into various situations where I&#8217;d love to have a full blown ORM behind me. One feature that is needed quite often by our application is inheritance. ActiveRecord only offers single table inheritance, and even there you have to make sure that each row is valid (ActiveRecord should have all needed information to do that by itself BTW) or you will run into problems later on. One problem is, that it tries to abstract too much functionality away from the database while not provided as advanced interfaces by itself. Data integrity handling? Abstracted away by rails, so all databases can be used the same. The drawback is, that the data constraints and relations are fully handled by rails and not passed on to the database. Any process that might produce invalid data (e.g. a faulty rails component) might corrupt the data. Rails is able to handle that cases by itself (due to ducktyping and very few default checks), but access that data with any other framework and it blows up directly into your face.</li>
<li>Transaction handling. Just try it. Then cry. Also I&#8217;m not sure if Transaction handling is even done on database level or in Rails (as done with constraints). If the later is true, it&#8217;s acutally not worth anything as soon as more processes try to access the database.</li>
</ul>
<p>The library and documentation problems where the main reason for me to reimplement the mailing and campaigning backend in Java. The front end is still a Rails application &#8212; which is exactly what Rails is for. As I&#8217;m no friend of blown-up EJB based solutions I&#8217;ve choosen a simple Spring and JPA based solution for that problem.</p>
<p>I&#8217;m currently testing the last features and replacing the Ruby code part by part. As soon as I&#8217;ve done that another blog post will examine the two implementations, how much time was spent on coding them and how they perform when compared to each other.</p>
]]></content:encoded>
			<wfw:commentRss>http://snikt.net/index.php/2008/02/17/ruby-on-rails-vs-java-part-1/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to enable TLS support in Ruby&#8217;s/Rails&#8217; Net::SMTP</title>
		<link>http://snikt.net/index.php/2007/12/19/how-to-enable-tls-support-in-rubysrails-netsmtp</link>
		<comments>http://snikt.net/index.php/2007/12/19/how-to-enable-tls-support-in-rubysrails-netsmtp#comments</comments>
		<pubDate>Wed, 19 Dec 2007 01:12:10 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://happiness-is-slavery.net/index.php/2007/12/19/how-to-enable-tls-support-in-rubysrails-netsmtp/</guid>
		<description><![CDATA[Ruby on Rails uses Ruby 1.8 which still lacks support for STARTTLS or SSL. This was added in Ruby 1.9, but as this release is designated to be unstable (and only the road to a stable Ruby 2.0) Rails 2.0 doesn&#8217;t support running with it. What to do? It&#8217;s a shame that a web framework [...]]]></description>
			<content:encoded><![CDATA[<p>Ruby on Rails uses Ruby 1.8 which still lacks support for STARTTLS or SSL. This was added in Ruby 1.9, but as this release is designated to be unstable (and only the road to a stable Ruby 2.0) Rails 2.0 doesn&#8217;t support running with it.</p>
<p>What to do? It&#8217;s a shame that a web framework like Rails doesn&#8217;t support secure transmission of mails.</p>
<p>So I rolled my own Ruby on Rails plugin that extends the  base Net::SMTP class with STARTTLS features. You can just call Net::SMTP.enable_tls (or do the same with an instance variable) to enable secure communications.</p>
<p>Honestly I didn&#8217;t write all the code on my own but searched the net and adapted some around-floating patches to this plugin as this is the easiest way of providing the needed TLS support to rails.</p>
<p>So if you need it, just <a href="http://happiness-is-slavery.net/wp-content/rails-plugins/">grab it from here</a>. More Information can be found in the plugin&#8217;s README file. Have fun and share your improvements to the plugin.</p>
]]></content:encoded>
			<wfw:commentRss>http://snikt.net/index.php/2007/12/19/how-to-enable-tls-support-in-rubysrails-netsmtp/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to upgrade to Ruby on Rails 2.0</title>
		<link>http://snikt.net/index.php/2007/12/10/how-to-upgrade-to-ruby-on-rails-20</link>
		<comments>http://snikt.net/index.php/2007/12/10/how-to-upgrade-to-ruby-on-rails-20#comments</comments>
		<pubDate>Mon, 10 Dec 2007 01:36:18 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://happiness-is-slavery.net/index.php/2007/12/10/how-to-upgrade-to-ruby-on-rails-20/</guid>
		<description><![CDATA[I wanted to upgrade on project of mine to Ruby on Rails 2.0 to automatically get some security and performance upgrades. So how to do it? My first try was: checkout a new copy of my project from the SCM upgrade the used rails version to EdgeRails (through executing &#8220;rake rails:freeze:edge&#8221; twice) adopted the RAILS_VERSION [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to upgrade on project of mine to <a href="http://weblog.rubyonrails.org/2007/12/7/rails-2-0-it-s-done">Ruby on Rails 2.0</a> to automatically get some security and performance upgrades. So how to do it? My first try was:</p>
<ol>
<li>checkout a new copy of my project from the SCM</li>
<li>upgrade the used rails version to <a href="http://wiki.rubyonrails.org/rails/pages/EdgeRails">EdgeRails</a><br />
(through executing &#8220;<em>rake rails:freeze:edge</em>&#8221; twice)</li>
<li>adopted the RAILS_VERSION variable in <em>config/environment.rb</em></li>
<li>Got a &#8220;500 Internal Error&#8221; without any usable logging information on starting the Rails server (&#8220;<em>script/server</em>&#8220;)</li>
</ol>
<p>So what? I upgraded everything as planned and got an error without any real debugging help. What to do now?</p>
<p>After some googling around I found <a href="http://pastie.caboo.se/private/krcevozww61drdeza13e3a">Mislav Marohnic&#8217;s excellent r2check.rb script</a>. Just run it in your Rails directory and it will report a lot of errors and deprecated features that might hit you. One of those reported errors was the new notation for singular resources, after it converted my <em>resources.rb</em> the application finally started (albeit I had to fix some errors in the restful_authentication plugin, but nothing to heavy). So now I&#8217;m running Rails 2.0.1 and some pages really fell a lot faster.</p>
<p>Thank you very much for that script!</p>
]]></content:encoded>
			<wfw:commentRss>http://snikt.net/index.php/2007/12/10/how-to-upgrade-to-ruby-on-rails-20/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ruby on Rails redux</title>
		<link>http://snikt.net/index.php/2007/11/12/ruby-on-rails-redux</link>
		<comments>http://snikt.net/index.php/2007/11/12/ruby-on-rails-redux#comments</comments>
		<pubDate>Sun, 11 Nov 2007 23:01:47 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://happiness-is-slavery.net/index.php/2007/11/12/ruby-on-rails-redux/</guid>
		<description><![CDATA[Approximately one week ago I claimed that I was happy replacing Ruby on Rails with a conglomerate of Java frameworks. I&#8217;ve got wiser. Even with maven2 it&#8217;s too hard to get even a simple mavenized spring2, acegi, spring-jpa-hibernate configureation to work. So I&#8217;m back to Rails. By now I feel more comfortable in the framework, [...]]]></description>
			<content:encoded><![CDATA[<p>Approximately one week ago I claimed that I was happy replacing Ruby on Rails with a conglomerate of Java frameworks. I&#8217;ve got wiser. Even with maven2 it&#8217;s too hard to get even a simple mavenized spring2, acegi, spring-jpa-hibernate configureation to work.</p>
<p>So I&#8217;m back to Rails. By now I feel more comfortable in the framework, but there are still some open issues but most things just work (TM).</p>
<p align="right"><em>You&#8217;re an atheist?</em></p>
<p align="right"><em>Only on Christmas or Easter,<br />
the rest of the time it doesn&#8217;t really matter</em></p>
<p align="right">House, M.D.</p>
]]></content:encoded>
			<wfw:commentRss>http://snikt.net/index.php/2007/11/12/ruby-on-rails-redux/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Back in Vienna and small stuff</title>
		<link>http://snikt.net/index.php/2007/11/06/back-in-vienna-and-small-stuff</link>
		<comments>http://snikt.net/index.php/2007/11/06/back-in-vienna-and-small-stuff#comments</comments>
		<pubDate>Tue, 06 Nov 2007 02:07:51 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://happiness-is-slavery.net/index.php/2007/11/06/back-in-vienna-and-small-stuff/</guid>
		<description><![CDATA[The last four days back home in Carinthia passed too fast.. and as soon as I was back in Vienna work covered me again.  I&#8217;ve finally finished my climbing lessons, didn&#8217;t even miss one of them. Now I hope that I can find the motivation to visit those halls of pain again. I&#8217;m more than [...]]]></description>
			<content:encoded><![CDATA[<p>The last four days back home in Carinthia passed too fast.. and as soon as I was back in Vienna work covered me again.  I&#8217;ve finally finished my climbing lessons, didn&#8217;t even miss one of them. Now I hope that I can find the motivation to visit those halls of pain again. I&#8217;m more than a little bit proud of my discipline, I even attended each Pencak Silat class until now &#8211; alas my performance in those ain&#8217;t the best.</p>
<p>I spent most of today&#8217;s afternoon coding a quite simple web application using JavaServer Pages with a <a href="http://www.springframework.org">Spring2</a>, Hibernate and Java Persistence Architecture back-end.  Security is handled through <a href="http://www.acegisecurity.org">acegi</a>, packaging through maven. Although this is more time-consuming compared to the last <a href="http://www.rubyonrails.org">Ruby on Rails</a> application I coded but there&#8217;s less Voodoo involved. Overall the resulting system feels more secure and stable.</p>
]]></content:encoded>
			<wfw:commentRss>http://snikt.net/index.php/2007/11/06/back-in-vienna-and-small-stuff/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
