<?xml version="1.0" encoding="utf-8" standalone="yes"?><?xml-stylesheet href="/feed_style.xsl" type="text/xsl"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="https://www.rssboard.org/media-rss"><channel><title>Kneth's Korner</title><link>https://k.zigzak.net/</link><description>Recent content on Kneth's Korner</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><copyright>Kenneth Geisshirt - [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/)</copyright><lastBuildDate>Wed, 13 Aug 2025 14:58:03 +0100</lastBuildDate><atom:link href="https://k.zigzak.net/index.xml" rel="self" type="application/rss+xml"/><icon>https://k.zigzak.net/img/icon.svg</icon><item><title>Remote Work Theorem</title><link>https://k.zigzak.net/posts/remote-work-theorem/</link><pubDate>Wed, 13 Aug 2025 14:58:03 +0100</pubDate><guid>https://k.zigzak.net/posts/remote-work-theorem/</guid><description><![CDATA[<h1 id="remote-work-theorem">Remote Work Theorem</h1>
<p>Prior to the COVID-19 pandemic in 2020, working remotely was considered a privilege for few people. During the pandemic, many employees were working from home, adopting new routines and technologies. In a post-pandemic time, many people have a desire to continue working from home full time and will effectively be fully remote employees.</p>
<p>I have experience of working with geographically distributed teams at companies like <a href="https://www.nokia.com/">Nokia</a>, <a href="https://en.wikipedia.org/wiki/Realm_(database)">Realm</a>, <a href="https://www.mongodb.com">MongoDB</a>, and <a href="https://cratedb.com/">CrateDB</a>. While not always working from home, working remotely from an office is a way to describe the situation where all team members work from other locations but work at different offices. The same technologies and routines apply as working fully remote.</p>
<p>The Remote Work Theorem applies to teams or organizations of any size, and it is capturing the possible modus operandi for different work situations. The theorem can be formulated as follows.</p>
<blockquote>
<h4 id="remote-work-theorem-1">Remote Work Theorem</h4>
<p>For any work situation, you can only pick two of following three conditions:</p>
<ul>
<li>Speed of Decision-Making (synchronous collaboration, fast iteration)</li>
<li>Deep Work &amp; Flexibility (asynchronous communication, fewer meetings)</li>
<li>Knowledge Retention &amp; Scalability (strong written culture, documentation-driven)</li>
</ul></blockquote>
<p>Based on my personal experiences, the theorem is purely empirical, and no strict proof can be offered.</p>
<p>The theorem implies that three different combinations of work conditions exist. Each combination sets the scene for trade-offs in how the work in a team optimally can be organized.</p>
<ul>
<li>If you optimize for <em>Speed</em> and <em>Deep Work</em>, you might sacrifice <em>Knowledge Retention</em>, as decisions happen quickly but aren’t well-documented.</li>
<li>If you prioritize <em>Deep Work</em> and <em>Knowledge Retention</em>, decision-making can be slow as asynchronous communication takes time - in particular if the team is spread across many time zones.</li>
<li>If you focus on <em>Speed</em> and <em>Knowledge Retention</em>, you risk over-synchronization, with too many meetings and interruptions.</li>
</ul>
<p>With the Remote Work Theorem, and the trade-offs outlined above, it is possible to design a work environment for any given team or organization. By applying an <em>inverted work environment maneuver</em>, the two work conditions can be found to support the desired work environment.</p>
<p>To mitigate the trade-offs when optimizing for <em>Speed</em> and <em>Deep Work</em>, processes can be designed. The processes will help the team to be able to communicate asynchronously as team members will know what to do next without slowing down by waiting (synchronization point) for other team members. While processes should not come before people, the processes can set the individual team members free and give them flexibility.</p>
<p>If <em>Deep Work</em> and <em>Knowledge Retention</em> are important, a clear team agreement on the asynchronous communication can lower the latency. An example of an agreement is that each team member spends time in the morning doing code reviews to unblock other team members. It requires a strong discipline to work in this regime as a single day missed for a reviewer, might waste a day for the other team members.</p>
<p>To combine <em>Speed</em> and <em>Knowledge Retention</em> will often require synchronization points (meetings). As interruptions and context switches are costly, it is important to schedule meetings either early or late in the day to give team members as long a flow time as possible. Moreover, a team agreement about meeting free days can be helpful.</p>
]]></description></item><item><title>FOSDEM 2025</title><link>https://k.zigzak.net/posts/fosdem-2025/</link><pubDate>Fri, 14 Feb 2025 10:43:48 +0100</pubDate><guid>https://k.zigzak.net/posts/fosdem-2025/</guid><description><![CDATA[<h1 id="fosdem-2025">FOSDEM 2025</h1>
<p>In February 2025 I attended <a href="https://www.fosdem.org">FOSDEM</a> in Brussels, Belgium for the first time. During two days, 1052 events/talks were held with 933 speakers. As you can imagine, I only attended a fraction of the sessions. As part of FOSDEM, many free software projects have booths, and I also spent time working around in the booth areas to get an impression of the diversity of the free software community today.</p>
<h2 id="devroom-tools-the-docs">Devroom: tools the docs</h2>
<h3 id="orgmode-witchcraft-at-spritely">Orgmode witchcraft at Spritely</h3>
<p>Presenter: Amy Grinn, tech admin, <a href="https://spritely.institute/">Spritely Institute</a></p>
<p>The talk was a general overview on how Spritely Institute uses Emacs in many tasks, include documentation. The entire presentation was done from Emacs!
The documentation is written as org-mode files, and one trick is to use Emacs as shell in Makefiles to write build scripts in Elisp, Scheme, or <a href="https://github.com/skeeto/wisp">WISP</a>:</p>
<pre tabindex="0"><code>SHELL = emacs
SHELLOPTIONS = -Q --batch --l setup.el --eval
</code></pre><p>To support multiple programming languages, a picker is added to the documentation. It is primarily using CSS to pick the language, and if JavaScript is disabled in the browser (the Tor browser in particular), a default language is shown only.
Org-mode and Emacs on mobile, the presenter recommends using <code>termux</code> and Syncthing is a good option to sync between laptop/desktop and mobile.
For bookkeeping, Spritely is using the ledger <a href="https://github.com/beancount/beancount">Beancount</a> which has a good integration with Emacs. The Emacs package<a href="https://elpa.gnu.org/packages/boxy.html">Boxy</a> (maintained by the presenter) is usedto render tree of accounts.</p>
<h3 id="cli-magic-tricks-for-docs-projects">CLI magic tricks for docs projects</h3>
<p>Presenter: Lorna Mitchell, between jobs (a vim and Linux user)
The take-home message in this talk is that command-line (CLI) tools are important for document. Arguments to learn CLI tools are:</p>
<ul>
<li>never go out of fashion</li>
<li>are searchable and the internet has many resources</li>
<li>are scriptable (for batch processing)</li>
</ul>
<p>The talk was a primarily a demo of useful tools: <code>ls</code>, <code>tree</code>, <code>wc</code>, <code>grep</code>, <code>sed</code>, <code>diff</code> (remember to set diff tool for git: <code>git config diff.tool</code>). Due to limited time, the presenter was not able to show any advanced use cases or tools.</p>
<h3 id="patterns-for-maintainer-and-tech-writer-collaboration">Patterns for maintainer and tech writer collaboration</h3>
<p>Presenter: Daniel D. Beck</p>
<p>The talk explained why many open source maintainers is failing to recognize (by under and overestimating) tech writers&rsquo; capacity and skills, and their own support. In that way, they are failing to link resources to project&rsquo;s need. The consequence is that tech writers and maintainers often don&rsquo;t collaborate.
The presenter has done research documentation project archetypes, and he has identified-</p>
<ul>
<li>Planning and evaluation</li>
<li>Production (manual, samples)</li>
<li>Revision and transformation</li>
<li>Tools and processes</li>
</ul>
<h4 id="references">References</h4>
<ul>
<li><a href="https://ddbeck.com/fosdem2025/">https://ddbeck.com/fosdem2025/</a></li>
<li><a href="https://innersourcecommons.org/">https://innersourcecommons.org/</a></li>
</ul>
<h3 id="evolving-real-world-asciidoc-into-a-specification-and-how-it-will-help-the-ecosystem">Evolving real-world AsciiDoc into a specification and how it will help the ecosystem</h3>
<p>Presenter: Alexander Schwartz, Redhat
AsciiDoc is a lightweight text format, and currently Eclipse Foundation is working on a formal specification.</p>
<p>The presenter explained about the three stages of a typical workflow when working with documentation: author -&gt; convert -&gt; publish. For documentation in AsciiDoc, <a href="https://antora.org/">Antora</a> is a tool for generating static web sites.</p>
<h4 id="reference">Reference</h4>
<ul>
<li><a href="https://asciidoc.org">https://asciidoc.org</a></li>
</ul>
<h3 id="docs-straight-from-the-code---ast-powered-automation">Docs straight from the code - AST powered automation</h3>
<p>Presenter: James Shubin, <a href="https://purpleidea.com/">https://purpleidea.com/</a></p>
<p>With this talk, the presenter introduced and demoed his own tool to generate API documentation for Go code. As most modern languages store comments in AST, you can generate the documentation from the comments.</p>
<h3 id="no-more-broken-docs-keep-docs-accurate-with-doc-detective">No more broken docs: keep docs accurate with Doc Detective</h3>
<p>Presenters: Jake Cahill and Ariel Kaiser</p>
<p>As a beginning, the presenters highlighted the challenges to keep docs in sync with product:</p>
<ul>
<li>product updates</li>
<li>share responsibilities -&gt; no responsible</li>
<li>lack of knowledge: tech writers don&rsquo;t know the product well enough</li>
</ul>
<p>When the document is out of sync with the product, the consequences can include</p>
<ul>
<li>user frustrations</li>
<li>support overhead</li>
<li>user retention</li>
</ul>
<p>One solution is to use <a href="https://www.docsastests.com/">docs as test</a> to automate testing of documentation.
The talk explained and demoed <a href="https://doc-detective.com/">Doc Detective</a> which is a test framework for CLI tools, web UI, and API calls. It used JSON as format to describe tests, and the target audience is tech writers. Features include</p>
<ul>
<li>take screenshots and do screen recordings to check if they differs from a previous screenshot
<ul>
<li>can also be used for updating documentation&rsquo;s screenshots</li>
</ul>
</li>
<li>can generate test files using regular expressions</li>
<li>has GHA support</li>
</ul>
<p>An example of a user of Doc Detective is <a href="https://docs.redpanda.com/current/console/quickstart/">RedPanda Console quick start</a>.</p>
<h3 id="api-documentation-testing-with-ai-user-simulation">API documentation testing with AI user simulation</h3>
<p>Presenter: Lisa Driukova, JetBrains</p>
<p>The talk was focusing on API documentation, and the challenges of getting feedback on API doc can be</p>
<ul>
<li>time constraints</li>
<li>expertise of users (too skilled, not enough skilled)</li>
</ul>
<p>The solution could be to use AI:</p>
<ul>
<li>test for gabs in documentation</li>
<li>identify edge cases and unanswered questions</li>
<li>reduce cognitive load of stakeholders</li>
</ul>
<p>The presenter has created a PoC with a workflow starting with an OpenAPI spec. Currently, using AI is not useful for unstructured documentation.</p>
<h3 id="9800-sandboxes-and-counting">9800 sandboxes and counting</h3>
<p>Presenter: Jay Clifford, Grafana</p>
<p>The goals of deveveloper documentation are</p>
<ul>
<li>key source of truth for product</li>
<li>enablement: from beginner to expert user</li>
</ul>
<p>Grafana is using a sandbox based on <a href="https://killercoda.com/">Killercoda</a>. The advances include</p>
<ul>
<li>a disposable VM</li>
<li>interactive docs</li>
<li>experiment risk free</li>
<li>accelate learning curve</li>
</ul>
<p>Currently is it used for course material at Grafana. Killercode is using with markdown and JSON, and has engagement tracking build in.</p>
<h2 id="building-the-next-generation-cloud-native-database">Building the next generation cloud native database</h2>
<p>Presenter: Sunny Bains, PingCAP
The presenter used the talk to introduce the <a href="https://github.com/tikv/tikv">TiKV</a>, which is implemented in Rust and is utilizing the <a href="https://raft.github.io/">Raft consensus algorithm</a>. The next generation of databases must be able to scale up to 200 PB - and scale down when needed!
A cloud native database (TiDB serverless as an example)- in the presenter&rsquo;s opinion - must use</p>
<ul>
<li>S3: it is cheap to storage but can be expensive to access</li>
<li>Integrate the database with the cloud providers&rsquo; services</li>
<li>Disaggregated storage
<ul>
<li>local disks or memory as write-through cache</li>
<li>data shared by row and column</li>
</ul>
</li>
<li>Raft logs as the only log</li>
<li>spot instances to operate on immutable S3</li>
</ul>
<h2 id="14-years-of-systemd">14 years of systemd</h2>
<p>Presenter: Lennart Poettering</p>
<p>The presenter&rsquo;s code (systemd) is used by major Linux distributions, and a few distributions have been created to use the presenter&rsquo;s code!</p>
<p>The title of the talk turned out to be inaccurate - it is 15 years ago systemd development was initiated.
Before systemd we had</p>
<ul>
<li>sysvinit (designed in 1983, first commit can be traced back to 1992)</li>
<li>upstart (2006 - 2014) - used by Ubuntu
<ul>
<li>manual configuration</li>
<li>slow development</li>
<li>unfair contributor rules (copyright transfer)</li>
</ul>
</li>
<li>babykit evolved into systemd</li>
</ul>
<p>Systemd is influenced by</p>
<ul>
<li>sysvinit and upstart</li>
<li>Apple&rsquo;s launchd (from 2005)</li>
<li>Solaris SMF (from 2005)</li>
<li>UNIX?
<ul>
<li>it has a unified repository for kernel and user space</li>
<li>Linux is the opposite with its many distributions</li>
<li>systemd is heavily using <code>cgroup</code> which is close to the UNIX&rsquo; philosophy that everything should be a file (or at least a directory)</li>
</ul>
</li>
</ul>
<p>Today, systemd is default for major Linux distributions:</p>
<ul>
<li>Fedora since 2011</li>
<li>openSuse and Arch since 2012</li>
<li>RHEL + SLES since 2014</li>
<li>Debian + Ubuntu since 2015</li>
</ul>
<p>The project has 6 core maintainers, and 60 persons with commit rights. It consists of about 150 binaries, and it is mostly written in C (690k SLOC). It relies heavily on <code>dlopen()</code> as a way to support weak dependencies.</p>
<p>When deciding if something belongs to systemd, the following criteria are considered:</p>
<ul>
<li>generic</li>
<li>foundational (low-level)</li>
<li>common</li>
<li>future (no legacy)</li>
<li>clean (don&rsquo;t cut corners)</li>
<li>follow a common style</li>
</ul>
<p>The project operates with a number of important concept. For example, a clear seperation of <code>/etc</code>, <code>/run</code>, and <code>/usr</code>. Hermetic <code>/usr</code> (<code>/usr</code> must contain everything needed to set up a minimal working system) is a cornerstone. Merging of configuration files from various locations should always work, and configuration should be declarative and not imperative. For the project, it is important to follow existing standards, and document behaviour accurately.
The future - according to the presenter and not all core maintainers - could include</p>
<ul>
<li>boot and system integrity (solved by major commercial operating systems) to lock down what you can run</li>
<li>Pivot IPC - <a href="https://varlink.org/">varlink</a> is an option</li>
<li>C
<ul>
<li>Rust is considered as an alternative but dynamic linking in Rust is not ready for production usage</li>
</ul>
</li>
<li>moving from a package-based OS to an image-based OS
<ul>
<li>systemd already has <a href="https://github.com/systemd/mkosi"><code>mkosi</code></a></li>
</ul>
</li>
</ul>
<h2 id="forked-communities-project-re-licensing-and-community-impact">Forked communities: project re-licensing and community impact</h2>
<p>Panel:</p>
<ul>
<li>Stephan Walli, Microsoft</li>
<li>Dawn M. Foster, CHAOSS</li>
<li>Ben Ford, Overlook InfraTech</li>
<li>Brian Proffitt, Redhat</li>
</ul>
<p>The panel discussion was focusing on a number of commercial open projects which have in the last years re-licensed to a non-open license: MongoDB, ElasticSearch, Redis, and Terraform.</p>
<p>The re-licensing has shown gaps in the (open source) business model, and it has typically abandoned the community around the project.</p>
<p>In the last decade, forking larger open source projects haven&rsquo;t been common, and often the code and projects have been merged back. Recent development is that forks happen more often.</p>
<p>Corporate diversity seems to make it less likely to re-license, and for projects with multiple companies participating, the project will be more healthy. And more healthy project, forking and re-licensing is less likely.</p>
<p>According to RedMonk, there is no financial benefit by re-licensing.</p>
<p>The panel agrees that cloud providers are in their rights to use open source software. But their scale seems to be the issue as they don&rsquo;t contribute back to the project.</p>
<h2 id="databases-in-the-ai-trenches">Databases in the AI trenches</h2>
<p>Presenter: Bruce Momjian, EDB</p>
<p>With the introduction of ChatGPT in November 2022, AI moved from discriminative AI to generative AI (GenAI). Discriminative AI is used for classification, recommendation, prediction, and translation. Generative AI gives us human-like conversations.
The presenter tried to give a high-level introduction to how GenAI is implemented. From embedding vectors, vector search to transformers. The ultra-high dimensional vector spaces can consume very large data sets.
The presenter used PostgreSQL and OpenAI/ChatGPT to demonstrate how you can implement your own AI applications.</p>
<h2 id="devroom-javascript">Devroom: JavaScript</h2>
<h3 id="jsr---open-source-package-registry">JSR - open source package registry</h3>
<p>Presenters: Leo Kettmier, Deno; Luca Casonato, Deno</p>
<p>JavaScript Registry (JSP) is a new alternative to NPM, and is a reaction to NPM&rsquo;s lack of openness and innovation. It can work with NPM packages, and it supports Deno, Bun, Node.js, and Cloudflare Workers.
TypeScript support is build in, and when you publish a package, TypeScript is transpiled to JavaScript by JSR to make it easy for NPM users to consume the package. Moreover, API documentation is extracted and published with the package.
To avoid type-squatting, all packages must be published within a scope.
JSR is currently setting up a governance board to ensure transparency in all decisions. In the near future, JSR will be transferred from Deno to a foundation (still unclear which one).</p>
<h3 id="nobody-asks-how-is-javascript">Nobody asks &ldquo;How is JavaScript?&rdquo;</h3>
<p>Presenter: Ujjwal Sharwa, Igalia</p>
<p>The talk was a walk-through of the standardization process around Java^H^H^H^HECMAScript. The technical committee (<a href="https://github.com/tc39">TC39</a>) consists of</p>
<ul>
<li>delegates
<ul>
<li>implementors</li>
<li>companies</li>
<li>non-profit organizations</li>
<li>universities</li>
</ul>
</li>
<li>invited experts
<ul>
<li>subject-matter experts</li>
<li>community representatives</li>
</ul>
</li>
<li>editors and reviewers</li>
</ul>
<p>All decisions are done in consensus, and each proposal goes through a number of stages:</p>
<ul>
<li>0: Just an idea (over-simplified proposal), and many proposals will not go further.</li>
<li>1: A proposal, and time is devoted to to develop it. A demo and polyfills are developed, and a champion is elected to managing the proposal. It is not a solution yet.</li>
<li>2: Syntactic and semantic details are ironed out, and a formal specification is written. It is now a solution as APIs are completed.</li>
<li>2.7: Conformance tests are written which will help engine implementors. The <a href="https://github.com/tc39/test262">test262</a> test suite is a good place to contribute.</li>
<li>3: Recommended for implementors.</li>
<li>4: Finished when two implementation are passing conformance tests.</li>
</ul>
<p>We can expect ECMAScript 2025 in June!</p>
<h3 id="privacy-first-architecture-alternatives-to-gdpr-popup-and-local-first">Privacy-first architecture: alternatives to GDPR popup and local-first</h3>
<p>Presenter: Andrey Sitnik</p>
<p>The talk was an introduction to <a href="https://localfirstweb.dev/">local-first</a> as a new paradigm in developing privacy-aware software. It stands in opposition to the current server-first (cloud) paradigm, and the local-only paradigm in the early days of computing.
Local-first is a spectrum as not all applications can satisfy the criteria in the <a href="https://www.inkandswitch.com/local-first/">locat-first manifesto</a>. The benefits include simplified server, cheap to scale up, no privacy issues, higher developer productivity and zero latency.
The technical side of local-first is to have a local/client-side database and persistence storage (can be challenging for browsers), and conflict resolution when synchronizing data. Often <a href="https://en.wikipedia.org/wiki/Conflict-free_replicated_data_type">CRDT</a> are used (the presenter didn&rsquo;t mention <a href="https://en.wikipedia.org/wiki/Operational_transformation">Operational Transformation</a>).</p>
<h3 id="demystifying-temporal">Demystifying Temporal</h3>
<p>Presenter: Aditi Singh, Igalia</p>
<p><code>Temporal</code> is the replacement for JavaScript&rsquo;s <code>Date</code>, and it has started to be implemented in popular JavaScript engine (currently in stage 3). The features are</p>
<ul>
<li>time/date computations</li>
<li>internationalization (including time zone and non-gregorian calendars)</li>
<li>strongly typed</li>
<li>immutable</li>
</ul>
<p>The talk demonstrated how <code>Temporal</code> can be used, and solutions were compared to code using <code>Date</code>. <code>Temporal</code> seems to be a good advancement for JavaScript developers.</p>
<h3 id="eurohpc-fp-a-federated-platform-for-hpc-infrastructure-in-europe-built-with-open-source-software">EuroHPC FP: a Federated Platform for HPC Infrastructure in Europe, Built with Open Source Software</h3>
<p>Presenter: Henrik Nortamo</p>
<p>The talk presented the work on unifying the HPC installations in Europe. Currently Europe has 9 active and 3 planned supercomputers, 7 announced AI factories and about 8 quantum computers in progress. A major challenges for users today is that they need to have separate accounts on each supercomputer or AI factory, they use. Moreover, using AI attract users with non-HPC background (read: Linux, C/C++/Fortran and command-line tools). EuroHPC wants to make it easier for researchers and companies to utilize the supercomputers and AI factories.</p>
<p>A federated platform (EFP) has been designed and is under development. We can expect it to be fully operational in Q1/2026. EFP will provide</p>
<ul>
<li>single sign-on</li>
<li>centralized view of resources</li>
<li>a software catalogue</li>
<li>interactive web accees</li>
</ul>
<p>The platform is built on open source software, including</p>
<ul>
<li>MyAccessID - secure shell, identity management</li>
<li>Walder - allocation/job scheduler</li>
<li>Grafana and OpenSearch - monitoring</li>
<li>OpenOnDemand - Jupyter and remote desktop</li>
<li>zammad - helpdesk</li>
<li>Lexis and Apache Airflow - workflows</li>
</ul>
<p>It is expected that later will be possible to integrate smaller regional/national installations with EFP.</p>
<h2 id="running-kubernetes-workloads-on-hpc-with-hpk">Running Kubernetes Workloads on HPC with HPK</h2>
<p>Presenter: Antony Chazapis, Institute of Computer Science, FORTH</p>
<p>The presenter introduced his system to integrate Kubernetes workloads on classical supercomputers. The system is called HPK (High Performance Kubernetes). It creates ephemeral Kubernetes mini-clusters to run on cluster nodes allocated by <a href="https://slurm.schedmd.com/documentation.html">Slurm</a>.</p>
<h2 id="how-we-are-defending-software-freedom-against-apple-at-the-eus-highest-court">How we are defending Software Freedom against Apple at the EU&rsquo;s highest court</h2>
<p>Presenter: Lucas Lasota, Free Software Foundation Europe</p>
<p>The presenter began his talk with talking about an awkward neighbor who</p>
<ul>
<li>eats 30 % of your pizza</li>
<li>never leaves</li>
<li>and controls who you can invite home</li>
</ul>
<p>The awkward neighbor is a metafore for Apple and how they control iOS and iPadOS. In general, EU calls the awkward neighbor gateway in the Digital Market Act, and specific actions can be taken against gateways. The talk centered around how FSFE has pushed the case against Apple at EU&rsquo;s highest court.</p>
<p>The presenter argues that if we can talk about healthy digital ecosystems, mobile today is a digital plantation and a monoculture.</p>
]]></description></item><item><title>Mathjs and the Brusselator</title><link>https://k.zigzak.net/posts/mathjs-brusselator/</link><pubDate>Sat, 29 Jul 2023 07:56:19 +0200</pubDate><guid>https://k.zigzak.net/posts/mathjs-brusselator/</guid><description><![CDATA[<h2 id="mathjs-and-the-brusselator">Mathjs and the Brusselator</h2>
<p>As a graduate student I implemented <a href="https://github.com/kneth/kc">kc</a> to simulate oscillating chemical reactions, and in collaboration with Keld Nielsen, I implemented numerical methods to solve ordinary differential equations (ODEs).</p>
<p>The <a href="https://en.wikipedia.org/wiki/Brusselator">Brusselator</a> is a fine example of an oscillating chemical reaction, and for most values of the parameters the behavior is pretty fine (meaning that you don&rsquo;t see very advanced numerical methods to solve it).</p>
<p>I recently noticed that functionality to <a href="https://github.com/josdejong/mathjs/pull/2958">solve ODEs</a> has been added to <a href="https://mathjs.org/">Mathjs</a>. To me that is a major development, and it make Mathjs an interesting library to work with. In order to try out the new functionality, I have simulated the Brusselator in JavaScript (using node.js). My little script <code>brussel.js</code> is:</p>
<div class="highlight"><pre tabindex="0" style="color:#e7e9db;background-color:#2f1e2e;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-js" data-lang="js"><span style="display:flex;"><span><span style="color:#815ba4">const</span> <span style="color:#06b6ef">math</span> <span style="color:#5bc4bf">=</span> <span style="color:#06b6ef">require</span>(<span style="color:#48b685">&#34;mathjs&#34;</span>);
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#815ba4">const</span> <span style="color:#06b6ef">A</span> <span style="color:#5bc4bf">=</span> <span style="color:#f99b15">1</span>;
</span></span><span style="display:flex;"><span><span style="color:#815ba4">const</span> <span style="color:#06b6ef">B</span> <span style="color:#5bc4bf">=</span> <span style="color:#f99b15">3</span>;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#815ba4">function</span> <span style="color:#06b6ef">brussel</span>(<span style="color:#06b6ef">t</span>, <span style="color:#06b6ef">c</span>) {
</span></span><span style="display:flex;"><span>  <span style="color:#06b6ef">X</span> <span style="color:#5bc4bf">=</span> <span style="color:#06b6ef">c</span>[<span style="color:#f99b15">0</span>];
</span></span><span style="display:flex;"><span>  <span style="color:#06b6ef">Y</span> <span style="color:#5bc4bf">=</span> <span style="color:#06b6ef">c</span>[<span style="color:#f99b15">1</span>];
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>  <span style="color:#06b6ef">dX</span> <span style="color:#5bc4bf">=</span> <span style="color:#06b6ef">A</span> <span style="color:#5bc4bf">+</span> <span style="color:#06b6ef">X</span><span style="color:#5bc4bf">*</span><span style="color:#06b6ef">X</span><span style="color:#5bc4bf">*</span><span style="color:#06b6ef">Y</span> <span style="color:#5bc4bf">-</span> <span style="color:#06b6ef">B</span><span style="color:#5bc4bf">*</span><span style="color:#06b6ef">X</span> <span style="color:#5bc4bf">-</span> <span style="color:#06b6ef">X</span>;
</span></span><span style="display:flex;"><span>  <span style="color:#06b6ef">dY</span> <span style="color:#5bc4bf">=</span> <span style="color:#06b6ef">B</span><span style="color:#5bc4bf">*</span><span style="color:#06b6ef">X</span> <span style="color:#5bc4bf">-</span> <span style="color:#06b6ef">X</span><span style="color:#5bc4bf">*</span><span style="color:#06b6ef">X</span><span style="color:#5bc4bf">*</span><span style="color:#06b6ef">Y</span>;
</span></span><span style="display:flex;"><span>  <span style="color:#815ba4">return</span> [<span style="color:#06b6ef">dX</span>, <span style="color:#06b6ef">dY</span>];
</span></span><span style="display:flex;"><span>}
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#815ba4">let</span> <span style="color:#06b6ef">sol</span> <span style="color:#5bc4bf">=</span> <span style="color:#06b6ef">math</span>.<span style="color:#06b6ef">solveODE</span>(<span style="color:#06b6ef">brussel</span>, [<span style="color:#f99b15">0</span>, <span style="color:#f99b15">30</span>], [<span style="color:#f99b15">1.0</span>, <span style="color:#f99b15">1.0</span>], { <span style="color:#06b6ef">method</span><span style="color:#5bc4bf">:</span> <span style="color:#48b685">&#34;RK23&#34;</span> });
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#815ba4">let</span> <span style="color:#06b6ef">n</span> <span style="color:#5bc4bf">=</span> <span style="color:#06b6ef">sol</span>.<span style="color:#06b6ef">t</span>.<span style="color:#06b6ef">length</span>;
</span></span><span style="display:flex;"><span><span style="color:#815ba4">for</span>(<span style="color:#815ba4">let</span> <span style="color:#06b6ef">i</span> <span style="color:#5bc4bf">=</span> <span style="color:#f99b15">0</span>; <span style="color:#06b6ef">i</span> <span style="color:#5bc4bf">&lt;</span> <span style="color:#06b6ef">n</span>; <span style="color:#06b6ef">i</span><span style="color:#5bc4bf">++</span>) {
</span></span><span style="display:flex;"><span>  <span style="color:#06b6ef">console</span>.<span style="color:#06b6ef">log</span>(<span style="color:#48b685">`</span><span style="color:#f99b15">${</span><span style="color:#06b6ef">sol</span>.<span style="color:#06b6ef">t</span>[<span style="color:#06b6ef">i</span>]<span style="color:#f99b15">}</span><span style="color:#48b685">, </span><span style="color:#f99b15">${</span><span style="color:#06b6ef">sol</span>.<span style="color:#06b6ef">y</span>[<span style="color:#06b6ef">i</span>][<span style="color:#f99b15">0</span>]<span style="color:#f99b15">}</span><span style="color:#48b685">, </span><span style="color:#f99b15">${</span><span style="color:#06b6ef">sol</span>.<span style="color:#06b6ef">y</span>[<span style="color:#06b6ef">i</span>][<span style="color:#f99b15">1</span>]<span style="color:#f99b15">}</span><span style="color:#48b685">`</span>);
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div><p>The script outputs a CSV file to <code>stdout</code>, and I run the script as <code>node brussel.js &gt; out</code>. To plot the data, I am using <a href="http://www.gnuplot.info">GNUplot</a>. My GNUplot script is very simple:</p>
<pre tabindex="0"><code>set terminal &#39;png&#39;
set output &#39;brussel.png&#39;

set title &#39;Brusselator&#39;
plot &#39;out&#39; using 1:2 title &#39;X&#39; with lines, &#39;out&#39; using 1:3 title &#39;Y&#39; with lines
</code></pre><p><img src="brussel.png" alt="Simulation of the Brusselator"></p>
<p>I hope that Mathjs will add more advanced ODE solvers in the future - in particular methods which can solve <a href="https://en.wikipedia.org/wiki/Stiff_equation">stiff equations</a> since many chemical reactions are stiff.</p>
]]></description></item><item><title>Talks</title><link>https://k.zigzak.net/talks/</link><pubDate>Fri, 10 Feb 2023 08:27:57 +0100</pubDate><guid>https://k.zigzak.net/talks/</guid><description><![CDATA[<p>Over the years I have give talks about many different topic.</p>
<h3 id="javascript">JavaScript</h3>
<ul>
<li><a href="temporal.pdf">Timestamps for the future - A brief introduction to Temporal</a> - <a href="https://copenhagenjs.dk">Copenhagen JS</a>, May 2026</li>
<li><a href="buildingparsersinjavascript-200221073752.pdf">Building parsers in JavaScript</a> - <a href="https://copenhagenjs.dk">Copenhagen JS</a>, February 2020</li>
<li><a href="microbitandjavascript-190125061500.pdf">micro:bit - JavaScript meets microcontroller</a> - <a href="https://copenhagenjs.dk">Copenhagen JS</a>, January 2019 - <a href="https://www.youtube.com/watch?v=HYqxc_zjqMg&amp;t=49s">video</a></li>
<li><a href="node-151107092256-lva1-app6891.pdf">Extending node.js using C++</a> - <a href="https://oredev.org/">Øredev</a> 2015</li>
<li><a href="extending-nodejs-using-c-150418024335-conversion-gate01.pdf">Extending Node.js using C++</a> - Open Source Days 2013</li>
<li><a href="osd12-js-120308092026-phpapp02.pdf">Introduction to JavaScript For Modern Software Development</a> - Open Source Days 2012</li>
<li><a href="js-emacs-120814073854-phpapp01.pdf">JavaScript-udvikling med Emacs</a> - EmacsForum 2011</li>
</ul>
<h3 id="android">Android</h3>
<ul>
<li><a href="2017-09-05-kg-droidcon-berlin-170907153223.pdf">Tales from the dark side - developing SDKs at scale</a> - Droidcon Berlin 2017 - <a href="https://www.youtube.com/watch?v=pA1Mq-Z6NAM&amp;t=38s">video</a></li>
<li><a href="android-things-170423065108.pdf">Is it an app? Is it a thing?</a> - DroidDev CPH, April 2017</li>
<li><a href="building-high-performance-android-apps-in-java-and-c++.pdf">Building High-Performance Android Applications in Java &amp; C++</a> - Droidcon Turin 2015 - <a href="https://www.youtube.com/watch?v=CXkQt6LSPeI">video</a></li>
<li><a href="tips-n-tricks-building-android-apps-with-native-code.pdf">Tips and Tricks for Building High-Performance Android Apps using Native Code</a> 2015</li>
</ul>
<h3 id="databases-and-data-engineering">Databases and Data Engineering</h3>
<ul>
<li><a href="cphjs-localfirst.pdf">Local-first apps - concepts and examples</a> - <a href="https://copenhagenjs.dk">Copenhagen JS</a>, October 2026. Examples: <a href="https://code.zigzak.net/kneth/talks/src/branch/main/cphjs-localfirst/example/automerge">automerge</a>, <a href="https://code.zigzak.net/kneth/talks/src/branch/main/cphjs-localfirst/example/rxdb">RxDB</a></li>
<li><a href="dkuug-21aug2012-120823031713-phpapp02.pdf">Apache Hadoop - værktøjskasse til Big Data</a> - <a href="http://www.dkuug.dk/">DKUUG</a>, April 2012</li>
<li><a href="is-the-database-a-solved-problem.pdf">Is the database a solved problem?</a></li>
</ul>
<h3 id="free-and-open-source-software">Free and Open Source Software</h3>
<ul>
<li><a href="open-source-in-real-life-191022064452.pdf">Open Source in Real Life</a></li>
</ul>
<h3 id="hors-catégorie">Hors Catégorie</h3>
<ul>
<li><a href="consolecowboy-151107092035-lva1-app6892.pdf">Unleash your inner console cowboy</a> - <a href="https://oredev.org/">Øredev</a> 2015</li>
<li><a href="sociale-netvrk-140930085739-phpapp01.pdf">Kendthed og vigtighed - om sociale netværk</a></li>
<li><a href="RJS_and_GitHub_Actions_-_CopenhagenJS_September_2023.pdf">Building, testing, and releasing a multiplatform SDK with GitHub Actions</a> - <a href="https://copenhagenjs.dk">Copenhagen JS</a>, September 2023</li>
<li><a href="https://www.webmatematik.dk/lektioner/til-foraeldre/foraeldrematematik-oplaeg">Forældrematematik oplæg</a></li>
</ul>
]]></description></item><item><title>Curriculum Vitae</title><link>https://k.zigzak.net/cv/</link><pubDate>Sat, 07 Jan 2023 07:37:51 +0100</pubDate><guid>https://k.zigzak.net/cv/</guid><description><![CDATA[<h2 id="education">Education</h2>
<ul>
<li>December 1997. Ph.D. (<a href="https://en.wikipedia.org/wiki/Soft_matter">soft material science</a>). <a href="https://ruc.dk">Roskilde University</a></li>
<li>May 1994. M.Sc. (chemistry). <a href="https://www.ku.dk">University of Copenhagen</a></li>
<li>May 1992. B.Sc. (computer science and chemistry). <a href="https://www.ku.dk">University of Copenhagen</a></li>
<li>June 1989. High school. <a href="https://fvgh.dk">Frederiksværk Gymnasium</a></li>
<li>June 1986. Primary/secondary school. Storebjergskolen, Hundested</li>
</ul>
<h2 id="experience">Experience</h2>
<ul>
<li>March 2026 - July 2026: Director, <a href="https://cratedb.com">CrateDB</a></li>
<li>July 2025 - February 2026: VP of engineering (interim), <a href="https://cratedb.com">CrateDB</a></li>
<li>October 2024 - June 2025: Director (developer experience), <a href="https://cratedb.com">CrateDB</a></li>
<li>February 2020 - August 2024: Lead engineer, <a href="https://www.mongodb.com">MongoDB</a></li>
<li>June 2019 - January 2020: Senior engineer, <a href="https://www.mongodb.com">MongoDB</a></li>
<li>January 2012 - May 2019: Member of technical staff, TightDB/<a href="https://realm.io">Realm</a></li>
<li>August 2009 - December 2010: Editor (freelance), Network Theory Ltd</li>
<li>January 2005 – December 2011: Self-employed developer, system administrator</li>
<li>January 2004 – December 2019: Writer (freelance), Audio Media/Alt om Data</li>
<li>February 2004 – December 2004: Developer and technical writer, Medical Insight A/S</li>
<li>February 2007 – December 2007: External supervisor of students&rsquo; projects, TEC (Frederiksberg)</li>
<li>August 2002 – January 2004: Consultant and software developer, Silex Science/<a href="https://cortexconsult.dk">Cortex Consult</a></li>
<li>June 2000 – August 2002: Software developer, Netgroup</li>
<li>January 2000 – June 2000: Field scientist, Ciphergen Biosystems</li>
<li>June 1999 – December 1999: Civilian service, <a href="https://www.rigshospitalet.dk/afdelinger-og-klinikker/neuro/hjerne-og-nervesygdomme/neurobiologisk-forskningsenhed/Sider/default.aspx">Neurobiological Research Unit</a>, Rigshospitalet</li>
<li>April 1998 – June 1999: Computational scientist, Structural Bioinformatics</li>
<li>February 1998 – April 1998: Civilian service, <a href="https://www.kb.dk">Royal Danish Library</a></li>
<li>December 1994 – December 1997: Ph.D. student, <a href="https://ruc.dk">Roskilde University</a></li>
<li>September 1993 – December 1993: Teaching assistant (numerical analysis), <a href="https://www.ku.dk">University of Copenhagen</a></li>
</ul>
<h2 id="projects">Projects</h2>
<ul>
<li><a href="https://github.com/crate/agent-skills">CrateDB agent skills</a> (May 2026 - July 2026)
<ul>
<li><code>SKILLS.md</code> files for agentic platforms</li>
<li>Claude Code, git</li>
</ul>
</li>
<li><a href="https://github.com/ddopson/node-segfault-handler">Segfault Handler</a> (April 2018 - present)
<ul>
<li>Maintainer (since v1.1.0) of a small node.js module to help debugging C/C++ extensions</li>
<li>git, C++, JavaScript, npm, node.js</li>
</ul>
</li>
<li><a href="https://www.packtpub.com/product/git-version-control-cookbook-second-edition/9781789137545">Git Version Control Cookbook, 2nd edition</a> (March 2018 - July 2018)
<ul>
<li>Book about git</li>
<li>git, shell scripting</li>
</ul>
</li>
<li>Realm Data Adapters (October 2017 – November 2019)
<ul>
<li>Development of bridge between Realm and relational databases</li>
<li>Shell scripting, node.js, npm, TypeScript, Postgres, SQL Server, git</li>
</ul>
</li>
<li><a href="https://github.com/realm/realm-js">Realm JavaScript</a> (August 2017 - August 2024)
<ul>
<li>Development of JavaScript SDK for the Realm database</li>
<li>Shell scripting, C++, JavaScript, TypeScript, React Native, node.js, npm, git, CMake</li>
</ul>
</li>
<li><a href="https://github.com/realm/realm-java-benchmarks">Realm Java Benchmarks</a> (February 2016 - May 2016)
<ul>
<li>Development of benchmark suite of mobile databases</li>
<li>Java, Android, git, Python</li>
</ul>
</li>
<li><a href="https://github.com/realm/realm-java">Realm Java</a> (August 2014 - August 2017)
<ul>
<li>Development of Android SDK for Realm database</li>
<li>C++, Java, Android NDK, git, shell scripting</li>
</ul>
</li>
<li>TightDB Node (February 2012 - January 2014)
<ul>
<li>Development of Node SDK for TightDB database</li>
<li>C++, JavaScript, shell scripting, git</li>
</ul>
</li>
<li>TightDB Python (August 2012 - January 2014)
<ul>
<li>Development of Python SDK for database</li>
<li>C++, Python, shell scripting, git</li>
</ul>
</li>
<li>TightDB PHP (January 2012 - January 2014)
<ul>
<li>Development of PHP SDK for database</li>
<li>C++, PHP, shell scripting, git</li>
</ul>
</li>
<li>XcodeCon (July 2010 – December 2011)
<ul>
<li>Conversion engine for Cool:Gen to EGL</li>
<li>Perl, Cool:Gen, EGL, Subversion, shell scripting</li>
</ul>
</li>
<li><a href="https://bibliotek.dk/da/search/work?search_block_form=Introduktion+til+JavaScript&amp;select_material_type=bibdk_frontpage&amp;op=S%C3%B8g&amp;year_op=%2522year_eq%2522&amp;year_value=&amp;form_build_id=form-esiQvj-LrLatjYKqorZNw62SlKQaXTCeOlrbxt3sEoU&amp;form_id=search_block_form&amp;sort=rank_frequency&amp;page_id=bibdk_frontpage#content">Introduktion til JavaScript</a> (February – May 2010)
<ul>
<li>Authoring a booklet (75 pages) about JavaScript in Danish</li>
<li>JavaScript, OpenOffice</li>
</ul>
</li>
<li>BASE (May 2009 – June 2010)
<ul>
<li>Development of web applications, backup scripts, build management scripts, and framework for Global Software Configuration Management</li>
<li>Perl, JavaScript (jQuery, prototype, Dojo), SQL (Oracle), Synergy</li>
</ul>
</li>
<li>Chemetics (March – December 2009)
<ul>
<li>Development of analysis tools for chemists and biologists in the form of KNIME nodes</li>
<li>KNIME, Python, shell, Subversion, Java</li>
</ul>
</li>
<li>Switch.dk (October 2008 – March 2009)
<ul>
<li>Development of web based self-care solutions, in particular backend components including integration with Oracle based ERP system, DIBS (Danish credit card gateway), PBS (Danish payment gateway), and E-Boks (Danish document archive).</li>
<li>PHP, SQL (MySQL, Oracle), Subversion</li>
</ul>
</li>
<li>GSCM (April 2007 – October 2008)
<ul>
<li>Development of web applications and framework for Global Software Configuration Management including e-learning, release registration and newsticker applications</li>
<li>Perl, SQL (Oracle), JavaScript (prototype/scriptaculous), Synergy</li>
</ul>
</li>
<li>LiSA (September 2006 – April 2007)
<ul>
<li>Maintenance and development of internal chemoinformatic software for registration and data analysis of large compound libraries</li>
<li>Delphi, C, Matlab, Python, Subversion</li>
</ul>
</li>
<li><a href="https://www.packtpub.com/product/pluggable-authentication-modules-the-definitive-guide-to-pam-for-linux-sysadmins-and-c-developers/9781904811329">Pluggable Authentication Modules - the definitive guide to PAM for Linux sysadmins and C developers</a> (March 2006 – December 2006)
<ul>
<li>Authoring a booklet about Pluggable Authentication Modules (PAM)</li>
<li>PAM, C, OpenOffice</li>
</ul>
</li>
<li>EasyViz (February 2004 – December 2004)
<ul>
<li>Design and documentation of high availability architecture and installation at hospitals for image archive and analysis software</li>
<li>Shell scripting, Heartbeat (Linux HA), C, CVS</li>
</ul>
</li>
<li>MPU (April 2003 – August 2003)
<ul>
<li>Development of library and utilities for manipulating Maestro files</li>
<li>C, CVS</li>
</ul>
</li>
<li>Chemetics (February 2003 – April 2003)
<ul>
<li>Development of application for selection of oligo libraries</li>
<li>C, CVS</li>
</ul>
</li>
<li>CAFE (January 2001 – July 2002)
<ul>
<li>Design, development, maintenance and documentation of internet payment system including anti-fraud engine and backend components interfacing payment gateways</li>
<li>C, PHP, Perl, SQL (MySQL), CVS</li>
</ul>
</li>
<li><a href="https://linuxbog.dk">Linux – Friheden til at vælge</a> (June 1998 – February 1999)
<ul>
<li>Author/editor of a book about Linux</li>
<li>DocBook, CVS</li>
</ul>
</li>
<li>panal (April 1998 – February 1999)
<ul>
<li>Development of software to statistical analysis of proteins</li>
<li>Perl, shell scripting</li>
</ul>
</li>
<li><a href="https://github.com/kneth/MDreac/tree/master/oldsrc">MDreac</a> (January 1995 – December 1997)
<ul>
<li>Development of parallel software for simulation of large reactive mixtures undergoing phase separation</li>
<li>Fortran-77, PVM, make</li>
</ul>
</li>
<li>EDCS (February 1996 – August 1997(
<ul>
<li>Development of simulation software for 1-dimensional granular media coupled to thermostats</li>
<li>C, make</li>
</ul>
</li>
<li><a href="https://github.com/kneth/kc">Kinetic Compiler</a> (May 1992 – December 1993)
<ul>
<li>Design and development of domain specific language for simulations and analysis of complex chemical reactions</li>
<li>C, make, lex &amp; yacc</li>
</ul>
</li>
</ul>
<h2 id="publications">Publications</h2>
<h3 id="thesis">Thesis</h3>
<ul>
<li><em>Non-equilibrium Molecular Dynamics: Application to oscillating chemical reactions and inelastic colliding particles</em>. Ph.D. thesis. <a href="https://ruc.dk">Roskilde University</a>, 1997.</li>
<li><em>Komplekse kemiske reaktionssystemer: Eksperimentelle og teoretiske metoder</em>. Award winning thesis. Co-author: M.P. Ipsen. <a href="https://www.ku.dk">University of Copenhagen</a>, 1994.</li>
<li><em>Chemical waves in reaction-diffusion systems: A numerical study</em>. M.Sc. thesis. <a href="https://www.ku.dk">University of Copenhagen</a>, 1994.</li>
</ul>
<h3 id="scientific-papers">Scientific papers</h3>
<ul>
<li><em>Oscillating chemical reactions and phase separation simulated by molecular dynamics</em>. Journal of Chemical Physics <strong>107</strong>, 9406 (1997). Co-authors: E. Praestgaard and S. Toxvaerd.</li>
<li><em>Controlling the temperature of one-dimensional systems composed of elastic and inelastic particles</em>. Physical Review E <strong>57</strong>, 1929-1938 (1998). Co-authors: E. Praestgaard, S. Toxvaerd, and P. Padilla.</li>
</ul>
<h3 id="text-books">Text books</h3>
<ul>
<li><em><a href="https://www.packtpub.com/product/git-version-control-cookbook-second-edition/9781789137545">Git Version Control Cookbook</a></em>, 2nd edition. Packt Publishing, 2018. Co-authors: E. Zattin, A. Olsson, and R. Voss.</li>
<li><em><a href="https://bibliotek.dk/da/search/work?search_block_form=Introduktion+til+JavaScript&amp;select_material_type=bibdk_frontpage&amp;op=S%C3%B8g&amp;year_op=%2522year_eq%2522&amp;year_value=&amp;form_build_id=form-esiQvj-LrLatjYKqorZNw62SlKQaXTCeOlrbxt3sEoU&amp;form_id=search_block_form&amp;sort=rank_frequency&amp;page_id=bibdk_frontpage#content">Introduktion til JavaScript</a></em>. Libris, 2010.</li>
<li><em><a href="https://www.packtpub.com/product/pluggable-authentication-modules-the-definitive-guide-to-pam-for-linux-sysadmins-and-c-developers/9781904811329">Pluggable Authentication Modules - the definitive guide to PAM for Linux sysadmins and C developers</a></em>. Packt Publishing, 2007.</li>
<li><em><a href="https://linuxbog.dk">Linux – friheden til at vælge</a></em>. Co-authors: P. Toft, S.J. Andersen and others. IDG Bøger, 1999; Globe, 2000</li>
<li><em><a href="https://github.com/kneth/chemical-kinetics">Introduction to Chemical Kinetics</a></em>. <a href="https://ruc.dk">Roskilde University</a>, 1996</li>
</ul>
<h3 id="feature-articles">Feature articles</h3>
<ul>
<li>100+ articles in Alt om DATA (2004 - 2019).</li>
<li>10+ articles in DKUUGnyt (2000 - 2010).</li>
<li><a href="/posts/when-memmove-fails/">When memmove() fails</a>. Realm blog, 2017.</li>
<li><em>Big data excavation with Apache Hadoop</em>. Linux Magazine, 144/2012.</li>
<li><em>Backing up portables with Box Backup</em>. Linux Magazine, 88/2008.</li>
<li><em>The status of the GNU Fortran project</em>. Linux Weekly News, November, 2005.</li>
</ul>
<h2 id="volunteering">Volunteering</h2>
<ul>
<li>Member of program committee, <a href="https://oredev.org/">Øredev</a>. February 2025 - present.</li>
<li>Presenter, <a href="https://www.matematikcenter.dk/">Matematikcenter</a>. October 2023 - present.</li>
<li>Mentor, Team Universal Robots (a <a href="https://www.firstinspires.org/">First Robotics Competition</a> team). December 2015 - April 2016.</li>
<li>Role model/presenter, <a href="https://itb.dk/">IT Branchen</a>. April 2008 - August 2011.</li>
<li>Board member, <a href="https://borneuni.dk/">BørneUNI</a>. October 2017 - June 2020.</li>
<li>Board member, <a href="https://www.taarnby.dk/borger/born-unge-og-familie/dagtilbud-0-6-ar/bornehuse/vestre-bygade-31/">Vestre Bygade 31</a>. October 2008 - October 2011.</li>
<li>Chair of the Board of Directors, Open Source Days ApS. July 2009 - May 2011.</li>
</ul>
]]></description></item><item><title>About</title><link>https://k.zigzak.net/about/</link><pubDate>Thu, 05 Jan 2023 17:12:17 +0100</pubDate><guid>https://k.zigzak.net/about/</guid><description><![CDATA[<p>Kneth&rsquo;s Korner is the personal website and blog of Kenneth Geisshirt.</p>
<h3 id="contact">Contact</h3>
<p>You are welcome to send me an email. My address is <code>k-at-zigzak.net</code> and my OpenPGP key is:</p>
<pre tabindex="0"><code>pub   rsa3072 2021-08-15 [SC]
      AF61BA954B99B914A4152FE3999B3DEBF6A171F5
uid           [ultimate] Kenneth Geisshirt &lt;k--at--zigzak.net&gt;
uid           [ultimate] Kenneth Geisshirt &lt;geisshirt--at--gmail.com&gt;
uid           [ultimate] Kenneth Geisshirt (Work) &lt;kenneth.geisshirt--at--crate.io&gt;
sub   rsa3072 2021-08-15 [E]

-----BEGIN PGP PUBLIC KEY BLOCK-----

mQGNBGEZOcMBDACh0oSOFzHJC51n89tDigvy7R2M870iq2QxusMtoA7vxWjJJb8J
XJsR6yjJCFe9atF4mCd3LKIWcmqiLaM2iHAZELK6G63Lo4VmgfXiO0/dxU6SVKyF
c1MwPZLlfzaXYOzmHM/LYYTh76H+YRi3Xyj2WrpIZIkDCeEEyCGuOww4rAsROZ3m
RBLhC1WmC76M/svdvqVr1XNfmeID3VIuTJ42BAa37ewE8bD/E/vIuf3/iRhFJc4u
j2KGSRmUWYa9w5b6mxtHwEkQuJ0I7pnPm4DX+/AJsMr5n0PdxKl1UZGkT76btLD6
6XsYYWEgySj5riC4UZcQWJ+u0o6KomEY6DSkDcPAuQk2cGAXNyGkp5pE5qbaApHD
fx7A0GP6rK7pK5M0YdHhfCHGQAhU3YrhWqBiKAh2MHDWFBtYlydmpLq9RFVj4UlL
H6fuMXpEXZkrECVPp6h+Ck8bLdcp0GC8qX66mm+kxUqQS39xOOT7e4EzWHnB/4xV
7UsSmZWNv4jV3QEAEQEAAbQgS2VubmV0aCBHZWlzc2hpcnQgPGtAemlnemFrLm5l
dD6JAdEEEwEIADsCGwMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AWIQSvYbqVS5m5
FKQVL+OZmz3r9qFx9QUCYRpnsAIZAQAKCRCZmz3r9qFx9R0nC/44oMIMSMLCPjwA
sDrT2O/LyxrUvz1d7OADgkdQPR2Hm0lMDJG1dPAR2WR7U/qIlv9E6Qg+6Kag76O9
hTvhW3kiNzCrMvIipY1e42WO/7QFQD0+sytbbsViIIosUNwDL/2HElM4hcMxBVSK
g0CqCVl+bDv04LiDVQfjb4/GPfLG2OqlT3QE9+zOFcVVF4QWRfiQvBuexJOf7FjM
qW9UU9WPGei4jSUmDfgIhi7Dz/dygcfoNEN+AzYN13YT03wSHM9I3i+LVz6DuIKy
WwxijVZA7rJKphEUmDA0kru7gPIIgVt/lAHn0t5SqFWyNEpv0tBTy5vxOFf54OVA
PhWQvMVwYxE9nOey1xSnINYQ/ERPQhdmIu4feL1Uyi0Fp1r9vtWlpZHqZSx9lYVZ
/OnS4FGBncFHm+q8sMgLZxe5pSDFofA5agrtKOQDxw/sBpRBnxyhbJtewVy/kxMv
g8YY5MjXVLAtDnUrgc4s32MEsmxgN4DT0DEZK5w89UXhw2Vyl2O0OEtlbm5ldGgg
R2Vpc3NoaXJ0IChXb3JrKSA8a2VubmV0aC5nZWlzc2hpcnRAbW9uZ29kYi5jb20+
iQHOBDABCAA4FiEEr2G6lUuZuRSkFS/jmZs96/ahcfUFAmcRHKsaHSBJIGRvbid0
IHdvcmsgZm9yIE1vbmdvREIACgkQmZs96/ahcfWuYgv+PTFK0u4jW4gB3LQPqv15
bwMtfYjgAPJVJh/p1TMeYh4aceo5AWADiq8eO+1QAbEyrgvjj9pou2gRpQsYY+ab
Fp+CrxZ5bYj9NdboBWngLtfIFVGFyzmSgHbgct4x0h6oIrKmCu24fcasdk1dCh6n
3WXjG92AJpa3niK3BPF65IUDXPBknrNpVgd9am3mh+jgHnx1dOeOujZ1yPzRO0On
y5tMWZlpc9IZS8WcYB3pXg+RBmMWhPb6ZVvWjlLh8nCi7vpY/SoHjs2Rd+g9r4i5
nnev5ltKjsvGj5y4LObTqHHOh1ebQL1upY/y1WKHJUniQ4tYeRYrvCE3S7sq5q+j
o9ohDDfN+aRwg7pOutj+U9d5cT79OUJ4hucqSjF/3oMNhtQsQoEEGiwZ4jcJMzsI
KFfuuwFK0oKuxPxFKWG2MKPzmWt5BvmW4K5iNRt0xsLrLLHc5rnWDmMnewHARWs9
o6mxgEclKW0z2rarOKjESARrXBuEu8YlQlQLepgMgIoCiQHOBBMBCAA4FiEEr2G6
lUuZuRSkFS/jmZs96/ahcfUFAmEZO9oCGwMFCwkIBwIGFQoJCAsCBBYCAwECHgEC
F4AACgkQmZs96/ahcfVg5wv+MATrivCaU29wLuUNbTpWjw4AYWTnqkxgabjdnb0r
yhuduF268yOySKkXGNriUMikx0ivtTiQYENrNVT7Nl3qRrDMpYTzK9K1MR2diGMv
992OP0LlYuY5wSDSCIXdIue8pRAj7WX4suVcl2JaymMFjlq3Vr0hV5TszijAd7Xj
LPeCzeaa3gudwT75MtmgrVnwnfSkFVTv+KBs1WtK9krPXElfWGqF0jW//6hAgkaU
qE/RylY8s69lwGujcxbmWDc7Z09ADgjWLipPJ0h5cXCLxuoU0EjCv37Gx5mOVJD7
9IDD1To2veJZCWXqzWnLuVXSIZcEg3VzwQ2ZBZwaSb4fwPcxG+ZGjzHOzfdozZIx
sIfSdxi4A6rEuHwP5hib6DFSBnAV76FM6tYJsJ/u0fWX4tXYWxY5X56PXmHuwGZj
CgPEz/yVS4Ab/sQvJwzwW0BwLuF567fKWKnFChBfZsqeUN8tYPeDEXjXLmWzNUqi
IVgQQwWgwlmMI7LU7xWfJ0qBtCdLZW5uZXRoIEdlaXNzaGlydCA8Z2Vpc3NoaXJ0
QGdtYWlsLmNvbT6JAc4EEwEIADgWIQSvYbqVS5m5FKQVL+OZmz3r9qFx9QUCYRk7
vQIbAwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgAAKCRCZmz3r9qFx9V3NC/9kdM/G
UhDfTTknLqV9MvQNKaZl0rBJLWhD7ZdcXi3lZ7co9u8Gxzude7EEKOG4/zEhxmUw
Otl5AJovb6LrR1N48YUIPx4I1fYVn7EjPXZWUP1P3uwU1+QgFmz8cDqw7qOXaE+t
VA3b70pOJlbKbA0XQ1ee65E7D/ybdo8rHGCPBpcuSHdBEgIp/mpDPhjcPZUjPVLp
6a4dYTp1OzWemT5i8vNdp1Hfq+R/JakVGyaQ4x2anGmRL4mAKOvqqVIBiyvN/sPO
Dxav3HToCD5iTnpzoABqam+oIBSgRG3i5eesc1RnBgciz8tTVflYrJgkwECI+Swk
DtO87eqjb80+I/X9+P6kNMIYILQbs5nzAXaCA4FeYhr/ChhGIr9mMOymwcISxms5
ESoBhc8JFOuBHv5RzWpb7EMEyc2e6lzWYTDAt7XIls2XTJYSEMAMShqEGmZtOqVC
ajuSB4SQEi+zHvNZ2LLq8zRpsKl42Mg74tn5qpXEIEbEPDob/CgXde/LG3K0NUtl
bm5ldGggR2Vpc3NoaXJ0IChXb3JrKSA8a2VubmV0aC5nZWlzc2hpcnRAY3JhdGUu
aW8+iQHRBBMBCAA7FiEEr2G6lUuZuRSkFS/jmZs96/ahcfUFAmcRHQYCGwMFCwkI
BwICIgIGFQoJCAsCBBYCAwECHgcCF4AACgkQmZs96/ahcfVROAv/Yv85F7qGS1Lk
Wzds4UuIxWJlg/faIp3ExbH9EUTn0fwLhgVFG/kGhP8vYYcnkr3r5zA+YhB7I183
oNzWyfoIGrKPgqNUc0dpNuMVAj6bXwbpgdoyEoCfcuXQVwrPo8VfBf7QulWT8J8f
XelMKAx7srb3SIqgnVcjfpNLyNr8exTYZdq4CxWIrubQiBBv6MxXA0pOl+jLPXew
H6HTJBVk8riG5iZ3SkJJaRpqNgBInIX/qKXmRuSo9N6WG9tTNQ3ILn3P0ayq/O1G
h5sOGGyeERhhyeGrmOvDu5s3fm80QQI/EbFtQETvCg5wRuQNEckDeq93NHnu4r3m
ahdp7yveEzsnGEHY/5XKQ8a2OH9fRpLJU1NbSis37BKBozh3Iz2VBFFO/uWcH+Xz
2BdDa7B921FSMUw6Bzgtr7S4rtse7QKBvZaekXRb4ltmXXMremWvZxy7uIl96yeM
KzEUoUikSsq/iwGY483Ka0/B19NRtfS9j46xknm1XVWxUGjTb8iPuQGNBGEZOcMB
DACrl5C1WlUa8eNYZcRIo8ltITGM+40quY7kFFlyrkVjHjZ0vmU5V8yrlVQX9FVB
B+4Un7bMn8QkPpg+JU5VtF2recBokI0ICVqxzBa8L2sYNCVExa2/mgthNz9pTBaL
FwOTdOj8qoKyoylk6yIuJUGX8rc0tCbqekhQHyBmcz9rhf/YWn1HpKhTGQ7XfU7f
apCIHoFzuKpk72uCD2MC1iJvZ4+FpVjP2+aGlVZ17t2CPtzNpShYBYN/CaHdBM0Y
VPmblb56osiGIMg0z4EaeJ0yIo+TNiPZ0Y+1Nv8njjJDv06RLfg/crKH04bXvIgo
G6ZGJwCcXr0HHvEFOPrFujVBTw0Cmymop9ofQO5tdqxHPfFiDJ9n1N5rYV0TmUTt
nhlnMk4cEAHQ208mT9CBO6JJHryDo/L3SPZ2AooEbOGO4DZo4K5jygkxVFMwod2Q
Y+UPaN/bLOArQBNqxgUUm7qNmD9MDH9hmjLnRGJo1fobACNrBYKPYPvLxJF6JS5b
i6MAEQEAAYkBtgQYAQgAIBYhBK9hupVLmbkUpBUv45mbPev2oXH1BQJhGTnDAhsM
AAoJEJmbPev2oXH1Qq4L/2UYKoJ7+xTjTHnSFtVUZfC7gdgqyMFNI7BU+ZlXpY7c
Kk0xAzx+8RffyRA3Va65CsT+vC0eLX+kkGDeEqeR5OnXGUKzLyvUVcjLp9QUcN7/
O+Ttz9zGxWyTkyb6jTjly/wiLFPM76gviuZ9LkddyMdJ6ZF7EaFtFL+q4mNUWJpL
Z8brCTUsyjTA2Ypds+7Q1vyV6lF2OMIRv1yPWbmyecCJkrdk1STgiUnwSiYrxt1N
EdJgcvkQOtv6pghhUVFfVXWOdJ1F7ctfd/XgTpN7q+nTlOS6QsbeHjz/KCWXfg70
j27/VVf+YEs3JglXqLUdumUhuybRS+WGRlqO4ZZgPFguTh0C4ML4xLE2wpimpjeJ
hoK6n0djXUjW2CazGpptlUeRk6yrvYJanL4eD62qGnke2hrK7CQCCJLmceaYROld
PhbALmvIDPh9qVeTtAcDxK3L/W4QxZoUT6pi2udp3NqkUeh7jiVM0xX4IRqoBCcE
476WTpfrB/nrvkfe4Ow2Hw==
=G3lA
-----END PGP PUBLIC KEY BLOCK-----
</code></pre>]]></description></item><item><title>The New Kneth's Korner</title><link>https://k.zigzak.net/posts/the-new-kneths-korner/</link><pubDate>Thu, 05 Jan 2023 16:29:24 +0100</pubDate><guid>https://k.zigzak.net/posts/the-new-kneths-korner/</guid><description><![CDATA[<h2 id="a-new-beginning">A new beginning</h2>
<p>My <a href="https://kneths-korner.blogspot.com/">old blog</a> has been inactive for many years. And for the last five-six years, I haven&rsquo;t published any articles in computer magazines. It is time to revive my writing habits. This is a new beginning for Kneth&rsquo;s Korner.</p>
<p>As <a href="https://en.wikipedia.org/wiki/Free_and_open-source_software">free and open source software</a> is close to my heart, <a href="https://gohugo.io">Hugo</a> seems to be a logical choice.</p>
]]></description></item><item><title>Git and VSCode</title><link>https://k.zigzak.net/posts/git-and-vscode/</link><pubDate>Sat, 27 Oct 2018 08:05:09 +0200</pubDate><guid>https://k.zigzak.net/posts/git-and-vscode/</guid><description><![CDATA[<h2 id="git-and-vscode">Git and VSCode</h2>
<p><a href="https://code.visualstudio.com/">Visual Studio Code</a> has since it first public release in 2015 increased fast in popularity. Being a cross-platform editor and released as open source software, many software developers have downloaded it. The fact that Microsoft is behind Visual Studio Code means that programming languages like TypeScript, C#, and C++ are well supported.</p>
<p>Git has become the de facto standard for version control systems. In particular Git providers like Gitlab, Bitbucket, and Github have made it easy for software developers to set up Git repositories. Many developers are using Git directly from the command-line, but there exist also a good portion of graphical Git clients. Today, any code editor and any integrated development environment (IDE) must have some kind of Git support.</p>
<h3 id="what-is-built-in">What is built-in?</h3>
<p>Visual Studio Code has support for basic Git operations. This includes creating branches, checkout branches and pushing to and pull from remotes.</p>
<p><img src="git-vscode-inline-diff.png" alt="Inline diffs are useful for quickly to see changes"></p>
<p>On the status line, you can see which branch you are on. By clicking on the branch name, a list of existing branches will appear, and you can easily checkout another branch. Another option is to create a new branch.</p>
<p>Right to the line numbers in the editor, you can see if you have change a line: a marker is shown. If you click on the marker, the diff will be shown. The inline diff is useful when you are working together with someone else on the same branch.</p>
<p>Once you are ready to commit your changes, you can click on the source code icon (default: third icon from the top) or use <code>SHIFT-CTRL-G</code>. You will see a list of all files you have changed or created. By clicking on a file in the list, the editor will split in two. You can now see the diff of the entire file. Clicking on the <code>+</code>-icon will add them to the commit. Type a message, and you have created a commit.</p>
<p><img src="git-vscode-split.diff.png" alt="Splitting the screen gives an overview of all the changes"></p>
<h3 id="gitlens">GitLens</h3>
<p><a href="https://gitlens.amod.io">GitLens</a> is a great extension to help you understand your code base better. It is in particular useful if you work on large code bases with many contributors. One way to explain GitLens is to say it is Git blame on steroids.</p>
<p>Once installed and enabled, you can see when and who change a line. Knowing who did the latest change to a line or block makes it easy to ask for help - you simply know who to ask right away. Of course, it is not the same as you will get a useful answer but that’s another story.</p>
<p><img src="git-vscode-gitlens-blame.png" alt="Git blame for every line"></p>
<p>GitLens also adds a new icon to the left menu. Clicking on the icon will open a Git explorer. You can now easily explore branches, tags, and stashes. Searching for old commits has never been easier.</p>
<p><img src="git-vscode-gitlens-explorer.png" alt="GitLens gives you a simple but power explorer"></p>
<h3 id="github-issues-and-pull-requests">Github issues and pull requests</h3>
<p>It is not a big secret - Microsoft has acquired Github. At the same time, Microsoft is the founding father of Visual Studio Code. Not surprisingly, Microsoft has developed a couple of extensions to make these two tools work better together.</p>
<p>First one to mention is <a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode.github-issues-prs">Github Issues</a> (<a href="https://github.com/Microsoft/vscode-github-issues-prs">Github repository</a> - yes, Microsoft has open sourced the source code!). The extension adds an issue explorer, and you find it under the file explorer. It is a personal tool in the sense it will only know Github issues assigned to you. A click on an issue, and the issue will be opened in your web browser.</p>
<p>Another fine extension from Microsoft is <a href="https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github">Github Pull Requests</a>. This extension adds an pull request explorer in the Git explorer so you can get to by <code>SHIFT-CTRL-G</code>. You can explore your pull requests; either the ones you have created or the ones which are assigned to you. Moreover, you can see the pull requests where you are asked for a review. Instead to doing the review in your browser, you can do it from within Visual Studio Code.</p>
<p><img src="git-vscode-github-pr.png" alt=""></p>
<h3 id="still-a-console-cowboy">Still a console cowboy</h3>
<p>I have recently moved to Visual Studio Code, and I am not yet a complete fanboy. But many aspects of it are good, and I keep exploring it.</p>
<p>After many years as a Git user, I still have the habit of doing many Git operations directly on the command-line. Simply because it has been part of my workflow for such a long time.</p>
<p>I have only scratch the surface by looking at a couple of extensions. If you go to Visual Studio Code market, you will be amazed by the number of Git related extensions.</p>
]]></description></item><item><title>When Memmove Fails</title><link>https://k.zigzak.net/posts/when-memmove-fails/</link><pubDate>Thu, 04 May 2017 11:33:50 +0200</pubDate><guid>https://k.zigzak.net/posts/when-memmove-fails/</guid><description><![CDATA[<p><strong>This blog post was first published as <a href="https://academy.realm.io/posts/when-memmove-fails/">When memmove fails</a></strong></p>
<p>It was late October last year, and as we began preparations for Realmstravaganza — our annual all-hands gathering in Copenhagen — we started receiving bug reports with some serious native crashes. No one could have guessed just how deep of a rabbit hole we’d have to go down to find a fix. Before we were done, we’d be neck deep in compiler-level optimizations of fundamental C functions, looking for a smoking gun that wouldn’t even set off our unit tests.</p>
<p>For a while, we weren’t even sure what devices were affected, and so we couldn’t even reproduce the crashes <a href="https://github.com/realm/realm-java/issues/3651">our users were sending us</a>. But as early reports trickled in, it seemed that the crashes were limited to certain older Android devices — running Android 4.2 Jelly Bean and 4.4 Kit Kat. By now, both versions are unsupported, but that doesn’t mean they’re unused. <a href="https://developer.android.com/about/dashboards/index.html">About 30%</a> of all Android devices are still running a pre-Lollipop version. We couldn’t slack on fixing this.</p>
<p>The popularity of older Android versions didn’t make finding a test device any easier. After a lot of searching and bartering, we dug up an end-of-life <a href="http://www.gsmarena.com/samsung_galaxy_tab_3_lite_7_0_3g-5975.php">Samsung Galaxy Tab 3 Lite (SM-T111)</a>. If there was a smoking gun in here somewhere, our Tab 3 would let us find it.</p>
<p>After all, the incoming comments on the original GitHub issue name this specific Samsung tablet as one of the devices which shows the mysterious native crashes. But even with the device, none of our unit tests failed. Only our example apps showed signs of this mysterious bug; combined with the stack traces reported by users, we thought it pointed to a bug in the way Realm Core <a href="https://github.com/realm/realm-core/blob/master/src/realm/array_string.cpp#L72">stores strings</a>.</p>
<p>Still, that would have been strange. The <code>ArrayString::set()</code> method is used very widely, so we had no reason to believe it contained a bug — especially a bug limited to such a narrow range of devices and Android versions. The next alternative wasn’t an appealing one: we had to look at the possibility that we were dealing with a native bug.</p>
<p>Really pesky native bugs tend to present themselves infrequently and only on certain hardware, and we were about to discover that we were facing one of the peskiest bugs around. Our challenge would be magnified because, until recently, the support for C++ and native debugging has been less than stellar.</p>
<p>Simply put: on the Android platform, native crashes can be hard to debug even when you know what you’re looking for.</p>
<p>It took us this long just to be able to reproduce the bug, but we weren’t anywhere close to uncovering its cause. We had to realize that the truth about this bug went much deeper than we’d hoped: we were looking at a bug on the device, not in our code.</p>
<p>But one day, a lucky breakthrough came from one of our users, and we found that other developers had faced the same bug. The culprit was right under our noses all along.</p>
<h2 id="from-bug-to-understanding">From bug to understanding</h2>
<p>With our trust Tab 3 in hand, and a sample app designed to trigger the native crashes that continued to elude our understanding, we felt closer than ever to a solution.</p>
<p>Our debugging app, <a href="https://github.com/realm/realm-java/tree/master/examples/introExample">introExample</a>, is extremely simple. It initializes Realm, create a Realm file with a couple of classes and inserts some objects. By using a non-stripped version of the native code, the crash from this app produced a stack trace which gave us an indication of what was going on:</p>
<pre tabindex="0"><code>frame #0: 0x5e61ea68 librealm-jni.so`realm::ArrayString::set(unsigned int, realm::StringData) + 176
frame #1: 0x5e640c1e librealm-jni.so`realm::Group::do_get_or_add_table(realm::StringData, bool (*)(realm::Spec const&amp;), void (*)(realm::Table&amp;), bool*) + 154
frame #2: 0x5e5f8570 librealm-jni.so`(anonymous namespace)::create_metadata_tables(realm::Group&amp;) + 152
frame #3: 0x5e5f86a4 librealm-jni.so`realm::ObjectStore::set_schema_version(realm::Group&amp;, unsigned long long) + 12
frame #4: 0x5e5bb50c librealm-jni.so`Java_io_realm_internal_SharedRealm_nativeSetVersion + 292
</code></pre><p>The <code>ArrayString::set()</code> method is taking care of storing strings within Realm Core. It has its share of pointer arithmetic and it has a few calls to standard library functions like <code>std::fill()</code> and i<code>std::copy_backward()</code>. Disassembling the object file of <code>ArrayString</code> shows that the crash happens when calling <code>memmove()</code> (at byte 176, the instruction after the call is found):</p>
<pre tabindex="0"><code>0x5faaf4c2 &lt;+168&gt;: mov    r0, r3
0x5faaf4c4 &lt;+170&gt;: mov    r1, r5
0x5faaf4c6 &lt;+172&gt;: blx    0x5f9e84cc                ; symbol stub for: memmove
0x5faaf4ca &lt;+176&gt;: mov    r3, r0
0x5faaf4cc &lt;+178&gt;: b      0x5faaf47e                ; &lt;+100&gt;
</code></pre><p>Could it really be that <code>memmove()</code> — a core C function handled by virtually every operating system — is the source of our bug?</p>
<p>Things got weirder. The <code>create_metadata_tables()</code> function in the above stack trace is only called when the Realm file is created. That is, it is only called once and before any objects have been inserted. The function is pretty simple: it creates two tables, adds a few columns to them and add search indices. We swapped the order of creating the tables, which exercised a different code path of <code>ArrayString::set()</code>, and that magically solved the issue. In most cases, exercising a different code path doesn’t really fix a bug; it only masks it. So even though it was likely only a <a href="https://github.com/realm/realm-java/pull/4067">short term work-around</a>, we were running out of options, and decided to release this fix in Realm Java 2.2.3 anyway.</p>
<p>Likewise, changing linker flags exercises another code path. But in uncovering what the linker flags changed, and unearthing a long-closed compiler-level issue, we’d discover the real bug.</p>
<h2 id="a-trip-down-memory-lane">A trip down memory lane</h2>
<p>The <code>memmove()</code> function - together with its cousins <code>memcpy()</code> and <code>bcopy()</code> - have been <a href="https://github.com/dspinellis/unix-history-repo/commit/5fc4877aa0c5088a818786dda9b4b0bc1bac2ef6">available to UNIX programmers since 1990</a> as part of <a href="http://gunkies.org/wiki/4.3_BSD_Reno">4.3BSD-Reno</a>. The signature of the function is pretty simple:</p>
<div class="highlight"><pre tabindex="0" style="color:#e7e9db;background-color:#2f1e2e;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-c" data-lang="c"><span style="display:flex;"><span><span style="color:#776e71">#include</span> <span style="color:#776e71">&lt;string.h&gt;</span><span style="color:#776e71">
</span></span></span><span style="display:flex;"><span><span style="color:#776e71"></span>
</span></span><span style="display:flex;"><span><span style="color:#fec418">void</span> <span style="color:#5bc4bf">*</span><span style="color:#06b6ef">memmove</span>(<span style="color:#fec418">void</span> <span style="color:#5bc4bf">*</span>s1, <span style="color:#815ba4">const</span> <span style="color:#fec418">void</span> <span style="color:#5bc4bf">*</span>s2, <span style="color:#fec418">size_t</span> n);
</span></span></code></pre></div><p>The function copies bytes in memory — even if the source and the destination memory areas overlap. The <code>memcpy()</code> function is not able to cope with overlaps but is generally faster than <code>memmove()</code>.</p>
<p>Virtually every operating system implements a version of <code>memmove()</code> and <code>memcpy()</code> - either in the kernel or through the C standard library. The functions are often used as primitives to implement other functions. Examples from GNU C++ standard library are <code>std::copy()</code> and <code>std::copy_backward()</code> — both of which <a href="https://github.com/gcc-mirror/gcc/blob/master/libstdc%2B%2B-v3/include/bits/stl_algobase.h#L570">call an implementation of <code>memmove()</code></a>. In order to have as good performance as possible, it is not uncommon to write optimized versions in assembler. Compilers often have <a href="https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html">builtin implementations</a> too, and these builtins are inlined at some optimization levels.</p>
<p>In sum: <code>memmove()</code> is a very fundamental method, and it can be changed in many different ways that are all hard to introspect.</p>
<h2 id="where-theres-smoke-theres-fire">Where there’s smoke, there’s fire</h2>
<p>A major breakthrough in understanding the issue came from our user <a href="https://github.com/diegomontoya">diegomontoya</a>. <a href="https://github.com/realm/realm-java/issues/3651#issuecomment-288350097">He had systematically built Realm Core</a> and Realm Java with different optimization flags. We typically use <code>-Os</code> which is extremely similar to <code>-O2</code>, but the space consuming optimizations are disabled. With optimization <code>-O1</code> flag, the bug seems to vanish.</p>
<p>By now, we’ve got a strong indication of an issue in <code>memmove()</code> or <code>memcpy()</code> in older versions of Android. That led us to a few similar bugs that other developers had documented. In his blog, <a href="https://github.com/chengyihe">ChengYi He</a> has published a <a href="https://chengyihe.wordpress.com/2015/08/30/android-binder-arm-segmentation-at-ipcthreadstateexecutecommand-in-libbinder-so/">thorough analysis</a> of a similar crash. Unfortunately, he did not have a solution. Furthermore, Unity has experienced <a href="https://forum.unity3d.com/threads/2-5x-increase-in-crashes-from-samsung-devices-on-android-4-4-2.246258/">similar crashes</a> but without indicating a solution.</p>
<p>With the optimization flag fix in mind, we found a <a href="https://code.google.com/p/android/issues/detail?id=81692">closed issue</a> reported by a Qt developer. In the original Qt bug, they found that <code>gcc</code> would swap the implementation of <code>memmove()</code>. By adding the <code>-fno-builtin-memmove</code> flag, they could switch from calling <code>gcc</code>’s builtin version of <code>memmove()</code> to the standard library version, and it solved their issue.</p>
<h2 id="dont-repeat-yourself">Don’t Repeat Yourself</h2>
<p>Unfortunately, trying <code>-fno-builtin-memmove</code> does not seem to fix the issue for us. Maybe we are going through yet another different code path? The solution, it turns out, was close at hand.</p>
<p>Taking a page from the Qt developer’s workaround, we decided to add our own version of <code>memmove()</code> and <code>memcpy()</code>. You can simply wrap <code>gcc</code>’s builtin functions by adding the flags <code>-Wl,--wrap,memmove</code> and <code>-Wl,--wrap,memcpyi</code>. Supply your own versions of them, and the calls to these functions will then be changed at linker time. <a href="https://github.com/realm/realm-java/pull/4402">Our code</a> wraps both functions, and we also added a simple test from the <a href="https://code.google.com/p/android/issues/detail?id=81692">closed issue</a> that the Qt developer filed with Android:</p>
<div class="highlight"><pre tabindex="0" style="color:#e7e9db;background-color:#2f1e2e;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-c" data-lang="c"><span style="display:flex;"><span><span style="color:#fec418">char</span> <span style="color:#5bc4bf">*</span>array <span style="color:#5bc4bf">=</span> <span style="color:#06b6ef">strdup</span>(<span style="color:#48b685">&#34;Foobar&#34;</span>);
</span></span><span style="display:flex;"><span><span style="color:#fec418">void</span> <span style="color:#5bc4bf">*</span>ptr <span style="color:#5bc4bf">=</span> <span style="color:#06b6ef">memmove</span>(array <span style="color:#5bc4bf">+</span> <span style="color:#f99b15">1</span>, array, <span style="color:#815ba4">sizeof</span>(<span style="color:#48b685">&#34;Foobar&#34;</span>) <span style="color:#5bc4bf">-</span> <span style="color:#f99b15">2</span>);
</span></span><span style="display:flex;"><span><span style="color:#06b6ef">assert</span>(ptr <span style="color:#5bc4bf">==</span> array <span style="color:#5bc4bf">+</span> <span style="color:#f99b15">1</span>);
</span></span></code></pre></div><p>We use that test to see if <code>memmove()</code> works correctly. If it does, it is likely much faster than any implementation we can come up with. In that case, we just call the version found in the standard library. If <code>memmove()</code> does not work, we use our version.</p>
<p>Instead of rolling a brand new version of <code>memmove()</code>, we have reviewed existing implementations, which is an exercise in weighing both technical and legal considerations. A strict license can have dramatic consequences for our users, but an incorrect implementation means Realm becomes unusable. In the end, the <a href="http://dryproject.org/">D.R.Y. Project</a> is our choice. The <code>libc11</code> library has easy-to-read implementations of <code>memcpy()</code> and <code>memmove()</code>, and the code is public domain.</p>
<h2 id="conclusion">Conclusion</h2>
<p>Developers like having flashy, new toys — so it’s pretty rare that you’ll have an end-of-life device in your pocket. That doesn’t mean your users don’t have them, and because Realm Java has been so broadly adopted, we’re likely to be used on all sort of devices. Even old ones, and even old ones with bugs. It is a great privilege to be able to serve so many devices, and the consequence is that we are likely to see extremely weird bugs — like specific devices with bugs in <a href="https://realm.io/news/realm-java-0.85.0/">signal handling</a>. We consider it part of our duty to not just serve our users by fixing these bugs, but to tell you about the process so that we all know what to look for in the future.</p>
<p>Moreover, we’re reminded of how hard it is to build great software. Even Samsung didn’t pick up on this device-specific bug in <code>memmove()</code>. And testing <code>memmove()</code> was only added to <a href="https://source.android.com/compatibility/cts/">CTS</a> in Lollipop. Even if most bugs happen because of silly typos, it doesn’t mean that it’s impossible for there to be a failure point in compiler-level optimizations of fundamental C methods.</p>
<p>At Realm, we are lucky. We have users who give us detailed bug reports, and sometimes from devices we have never heard about. We are lucky to have users who try out unreleased patches on these devices. And we’re lucky to be able to see all the diversity of the mobile ecosystem, and to know that happens because our software matters to so many people. It’s a big responsibility, and we appreciate your trust in our platform. It’s what drives us to find and fix bugs like these, and to tell you about the mystery of a weird little bug on an old Samsung tablet.</p>
]]></description></item><item><title>Review of WebRTC Integrator's Guide</title><link>https://k.zigzak.net/posts/review-webrtc-integrators-guide/</link><pubDate>Mon, 29 Dec 2014 17:05:48 +0200</pubDate><guid>https://k.zigzak.net/posts/review-webrtc-integrators-guide/</guid><description><![CDATA[<h2 id="review-of-webrtc-integrators-guide-by-altanai-bisht">Review of WebRTC Integrator&rsquo;s Guide by Altanai Bisht</h2>
<p>I picked up the book - not because I&rsquo;m working on WebRTC or related stuff but simply to get an idea of what this new technology is all about. It&rsquo;s a lengthly book, and the author seems to know every trick of the trade. After finishing the book, I feel that I have a better understanding of what WebRTC (and SIP and PSTN) works - at least on the high level.</p>
<p>One thing I like about the book is that it has many diagrams. As I don&rsquo;t have an in-depth experience before reading the book, the diagrams help me to get a understanding fast.</p>
<p>From a practical standpoint I like chapter 9. It&rsquo;s about native clients of the most widely used platforms today (both desktop and mobile). If you read the book to years after publication, it is probably outdated, and I hope that the publisher will ask the author to update it and publish it at their web site.</p>
<p>Chapter 10 touches a topic which is only going to become larger: WebRTC and TV. Today, we see a shift from broadcasting services (like BBC) to streaming services (like Netflix), and a contemporary TV set (SmartTV) is more a connected computer with a monitor than a receiver of TV signals. Reading chapter 10 is like looking into the future. The book also mention WebRTC in healthcare, and I guess that most countries are discussing how to implement remote healthcare so patients can stay at home.</p>
<p>The book&rsquo;s website is <a href="http://bit.ly/1wBZ2fG">http://bit.ly/1wBZ2fG</a>.</p>
]]></description></item><item><title>Review - JavaScript Promises Essentials</title><link>https://k.zigzak.net/posts/review-js-promises-essentials/</link><pubDate>Thu, 04 Dec 2014 09:52:02 +0200</pubDate><guid>https://k.zigzak.net/posts/review-js-promises-essentials/</guid><description><![CDATA[<h2 id="review-of-javascript-promises-essentials">Review of JavaScript Promises Essentials</h2>
<p>Promises are an old pattern in concurrent programming. In the computer science literature, promises date back to the papers by Friendman and Wise from mid 1970s. Many programming languages have promise - and futures as in Java are a similar idea. A promise is a variable or an object which value is initially unknown and is the result of another task. Modern JavaScript development is highly asynchronous by design: the UI (in the web browser) is updated by calls to the backend using HTTP requests.</p>
<p>JavaScript (ECMAScript to be correct) will soon have promises build into the core of the runtime environment, and promises already exist in many libraries and frameworks. If you haven’t worked with promises in a JavaScript context before, now is a good time to begin. In order to ease the use of promises in JavaScript development, the Promises/A+ standard has emerged.</p>
<p>The book is short and divided in six chapters. The first chapter is an introduction to the state of front-end JavaScript development in general and the asynchronous model in particular. The chapter sets the scene for the rest of the book, and discuss how promises fit well into JavaScript.</p>
<p>The second chapter is written in a very dense format using many bullet lists. You are probably going to read the chapter more than once to get all the information. The good news is that is a lot of information. Chapters 2-4 are a presentation of how to use promises, include error handling.</p>
<p>Chapter 5 is devoted to WinJS - the open source library for development of Windows 8 and Windows mobile applications in  JavaScript. Personally, I don’t develop for any of the Microsoft stacks, but the chapter is still useful as it shows how a widely used library is applying the promise concepts.</p>
<p>The final chapter explains how to implement your own promise library. I guess that there exist many in-house JavaScript libraries. If you have such a library, you will find this chapter useful.</p>
<p>In general, the book is well-written. The usage of bullet list many place (and chapter 2 in particular) can make it hard to read the book. Still, any JavaScript developer should read the book and get ready to the great promise of promises. You can find more information about the book <a href="https://subscription.packtpub.com/search?query=javascript%20promises%20essentials">here</a>.</p>
]]></description></item><item><title>Happy Birthday, Grace</title><link>https://k.zigzak.net/posts/happy-birthday-grace/</link><pubDate>Tue, 10 Dec 2013 12:52:46 +0200</pubDate><guid>https://k.zigzak.net/posts/happy-birthday-grace/</guid><description><![CDATA[<h2 id="happy-birthday-grace">Happy birthday, Grace</h2>
<p>Yesterday, <a href="http://en.wikipedia.org/wiki/Grace_Hopper">Grace Hopper</a> would have turn 107 years old. She was one of the first computer scientists. She worked on compilers but she is probably best known for her development of <a href="http://en.wikipedia.org/wiki/COBOL">COBOL</a>. COBOL is one of the first high-level programming languages (FORTRAN is the other one). Back in the 1950s, computers were used as calculators, but COBOL and Grace Hopper shown us that computers can be used for much more that simple calculations. Today, COBOL is still wildly used.</p>
<p>As a tribute to Grace Hopper, I have played a bit with the <a href="http://opencobol.org/">OpenCOBOL</a> compiler. OpenCOBOL can translate COBOL source code to C and use a C compiler to generate a real executable program. The compiler is licensed under GNU General Public License (version 3), and the runtime is licensed under GNU Lesser General Public License (version 3). That is, OpenCOBOL is free software!</p>
<p><a href="http://www.ubuntu.com/">Ubuntu Linux</a> and <a href="http://www.linuxmint.com/">Linux Mint</a> have packages for OpenCOBOL. Probably other Linux distributions and FreeBSD have packages as well but I haven&rsquo;t checked. The installation (using Linux Mint) is simple:</p>
<div class="highlight"><pre tabindex="0" style="color:#e7e9db;background-color:#2f1e2e;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sh" data-lang="sh"><span style="display:flex;"><span>sudo apt-get install open-cobol
</span></span></code></pre></div><p>I haven&rsquo;t tried to write software in COBOL. The closest I ever came is that I worked on converting between 4th generation languages (4GL) a few years ago. 4GL programs are often converted to COBOL. But I have written a short program in COBOL:</p>
<div class="highlight"><pre tabindex="0" style="color:#e7e9db;background-color:#2f1e2e;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-cobol" data-lang="cobol"><span style="display:flex;"><span><span style="color:#776e71">      * Greeting to Grace Hopper
</span></span></span><span style="display:flex;"><span><span style="color:#776e71">      </span> <span style="color:#815ba4">IDENTIFICATION</span> <span style="color:#815ba4">DIVISION</span>.<span style="color:#ef6155">
</span></span></span><span style="display:flex;"><span><span style="color:#ef6155"></span><span style="color:#776e71">      </span> <span style="color:#815ba4">PROGRAM-ID</span>.    <span style="color:#ef6155">greeting</span>.<span style="color:#ef6155">
</span></span></span><span style="display:flex;"><span><span style="color:#ef6155"></span><span style="color:#776e71">      </span> <span style="color:#815ba4">DATA</span> <span style="color:#815ba4">DIVISION</span>.<span style="color:#ef6155">
</span></span></span><span style="display:flex;"><span><span style="color:#ef6155"></span><span style="color:#776e71">      </span> <span style="color:#815ba4">WORKING-STORAGE</span> <span style="color:#815ba4">SECTION</span>.<span style="color:#ef6155">
</span></span></span><span style="display:flex;"><span><span style="color:#ef6155"></span><span style="color:#776e71">      </span> <span style="color:#f99b15">01 </span><span style="color:#ef6155">WS-TODAY</span> <span style="color:#fec418">PIC X(21)</span>.<span style="color:#ef6155">
</span></span></span><span style="display:flex;"><span><span style="color:#ef6155"></span><span style="color:#776e71">      </span> <span style="color:#f99b15">01 </span><span style="color:#ef6155">WS-YEAR</span>  <span style="color:#fec418">PIC 9(4)</span>.<span style="color:#ef6155">
</span></span></span><span style="display:flex;"><span><span style="color:#ef6155">
</span></span></span><span style="display:flex;"><span><span style="color:#ef6155"></span><span style="color:#776e71">      </span> <span style="color:#815ba4">PROCEDURE</span> <span style="color:#815ba4">DIVISION</span>.<span style="color:#ef6155">
</span></span></span><span style="display:flex;"><span><span style="color:#ef6155"></span><span style="color:#776e71">      </span> <span style="color:#f99b15">010</span><span style="color:#5bc4bf">-</span><span style="color:#ef6155">Greet</span>.<span style="color:#ef6155">
</span></span></span><span style="display:flex;"><span><span style="color:#ef6155"></span><span style="color:#776e71">      </span>     <span style="color:#815ba4">MOVE</span> <span style="color:#815ba4">FUNCTION</span> <span style="color:#06b6ef">CURRENT-DATE</span> <span style="color:#815ba4">TO</span> <span style="color:#ef6155">WS-TODAY</span>.<span style="color:#ef6155">
</span></span></span><span style="display:flex;"><span><span style="color:#ef6155"></span><span style="color:#776e71">      </span>     <span style="color:#815ba4">MOVE</span> <span style="color:#ef6155">WS-TODAY</span> (<span style="color:#f99b15">1</span>:<span style="color:#f99b15">4</span>) <span style="color:#815ba4">TO</span> <span style="color:#ef6155">WS-YEAR</span>.<span style="color:#ef6155">
</span></span></span><span style="display:flex;"><span><span style="color:#ef6155"></span><span style="color:#776e71">      </span>     <span style="color:#ef6155">
</span></span></span><span style="display:flex;"><span><span style="color:#ef6155"></span><span style="color:#776e71">      </span>     <span style="color:#815ba4">SUBTRACT</span> <span style="color:#f99b15">1906 </span><span style="color:#815ba4">FROM</span> <span style="color:#ef6155">WS-YEAR</span>.<span style="color:#ef6155">
</span></span></span><span style="display:flex;"><span><span style="color:#ef6155"></span><span style="color:#776e71">      </span>     <span style="color:#815ba4">DISPLAY </span><span style="color:#48b685">&#34;Happy birthday&#34;</span><span style="color:#ef6155">
</span></span></span><span style="display:flex;"><span><span style="color:#ef6155"></span><span style="color:#776e71">      </span>     <span style="color:#815ba4">DISPLAY</span> <span style="color:#ef6155">WS-YEAR</span><span style="color:#ef6155">
</span></span></span><span style="display:flex;"><span><span style="color:#ef6155"></span><span style="color:#776e71">      </span>     <span style="color:#815ba4">EXIT</span> <span style="color:#815ba4">PROGRAM
</span></span></span><span style="display:flex;"><span><span style="color:#815ba4">           </span>.<span style="color:#ef6155">
</span></span></span><span style="display:flex;"><span><span style="color:#ef6155"></span><span style="color:#776e71">      </span> <span style="color:#815ba4">STOP</span> <span style="color:#815ba4">RUN</span>.<span style="color:#ef6155">
</span></span></span></code></pre></div><p>Compiling the program using OpenCOBOL is easy:</p>
<div class="highlight"><pre tabindex="0" style="color:#e7e9db;background-color:#2f1e2e;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sh" data-lang="sh"><span style="display:flex;"><span>cobc -x greeting.cob
</span></span></code></pre></div><p>and running is easy:</p>
<div class="highlight"><pre tabindex="0" style="color:#e7e9db;background-color:#2f1e2e;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sh" data-lang="sh"><span style="display:flex;"><span>./greeting
</span></span></code></pre></div><p>I am not going to do a lot of COBOL programming in the future, but it seems to possible to replace old legacy operating systems with a modern platform like Linux.</p>
]]></description></item><item><title>Review Storm Real Time Processing Cookbook</title><link>https://k.zigzak.net/posts/review-storm-real-time-processing-cookbook/</link><pubDate>Sun, 10 Nov 2013 18:32:45 +0200</pubDate><guid>https://k.zigzak.net/posts/review-storm-real-time-processing-cookbook/</guid><description><![CDATA[<h2 id="review-storm---real-time-processing-cookbook">Review: Storm - real-time processing cookbook</h2>
<p>Quinton Anderson has written a book on the analysis platform <a href="http://storm-project.net/">Storm</a> and published it at <a href="http://www.packtpub.com/">Packt</a>. I have worked a little with <a href="http://hadoop.apache.org/">Hadoop</a> in the last couple of years, and it is only natural to take a look at the other big data processing platform. Hadoop is a batch processing platform, and Storm is for real-time processing and analysis of data. That means the two projects are not direct competitors, and they might complement each other.</p>
<p>When reviewing a technical book for the general public, it is important not to review the technology but the book. You can easily write a crappy book on excellent technologies while the opposite is very difficult. This review should be read in this context.</p>
<p>The author starts out by explaining how to set up Storm. Storm seems to be quite a complex beast, but Mr. Anderson gets nicely through it. I would have preferred to get an introduction to some of the concept before jumping into the many tasks. But it is my personal preference, and this is a cookbook and not a text book for a university course.</p>
<p>The first couple of chapters is about processing real-time data. Twitter and log files are the canonical examples in this area, and the book utilizes these as well.</p>
<p>One chapter are on how to use C++ and Qt in your real-time data processing. If you think that Qt is about graphical user interfaces, the book will show you that Qt is a lot more. The author is using Qt&rsquo;s non-GUI parts in his processing.</p>
<p>Another chapter is about machine learning. As part of the big data revolution, machine learning has become popular again. Machine learning is a topic that Mr. Anderson is passionate about, and he analyzes in great detail the problem before showing the recipe.</p>
<p>One of the major disadvantages of the book is that the assumptions about the reader are pretty hard. The reader is assumed to know at least about:</p>
<ul>
<li>Java development using and Maven and Eclipse</li>
<li>Some functional programming</li>
<li>Ubuntu or Debian (or any UNIX) command-line</li>
<li>Web development (HTML, CSS, JavaScript, JSON)</li>
<li>Data modelling experience</li>
<li>A little about NoSQL</li>
</ul>
<p>This problem does not really from the author but from Storm. But the author might have chosen other examples. The book is not a university text book, and therefore I would like many more references to text book and papers.</p>
<p>There is a lot of source code in the cook. You should really download the examples as some of them are longer than a page. It would be great if Packt would do some kind of syntax highlighting. Most programmers find it easier to read syntax highlighted code. In particular, electronic books (I have read the book as PDF) can easily be colorized!</p>
<p>One of the things I really like about the book is that the author has taken time to craft understandable diagrams. A well-composed diagram is worth many words, and he often sums up the key points in a diagram. In general the author writes in a rather dry or fact based language. But on page 111, you find that the author cannot suppress his humor: &ldquo;&hellip; for  automating Clojure projects without setting your hair on fire.&rdquo;</p>
<p>I&rsquo;m not going to say that Storm is a crappy technology but Quinton Anderson has done the job well by writing a good cook book.</p>
<p>If you are serious in getting into data science and data processing, I wouldn&rsquo;t hesitate to recommend the book. You can find the book at <a href="http://www.packtpub.com/storm-realtime-processing-cookbook/book">http://www.packtpub.com/storm-realtime-processing-cookbook/book</a>.</p>
]]></description></item><item><title>Review - Instant ExtJS Starter</title><link>https://k.zigzak.net/posts/review-instant-extjs-starter/</link><pubDate>Fri, 05 Jul 2013 12:48:30 +0200</pubDate><guid>https://k.zigzak.net/posts/review-instant-extjs-starter/</guid><description><![CDATA[<h2 id="review-instant-extjs-starter">Review: Instant ExtJS Starter</h2>
<p>Recently, <a href="http://www.packtpub.com/">Packt Publishing</a> published a book by N. Bhava on <a href="http://www.sencha.com/products/extjs/">ExtJS</a>. It&rsquo;s a fairly short book, about 60 pages long. The idea is to get you started with ExtJS. If you don&rsquo;t know what ExtJS, it is a framework to develop the front-end of web applications. Today, users except web applications to behave must like desktop applications, and a typical web developer is much more like a GUI programmer just a few years ago. In order to get started with ExtJS, the book is an excellent introduction. By reading the book, it quickly becomes obvious that today&rsquo;s web developers just have a great deal of knowledge of JavaScript, object-oriented programming, HTML and CSS. JavaScript is a class-less object-oriented programming language. But ExtJS is based on the notion of classes, and they are somehow emulated by plain JavaScript. The author does not go into details - probably due to the limited length of the book. A book of less than 60 pages cannot scratch the surface no matter how great the author is. Indeed, the book is quite well written, and the flow of the book is fine. But I must be honest, I have tried ExtJS ever before, and the book is too short for my taste. I do like the cook-book like steps in how to install ExtJS. And I like the usage of the browsers&rsquo; debugger to inspect code and DOM. The proof-reading of the book could be better. On page 9, the different edition of ExtJS is mentioned twice, and the example of page 35 has an extra <code>&lt;/tpl&gt;</code> tag. If you have another web framework (jQuery UI, YUI, etc.), you will find the book useful. It will give you a clear idea of what ExtJS is all about in a short time. The author emphases early that the strength of ExtJS is it&rsquo;s components. The major components (layout, containers, data, templates, and forms) are discussed. In particular, the layout and data components are nicely explained. You can find the book <a href="http://www.packtpub.com/ext-js-starter/book">here</a>.</p>
]]></description></item><item><title>Review - Learning JavascriptMVC</title><link>https://k.zigzak.net/posts/review-learning-javascriptmvc/</link><pubDate>Mon, 24 Jun 2013 12:45:51 +0200</pubDate><guid>https://k.zigzak.net/posts/review-learning-javascriptmvc/</guid><description><![CDATA[<p>I haven&rsquo;t been developing front-end code in JavaScript for some time. Well, to be more precise: years. Most of my JavaScript code these days is unit tests for a <a href="http://www.nodejs.org/">node.js</a> extension, I&rsquo;m maintaining at work. Recently, a book on <a href="http://www.javascriptmvc.com/">JavaScriptMVC</a> by Wojceich Bednanski was published by <a href="http://www.packtpub.com/">Packt</a>. I was curious to see how contemporary web applications are written so I picked up the book. It is a short book - only 124 pages. In the preface, the author sets the requirement of the reader but I think he underestimate what it takes to read the book. In my opinion, the reader is an experience software developer with a sound knowledge of JavaScript, jQuery, and HTML. If the reader hasn&rsquo;t read <a href="http://www.amazon.com/exec/obidos/ASIN/0596517742/wrrrldwideweb">&ldquo;the good parts&rdquo;</a>, I would recommend her to do so before reading this book. Furthermore, the reader should not be afraid of the Linux command line. Today, most software developers are trained in object-oriented modeling and design, and the author does assume so. Through-out most of the book, the reader sees how to develop a simple TODO manager. As TODO managers generally work with dates, the book has a number of assuming dates. On page 21, one sees a task due 1st December <a href="http://en.wikipedia.org/wiki/1012">1012</a>. The approach of the book is to begin by the basic elements and gradually move to more advanced components. If the book has been much longer, I believe that many readers will be lost by this approach. To be fair, a complete example is introduced in the beginning of the book but explanations are coming in later chapters, the reader is left a bit frustrated. Chapter 2 and 3 are about topics which are invisible to the user of an application: documentation and testing. I agree with the author that these topics are important but I would have preferred them later in the book. Chapter 4 is about how to organize an application. It seems strange that large portion of the example code is commented out on page 51. Moreover, some of the plugins are discussed so briefly that the reader has no clue if there are useful or when to use them. One of the toughest part of a JavaScript application is to load the required libraries - and in the right order. In my dark past as front-end developer, I wrote a small library for loading libraries. Actually, it is just an excuse to write a graph class in JavaScript. Chapter 5 shows how to do load depending library using JavaScriptMVC. Unfortunately, the author does not explain in details how it works, and the examples are so simple that they have limited value. I like that the author introduces a complex framework like JavaScriptMVC is a very short book. But I was at times a little confused: does the author only show me the simple solution or best practices? If the publisher has asked for more pages, the author might have had a chance to get deeper into the subject. You can find the book <a href="http://www.packtpub.com/building-javasript-web-applications-using-javascriptmvc/book">here</a>.</p>
]]></description></item><item><title>Map/Reduce - GNU Parallel</title><link>https://k.zigzak.net/posts/map-reduce-gnu-parallel/</link><pubDate>Thu, 11 Oct 2012 21:45:10 +0200</pubDate><guid>https://k.zigzak.net/posts/map-reduce-gnu-parallel/</guid><description><![CDATA[<h2 id="mapreduce-and-gnu-parallel">Map/Reduce and GNU Parallel</h2>
<p>This week I attended a meeting organized by <a href="http://www.dkuug.dk/">DKUUG</a>. The topic was <a href="http://www.gnu.org/software/parallel/">GNU Parallel</a> and the speaker was <a href="http://ole.tange.dk/">Ole Tange</a> - the developer behind GNU Parallel.</p>
<p>To be honest, I have not used GNU Parallel before. Of course, I have heard about it as Ole always talks about the program when I meet him. His introduction to the program was great - enjoy it when DKUUG releases the video.</p>
<p>Simply put, GNU Parallel is able to run tasks in parallel. It can either be running locally or remotely. In order words, GNU Parallel can help you to transform your command-line into a parallel computational engine.</p>
<p>Lately, I have been studying <a href="http://hadoop.apache.org/">Apache Hadoop</a>. Currently, Hadoop is probably the most popular implementation of the programming paradigm <a href="http://en.wikipedia.org/wiki/Map/reduce">Map/Reduce</a>. GNU Parallel offers a way of specifying the Map component. It is activated by using the <code>--pipe</code> option. On my way home I was thinking on how to implement a simply Map/Reduce based analysis using GNU Parallel.</p>
<p>I have used the <a href="http://www.transtats.bts.gov/Fields.asp?Table_ID=236">On Time Performance</a> data set more than once. It is a good data set as it is highly regular and it is large (5-600,000 rows every month). The data set records every flight within USA, and you can find information about destination airport, delays, and 120 other data points. 6 months of data will result in a 1.3 GB (comma separated value) file.</p>
<p>A simple analysis of the data set is to generate a table of the number of time an airport is used by a flight. The three-letter airport code is unique e.g., LAX is Los Angeles International Airport. It is possible do the analysis in parallel by breaking the data file into smaller parts. This is the map task. Each task will produce a table, and the reduce task will combine the output for each map task into the final table.</p>
<p>In order to use GNU Parallel as driver for Map/Reduce, I have implemented the mapper and reduce in Perl. The mapper is:</p>
<div class="highlight"><pre tabindex="0" style="color:#e7e9db;background-color:#2f1e2e;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-perl" data-lang="perl"><span style="display:flex;"><span><span style="color:#776e71">#!/usr/bin/perl -w</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#815ba4">use</span> <span style="color:#fec418">strict</span>;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#815ba4">my</span> <span style="color:#ef6155">%dests</span>;
</span></span><span style="display:flex;"><span><span style="color:#815ba4">while</span> (<span style="color:#5bc4bf">&lt;&gt;</span>) {
</span></span><span style="display:flex;"><span>    <span style="color:#815ba4">my</span> <span style="color:#ef6155">@data</span> <span style="color:#5bc4bf">=</span> split <span style="color:#48b685">/,/</span>;
</span></span><span style="display:flex;"><span>    <span style="color:#815ba4">my</span> <span style="color:#ef6155">$airport</span> <span style="color:#5bc4bf">=</span> <span style="color:#ef6155">$data</span>[<span style="color:#f99b15">14</span>];
</span></span><span style="display:flex;"><span>    <span style="color:#ef6155">$dests</span>{<span style="color:#ef6155">$airport</span>} <span style="color:#5bc4bf">=</span> <span style="color:#f99b15">0</span> <span style="color:#815ba4">if</span> (<span style="color:#5bc4bf">not</span> exists <span style="color:#ef6155">$dests</span>{<span style="color:#ef6155">$airport</span>});
</span></span><span style="display:flex;"><span>    <span style="color:#ef6155">$dests</span>{<span style="color:#ef6155">$airport</span>}<span style="color:#5bc4bf">++</span>
</span></span><span style="display:flex;"><span>}
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#815ba4">foreach</span> <span style="color:#815ba4">my</span> <span style="color:#ef6155">$airport</span> (keys <span style="color:#ef6155">%dests</span>) {
</span></span><span style="display:flex;"><span>    printf <span style="color:#48b685">&#34;$airport $dests{$airport}\n&#34;</span>;
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div><p>The reducer is also simple:</p>
<div class="highlight"><pre tabindex="0" style="color:#e7e9db;background-color:#2f1e2e;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-perl" data-lang="perl"><span style="display:flex;"><span><span style="color:#776e71">#!/usr/bin/perl -w</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#815ba4">use</span> <span style="color:#fec418">strict</span>;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#815ba4">my</span> <span style="color:#ef6155">%dests</span>;
</span></span><span style="display:flex;"><span><span style="color:#815ba4">while</span> (<span style="color:#5bc4bf">&lt;&gt;</span>) {
</span></span><span style="display:flex;"><span>    chomp;
</span></span><span style="display:flex;"><span>    <span style="color:#815ba4">my</span> (<span style="color:#ef6155">$airport</span>, <span style="color:#ef6155">$count</span>) <span style="color:#5bc4bf">=</span> split <span style="color:#48b685">/ /</span>;
</span></span><span style="display:flex;"><span>    <span style="color:#ef6155">$dests</span>{<span style="color:#ef6155">$airport</span>} <span style="color:#5bc4bf">=</span> <span style="color:#f99b15">0</span> <span style="color:#815ba4">if</span> (<span style="color:#5bc4bf">not</span> exists <span style="color:#ef6155">$dests</span>{<span style="color:#ef6155">$airport</span>});
</span></span><span style="display:flex;"><span>    <span style="color:#ef6155">$dests</span>{<span style="color:#ef6155">$airport</span>} <span style="color:#5bc4bf">+=</span> <span style="color:#ef6155">$count</span>;
</span></span><span style="display:flex;"><span>}
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#815ba4">my</span> <span style="color:#ef6155">$total</span> <span style="color:#5bc4bf">=</span> <span style="color:#f99b15">0</span>;
</span></span><span style="display:flex;"><span><span style="color:#815ba4">foreach</span> <span style="color:#815ba4">my</span> <span style="color:#ef6155">$airport</span> (sort keys <span style="color:#ef6155">%dests</span>) {
</span></span><span style="display:flex;"><span>    <span style="color:#ef6155">$total</span> <span style="color:#5bc4bf">+=</span> <span style="color:#ef6155">$dests</span>{<span style="color:#ef6155">$airport</span>};
</span></span><span style="display:flex;"><span>    <span style="color:#815ba4">print</span> <span style="color:#48b685">&#34;$airport $dests{$airport}\n&#34;</span>;
</span></span><span style="display:flex;"><span>}
</span></span><span style="display:flex;"><span><span style="color:#815ba4">print</span> <span style="color:#48b685">&#34;Total: $total\n&#34;</span>;
</span></span></code></pre></div><p>It is possible to run the Map/Reduce analysis by the command-line:</p>
<div class="highlight"><pre tabindex="0" style="color:#e7e9db;background-color:#2f1e2e;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sh" data-lang="sh"><span style="display:flex;"><span>cat On_Time_Performance_1H2012.csv | parallel --pipe --blocksize 64M ./map.pl | ./reduce.pl
</span></span></code></pre></div><p>The input file is broken down into 64 MB chunks. GNU Parallel is line oriented so a chunk will not be exactly 64 MB but close. My laptop has four cores, and they are fully utilized.</p>
<p><img src="map-reduce-load.png" alt="Work load of GNU Parallel"></p>
<p>It seems to me that GNU Parallel offers a simple approach to Map/Reduce for people living much of their life on a command-line.</p>
]]></description></item><item><title>GotoCon 2012</title><link>https://k.zigzak.net/posts/gotocon-2012/</link><pubDate>Mon, 08 Oct 2012 21:06:23 +0200</pubDate><guid>https://k.zigzak.net/posts/gotocon-2012/</guid><description><![CDATA[<h2 id="gotocon-2012-in-århus">GotoCon 2012 in Århus</h2>
<p>I attended <a href="http://gotocon.com/aarhus-2012/">GotoCon 2012</a> in Århus last week. To be more precise, I attended the <a href="http://gotocon.com/aarhus-2012/tracks/show_track.jsp?trackOID=615">Big Data track</a> Monday. My educational background is somewhat related to supercomputing (yeah, I did my share of Fortran-77 programming as a graduate student), and I have over the years worked on various &ldquo;Big Data&rdquo; project: bioinformatics, credit card fraud detection, building Linux clusters, etc. Currently, I work for a small NoSQL database vendor, and our solution could fit the Big Data quite nicely. Given all this, going to Århus and spend a day listening to the open source Big Data vendors sounded like a treat.</p>
<h3 id="neo4j---jim-webber">Neo4j - Jim Webber</h3>
<p>First speaker was Jim Webber from <a href="http://neo4j.org/">Neo4j</a>. Neo4j is a graph database, and I like graph theory a lot. Jim is not just a speaker - he is an entertainer. He began his talk by looking back on the database history. As you might be aware of, relational databases were developed in 1970s, and through the 1980s, Oracle became The Database. In the last decade, a number of companies has gone &ldquo;google scale&rdquo; that is, they have vast amount of data. Handling big data requires different data models than relational databases.
Jim pointed out that the complexity of an application is a function of data size, connectness, and uniformity. Of course, his graph database can help you if your data is highly connected. He demonstrated a number of data sets and how to query them using Neo4j.</p>
<h3 id="couchbase---chris-andersen">Couchbase - Chris Andersen</h3>
<p>Chris noted that the database industry is changing rapidly these years. Companies are required to shrink and grow databases on demand. In particular in the mobile app world where an app can go virtal over night. As an example, he mentioned Instagram who gained about one million new users on one day when they released their Android app.</p>
<p>He boils down the requirements to:</p>
<ul>
<li>grow and shrink databases on demand</li>
<li>easy cluster node deployment</li>
<li>multiple masters in the cluster (for availability)</li>
<li>multiple datacenters (for availability)</li>
<li>auto sharding</li>
</ul>
<p>The old-school approach to scalability of the data layer is to sharded MySQL instances and memcached. But this approach typically requires some high availability handling in the application code. With Couchbase (and probably other NoSQL databases), the applications are free of this complexity.</p>
<p>Couchbase has conducted a survey among NoSQL users, and the flexible schemas are reported as the most important feature.</p>
<h3 id="cassandra---matthew-dennis">Cassandra - Matthew Dennis</h3>
<p>Matthew began his talk by discussing the relevance of Big Data. According to studies, companies using Big Data products and techniques seem to be out perform companies not using Big Data. <a href="http://cassandra.apache.org/">Cassandra</a> is offering a master-free cluster database, and it scales well. When data sets are larger than physical memory, it slows down gracefully. A personal note: data sets smaller than physical memory are not big data.</p>
<p>According to Matthew Solid State Disks (SSD) are pushing the limit as they lower the latency. Cassandra is SSD aware: it does not overwrite data but only append data. Files (probably, its blocks) are reclaimed by the database when they are not used any more. Latency is important for Matthew, and he argues that linear scalability means that latency is constant when:</p>
<ul>
<li>increasing throughput and increasing number of nodes</li>
<li>increasing load and increasing nodes</li>
</ul>
<p>The nodes in a Cassandra cluster are equal, and queries are proxies from node to node. This implies that Cassandra is eventually consistent.</p>
<h3 id="mongodb---alvin-richards">MongoDB - Alvin Richards</h3>
<p>Last speaker in the track was about <a href="http://www.mongodb.org/">MongoDB</a>. Alvin talked about scaling up without spending (too much) money and that is where the NoSQL revolution fits in. In the last 40 years, we have seen a dramatic growth in computing power for example, memory has increased from 1 Kb to 4 GB, and disk space has gone from 100 MB to 3 TB.</p>
<p>For MongoDB, availability is some important than consistency. Together with the <a href="http://en.wikipedia.org/wiki/CAP_theorem">CAP theorem</a>, this gives some consequences for the architectural choices for MongoDB. The asynchronous replication within a MongoDB cluster implies that MongoDB is eventually consistent.
Storing and analyzing time series is an important use case for NoSQL.</p>
<h3 id="panel-discussion">Panel discussion</h3>
<p>The organizers has arrange a panel discussion with the major NoSQL vendors - and <a href="http://martinfowler.com/">Martin Fowler</a>. Martin has just published a <a href="http://martinfowler.com/books/nosql.html">book about NoSQL</a>. I have read it - and I will return with a review in the near future.</p>
<p>Martin noted that NoSQL is still immature. But the good news is that NoSQL brings us past &ldquo;one model fits all&rdquo;. It is worth noticing that most NoSQL databases are released under an open source license - and backed by companies.</p>
<p>The panelists agreed that the CAP theorem and the application should drive which database to choose. The major issue here is that the majority of software developers only read 1 computer science book per year.</p>
]]></description></item><item><title>Playing With TypeScript</title><link>https://k.zigzak.net/posts/playing-with-typescript/</link><pubDate>Fri, 05 Oct 2012 17:56:41 +0200</pubDate><guid>https://k.zigzak.net/posts/playing-with-typescript/</guid><description><![CDATA[<h2 id="taking-typescript-out-for-a-spin">Taking TypeScript out for a spin</h2>
<p><a href="http://www.microsoft.com/">Microsoft</a> announced a new programming language by the name <a href="http://www.typescriptlang.org/">TypeScript</a> this week. The driving philosophy behind the language is to extend JavaScript. Since I have done my shared of JavaScript programming - and given <a href="http://www.slideshare.net/geisshirt/javascript-11922069">talks</a>, <a href="http://www.opensourcedays.org/2012/node/18">taught classes</a>, and written articles and a <a href="http://www.libris.dk/produkt/Introduktion_til_Javascript.htm">book</a> on the topic - I decided to take TypeScript out for a spin.</p>
<p>The language comes with a specification (97 pages) and a compiler. The compiler is compiling TypeScript to JavaScript. In this way, Microsoft can support virtually any platform in the world. The big trend at the moment is that JavaScript is used as a server-side programming language - <a href="http://nodejs.org/">node.js</a> is popular. In my day-work, I have recently worked on an extension (in C++) for node.js for employer&rsquo;s database.</p>
<h3 id="open-source">Open Source</h3>
<p>One of the interesting developments of TypeScript is that Microsoft has released everything as free or open source software. According to Microsoft, they are an operating systems company and not focusing on development tools. Today, developers are used to open source software, and in order to succeed within the developer community, you are forced to released under these terms.</p>
<p>The TypeScript compiler has a command-line interface. Basically, it is simply a node.js application. I have tested the compiler on my laptop which is currently running Fedora 17.</p>
<p>As an Emacs user, I am happy to see that Microsoft has released a TypeScript mode for Emacs. It is a simple mode as it primarily does syntax highlighting and indention. I have briefly looked at the elisp source code, and it seems to pretty well organized. If TypeScript becomes popular, I do hope that we will see a more advanced mode like <a href="http://code.google.com/p/js2-mode/">js2</a>.</p>
<h3 id="classes-and-strongly-typing">Classes and strongly typing</h3>
<p>As you might know, JavaScript is an object-oriented programming language. But is does not have classes. Over the years, various techniques for encapsulating data and emulating classes have been developed. For example, you can use a function as constructor. TypeScript introduces classes, and it is possible to inherit from a class. This implies that common design patterns can probably be implemented easily in TypeScript.</p>
<p>JavaScript is a dynamical typed languages, and TypeScript brings strongly typing to JavaScript. You must declare variables - with associated types. It is possible for the TypeScript compiler to infer types in many cases, and an <code>any</code> type gives you the flexibility of weak typing.</p>
<h3 id="an-example">An example</h3>
<p>I am fond of graph theory, and I have written a simple graph class in TypeScript. I implemented typological sorting in JavaScript a few years ago as a non-trivial example for a course I was teaching.</p>
<p>The TypeScript example uses two classes. The <code>MyNode</code> class is actually just a convenient way to store collection of data items. For a C programmer, it is just a <code>struct</code>. The <code>Graph</code> class is somewhat longer. As you can see, a TypeScript class has attributes, a constructor and methods. It is different from JavaScript where you do not have classes and objects do not have methods (but properties can be anonymous functions).</p>
<div class="highlight"><pre tabindex="0" style="color:#e7e9db;background-color:#2f1e2e;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-typescript" data-lang="typescript"><span style="display:flex;"><span><span style="color:#815ba4">class</span> <span style="color:#06b6ef">MyNode</span> {
</span></span><span style="display:flex;"><span>    <span style="color:#06b6ef">id</span>: <span style="color:#fec418">string</span>;
</span></span><span style="display:flex;"><span>    <span style="color:#06b6ef">visited</span>: <span style="color:#fec418">bool</span>;
</span></span><span style="display:flex;"><span>    <span style="color:#06b6ef">edges</span>: <span style="color:#fec418">number</span>[];
</span></span><span style="display:flex;"><span>    <span style="color:#06b6ef">payload</span>: <span style="color:#fec418">string</span>;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#815ba4">constructor</span>(<span style="color:#06b6ef">id</span> : <span style="color:#fec418">string</span>, <span style="color:#06b6ef">payload</span> : <span style="color:#fec418">string</span>) {
</span></span><span style="display:flex;"><span>        <span style="color:#815ba4">this</span>.<span style="color:#06b6ef">id</span> <span style="color:#5bc4bf">=</span> <span style="color:#06b6ef">id</span>;
</span></span><span style="display:flex;"><span>        <span style="color:#815ba4">this</span>.<span style="color:#06b6ef">payload</span> <span style="color:#5bc4bf">=</span> <span style="color:#06b6ef">payload</span>;
</span></span><span style="display:flex;"><span>        <span style="color:#815ba4">this</span>.<span style="color:#06b6ef">visited</span> <span style="color:#5bc4bf">=</span> <span style="color:#815ba4">false</span>;
</span></span><span style="display:flex;"><span>        <span style="color:#815ba4">this</span>.<span style="color:#06b6ef">edges</span> <span style="color:#5bc4bf">=</span> [];
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>};
</span></span><span style="display:flex;"><span>    
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#815ba4">class</span> <span style="color:#06b6ef">Graph</span> {
</span></span><span style="display:flex;"><span>    <span style="color:#06b6ef">name</span>: <span style="color:#fec418">string</span>;
</span></span><span style="display:flex;"><span>    <span style="color:#06b6ef">nodes</span>: <span style="color:#fec418">MyNode</span>[];
</span></span><span style="display:flex;"><span>    
</span></span><span style="display:flex;"><span>    <span style="color:#815ba4">constructor</span>(<span style="color:#06b6ef">name</span> : <span style="color:#fec418">string</span>) {
</span></span><span style="display:flex;"><span>        <span style="color:#815ba4">this</span>.<span style="color:#06b6ef">name</span> <span style="color:#5bc4bf">=</span> <span style="color:#06b6ef">name</span>;
</span></span><span style="display:flex;"><span>        <span style="color:#815ba4">this</span>.<span style="color:#06b6ef">nodes</span> <span style="color:#5bc4bf">=</span> [];
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#06b6ef">find_node</span>(<span style="color:#06b6ef">id</span> : <span style="color:#fec418">string</span>) <span style="color:#5bc4bf">:</span> <span style="color:#fec418">number</span> {
</span></span><span style="display:flex;"><span>        <span style="color:#815ba4">var</span> <span style="color:#06b6ef">i</span>;
</span></span><span style="display:flex;"><span>        <span style="color:#815ba4">var</span> <span style="color:#06b6ef">found</span>;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        <span style="color:#815ba4">if</span> (<span style="color:#815ba4">this</span>.<span style="color:#06b6ef">nodes</span>.<span style="color:#06b6ef">length</span> <span style="color:#5bc4bf">==</span> <span style="color:#f99b15">0</span>) {
</span></span><span style="display:flex;"><span>            <span style="color:#815ba4">return</span> <span style="color:#5bc4bf">-</span><span style="color:#f99b15">1</span>;
</span></span><span style="display:flex;"><span>        }
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        <span style="color:#06b6ef">i</span> <span style="color:#5bc4bf">=</span> <span style="color:#f99b15">0</span>;
</span></span><span style="display:flex;"><span>        <span style="color:#06b6ef">found</span> <span style="color:#5bc4bf">=</span> <span style="color:#815ba4">false</span>;
</span></span><span style="display:flex;"><span>        <span style="color:#815ba4">while</span> (<span style="color:#06b6ef">i</span>&lt;<span style="color:#5bc4bf">this.nodes.length</span><span style="color:#ef6155">)</span> {
</span></span><span style="display:flex;"><span>            <span style="color:#06b6ef">if</span> <span style="color:#ef6155">(</span><span style="color:#06b6ef">this.nodes</span><span style="color:#ef6155">[</span><span style="color:#06b6ef">i</span><span style="color:#ef6155">]</span><span style="color:#06b6ef">.id</span> <span style="color:#ef6155">==</span> <span style="color:#06b6ef">id</span><span style="color:#ef6155">)</span> {
</span></span><span style="display:flex;"><span>                <span style="color:#06b6ef">found </span><span style="color:#5bc4bf">=</span> <span style="color:#06b6ef">true</span><span style="color:#ef6155">;</span>
</span></span><span style="display:flex;"><span>            }
</span></span><span style="display:flex;"><span>            <span style="color:#06b6ef">if</span> <span style="color:#ef6155">(</span><span style="color:#06b6ef">found</span><span style="color:#ef6155">)</span> {
</span></span><span style="display:flex;"><span>                <span style="color:#06b6ef">break</span><span style="color:#ef6155">;</span>
</span></span><span style="display:flex;"><span>            }
</span></span><span style="display:flex;"><span>            <span style="color:#06b6ef">i</span><span style="color:#ef6155">++;</span>
</span></span><span style="display:flex;"><span>        }
</span></span><span style="display:flex;"><span>        <span style="color:#06b6ef">if</span> <span style="color:#ef6155">(</span><span style="color:#06b6ef">found</span><span style="color:#ef6155">)</span> {
</span></span><span style="display:flex;"><span>            <span style="color:#06b6ef">return</span> <span style="color:#06b6ef">i</span><span style="color:#ef6155">;</span>
</span></span><span style="display:flex;"><span>        } <span style="color:#06b6ef">else</span> {
</span></span><span style="display:flex;"><span>            <span style="color:#06b6ef">return</span> <span style="color:#ef6155">-</span><span style="color:#06b6ef">1</span><span style="color:#ef6155">;</span>
</span></span><span style="display:flex;"><span>        }
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#776e71">// add nodes - id is a unique string for identification
</span></span></span><span style="display:flex;"><span><span style="color:#776e71"></span>    <span style="color:#06b6ef">add_node</span><span style="color:#ef6155">(</span><span style="color:#06b6ef">id</span> <span style="color:#ef6155">:</span> <span style="color:#06b6ef">string</span>, <span style="color:#06b6ef">payload</span> <span style="color:#ef6155">:</span> <span style="color:#06b6ef">string</span><span style="color:#ef6155">)</span> {
</span></span><span style="display:flex;"><span>        <span style="color:#06b6ef">if</span> <span style="color:#ef6155">(</span><span style="color:#06b6ef">this.find_node</span><span style="color:#ef6155">(</span><span style="color:#06b6ef">id</span><span style="color:#ef6155">)</span> <span style="color:#ef6155">&lt;</span> <span style="color:#06b6ef">0</span><span style="color:#ef6155">)</span> {
</span></span><span style="display:flex;"><span>            <span style="color:#06b6ef">var</span> <span style="color:#06b6ef">edges </span><span style="color:#5bc4bf">=</span> <span style="color:#ef6155">[];</span>
</span></span><span style="display:flex;"><span>            <span style="color:#06b6ef">var</span> <span style="color:#06b6ef">n </span><span style="color:#5bc4bf">=</span> <span style="color:#06b6ef">new</span> <span style="color:#06b6ef">MyNode</span><span style="color:#ef6155">(</span><span style="color:#06b6ef">id</span>, <span style="color:#06b6ef">payload</span><span style="color:#ef6155">);</span>
</span></span><span style="display:flex;"><span>            <span style="color:#06b6ef">this.nodes.push</span><span style="color:#ef6155">(</span><span style="color:#06b6ef">n</span><span style="color:#ef6155">);</span>
</span></span><span style="display:flex;"><span>        }
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#776e71">// add edge - work well for DAGs
</span></span></span><span style="display:flex;"><span><span style="color:#776e71"></span>    <span style="color:#776e71">// if you don&#39;t work with DAGs, then use
</span></span></span><span style="display:flex;"><span><span style="color:#776e71"></span>    <span style="color:#776e71">// add_edge(i, j) ; add_edge(j, i);
</span></span></span><span style="display:flex;"><span><span style="color:#776e71"></span>    <span style="color:#06b6ef">add_edge</span><span style="color:#ef6155">(</span><span style="color:#06b6ef">src</span> <span style="color:#ef6155">:</span> <span style="color:#06b6ef">string</span>, <span style="color:#06b6ef">dst</span> <span style="color:#ef6155">:</span> <span style="color:#06b6ef">string</span><span style="color:#ef6155">)</span> {
</span></span><span style="display:flex;"><span>        <span style="color:#06b6ef">var</span> <span style="color:#06b6ef">n</span><span style="color:#ef6155">;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#06b6ef">var</span> <span style="color:#06b6ef">i </span><span style="color:#5bc4bf">=</span> <span style="color:#06b6ef">this.find_node</span><span style="color:#ef6155">(</span><span style="color:#06b6ef">src</span><span style="color:#ef6155">);</span>
</span></span><span style="display:flex;"><span>        <span style="color:#06b6ef">var</span> <span style="color:#06b6ef">j </span><span style="color:#5bc4bf">=</span> <span style="color:#06b6ef">this.find_node</span><span style="color:#ef6155">(</span><span style="color:#06b6ef">dst</span><span style="color:#ef6155">);</span>
</span></span><span style="display:flex;"><span>        <span style="color:#06b6ef">if</span> <span style="color:#ef6155">(</span><span style="color:#06b6ef">i</span>&gt;<span style="color:#5bc4bf">=</span><span style="color:#f99b15">0</span> <span style="color:#5bc4bf">&amp;&amp;</span> <span style="color:#06b6ef">j</span><span style="color:#5bc4bf">&gt;=</span><span style="color:#f99b15">0</span>) {
</span></span><span style="display:flex;"><span>            <span style="color:#06b6ef">n</span> <span style="color:#5bc4bf">=</span> <span style="color:#815ba4">this</span>.<span style="color:#06b6ef">nodes</span>[<span style="color:#06b6ef">i</span>].<span style="color:#06b6ef">edges</span>.<span style="color:#06b6ef">push</span>(<span style="color:#06b6ef">j</span>);
</span></span><span style="display:flex;"><span>        }
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#776e71">// topological sorting - return array of IDs
</span></span></span><span style="display:flex;"><span><span style="color:#776e71"></span>    <span style="color:#776e71">// see http://en.wikipedia.org/wiki/Topological_sort
</span></span></span><span style="display:flex;"><span><span style="color:#776e71"></span>    <span style="color:#776e71">// (alternative algorithm)
</span></span></span><span style="display:flex;"><span><span style="color:#776e71"></span>    <span style="color:#06b6ef">sort</span>() <span style="color:#5bc4bf">:</span> <span style="color:#fec418">number</span>[] {
</span></span><span style="display:flex;"><span>        <span style="color:#815ba4">var</span> <span style="color:#06b6ef">i</span>, <span style="color:#06b6ef">j</span>, <span style="color:#06b6ef">m</span>;
</span></span><span style="display:flex;"><span>        <span style="color:#815ba4">var</span> <span style="color:#06b6ef">L</span> <span style="color:#5bc4bf">=</span> [], <span style="color:#06b6ef">Lid</span> <span style="color:#5bc4bf">=</span> [];
</span></span><span style="display:flex;"><span>        <span style="color:#815ba4">var</span> <span style="color:#06b6ef">that</span> <span style="color:#5bc4bf">=</span> <span style="color:#815ba4">this</span>;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        <span style="color:#815ba4">for</span> (<span style="color:#06b6ef">i</span> <span style="color:#815ba4">in</span> <span style="color:#815ba4">this</span>.<span style="color:#06b6ef">nodes</span>) {
</span></span><span style="display:flex;"><span>            <span style="color:#815ba4">this</span>.<span style="color:#06b6ef">nodes</span>[<span style="color:#06b6ef">i</span>].<span style="color:#06b6ef">visited</span> <span style="color:#5bc4bf">=</span> <span style="color:#815ba4">false</span>;
</span></span><span style="display:flex;"><span>        }
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        <span style="color:#815ba4">function</span> <span style="color:#06b6ef">_visit</span>(<span style="color:#06b6ef">n</span>) {
</span></span><span style="display:flex;"><span>            <span style="color:#815ba4">var</span> <span style="color:#06b6ef">j</span>;
</span></span><span style="display:flex;"><span>            <span style="color:#815ba4">if</span> (<span style="color:#5bc4bf">!</span><span style="color:#06b6ef">that</span>.<span style="color:#06b6ef">nodes</span>[<span style="color:#06b6ef">n</span>].<span style="color:#06b6ef">visited</span>) {
</span></span><span style="display:flex;"><span>                <span style="color:#06b6ef">that</span>.<span style="color:#06b6ef">nodes</span>[<span style="color:#06b6ef">n</span>].<span style="color:#06b6ef">visited</span> <span style="color:#5bc4bf">=</span> <span style="color:#815ba4">true</span>;
</span></span><span style="display:flex;"><span>                <span style="color:#815ba4">for</span> (<span style="color:#06b6ef">j</span> <span style="color:#815ba4">in</span> <span style="color:#06b6ef">that</span>.<span style="color:#06b6ef">nodes</span>[<span style="color:#06b6ef">n</span>].<span style="color:#06b6ef">edges</span>) {
</span></span><span style="display:flex;"><span>                    <span style="color:#06b6ef">m</span> <span style="color:#5bc4bf">=</span> <span style="color:#06b6ef">that</span>.<span style="color:#06b6ef">nodes</span>[<span style="color:#06b6ef">n</span>].<span style="color:#06b6ef">edges</span>[<span style="color:#06b6ef">j</span>];
</span></span><span style="display:flex;"><span>                    <span style="color:#06b6ef">_visit</span>(<span style="color:#06b6ef">m</span>);
</span></span><span style="display:flex;"><span>                }
</span></span><span style="display:flex;"><span>                <span style="color:#06b6ef">L</span>.<span style="color:#06b6ef">push</span>(<span style="color:#06b6ef">n</span>);
</span></span><span style="display:flex;"><span>            }
</span></span><span style="display:flex;"><span>        }
</span></span><span style="display:flex;"><span>        <span style="color:#815ba4">for</span> (<span style="color:#06b6ef">i</span> <span style="color:#815ba4">in</span> <span style="color:#815ba4">this</span>.<span style="color:#06b6ef">nodes</span>) {
</span></span><span style="display:flex;"><span>            <span style="color:#06b6ef">_visit</span>(<span style="color:#06b6ef">i</span>);
</span></span><span style="display:flex;"><span>        }
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        <span style="color:#815ba4">for</span> (<span style="color:#06b6ef">i</span> <span style="color:#815ba4">in</span> <span style="color:#06b6ef">L</span>) {
</span></span><span style="display:flex;"><span>            <span style="color:#06b6ef">j</span> <span style="color:#5bc4bf">=</span> <span style="color:#06b6ef">L</span>[<span style="color:#06b6ef">i</span>];
</span></span><span style="display:flex;"><span>            <span style="color:#06b6ef">Lid</span>.<span style="color:#06b6ef">push</span>(<span style="color:#815ba4">this</span>.<span style="color:#06b6ef">nodes</span>[<span style="color:#06b6ef">j</span>].<span style="color:#06b6ef">id</span>);
</span></span><span style="display:flex;"><span>        }
</span></span><span style="display:flex;"><span>        <span style="color:#815ba4">return</span> <span style="color:#06b6ef">Lid</span>;
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>}
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#776e71">// Test case
</span></span></span><span style="display:flex;"><span><span style="color:#776e71"></span><span style="color:#815ba4">var</span> <span style="color:#06b6ef">g</span> <span style="color:#5bc4bf">=</span> <span style="color:#815ba4">new</span> <span style="color:#06b6ef">Graph</span>(<span style="color:#48b685">&#34;Software&#34;</span>);
</span></span><span style="display:flex;"><span><span style="color:#06b6ef">g</span>.<span style="color:#06b6ef">add_node</span>(<span style="color:#48b685">&#39;Emacs&#39;</span>, <span style="color:#48b685">&#39;23.1&#39;</span>);
</span></span><span style="display:flex;"><span><span style="color:#06b6ef">g</span>.<span style="color:#06b6ef">add_node</span>(<span style="color:#48b685">&#39;GTK&#39;</span>,   <span style="color:#48b685">&#39;2.18.3&#39;</span>);
</span></span><span style="display:flex;"><span><span style="color:#06b6ef">g</span>.<span style="color:#06b6ef">add_node</span>(<span style="color:#48b685">&#39;Cairo&#39;</span>, <span style="color:#48b685">&#39;1.8.8&#39;</span>);
</span></span><span style="display:flex;"><span><span style="color:#06b6ef">g</span>.<span style="color:#06b6ef">add_node</span>(<span style="color:#48b685">&#39;glib&#39;</span>,  <span style="color:#48b685">&#39;2.22.3&#39;</span>);
</span></span><span style="display:flex;"><span><span style="color:#06b6ef">g</span>.<span style="color:#06b6ef">add_node</span>(<span style="color:#48b685">&#39;libc&#39;</span>,  <span style="color:#48b685">&#39;2.10.1&#39;</span>);
</span></span><span style="display:flex;"><span><span style="color:#06b6ef">g</span>.<span style="color:#06b6ef">add_edge</span>(<span style="color:#48b685">&#39;Emacs&#39;</span>, <span style="color:#48b685">&#39;libc&#39;</span>);
</span></span><span style="display:flex;"><span><span style="color:#06b6ef">g</span>.<span style="color:#06b6ef">add_edge</span>(<span style="color:#48b685">&#39;Emacs&#39;</span>, <span style="color:#48b685">&#39;GTK&#39;</span>);
</span></span><span style="display:flex;"><span><span style="color:#06b6ef">g</span>.<span style="color:#06b6ef">add_edge</span>(<span style="color:#48b685">&#39;GTK&#39;</span>,   <span style="color:#48b685">&#39;glib&#39;</span>);
</span></span><span style="display:flex;"><span><span style="color:#06b6ef">g</span>.<span style="color:#06b6ef">add_edge</span>(<span style="color:#48b685">&#39;GTK&#39;</span>,   <span style="color:#48b685">&#39;Cairo&#39;</span>);
</span></span><span style="display:flex;"><span><span style="color:#06b6ef">g</span>.<span style="color:#06b6ef">add_edge</span>(<span style="color:#48b685">&#39;Cairo&#39;</span>, <span style="color:#48b685">&#39;libc&#39;</span>);
</span></span><span style="display:flex;"><span><span style="color:#06b6ef">g</span>.<span style="color:#06b6ef">add_edge</span>(<span style="color:#48b685">&#39;glib&#39;</span>,  <span style="color:#48b685">&#39;libc&#39;</span>);
</span></span><span style="display:flex;"><span><span style="color:#815ba4">var</span> <span style="color:#06b6ef">list</span> <span style="color:#5bc4bf">=</span> <span style="color:#06b6ef">g</span>.<span style="color:#06b6ef">sort</span>();
</span></span><span style="display:flex;"><span><span style="color:#06b6ef">console</span>.<span style="color:#06b6ef">log</span>(<span style="color:#48b685">&#39;Topological sort: &#39;</span><span style="color:#5bc4bf">+</span><span style="color:#06b6ef">list</span>.<span style="color:#06b6ef">join</span>(<span style="color:#48b685">&#39;-&gt;&#39;</span>));
</span></span></code></pre></div><p>The TypeScript language is an interesting development as it offers (web) programmers a more mainstream approach. To be honest, when I have been teaching JavaScript for seasoned programmers, they have often been puzzled by the odd object system behind JavaScript. The scope rules of JavaScript are always regarded as being odd. I have not yet examined rules in TypeScript, but I hope to return to the topic in the near future.</p>
]]></description></item><item><title>Open Source Days 2012</title><link>https://k.zigzak.net/posts/open-source-days-2012/</link><pubDate>Fri, 09 Mar 2012 13:32:11 +0200</pubDate><guid>https://k.zigzak.net/posts/open-source-days-2012/</guid><description><![CDATA[<h2 id="open-source-days-2012">Open Source Days 2012</h2>
<p>I&rsquo;m going to the <a href="http://www.opensourcedays.org/">Open Source Days 2012</a> conference this weekend. This year&rsquo;s program is really interesting, and I&rsquo;m looking forward to spend two days listening to geeky talks. The organizers have ask me to take the role as chairman. Saturday I will chair the session of web programming, but I&rsquo;m not sure about Sunday.</p>
<p>Actually, for me the conference began yesterday. I gave a full day course on JavaScript programming. It was really great to explains the language in details for a group of experience software developers. You can find my slides at <a href="http://www.slideshare.net/geisshirt/javascript-11922069">slide share</a>.</p>
]]></description></item><item><title>Morse Code and Arduino</title><link>https://k.zigzak.net/posts/morse-code-and-arduino/</link><pubDate>Tue, 07 Feb 2012 18:06:14 +0200</pubDate><guid>https://k.zigzak.net/posts/morse-code-and-arduino/</guid><description><![CDATA[<h2 id="morse-codes-and-arduino">Morse codes and Arduino</h2>
<p>My son <a href="http://www.supersejemig.dk/">Svante</a> came home Friday and told me that he had been working on Morse codes in science class. We talked a bit on how to translate sentences to Morse code. Yesterday evening I had to construct a translator using my <a href="http://www.arduino.cc/">Arduino</a> board, a LED and a LCD display. The program is pretty simple. It processes the message - letter by letter - and shows the current letter in capital and the Morse code on the second line. Moreover, it blinks the Morse code using the LED. You find my program below.</p>
<div class="highlight"><pre tabindex="0" style="color:#e7e9db;background-color:#2f1e2e;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-C" data-lang="C"><span style="display:flex;"><span><span style="color:#776e71">#include</span> <span style="color:#776e71">&lt;stdio.h&gt;</span><span style="color:#776e71">
</span></span></span><span style="display:flex;"><span><span style="color:#776e71">#include</span> <span style="color:#776e71">&lt;stdlib.h&gt;</span><span style="color:#776e71">
</span></span></span><span style="display:flex;"><span><span style="color:#776e71">#include</span> <span style="color:#776e71">&lt;LiquidCrystal.h&gt;</span><span style="color:#776e71">
</span></span></span><span style="display:flex;"><span><span style="color:#776e71"></span>
</span></span><span style="display:flex;"><span><span style="color:#fec418">int</span> LED  <span style="color:#5bc4bf">=</span> <span style="color:#f99b15">9</span>;
</span></span><span style="display:flex;"><span>LiquidCrystal <span style="color:#06b6ef">lcd</span>(<span style="color:#f99b15">10</span>, <span style="color:#f99b15">11</span>, <span style="color:#f99b15">12</span>, <span style="color:#f99b15">13</span>, <span style="color:#f99b15">14</span>, <span style="color:#f99b15">15</span>, <span style="color:#f99b15">16</span>);
</span></span><span style="display:flex;"><span><span style="color:#fec418">char</span> msg[] <span style="color:#5bc4bf">=</span> <span style="color:#48b685">&#34;super seje mig&#34;</span>;
</span></span><span style="display:flex;"><span><span style="color:#fec418">char</span> m[<span style="color:#f99b15">16</span>];
</span></span><span style="display:flex;"><span><span style="color:#fec418">char</span> <span style="color:#5bc4bf">*</span>morse[] <span style="color:#5bc4bf">=</span> {
</span></span><span style="display:flex;"><span>  <span style="color:#48b685">&#34;*-&#34;</span>,       <span style="color:#776e71">// A
</span></span></span><span style="display:flex;"><span><span style="color:#776e71"></span>  <span style="color:#48b685">&#34;-***&#34;</span>,     <span style="color:#776e71">// B
</span></span></span><span style="display:flex;"><span><span style="color:#776e71"></span>  <span style="color:#48b685">&#34;-*-*&#34;</span>,     <span style="color:#776e71">// C 
</span></span></span><span style="display:flex;"><span><span style="color:#776e71"></span>  <span style="color:#48b685">&#34;*--&#34;</span>,      <span style="color:#776e71">// D
</span></span></span><span style="display:flex;"><span><span style="color:#776e71"></span>  <span style="color:#48b685">&#34;*&#34;</span>,        <span style="color:#776e71">// E
</span></span></span><span style="display:flex;"><span><span style="color:#776e71"></span>  <span style="color:#48b685">&#34;**-*&#34;</span>,     <span style="color:#776e71">// F
</span></span></span><span style="display:flex;"><span><span style="color:#776e71"></span>  <span style="color:#48b685">&#34;--*&#34;</span>,      <span style="color:#776e71">// G
</span></span></span><span style="display:flex;"><span><span style="color:#776e71"></span>  <span style="color:#48b685">&#34;****&#34;</span>,     <span style="color:#776e71">// H
</span></span></span><span style="display:flex;"><span><span style="color:#776e71"></span>  <span style="color:#48b685">&#34;**&#34;</span>,       <span style="color:#776e71">// I
</span></span></span><span style="display:flex;"><span><span style="color:#776e71"></span>  <span style="color:#48b685">&#34;*---&#34;</span>,     <span style="color:#776e71">// J
</span></span></span><span style="display:flex;"><span><span style="color:#776e71"></span>  <span style="color:#48b685">&#34;-*-&#34;</span>,      <span style="color:#776e71">// K
</span></span></span><span style="display:flex;"><span><span style="color:#776e71"></span>  <span style="color:#48b685">&#34;*-**&#34;</span>,     <span style="color:#776e71">// L
</span></span></span><span style="display:flex;"><span><span style="color:#776e71"></span>  <span style="color:#48b685">&#34;--&#34;</span>,       <span style="color:#776e71">// M
</span></span></span><span style="display:flex;"><span><span style="color:#776e71"></span>  <span style="color:#48b685">&#34;-*&#34;</span>,       <span style="color:#776e71">// N
</span></span></span><span style="display:flex;"><span><span style="color:#776e71"></span>  <span style="color:#48b685">&#34;---&#34;</span>,      <span style="color:#776e71">// O
</span></span></span><span style="display:flex;"><span><span style="color:#776e71"></span>  <span style="color:#48b685">&#34;*--*&#34;</span>,     <span style="color:#776e71">// P
</span></span></span><span style="display:flex;"><span><span style="color:#776e71"></span>  <span style="color:#48b685">&#34;--*-&#34;</span>,     <span style="color:#776e71">// Q
</span></span></span><span style="display:flex;"><span><span style="color:#776e71"></span>  <span style="color:#48b685">&#34;*-*&#34;</span>,      <span style="color:#776e71">// R
</span></span></span><span style="display:flex;"><span><span style="color:#776e71"></span>  <span style="color:#48b685">&#34;***&#34;</span>,      <span style="color:#776e71">// S
</span></span></span><span style="display:flex;"><span><span style="color:#776e71"></span>  <span style="color:#48b685">&#34;-&#34;</span>,        <span style="color:#776e71">// T
</span></span></span><span style="display:flex;"><span><span style="color:#776e71"></span>  <span style="color:#48b685">&#34;**-&#34;</span>,      <span style="color:#776e71">// U
</span></span></span><span style="display:flex;"><span><span style="color:#776e71"></span>  <span style="color:#48b685">&#34;***-&#34;</span>,     <span style="color:#776e71">// V
</span></span></span><span style="display:flex;"><span><span style="color:#776e71"></span>  <span style="color:#48b685">&#34;*--&#34;</span>,      <span style="color:#776e71">// W
</span></span></span><span style="display:flex;"><span><span style="color:#776e71"></span>  <span style="color:#48b685">&#34;-**-&#34;</span>,     <span style="color:#776e71">// X
</span></span></span><span style="display:flex;"><span><span style="color:#776e71"></span>  <span style="color:#48b685">&#34;-*--&#34;</span>,     <span style="color:#776e71">// Y
</span></span></span><span style="display:flex;"><span><span style="color:#776e71"></span>  <span style="color:#48b685">&#34;--**&#34;</span>      <span style="color:#776e71">// Z
</span></span></span><span style="display:flex;"><span><span style="color:#776e71"></span>};
</span></span><span style="display:flex;"><span><span style="color:#fec418">void</span> <span style="color:#06b6ef">setup</span>() {
</span></span><span style="display:flex;"><span>  lcd.<span style="color:#06b6ef">begin</span>(<span style="color:#f99b15">16</span>, <span style="color:#f99b15">2</span>);
</span></span><span style="display:flex;"><span>  lcd.<span style="color:#06b6ef">clear</span>();
</span></span><span style="display:flex;"><span>  lcd.<span style="color:#06b6ef">setCursor</span>(<span style="color:#f99b15">0</span>, <span style="color:#f99b15">0</span>);
</span></span><span style="display:flex;"><span>  lcd.<span style="color:#06b6ef">print</span>(<span style="color:#48b685">&#34;Booting&#34;</span>);
</span></span><span style="display:flex;"><span>  <span style="color:#815ba4">for</span>(<span style="color:#fec418">int</span> i<span style="color:#5bc4bf">=</span><span style="color:#f99b15">0</span>; i<span style="color:#5bc4bf">&lt;</span><span style="color:#f99b15">16</span>; i<span style="color:#5bc4bf">++</span>) {
</span></span><span style="display:flex;"><span>    lcd.<span style="color:#06b6ef">setCursor</span>(i, <span style="color:#f99b15">1</span>);
</span></span><span style="display:flex;"><span>    lcd.<span style="color:#06b6ef">write</span>(<span style="color:#48b685">&#39;.&#39;</span>);
</span></span><span style="display:flex;"><span>    <span style="color:#06b6ef">delay</span>(<span style="color:#f99b15">100</span>);
</span></span><span style="display:flex;"><span>  } 
</span></span><span style="display:flex;"><span>  lcd.<span style="color:#06b6ef">clear</span>(); 
</span></span><span style="display:flex;"><span>  lcd.<span style="color:#06b6ef">setCursor</span>(<span style="color:#f99b15">0</span>, <span style="color:#f99b15">0</span>);
</span></span><span style="display:flex;"><span>  lcd.<span style="color:#06b6ef">print</span>(<span style="color:#48b685">&#34;K. Geisshirt&#34;</span>);
</span></span><span style="display:flex;"><span>  lcd.<span style="color:#06b6ef">setCursor</span>(<span style="color:#f99b15">0</span>, <span style="color:#f99b15">1</span>);
</span></span><span style="display:flex;"><span>  lcd.<span style="color:#06b6ef">print</span>(<span style="color:#48b685">&#34;Copyright 2012&#34;</span>);
</span></span><span style="display:flex;"><span>  <span style="color:#06b6ef">delay</span>(<span style="color:#f99b15">1000</span>);
</span></span><span style="display:flex;"><span>  <span style="color:#06b6ef">pinMode</span>(LED, OUTPUT);
</span></span><span style="display:flex;"><span>}
</span></span><span style="display:flex;"><span><span style="color:#fec418">void</span> <span style="color:#06b6ef">loop</span>() {
</span></span><span style="display:flex;"><span>  <span style="color:#815ba4">for</span>(<span style="color:#fec418">int</span> i<span style="color:#5bc4bf">=</span><span style="color:#f99b15">0</span>; i<span style="color:#5bc4bf">&lt;</span><span style="color:#06b6ef">strlen</span>(msg); i<span style="color:#5bc4bf">++</span>) {
</span></span><span style="display:flex;"><span>    <span style="color:#815ba4">for</span>(<span style="color:#fec418">int</span> j<span style="color:#5bc4bf">=</span><span style="color:#f99b15">0</span>; j<span style="color:#5bc4bf">&lt;</span><span style="color:#06b6ef">strlen</span>(msg); j<span style="color:#5bc4bf">++</span>) m[j] <span style="color:#5bc4bf">=</span> msg[j];
</span></span><span style="display:flex;"><span>    m[<span style="color:#06b6ef">strlen</span>(msg)] <span style="color:#5bc4bf">=</span><span style="color:#48b685">&#39;\0&#39;</span>; 
</span></span><span style="display:flex;"><span>    <span style="color:#815ba4">if</span> (m[i] <span style="color:#5bc4bf">!=</span> <span style="color:#48b685">&#39; &#39;</span>) m[i] <span style="color:#5bc4bf">=</span> m[i]<span style="color:#5bc4bf">+</span>(<span style="color:#48b685">&#39;A&#39;</span><span style="color:#5bc4bf">-</span><span style="color:#48b685">&#39;a&#39;</span>); 
</span></span><span style="display:flex;"><span>    lcd.<span style="color:#06b6ef">clear</span>();
</span></span><span style="display:flex;"><span>    lcd.<span style="color:#06b6ef">setCursor</span>(<span style="color:#f99b15">0</span>, <span style="color:#f99b15">0</span>);
</span></span><span style="display:flex;"><span>    lcd.<span style="color:#06b6ef">print</span>(m);
</span></span><span style="display:flex;"><span>    lcd.<span style="color:#06b6ef">setCursor</span>(<span style="color:#f99b15">0</span>, <span style="color:#f99b15">1</span>);
</span></span><span style="display:flex;"><span>    <span style="color:#815ba4">if</span> (m[i] <span style="color:#5bc4bf">!=</span> <span style="color:#48b685">&#39; &#39;</span>) {
</span></span><span style="display:flex;"><span>      lcd.<span style="color:#06b6ef">print</span>(morse[m[i]<span style="color:#5bc4bf">-</span><span style="color:#48b685">&#39;A&#39;</span>]);
</span></span><span style="display:flex;"><span>      <span style="color:#815ba4">for</span>(<span style="color:#fec418">int</span> j<span style="color:#5bc4bf">=</span><span style="color:#f99b15">0</span>; j<span style="color:#5bc4bf">&lt;</span><span style="color:#06b6ef">strlen</span>(morse[m[i]<span style="color:#5bc4bf">-</span><span style="color:#48b685">&#39;A&#39;</span>]); j<span style="color:#5bc4bf">++</span>) {
</span></span><span style="display:flex;"><span>        <span style="color:#06b6ef">digitalWrite</span>(LED, HIGH);
</span></span><span style="display:flex;"><span>        <span style="color:#815ba4">if</span> (morse[m[i]<span style="color:#5bc4bf">-</span><span style="color:#48b685">&#39;A&#39;</span>][j] <span style="color:#5bc4bf">==</span> <span style="color:#48b685">&#39;*&#39;</span>) {
</span></span><span style="display:flex;"><span>          <span style="color:#06b6ef">delay</span>(<span style="color:#f99b15">500</span>);
</span></span><span style="display:flex;"><span>        } <span style="color:#815ba4">else</span> {
</span></span><span style="display:flex;"><span>          <span style="color:#06b6ef">delay</span>(<span style="color:#f99b15">1000</span>);
</span></span><span style="display:flex;"><span>        }
</span></span><span style="display:flex;"><span>        <span style="color:#06b6ef">digitalWrite</span>(LED, LOW);
</span></span><span style="display:flex;"><span>        <span style="color:#06b6ef">delay</span>(<span style="color:#f99b15">250</span>);
</span></span><span style="display:flex;"><span>      }
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>    <span style="color:#815ba4">if</span> (m[i] <span style="color:#5bc4bf">!=</span> <span style="color:#48b685">&#39; &#39;</span>) {   
</span></span><span style="display:flex;"><span>      <span style="color:#06b6ef">delay</span>(<span style="color:#f99b15">1000</span>);
</span></span><span style="display:flex;"><span>    } <span style="color:#815ba4">else</span> {
</span></span><span style="display:flex;"><span>      <span style="color:#06b6ef">delay</span>(<span style="color:#f99b15">100</span>);
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>  }
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div><p>If you haven&rsquo;t tried an Arduino board, it is highly recommended. With an electronic brick and a few components, it is much like LEGO for adults.</p>
<div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;">
      <iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen="allowfullscreen" loading="eager" referrerpolicy="strict-origin-when-cross-origin" src="https://www.youtube.com/embed/KBK3YLvwbwg?autoplay=0&amp;controls=1&amp;end=0&amp;loop=0&amp;mute=0&amp;start=0" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" title="YouTube video"></iframe>
    </div>

]]></description></item><item><title>GNOME 3 - a review</title><link>https://k.zigzak.net/posts/review-gnome-3/</link><pubDate>Thu, 02 Feb 2012 18:30:56 +0200</pubDate><guid>https://k.zigzak.net/posts/review-gnome-3/</guid><description><![CDATA[<h2 id="gnome-3---a-review">GNOME 3 - a review</h2>
<p>After the arrival of <a href="http://www.gnome.org/gnome-3/">GNOME 3</a> and Unity, we have seen months of discussion on the future of the free desktops. Both GNOME 3 and Unity have been considered as a step backward. Many old-school Linux users believe that these new offerings are worse than the good well-documented desktops like GNOME 2 and <a href="http://www.xfce.org/">XFCE</a>.</p>
<p>Over the years I have used many different desktop environments and window managers. GNOME 2 (both for Debian GNU/Linux and Ubuntu Linux) has served me well. A couple of weeks ago, I decided to try out GNOME 3. And to jump to the conclusion - GNOME 3 is different!</p>
<p>In my test of GNOME 3, I use my four years old <a href="http://www.dell.com/us/dfh/p/xps-m1330/pd">Dell XPS 1330M</a> laptop. With an Intel Core2 Duo (2 GHz), 4 GB memory and Intel graphics, it is not a speed devil. But it is a small laptop, and I can carry it around (I&rsquo;m usually on bike) easily. I have upgraded the battery to a 9-cell battery, and that gives me enough power to work for long period without plugging it to the wall. The operating system is <a href="http://www.archlinux.org/">Arch Linux</a> (64 bit).</p>
<p>Is the difference between GNOME 2 (old-school desktop) and GNOME 3 a good thing? Yes, I like it. I like that the panel is so small - yeah, I know it&rsquo;s not a panel. And I like the activity concept. I use the same 5 applications (browser, editor, terminal, word processor, and photo manager) so adding them to the activity panel is pretty nice. It took a couple of days to get use to the virtual desktops. In many years I have visualized my virtual desktops horizontal (and used Ctrl-Alt-Left/Right to move between them). Now, they are vertically organized (Ctrl-Alt-Down/Up). One thing I like is that the number of virtual desktops are changed dynamically as I move between them and starting and stopping applications.</p>
<p>The idea that you must use the Alt key together with the top-right menu is new to me. Luckily, a friend showed me after a week that I can power down my laptop as the menu changes when I press Alt. For one week I logged out and powered down. Knowing that the meta keys (Alt, Windows, etc.) is used throughout the GNOME Shell, makes me a bit more productive - or probably closer to my GNOME 2 productivity. I can only recommend that you read the user&rsquo;s manual to GNOME 3 and the GNOME Shell when you start using GNOME 3 for the first time.</p>
<p>One of the most criticized parts of GNOME 3 has been that it is not possible to customize the desktop. Strangely, I have not encountered many problems with this. Maybe the default values are just right for me. Of course I have changed a few things, but I have not wished to customized an item and haven&rsquo;t been able to find it.</p>
<p>The network manager has been upgraded, and this is the place where I think it is a downgrade. The VPN dialogs do not allow to import configuration files. Typically your network administrator will send you the configuration in some sort of file (each VPN implementation has it own format). I can manually type in the information, but it was much nicer in previous versions where I could import it.</p>
<p>The default applications in GNOME 3 are fine with me. I have only changed two applications: Firefox as browser, and Emacs as editor. The GNOME Editor (gedit) is not powerful enough for a full time software developer like me (working in 3-4 programming languages at the same time).</p>
<p>GNOME 3 introduces a concept of online accounts. The idea is that you register your accounts one place and all applications can use the information. Currently, only Google accounts are supported, but it is really nice that Evolution, Empathy and GNOME Shell calendar take advantage of it. I hope that Twitter, Facebook, LinkedIn and other web services soon will be supported.</p>
<p>For almost three weeks I have been using GNOME 3, and I must say I am impressed. The GNOME developers have really tried to rethink the free software desktop - and they have produced a cool desktop!</p>
]]></description></item><item><title>Free Chemistry Software - Quantum Chemistry</title><link>https://k.zigzak.net/posts/free-chemistry-software-quantum/</link><pubDate>Thu, 01 Dec 2011 08:18:30 +0200</pubDate><guid>https://k.zigzak.net/posts/free-chemistry-software-quantum/</guid><description><![CDATA[<h2 id="free-chemistry-software---quantum-chemistry">Free chemistry software - quantum chemistry</h2>
<p>In the previous part of the journey into free chemistry software I wrote about molecular mechanics. The molecular mechanics view of a molecular system is a classical mechanical view i.e., the atoms move according to Newton&rsquo;s law.</p>
<p>Quantum mechanics revolutionized the view of the atomic world. The <a href="http://en.wikipedia.org/wiki/Schr%C3%B6dinger_equation">Schrödinger equation</a> is a general model and number of parameters is limited. Solving a Schrödinger equation for an atomic or molecular system is often referred to an ab initio calculation. The word <em>ab initio</em> is latin and can be translated to <em>from the beginning</em> or <em>from first principles</em>.</p>
<p>The Schrödinger equation - in particular the time-independent equation - can be used to calculate many different properties of chemical substances. Properties like enthalpy and entropy, and heat capacity can calculated as the partition function can be calculated from the solution. Moreover, it is possible to predict data for various spectra (IR, Raman, UV-VIS, etc.). The problem is that it is not possible to find an analytical solution for any non-trivial cases. The solutions to the equation are called wave functions. The <a href="http://en.wikipedia.org/wiki/Copenhagen_interpretation">Copenhagen interpretation</a> of quantum mechanics is that the wave function represents the probably distribution (in space) of the electron.</p>
<p>In order to solve the (time independent) Schrödinger equation you must make two important approximations. The first approximation is that the nucleus of the atom is fixed in space, and the Schrödinger equation is reduced to only model the electrons. This approximation is called the <a href="http://en.wikipedia.org/wiki/Born-Oppenheimer_approximation">Born-Oppenheimer approximation</a>. The rationale behind the approximation is that the nucleus of an atom is much heavier that the electrons, and the nucleus moves much slower (this is probably a classical mechanical picture). The second approximation is that the wave function is a sum - or linear combination - of other functions. These functions form a basis set. The basis set is often atom orbitals (solution to the Schrödinger equation for a single atom), and they are often selected in much a manner that they require so few CPU cycles to process as possible. A popular family of basis set is the <a href="http://en.wikipedia.org/wiki/STO-nG_basis_sets">Slater-type orbitals</a>.</p>
<p>There are many quantum chemistry packages in the world. From a license perspective, they fall in three groups. The first group is completely proprietary software. You buy the package (maybe the source code is included so you can compile it yourself) and can use it for the set of computers, you have bought a license for. It is not rare to find special pricing schemes for users in the academic world. <a href="http://www.gaussian.com/">Gaussian</a> is a leading software vendor in this field, and a site license (with UNIX source code) for commercial use is listed as roughly 40,000 USD. This might sound like a high price tag but you must remember that the development of a new drug can easily run in billions. Compared to that, the software is quite cheap - if you are in <a href="http://en.wikipedia.org/wiki/Big_pharma">big pharma</a>. Gaussian does provided must more that just a quantum chemistry calculation engine - it includes various supporting utilities. The group of free software packages is another group with a completely different licensing model. A typical example is <a href="http://www.mpqc.org/">MPQC</a> (Massive Parallel Quantum Chemistry). Released under GNU General Public License it is a truly free software package. The motivation of the developers is to test new algorithm - in particular for the parallellization for using either compute clusters or multicore computers. Somewhere in between you find the third group. Software packages in this group are free to download (if you are in academia or using it for personal purposes) but you are allowed to redistribute the source code or binary. And often you must include a citation to a particular scientific paper if you publish any results based on the software. In this group you find packages like GAMESS (both US and UK versions).</p>
<h3 id="gabedit">Gabedit</h3>
<p>The program <a href="http://gabedit.sourceforge.net/">gabedit</a> provides a uniform interface to many quantum chemistry packages including GAMESS-US, GAMESS-UK, Gaussian and MPQC. The program exists as a binary package for most Linux distributions including Ubuntu Linux and Debian GNU/Linux which makes the installation quite simple.</p>
<p><img src="Gabedit-MPQC-input.png" alt="Setting up a calculation in Gabedit"></p>
<p><a href="http://pubchem.ncbi.nlm.nih.gov/summary/summary.cgi?cid=2519&amp;loc=ec_rcs">1,3,7-trimethylxanthine</a> is a known (legal) psycho-active chemical. It is found naturally in coffee, tea, and soft drinks. The trivial (non systematic) name is <a href="http://en.wikipedia.org/wiki/Caffeine">cafferine</a>. It is a small molecule with an aromatic ring structure.</p>
<p>You can either draw your molecule or load a file. The structure of many molecules can be found at PubChem or similar services. A 3-dimensional structure of Cafferine can be found at <a href="http://pubchem.ncbi.nlm.nih.gov/">PubChem</a>. A 3-dimensional structure is nothing more that the coordinates of the nuclei of the atoms in the molecule. Using OpenBabel (discussed in previous blog entries), you can convert the PubChem files format to something that Gabedit can understand.</p>
<p>Setting up a calculation is simple but you are required to know and understand all the parameters and methods. For a causal user of quantum chemistry software, Gabedit might help you to allow to write configuration files manually, but the program is a thin wrapper only.</p>
<p><img src="Screenshot-Gabedit-1.png" alt="Monitoring a calculation"></p>
<p>Once you have edited the calculation parameters, you are ready to go. It is possible to monitor the progress of your simulation but beware that quantum chemistry calculation might take hours. Gabedit will use the good old UNIX trick called <code>nohup</code> so you can come back later. Moreover, Gabedit let you perform the calculation on remote machines. This is useful for long calculations.</p>
<p>When the calculation has finished, Gabedit can assist you in analyzing the result. It is only a limited number of analyses offered, and if you need more advanced analysis, you will probably write small scripts and programs to help you.</p>
<p><img src="Screenshot_Gabedit_analyze.png" alt="Analyzing the result of a geometry optimization in Gabedit"></p>
<p>The really good thing about Gabedit is that it provides a uniform interface to the most common quantum chemistry packages.</p>
<p>Other software packages exists e.g., <a href="http://bioinformatics.org/ghemical/ghemical/index.html">Ghemical</a>. Ghemical is fairly tight bound to GNOME, and tries to solve all needs for computational chemistry in one packages. The latest version of Ghemical is recent (October 2011).</p>
<h3 id="mpqc">MPQC</h3>
<p><a href="http://www.mpqc.org/">MPQC</a> is a pure free software project which provides an ab initio package. It is designed to run in multicore or cluster environments i.e., in massive parallel environment. Ubuntu and Debian packages exists. Currently, two packages exist: the core program and supporting utilities. Even an Emacs mode can be found for editing the configuration files. The main mode of operation is that the user writes a configuration or input file and run the program from the command-line or through a <a href="http://en.wikipedia.org/wiki/Batch-queuing_system">batch system</a>. The OpenBabel conversion utility supports MPQC and can write raw input files from structure file formats. This simplifies the usage a lot in the learning period.</p>
<p>In order to test MPQC, I have prepared an input file using Caffeine. As MPQC supports the calculation of thermodynamics properties (non-electronic enthalpy and entropy), my test input file will perform this analysis after the <a href="http://en.wikipedia.org/wiki/Geometry_optimization">geometry optimization</a> using the STO-6G basis set and a Hartree-Fock method. The <a href="http://en.wikipedia.org/wiki/Hartree%E2%80%93Fock_method">Hartree-Fock method</a> is only calculating the ground level state, and the thermodynamics will be somewhat inaccurate.</p>
<p><img src="mpqc-speedup.png" alt="MQPC/Linux speed-up"></p>
<p>As MPQC is a parallel calculation program, it is worth analyzing the speed-up i.e., how well does scale as the number of core/CPUs increases. MPQC is parallellized using either <a href="http://www.open-mpi.org/">MPI</a>, SysV shared memory and Posix threads.</p>
<p>Running on multiple cores is simple with MPQC. You can specify the number of threads on the command-line. For a 4-thread calculation, the command-line is: <code>mpqc -threadgrp &quot;&lt;PthreadThreadGrp&gt;:(num_threads = 4) -o caffeine.out caffeine.in</code> where <code>caffeine.in</code> is the input file and the output is found in caffeine.out.
As I have access to a hyperthreaded quad-core computer, I have tested the Posix thread parallelization (please remember that Linux has a highly optimized Posix thread implementation).</p>
<p>The result of my simple benchmark shows that hyperthreading is not a good idea in heavy computing environment - notice that the speed-up levels off at four cores. The reason is probably that the threads are competing for a limited resource: the floating-point units. A calculation of the Caffeine molecule took about 8 hours using 4 Posix threads, and this only calculated the ground state using the STO-6G basis set.</p>
<h3 id="summary">Summary</h3>
<p>In general it is possible to carry out quantum chemistry calculation using free software if you can live without a fancy user interface. If you do many calculations, you might be happy to know that you can modify and extend the source code. For a causal computational chemist (maybe an organic chemist predicting spectres), free chemistry software might not be the solution yet.</p>
]]></description></item><item><title>Saved by Dropbox</title><link>https://k.zigzak.net/posts/saved-by-dropbox/</link><pubDate>Thu, 24 Nov 2011 17:33:44 +0200</pubDate><guid>https://k.zigzak.net/posts/saved-by-dropbox/</guid><description><![CDATA[<h2 id="saved-by-dropbox">Saved by Dropbox</h2>
<p>I have installed <a href="https://www.dropbox.com">Dropbox</a> on my laptops and my phone. On my laptops I use it for two purposes: synchronization and backup. Initially, I used it for synchronization of my private and my work laptop (both computers are running Linux).</p>
<p>The laptop at work is a bit unstable. It crashes probably 3-4 times a week, and I believe it has something to do with the temperature of the processor. It happened to me the other way, and an OpenOffice document was left in a state where the file did not contain anything else that zeroes.</p>
<p>Luckily, Dropbox keeps track on my revisions of the files. That means that I was able to go one revision back and recover much of my file (probably lost half a page). Needless to say, I&rsquo;m pretty happy with the Dropbox service now!</p>
]]></description></item><item><title>Emacsforum 2011</title><link>https://k.zigzak.net/posts/emacsforum-2011/</link><pubDate>Tue, 01 Nov 2011 08:30:24 +0200</pubDate><guid>https://k.zigzak.net/posts/emacsforum-2011/</guid><description><![CDATA[<h2 id="emacsforum-2011">Emacsforum 2011</h2>
<p><a href="http://www.version2.dk/blogs/peter-toft">Peter Toft</a> and I are in the process of preparing <a href="http://www.emacsforum.dk/">Emacsforum 2011</a> with some help by Troels Henriksen (at <a href="http://www.diku.dk/">DIKU</a>) and Keld Simonsen (from <a href="http://www.klid.dk/">KLID</a>). The program is almost ready for publication, so I will not say too much - but there will be something for scientists and developers. Even our <a href="http://www.vim.org/">Evil Twin</a> will be represented.</p>
<p>The mini-conference takes place 12th November 2011 at DIKU. The is no conference fee - and there will be no benefits.</p>
<p>If you are using Emacs (and even XEmacs) and live in the Copenhagen area, Emacsforum is a good place to meet fellow users.</p>
]]></description></item><item><title>Free Chemistry Software - Molecular Modeling</title><link>https://k.zigzak.net/posts/free-chemistry-software-molecular-modeling/</link><pubDate>Sat, 29 Oct 2011 08:35:48 +0200</pubDate><guid>https://k.zigzak.net/posts/free-chemistry-software-molecular-modeling/</guid><description><![CDATA[<h2 id="free-chemistry-software---molecular-modeling">Free Chemistry Software - Molecular Modeling</h2>
<p>Molecular modeling is a very large and important field of chemistry. As computers have increased in raw computing power, the usage of computers to calculate molecular properties is not a specialized fields for the few. Today, every chemist can perform calculation for even large molecules.</p>
<p>Roughly speaking, you can divide the calculations in two separate groups: molecular mechanics and quantum chemistry. The first is based on classical mechanics, while the second group uses quantum mechanics as a underlying model and equations. The software list at <a href="http://en.wikipedia.org/wiki/Molecular_modeling">http://en.wikipedia.org/wiki/Molecular_modeling</a> shows a wide range of offerings. Many of them are commercial and closed-source solutions.</p>
<p>Molecular mechanics calculations are used when no chemistry is going to. By definition, chemistry is the rearrangement of atoms - and that involves electrons. But molecular mechanics can be used to investigate how a molecule is solvent that is, how its structure changing when it is surrounded by a solvent like water.</p>
<p><a href="http://www.gromacs.org/">Gromacs</a> is one of the oldest and most successful molecular mechanics software suites. It is covered by the GNU General Public License (version 2), and most distributions like Debian GNU/Linux have a package of it. It does not come with a fancy user interface, and the user primarily interacts with Gromacs at the command line. It is a big advantage as some of the operations can take a long time. Seldomly, you sit by your computer and work with Gromacs. The typical usage is to write small shell scripts and run them as batch jobs.</p>
<p>Today, most supercomputers in the chemical industry and academia are Linux clusters which are build from commodity hardware. That means that a supercomputer is a distributed system where the individual processors are loosely coupled using Ethernet (or maybe InfiniBand). The <a href="http://www.mpi.org/">MPI</a> framework is used by Gromacs to utilize such a supercomputer (if you have a SMP system, MPI can still be used for parallelization). Queuing systems (SUN Grid Engine, OpenPBS/Torque, etc.) schedule which batch job to execute, and the command-line nature of Gromacs comes to its rights on such systems.</p>
<p>Explaining all details of Gromacs is not the scope here. But let us a quick tour on how to use some of the many utilities and programs of Gromacs. The assignment is to take the experimentally determined structure a small biological active molecule and create a solvated version of the molecule. The structure found at the Protein DataBank is for a crystal, and IGF-1 (as most other molecules in your body) is in a solution where water is the solvent (remember, 60 % of you body is water). For the tour, the <a href="http://en.wikipedia.org/wiki/IGF-1">Insulin-like growth factor 1</a> (IGF-1) is chosen. IGF-1 is a small protein (or peptide) which is involved of the growth and regeneration of your body. You can download a file with the experimental structure from <a href="http://www.pdb.org/pdb/home/home.do">Protein DataBank</a>.</p>
<p>First, you must pre-process the downloaded file into files used by Gromacs. In that process you decided the force field. The force field is the parametrization of the interaction between the atoms, and all calculations in Gromacs (and any other molecular mechanical program) are based on <a href="http://en.wikipedia.org/wiki/Newton's_second_law#Newton.27s_second_law">Newton&rsquo;s second law</a>. In the command-line below, two files are generated (<code>2GF1.gro</code> and <code>2GF1.top</code>).</p>
<div class="highlight"><pre tabindex="0" style="color:#e7e9db;background-color:#2f1e2e;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sh" data-lang="sh"><span style="display:flex;"><span>pdb2gmx -f 2GF1.pdb -o 2GF1.gro -p 2GF1.top -ignh -ff G53a6
</span></span></code></pre></div><p>Now you have to edit the output file (<code>2GF1.gro</code>) in order to change box size. You can do an energy minimization and generate a solvation box using the commands (some steps might take some time):</p>
<div class="highlight"><pre tabindex="0" style="color:#e7e9db;background-color:#2f1e2e;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sh" data-lang="sh"><span style="display:flex;"><span>mdrun -v -deffnm 2GF1-EM-vacuum -c 2GF1-EM-vacuum.gro
</span></span><span style="display:flex;"><span>editconf -f 2GF1-EM-vacuum.gro -o 2GF1-PBC.gro -bt dodecahedron -d 1.2
</span></span><span style="display:flex;"><span>genbox -cp 2GF1-PBC.gro -cs spc216.gro -p 2GF1.top -o 2GF1-water.gro
</span></span></code></pre></div><p>The final file is <code>2GF1-water.gro</code> which is the biological molecule solvated in water. It might not sound as a great deal, but the file can be used in further simulation involving the solvated molecule.</p>
<p>Other molecular modeling packages exists. <a href="http://www.ks.uiuc.edu/Research/namd/">NAMD</a> is a highly scalable molecular dynamics program. It is aimed at large molecules (proteins) and can utilize very large parallel computers. But NAMD is not free software as defined by <a href="http://www.fsf.org/">Free Software Foundation</a>. You can download it and use it for any non-commercial purpose.</p>
]]></description></item><item><title>Free Chemistry Software - Utilities</title><link>https://k.zigzak.net/posts/free-chemistry-software-utilities/</link><pubDate>Mon, 10 Oct 2011 18:30:57 +0200</pubDate><guid>https://k.zigzak.net/posts/free-chemistry-software-utilities/</guid><description><![CDATA[<h2 id="free-chemistry-software---utilities">Free Chemistry Software - Utilities</h2>
<p>One of the major annoyances as chemists in front of computer is faced with is the vast number of file formats. The good news is that most file formats are text files so it is possible to reverse engineer them by looking at a number of examples. One open source project called <a href="http://www.openbabel.org/">OpenBabel</a> tries to help chemists in converting between the formats (currently OpenBabel supports 113 file formats related to chemistry). Most Linux distributions have packages for OpenBabel, including Debian GNU/Linux (it&rsquo;s a version from 2009 you find in Debian stable). Converting a molecular structure of caffeine from one file format (SDF) to another (PDB) is simply done by the following command: <code>babel -isdf caffeine.sdf -opdb caffeine.pdb</code></p>
<p>You can find many small molecules - with 3D structures, physical properties and toxicology data - at <a href="http://pubchem.ncbi.nlm.nih.gov/">PubChem</a>. For larger molecules (proteins mainly), you can go to the <a href="http://www.pdb.org/">Protein Data Bank</a>. The file for caffeine as used above can be found at PubChem.</p>
<p>OpenBabel project also includes a number of other utilities including a chemist&rsquo;s version of <code>grep</code> called <code>obgrep</code> (searching for molecules with a particular substructure within a database) and simple program to (energy) minimize a molecule called <code>obminimize</code>.</p>
<p><a href="http://gchemutils.nongnu.org/">GNOME Chemistry Utils</a> is a set of utilities developed for GNOME users. The set includes a calculator (for calculating the molecular mass of a molecule), the periodic table of the elements, and a spectrum viewer. The periodic table of the elements can give you the physical and chemical properties of all elements. Most chemists have a periodic table of elements close when working,
and having one on your desktop seems as a good idea.</p>
<p><img src="gchemtable.png" alt="The periodic table of elements for GNOME"></p>
<p>Chemists do a lot of drawing: they draw structures of molecules. In can be regarded as a generic representation of a molecules 3-dimensional structure using a 2D paper. Understanding and drawing such chemical structures are an integral part of any chemist&rsquo;s education and chemists have used these drawing for more than 150 years (the discovery of the electron and the development of quantum mechanics changed the view of molecular structures). The 3-dimensional geometry is an important factor for determine the properties (reactivity, toxicology, color, etc.) of a molecule.</p>
<p>A drawing program for chemists is not hard to image. When it comes to free software, we are so lucky that we have more than one. GNOME users can use the molecular drawing program from the GNOME Chemistry Utils project. It is called <code>GChemPaint</code>. As GChemPaint can only load a rather small number of file formats, you really learn to use OpenBabel rather quickly. It is an easy program to work with, and it is possible to save your drawing in most used image formats (both bitmap and vector formats). You can then easily insert your drawing in your favorite word processing software prior to publication (take publication rather broad: everything from a high-school report to a paper in <a href="http://www.nature.com/">Nature</a>).</p>
<p><img src="gchempaint.png" alt="Drawing molecules with GNOME"></p>
<p>As already said, drawing programs for chemists are not hard to imagine. Other projects in this area include titles likes bkchem, chemtool, easychem, xdrawchem, <a href="http://cdk.sourceforge.net/">jchempaint</a>, <a href="http://molsketch.sourceforge.net/">molsKetch</a> (probably stalled).</p>
]]></description></item><item><title>Free Chemistry Software - Introduction</title><link>https://k.zigzak.net/posts/free-chemistry-software-introduction/</link><pubDate>Fri, 07 Oct 2011 12:50:30 +0200</pubDate><guid>https://k.zigzak.net/posts/free-chemistry-software-introduction/</guid><description><![CDATA[<p>The year of 2011 has been declared the International Year of Chemistry by <a href="http://www.unesco.org/">UNESCO</a> (United Nations Educational, Scientific and Cultural Organization) and <a href="http://www.iupac.org/">IUPAC</a> (International Union of Pure and Applied Chemistry). The purpose of devoting a full year to chemistry is to spread the notion that chemistry is important for our daily life.</p>
<p>In this series of blog posts I have examined the state of free software in chemistry. This first post is an outline of the usage of computers in chemistry.</p>
<p>It is hard to imagine modern life without the discoveries and developments done by chemists and chemical engineers over the last two or three centuries. Plastic, gasoline, and pharmaceuticals are products from the chemical industry. And forensic scientists use many chemical analysis in order to provide evidence for police investigations all over the world. But chemistry is more that an applied science. It also give us an insight to how our world works. In the recent decade, the modern cuisine has changed. For example, the chief Heston Blumenthal has been using chemistry to create new dishes (this branch of chemistry is called <a href="http://en.wikipedia.org/wiki/Molecular_gastronomy">molecular gastronomy</a>).</p>
<p>As you can see, chemistry is a broad science and engineering discipline. Modern chemistry is divided into a number of branches. Traditionally, an academic education of chemistry consists of courses in general, organic, inorganic, physical and even analytical chemistry. Chemistry is a wet science, and as a student you spend a lot of time in laboratories. Amongst chemists, it is still discussed whether chemistry is a <a href="http://en.wikipedia.org/wiki/Descriptive_science">descriptive science</a> (classification of observations) or an <a href="http://en.wikipedia.org/wiki/Exact_science">exact science</a> (explaining observations).</p>
<p>Chemistry interfaces most other sciences, including physics, mathematics, statistics and biology. Quantum chemistry applies quantum mechanics to calculate properties of chemical substances. But as you might imagine, the <a href="http://en.wikipedia.org/wiki/Three-body_problem">three-body problem</a> is a serious show-stopper for a chemist as very few molecules have only three nucleus and electrons.</p>
<p>Computers are heavily used in chemistry. One example is to perform quantum chemistry calculation as finding an analytical solution for a many-body problem is impossible. A rough break-down of the usage of computers in chemistry consists of three major areas. Firstly, you have the end-user applications used by every chemist. The applications are domain-specific applications - the domain is as broad as chemistry. The second area is <a href="http://en.wikipedia.org/wiki/Chemoinformatics">chemoinformatics</a>. It is a fairly young area (a decade or two only). Chemoinformatics applies techniques from informatics to transform chemical data to knowledge and thereby improving the decision making process. The usage of specialized databases and search algorithms is an integral part of chemoinformatics. Any non-trivial chemical compound can be represented in a number of ways. Even a small molecule like styrene can be named in different ways depending on how you look at it. Chemoinformaticians have introduced a string representation for all chemical compounds called the <a href="http://en.wikipedia.org/wiki/Smiles">simplified molecular input line entry specification</a> (SMILES). The SMILES code for styrene is <code>C=CC1=CC=CC=C1</code>. Image to find all compounds in your database with a certain substructure. You cannot use a regular expression or an SQL query. As molecules can be regarded as graphs (atoms are connected by chemical bonds), searching in chemical databases is a variant of find subgraphs. This is the core of chemoinformatics.</p>
<p>The third area where computers are used in chemistry is to perform calculations and it is often referred to as computational chemistry. It is an old area - calculation and simulation of properties of chemical compounds and reaction have been carried out as long as computers have been available to scientists. The calculations either use a classical-mechanical approach or a quantum mechanical approach. In the first approach, electrons is neglected and a force-field between the atoms are applied. This is possible to simulate large molecules using this approach. But if you need to predict the energy levels, thermodynamical properties, and charge distribution of a molecule, you have to use a quantum mechanical approach. This involves solving the time-independent <a href="http://en.wikipedia.org/wiki/Schr%C3%B6dinger_equation">Schrödinger equation</a> (or at least an approximation to the equation called the Born-Oppenheimer approximation).</p>
<p>It is important to understand that most chemists are not educated as programmers. On the other hand, using computational techniques can save chemical industries huge fortunes. Today, most pharmaceutical companies have specialized departments for performing chemical calculations and supporting an informatics infrastructure. These departments are small in terms of man-power compared to the company as a whole. As the market is small and the potential benefits huge (time-to-market and saving expensive laboratory time), vendors often ask for very high license-fees. Vendors like <a href="http://www.schodinger.com/">Schrödinger</a>, <a href="http://www.wavefun.com/">Wavefunction</a>, <a href="http://gaussian.com/">Gaussian</a>, and <a href="http://www.eyesopen.com/">OpenEye</a> offer software packages for chemists. Sadly, free software is a minor player in chemistry but you can find free chemistry software for most needs.</p>
]]></description></item><item><title>Open Source for Ledere</title><link>https://k.zigzak.net/posts/open-source-for-ledere/</link><pubDate>Sun, 18 Apr 1999 09:56:57 +0200</pubDate><guid>https://k.zigzak.net/posts/open-source-for-ledere/</guid><description><![CDATA[<h2 id="tjen-penge-på-open-source">Tjen penge på Open Source</h2>
<h3 id="notes-in-english">Notes in English</h3>
<ul>
<li>Co-authors: <a href="https://www.linkedin.com/in/petertoftdk/">Peter Toft</a> and <a href="https://www.linkedin.com/in/hanne-munkholm/">Hanne Munkholm</a></li>
<li>Published at sslug.dk</li>
<li>Original license: <a href="https://web.archive.org/web/19991009175004/http://www.opencontent.org/opl.shtml">http://www.opencontent.org/opl.shtml</a></li>
</ul>
<h3 id="formål">Formål</h3>
<p>Vi vil i denne artikel argumentere for at <a href="https://web.archive.org/web/19991009175004/http://www.opensource.org/">Open Source</a> Software er bedre end det mere traditionelle lukkede software. Det vil blive beskrevet hvorfor Linux-verdenens måde at udvikle software på har store fordele - dels med hensyn til stabilitet og sikkerhed, men også med hensyn til den strategiske risiko, som en moderne erhvervsleder altid må tage, når der købes software.</p>
<p>Artiklen er kraftigt inspireret af Open Source bevægelsen og Eric S. Raymonds artikler og foredrag. Eric S. Raymond er en (nu meget kendt) systemprogrammør fra USA, der har studeret og dokumenteret mange af de stærke ting, som kendetegner udviklingen af det meget udbredte Linux styresystem.</p>
<h3 id="indledning-til-open-source">Indledning til Open Source</h3>
<p>I de første måneder af 1998 opstod et nyt begreb blandt Internet-brugere: Open Source. Eric S. Raymond skrev et par opsigtsvækkende artikler omkring udvikling af software, og netop disse artikler fik Netscape til at åbne dørene til Netscape Communicator. I starten af 1998 fik hele verden adgang til kildeteksten (selve programkoden) til Netscape Communicator, og programmet fik en Open Source kompatibel licens. Det gjorde det muligt at tilføje til eller ændre i programmet, i modsætning til de gængse binære programmer, som ikke kan ændres. Disse vil vi kalde &ldquo;closed source&rdquo; programmer i det følgende.</p>
<p>Open Source er i virkeligheden et simpelt begreb, som anvendes på licensbetingelserne til software. I sin enkelhed betyder Open Source at alle mennesker, uanset hudfarve, religion, politisk overbevisning eller geografisk placering, kommerciel eller privat bruger, skal have adgang til kildeteksten til softwaren. Endvidere medfølger retten til at ændre kildeteksten.</p>
<p>Men Open Source er mere end blot adgang til kildeteksten. Ofte følger de programmer, som har en Open Source licens, en række fælles mønstre. Et af mønstrene er, at udviklingssprojekterne ofte bruger Internettet som det vigtigste medium, dvs. at e-post og WWW er vigtige elementer hvor udviklerne kommunikerer. Et andet fælles mønster er den udviklingsmodel, som man benytter i projekterne (ofte uden bevidst at tænke over den).</p>
<p>Flere af de store firmaer anerkender nu Open Source og anvender det som udviklingsmodel: SUN, Silicon Graphics og Netscape.</p>
<p>Der findes en mange tusinde mere eller mindre kendte Open Source projekter.  De allermest kendte er</p>
<ul>
<li><strong>Linux</strong> - Med en vækst på 212% i 1998 og ca. 20 millioner brugere er Linux det styresystem, der virker mest lovende af alle. Linux er i dag det mest anvendte styresystem til web, news og ftp-servere med en markeds andel på 25%-33%</li>
<li><strong>Apache</strong> - Webserveren Apache kan downloades gratis fra Internettet og er af en meget høj kvalitet. Netop den høje kvalitet har betydet, at Apache har en markedsandel på omkring 50%.</li>
<li><strong>Samba</strong> - <a href="https://web.archive.org/web/19991009175004/http://www.samba.org/">Samba</a> er blandt mange ting et stykke software, som kan fungere som filserver for et Microsoft Windows 95 netværk. Programmet betyder at en edb-afdeling kan benytte UNIX-baserede servere, imens slutbrugerne bruger Windows og de mange applikationer, som findes til Windows 95. Mange firmaer anvender i dag Samba uden at klienterne aner det.</li>
<li><strong>Perl</strong> - Programmeringssproget <a href="https://web.archive.org/web/19991009175004/http://www.perl.org/">Perl</a> benyttes af rigtig mange mennesker. Omkring 95 % af alle CGI-scripts (interaktive hjemmesider) er skrevet i Perl.</li>
<li><strong>Netscape Communicator</strong> - Netscape Communicator var det første store kommercielle produkt der gik over til Open Source. Man regner med at ca. 50 % af alle verdens browsere er fra Netscape.</li>
</ul>
<h3 id="linux-development-model">Linux Development Model</h3>
<p>Udviklingsprojekter som har en grad af Open Source over sig benytter ofte en udviklingsmodel, som hos Eric S. Raymond går under betegnelsen Linux Development Model (LDM).</p>
<p>I et traditionelt udviklingsprojekt arbejder N programmører sammen. Omkostningerne for ethvert projekt måles i mandemåneder, dvs. hvor mange måneder en programmør vil være om at udvikle det ønskede programmel. Hypotesen bag den målestok er, at sættes der dobbelt så mange programmører på projektet, vil det tage den halve tid. Men virkeligheden er en anden! Udviklingsomkostningerne sprænger næsten altid budgetterne.</p>
<p>Det kan let forklares, at det ikke er muligt at sætte udviklingstiden vilkårligt ned ved at ansætte flere programmører. Frederick P. Brooks, jr. giver forklaringen i <em>The Mythical Man-month</em> [Addison-Wesley, 1995]. Når man har N programmører er der N(N-1)/2 snitflader mellem programmørerne. Det vil sige, at hvis man fordobler antallet af programmører, vil antallet af snitflader firdobles. Med andre ord vil produktiviteten ædes op af kommunikation og konflikter mellem programmørerne. Derfor ser man ofte projekter med små hold af programmører, som arbejder med velafgrænsede opgaver og integration mellem delprogrammer.</p>
<p>LDM er anderledes. I Open Source projekter findes der typisk en kerne af programmører (N personer), som leder projektet. Men der findes M personer, f.eks. 10.000 personer, som downloader programmet. Disse personer (beta-testerne) finder fejl og sender typisk rettelserne til den lille kerne af N personer, der leder projektet. Men antallet af snitflader er kun M, idet beta-testerne ikke kommunikerer med hinanden. Eftersom M typisk er mange gange større end N, ser vi at kompleksiteten vokser lineært med antallet af beta-testere, men kompleksiteten for et traditionelt ledet projekt vokser med kvadratet.</p>
<p>For at konkludere uden brug af matematik: LDM har de to store fordele at arbejdet per person udnyttes virkelig godt, og at alle de personer, der arbejder som beta-testere og retter i koden, ikke skal betales af firmaet. I den traditionelle beta-test af programmer uden kildetekst, er belastningen af de betalte programmører, som modtager fejlrapporter stor - for de skal selv genskabe samme fejl, finde fejlen i koden og rette den. Oftest er dette en ineffektiv arbejdsgang. Som software producent opnår man med LDM en mere effektiv arbejdsgang, og et bedre testet og mere stabilt program, hvor det er meget svært at skjule sikkerhedshuller, da alle kan læse med i kildeteksten.</p>
<p>Det er dog ikke altid, at man som software producent kan bruge Open Source konceptet. Laver man f.eks. produkter som alene sælges på grund af en nyudviklet hemmelig metode, så kan producenten ikke bevare den hemmelighed i Open Source programmel, da alle har adgang til kildeteksten. Men de fleste computerbrugere bruger alene software, hvor programmets værdi ret beset skyldes programmets stabilitet - og kun i ringe grad hemmeligheder. Som computerbruger vil man som oftest langt hellere have et stabilt program, man kan stole på - fremfor et par ekstra &ldquo;features&rdquo;, som får programmet til at gå ned fra tid til anden. Med hensyn til stabilitet, og oftest også ydelse, er Open Source og LDM en overlegen udviklingsmetode.</p>
<h3 id="reduktion-af-omkostninger">Reduktion af omkostninger</h3>
<p>I en virksomhed, som ikke lever af at udvikle software, sker der ofte en hel del softwareudvikling alligevel. Mange forbinder software udvikling med færdige software produkter man kan købe, men sandheden er snarere, at mindst 90 % af alle edb-folk arbejder med intern udvikling eller drift. Dette er overraskende, men det betyder at langt de fleste firmaer udvikler software for at bruge den, ikke for at sælge den. Disse firmaer har oftest større fordel af at have stabile og effektive programmer, hvor programmernes kildetekst er offentlig kendt, fremfor at skulle stole på at et &ldquo;closed source&rdquo;-firma ikke har fejl i deres program.</p>
<p>Som eksempel vil vi nævne Cisco. Cisco fremstiller diverse netværkskomponenter, f.eks. routere. Eftersom Cisco er en international virksomhed, har virksomheden kontorer rundt om i verdenen. På et tidspunkt ønskede ledelsen, at alle Ciscos ansatte kunne udskrive på en vilkårlig printer et andet sted i verden. Ciscos edb-afdeling påbegyndte projektet, og valgte efter nogen tid at lade projektet være Open Source, så andre virksomheder i dag kan bruge systemet, og bidrage til dets udvikling. Det betyder, at Cisco ikke blev nær så afhængige af den lille gruppe ansatte, der har udviklet systemet. De finder måske et andet job en dag, og var det et lukket system, var der ikke længere nogen, der var kvalificerede til at vedligeholde softwaren. Ved at lave deres printerstyringsprojekt til et Open Source projekt opnåede Cisco risikospredning, men de har også opnået at udviklingsomkostningerne bliver delt imellem flere virksomheder. Da Cisco&rsquo;s forretningsområde ikke er printerstyring, vil de ikke miste markedsandele, hvis deres konkurrenter bruger det samme program. Typisk vil et sådant program, blive anvendt af alle mulige andre virksomheder som strukturmæssigt minder om Cisco, og altså ikke fremstiller det samme som Cisco - og Cisco har reelt fået et system, som ikke koster ret meget, men bidrager til den interne værdi i firmaet.</p>
<p>Open Source Software (OSS) kan typisk fås gratis eller for et symbolsk beløb svarende til en manuals pris, hvilket også betyder en kraftig reduktion af omkostningerne. Skal man installere både Microsoft Windows NT og Microsoft Office på en PC løber det let op i mere end 5.000 kr. Naturligvis koster uddannelsen af medarbejderne det samme for både Open Source og kommercielle produkter. Hardware er typisk billigere, hvis man kun kører Open Source Software, idet Open Source Software typisk er mindre ressourcekrævende. Dette er navnlig sandt, når vi taler om servere. En Linux webserver kan køre fint på en i486 maskine med kun 16 MB RAM.</p>
<h3 id="reduktion-af-risiko">Reduktion af risiko</h3>
<p>Et oplagt problem med closed source software er, at leverandøren går konkurs eller vælger at stoppe vedligeholdelsen af et produkt. En konkurs vil betyde, at du sidder med et edb-system, som du ikke kan få rettet fejl i eller tilføjet nye funktioner til.</p>
<p>I mange tilfælde vil et stop af vedligeholdelsen af et program være endog meget kritisk for en virksomhed. Et måske noget letkøbt eksempel kunne være et lagerstyringssystem, som ikke er år 2000 klar. Eller blot, at det har et maximalt antal varegrupper, som firmaet nu overskrider. Fatale problemer, som man møder alt for ofte.</p>
<p>Benyttes Open Source Software har du adgang til selve kildesteksten. Derved kan du ansætte en programmør til at gøre dit lagerstyringssystem klar til år 2000. Brugen af Open Source Software er derfor en reduktion af din risiko.</p>
<p>Reduktion af risiko gælder også software udviklet internt i et firma, hvor man selv har kildeteksten. Hvor mange har ikke oplevet at et eller andet ikke længere kunne bruges, fordi &ldquo;ham der havde forstand på det&rdquo; er rejst. Software skal vedligeholdes, og det tager tid og kræfter at sætte sig ind i et projekt, selvom man har kildeteksten. Hvis et projekt er Open Source, vil der altid være nogen et eller andet sted, som har forstand på det, og de kan lære hinanden op. Således kommer et godt Open Source projekt aldrig til at samle støv i skuffen. Modsat så vil et dårligt Open Source projekt aldrig få stor støtte og aldrig få luft under vingerne - ligesom et tilsvarende kommercielt produkt nok ville være svært at sælge.</p>
<p>Som bruger af Open Source software har man den sikkerhed, at når først et program er startet som Open Source, så kan man ikke stoppe udviklingen - programmet vil fortsætte som Open Source. Man kan ikke købe sig tilbage til et lukket udviklingsmodel. Som eksempel er Linux kernen copyrightet af mange hundrede folk under en Open Source licens.</p>
<h3 id="aktiv-it-strategi">Aktiv IT-strategi</h3>
<p>Ikke-softwarefirmaer, der udveksler information med hinanden, har den fælles interesse, at dokumenterne er læsbare, når de når frem. Virksomhederne er som sådan ikke interesserede i anvende det samme program, hvor de måske har forskellige behov. Virksomhederne er blot interesserede i at dokumenter følger en åben standard, så modtageren kan læse det. Dette er modtridende med den kommercielle software producents interesser, som ønsker at alle bruger deres software.</p>
<p>Hvis en virksomhed vælger Open Source Software, vælger virksomheden samtidig sin egen skæbne. Det lyder måske prætentiøst, men i virkeligheden er det meget simpelt. Sagen er, at ved at vælge lukket (kommerciel) software, vælger du ikke din egen IT-strategi. Din IT-strategi bliver kraftigt bundet til din leverandørs forretningsstrategi.</p>
<p>Et velkendt eksempel er da Microsoft kom med Office97 pakken. Mange firmaer havde installeret Word95 til tekstbehandling, men med Word97 blev det almindelige filformat ændret, og dermed kunne man ikke længere i Word95 læse de filer, som Word97 brugere genererede. Resultatet blev, at langt de fleste Office95 installationer blev erstattet af Office97. Hvem blev vinderen af dette? Synes du, som erhvervsleder, at I reelt fik mere, end hvad I havde? For lige at være retfærdig, så frigav Microsoft ganske vist filtre (programændringer af Word95), så man kunne læse Word97 tekstbehandlingsfiler fra Word95, men det blev aldrig rigtig godt.</p>
<p>Et andet grelt eksempel er fra den gang, da IBM og Microsoft indgik et meget integreret samarbejde omkring OS/2. Alle var vilde - de ville bruge OS/2. Danmark var dengang et WordPerfect-land - der blev solgt WP-bøger og kurser. WordPerfect Corp. satsede stærkt på OS/2 og f.eks. banker og mange financielle virksomheder skiftede selv på server-siden. Men hvad skete der? Microsoft skiftede forretningsstategi - på det tidspunkt kom Windows 3.0, og pludselig kunne alle WordPerfect-brugerne se deres erfaring gå tabt: WordPerfect kom ikke lige så hurtigt til Windows systemerne, som Word gjorde.</p>
<p>Et endnu værre eksempel ville være hvis leverandøren enten gik konkurs eller ikke længere ønskede at vedligeholde en bestemt programpakke. Eller at leverandøren ikke ønsker at bibeholde en - for dig - missionskritisk funktion.</p>
<p>Men hvis du har kildeteksten, dvs. benytter Open Source Software, kan du (evt. sammen med andre) fortsætte med at videreudvikle og vedligeholde programmet. Mange virksomheder har ikke resourcer til at rette en fejl i f.eks. Linux, men kan i den situation købe sig til en rettelse af et konsulentfirma. Det vil være kostbart, men endnu mere kostbart, hvis ikke fejlen blev rettet.</p>
<p>Elektronisk Dokument Udveksling (EDI), er et eksempel på en standard hvor åbenhed er en nødvendighed. Skal forskellige økonomisystemer kunne kommunikere med hinanden, må de forskellige producenter have fri adgang til standarderne. For brugerne af økonomisystemerne, har det den yderligere fordel, at de har mulighed for, at skifte til et andet system, når dette bliver nødvendigt for virksomheden.</p>
<p>Nu vil nogen sikkert mene, at deres virksomhed ikke er specielt IT-tung, og derfor er de ikke så sårbare overfor leverandørens luner. Dette er desværre nok ikke rigtigt; alle virksomheder er sårbare overfor deres leverandørers luner - og IT er hurtigt blevet en integreret del af alle moderne virksomheder. Det er vigtigt at huske på, at IT-verdenen er en verden, hvor udviklingen går meget stærkt, og netop derfor kan en leverandør skifte strategi med meget kort varsel.</p>
<h3 id="support">Support</h3>
<p>Ofte hører man indvendinger om at der ingen support er på Open Source Software. Hvor ringer man hen når systemet ikke virker som det skal?</p>
<p>For nogle år siden var der noget om snakken. Men i dag kan man sagtens betale sig til fuld support på Open Source software. De firmaer, der tilbyder support, ejer ikke softwaren - den er frit tilgængelig for alle. Men de har fuld adgang til kildeteksten, og kan derfor lige så godt løse kundens problemer, som hvis det var et kommercielt produkt de ydede support på. Måske endda bedre og hurtigere - måske er der andre, der allerede har løst problemet. Internettet bugner i dag af support information på Open Source Software. Support-leverandøren skal bare sørge for at løsningen kommer hurtigt ud til kunden. Og det er muligt for support-leverandøren at ansætte folk, som allerede kender til systemet, i stedet for at det tager evigheder at lære nye folk op.</p>
<h3 id="penge-og-open-source">Penge og Open Source</h3>
<p>Selvom størstedelen af dagens software udvikling foregår internt, er der alligevel en del virksomheder, der lever af at udvikle software og sælge det. Disse virksomheder behøver ikke at fortvivle fordi Open Source og gratis software vinder frem. Der er masser af måder at tjene penge på - men producenten skal forstå de ændrede vilkår for at kunne indse disse muligheder og udnytte dem optimalt.</p>
<p>Man kan godt tjene penge på at sælge Open Source software, selvom folk i princippet kunne få det gratis. Hvis man pakker det på en pæn måde, gør det nemt at installere, og laver en manual, er der mange, der vælger at betale for at få disse goder. Man kan yde support på nogle Open Source programmer, og det vil mange virksomheder gerne betale for. Træning og uddannelse i Open Source software er der bestemt mange penge at hente indenfor.</p>
<p>Der er også mulighed for at lave hardware og software kombinationer, hvor softwaren er Open Source og pengene tjenes på hardwaren. Det har en del fordele for producenten. Antallet af personer, som hjælper med softwareudviklingen (og ikke skal lønnes) vil være anseeligt hvis programmet er interessant, og der vi automatisk være mange, som sørger for en yderligere udbredelse af produktet - helt uden reklamekroner i ryggen. Modsat vil det være en vurdering, om man har forretningshemmeligheder i klemme i software-delen. Oftest er det dog stabilitet, som er i højsædet, og her kan fordelene ved Open Source ofte opveje ulemperne.</p>
<p>At afsætte udviklere til at arbejde på et Open Source projekt kan umiddelbart virke som en ren udgift. Men hvis dette danner grundlag for at virksomhedens closed source programmer kan overleve, eller vinde frem, er der pludselig en vis økonomisk fornuft i det. Den grundlæggende software kan være Open Source, tilgængelig for alle og klippestabil. Den mere specialiserede software kan forblive lukket. Netscape frigav deres browser som Open Source for at bevare grundlaget for deres server software.</p>
<h3 id="epilog">Epilog</h3>
<p>Vi er af den mening, at jo mere kritisk et program er for din virksomhed, jo vigtigere er, at du selv bestemmer programmets skæbne. Det vil sige, at software, der er kritisk for firmaers drift bør være Open Source Software.</p>
<p>Hvem skal bestemme fremtiden, dig eller din leverandør?</p>
<h3 id="relevante-links-for-at-læse-videre">Relevante links for at læse videre</h3>
<ul>
<li>Open Source - <a href="https://web.archive.org/web/19991009175004/http://www.opensource.dk/mirror">http://www.opensource.dk/mirror</a></li>
<li>Eric S. Raymond - <a href="https://web.archive.org/web/19991009175004/http://www.tuxedo.org/~esr/">http://www.tuxedo.org/~esr</a></li>
<li>The Cathedral and the Bazaar - <a href="https://web.archive.org/web/19991009175004/http://www.tuxedo.org/~esr/writings/cathedral-bazaar">http://www.tuxedo.org/~esr/writings/cathedral-bazaar</a></li>
<li>Homesteading the Noosphere - <a href="https://web.archive.org/web/19991009175004/http://www.tuxedo.org/~esr/writings/homesteading">http://www.tuxedo.org/~esr/writings/homesteading</a></li>
<li>Open Source artikel på dansk - <a href="https://web.archive.org/web/19991009175004/http://www.sslug.dk/artikler/OpenSource.html">http://www.sslug.dk/artikler/OpenSource.html</a></li>
</ul>
<h3 id="vi-takker">Vi takker</h3>
<ul>
<li>
<ol start="15">
<li>marts 1999: Katja Blankensteiner - en større revision af teksten.</li>
</ol>
</li>
<li>
<ol start="17">
<li>marts 1999: Torben Fjerdingstad - et par gode sproglige rettelser.</li>
</ol>
</li>
<li>
<ol start="18">
<li>marts 1999: Hans Schou - et par rigtig sunde tilføjelser.</li>
</ol>
</li>
<li>
<ol start="23">
<li>marts 1999: Hans Chr. Andersen - mere objektiv holdning i teksten.</li>
</ol>
</li>
</ul>
]]></description></item><item><title>Open Source</title><link>https://k.zigzak.net/posts/open-source/</link><pubDate>Wed, 09 Sep 1998 10:22:10 +0200</pubDate><guid>https://k.zigzak.net/posts/open-source/</guid><description><![CDATA[<h2 id="open-source-tm">Open Source (TM)</h2>
<h3 id="notes-in-english">Notes in English</h3>
<ul>
<li>Co-author: <a href="https://www.linkedin.com/in/petertoftdk/">Peter Toft</a></li>
<li>Published at sslug.dk</li>
</ul>
<h3 id="introduktion">Introduktion</h3>
<p>En af de mest spændende udviklinger på software fronten det sidste stykke tid er konceptet Open Source (TM), der dækker over frigivelse af kildeteksten til et program. Dette sker under en licens, der giver lov til at alle - uanset kulturelle og geografiske skel - må anvende og ændre kildekode efter behov, og derefter frit videregive den modificerede kode under samme licens.</p>
<h3 id="hvad-er-der-galt-med-free-software">Hvad er der galt med Free Software</h3>
<p>Nogle vil sige at indledningen ikke bringer noget nyt, idet vi førhen har man talt om frie programmer (free software og freeware). Problemet med disse betegnelser har affødt en del debat om hvad begreberne egentlig dækker over. Det har bestemt været et problem at der var flere betegnelser som næsten var det samme og det var ikke helt klart hvad der ligger i betegnelsen &ldquo;fri&rdquo;.</p>
<p>Er et program frit, hvis man kan få programmet uden at betale, men kun på binær form? Er det frit hvis man kan få kildeteksten, men ikke må ændre den og distribuere videre?</p>
<p>Nogle af de omtalte problemer ligger i selve ordet &ldquo;fri&rdquo; - på engelsk &ldquo;free&rdquo;. Det engelske ord har nemlig to betydninger; fri (som i frihed) og gratis. En stor fordel ved at opfinde et nyt samlende navn er at mange forretningsfolk langt nemmere kan acceptere selve navnet Open Source - fremfor begreber som indeholdt ordet free. Der ligger simpelthen en psykologisk barriere i selve navnet free. For os danskere er ordet &ldquo;fri&rdquo; mindre tvetydigt, men vi ser ofte, at ordet bliver forkert oversat (husk på den danske oversættelse af FN&rsquo;s menneskerettigheder, hvor der stå &ldquo;free education&rdquo; som i den danske oversættelse er blevet til &ldquo;gratis uddannelse&rdquo;).</p>
<p>For at en gang for alle at få et samlende navn med klar definition for anvendelsen blev konceptet Open Source (TM), registreret som et beskyttet navn, så grundlaget ikke kan anfægtes. På rekord tid er navnet Open Source (TM) blevet adopteret som et samlende navn alle accepterede. Naturligvis er licensen opbygget på en måde, der gør at alle kan anvende navnet Open Source (TM), uden afgift, blot det anvendes korrekt.</p>
<h3 id="hvorfor-udvikle-open-source-software">Hvorfor udvikle Open Source software</h3>
<p>I det følgende vil vi prøvet at se lidt på hvilke grunde der kan være til at frigive kildeteksten til sit program? Og hvilke implikationer har dette for fremtiden af det programmel man har eller vil udvikle. Endvidere kommer vi med et forslag til en ny udviklingsmodel, som i mange tilfælde vil betyde en ikke ubetydelig acceleration af udviklingsprocessen.</p>
<p>Først kan vi se på et firma med almindeligt hierarki i forhold til hacker-kulturen (positive programmører med trang til at lave de bedste programmer, hvilket ikke må at forveksle med crackere, som er destruktive personer). Hvis et firma ansætter dobbelt så mange personer vil deres produktivitet ikke stige til det dobbelte. Der skal et større antal personer i firmaet til at styre de små ting som følge af væksten er blevet større. Firmaerne skal også have ledere som ikke lave produktion eller udvikling osv. Hacker kulturen er traditionelt meget flad og ektremt levende. Det er helt klart en trend som vi vil se mere til. Et firma som Oticon har været med stort helt praktiseret den flade struktur i lang tid.</p>
<p>Firmaet skal markedsføre sine produkter og sørge for at de er nogenlunde up-to-date og lige præcis opfylder kundens forventninger. Ofte er kvalitet bestemt af en salgspris, og hvad markedet kan bære, fremfor at levere det bedste, der kan laves. Det er selvfølgelig groft simplificeret, men det er ofte meget sandt.</p>
<p>I Open Source samfundet arbejder man helt anderledes. Enhver kan komme med egne ideer for hvordan fremtiden skal udvikle sig, og fanger ideen an, så dannes grupper, som får udtænkt og udført programmeringsprojekter til gavn for os alle. Der er altså ingen reel global leder af projekterne som helhed, men ligesom i det vilde vesten er enhver sin egen herre og småsamfund dannes alt efter hvem der har lyst til at arbejde sammen. Umiddelbart lyder dette som det rene kaos, men det er en ny udviklingsstrategi som har sin styrke. Det er som fraktaler - et kaotisk system, men underligt nok der kan findes masser af orden og og system i det.</p>
<p>Den ultimative fordel med Open Source er at den sikrer aktivitet og fremdrift. Lederen af et projekt anerkendes for at få projektet til at gå fremad og at få det til at blive en succes i alles øjne. Oftest er lederen af et projekt den som har starten ideen, men man skal forstå at en person som Linus Torvalds som startede Linux projektet kun er lederen idag, fordi han til stadighed beviser, at han er den rigtige leder.</p>
<p>Haves en god ide, men projektet måske mangler en dynamisk leder vil andre med visioner gradvist tage over, og projektet vil gå videre. Og det skal understeges at Open Source er tæt knyttet til Internettets succes og kontaktformer, hvor antallet af aktive deltagere hastigt er på vej op.</p>
<p>Glosen &ldquo;den globale landsby&rdquo; er nu helt rigtig. De personer som deltager i et projekt vil ofte have helt anden kulturel baggrund end en selv, men kontakterne, diskussionerne og resultaterne er ofte spændende og ofte med en kvalitet som uden problemer kan leve op til kommerciel software. Specielt med hensyn til stabilitet er hacker samfundet alle firmaer overlegne. Generelt hjælper man hinanden og særligt svære problemer kan gå hen at blive til udfordringer som giver ære og anseelse til den som knækker nøden. Igen skal det bemærkes at disse måder at arbejde på ofte slet ikke tilfældet i et firma.</p>
<p>Ud over Internettets sammenbinding af folk så er der også et kulturelt mønster i det. Det er i høj grad fordi mange har en indtjening ved siden af og syner det er sjovt at deltage. Der er en form for gave-bytteri vi laver. Vil mange mennesker have din gave - dvs. dit programmel - som du præsenterer for dem, så stiger aktiviteten for projektet og antallet af aktive og positive tilbagemeldinger vil gøre, at det er sjovt og spændende at have delt ideen med alle andre.</p>
<h3 id="hvad-med-penge">Hvad med penge?</h3>
<p>Da Open Source gør, at man frigiver al information om programmet og at andre må arbejde videre med det efter behov, så melder spørgsmålet sig: ødelægger vi så ikke alle firmaer og de programmører, der vil tjene penge på det?</p>
<p>Svaret er &ldquo;Nok ikke&rdquo;. Det er oplagt at mange vil tage kildeteksten uden at betale, men det kan godt lade sig gøre at tjene penge på Open Source kode. Firmaer som RedHat, Cygnus, Cyclic og nu Netscape har frigivet programmel under Open Source og de kan godt tjene penge alligevel. For Netscape var situationen dog lidt speciel, på grund af hård konkurrence fra et firma, der hedder Microsoft.</p>
<h3 id="grunde-til-at-vælge-open-source">Grunde til at vælge Open Source</h3>
<ul>
<li><strong>En god ide.</strong> Man har en god projekt ide, men har ikke programmeringserfaringen eller kræfterne til at løfte projektet alene. I denne situation er Open Source helt perfekt. Man kan få dannet et projekt hold, hvis ideen kan bære. Så skal projektet laves med de regler som projektets deltagerne selv vælger.</li>
<li><strong>Jeg vil også give.</strong> Man har ideen og kræfterne til at lave et godt produkt, da kan man også med fordel anvende Open Source, men af forskellige grunde. Dels kan man få anseelse og respekt fra andre. Dels kan man have en holdning om at man gerne vil yde for og sammen med det fællesskab der er omkring Open Source. Man vil gerne give sit bidrag tilbage med tak for alt det man selv har fået.</li>
<li><strong>Outsourcing.</strong> Har man f.eks. i sit firma brug for produktet, som arbejdsredskab eller som fremtidssikring, da kan man drive et software projekt med meget få ressourcer for firmaet og store programmeringskræfter kan hentes gratis udefra.</li>
<li><strong>Markeds-taberen.</strong> Har man allerede er produkt, som er hårdt trængt økonomisk kan Open Source være det rigtige våben at vælge. Som godt eksempel kan nævnes Netscapes kamp mod Microsoft. Man kan ikke slå Microsoft, hvis man spiller efter de samme regler. Microsoft kan og vil dog ikke følge Open Source, hvorfor Netscape nu kan fortsætte dog med en helt ny strategi. Antallet af programmører, der anbejder på Netscape Communicator er kraftigt stigende på grund af adgang til kildeteksten og muligheden for at deltage i udviklingen. Det er nok ikke helt forkert at tro, at Netscape har skaffet sig 10 gange så mange reele programmører til projektet uden at skulle betale dem noget for det. Netscape kan så tjene på service, andre proodukter og de reklameindtægter de får ind på deres hjemmesider.</li>
<li><strong>Service firmaet.</strong> Har man et et godt produkt, kan man dele produktet op i en form, hvor man kan få det med Open Source og dermed sikre sig aktivitet og fremdrift, og dels i en del som er service og konfiguration for kunder. Som eksempel kan nævnes databaser. Et er købet af en database, men ofte er indtægterne fra service de vigtigste. Ydermere kan man forestille sig at service firmaet sælger konfiguration, så kunden kan få databasen og sælge eller anvende denne gratis, efter at service firmaet har sat den op med de poster og muligheder som kunden ønsker.</li>
<li><strong>Hardware fabrikanen.</strong> Et firma som laver hardware, f.eks. netkort, lydkort og grafikkort tjener penge på at sælge hardware og drivere er egentlig en afledt aktivitet. Folk køber selvfølgelig kombinationen, men tit vil det ikke være forbundet med et tab at lade driverne være på Open Source form, idet firmaet kan få rekruteret programmører til at forbedre drivere for Driver firmaet uden at det koster noget. For virksomheder, der får udviklet special-software af en leverandør, er der en risiko for, at leverandøren af den ene eller anden grund stopper udviklingen. Det kan være pga. manglende rentabilitet/ressourcer eller konkurs. Derfor er det vigtigt som kunde at have adgang til kildeteksten til den specielt-udviklede software, så man har mulighed for at hyre andre til at overtage udviklingen. Som kunde bør man derfor sikre sig, at man enten selv overtager copyright på det udviklede software, eller at softwaren bliver udviklet under Open Source.</li>
<li><strong>Missionskritisk software.</strong> Er den software man udvikler meget kritisk og kan de kritiske dele af softwaren sammensættes så det er af mere generel anvendelighed, så kan Open Source være det rigtige valg idet man kan få afprøvet programmellet af et meget stærkt hacker samfund. F.eks. har ESA og NASA sat fokus på Linux, pga. Linux&rsquo; meget høje driftsikkerhed og dets meget åbne og effektive møde, man i fællesskab løser fejl på.</li>
</ul>
<h3 id="linux-development-model">Linux Development Model</h3>
<p>Udviklingen af Linux kernen har vist os en hel ny møde at arbejde på. Vi vil her forsøge at skitsere den udviklingsmodel, som Linus Torvalds har benyttet (i begyndelsen ubevidst) i udviklingen af Linux.</p>
<ul>
<li>Find et problem, som interesser dig. Det er i virkligheden oplagt, idet man ved meget om det problem, som p.t. optager en, og man vil arbejde meget hårdere for at løse det.</li>
<li>Gode programmører ved hvad der skal skrives, mens de bedste ved hvad der skal omskrives og hvad der kan genbruges. Sagen er jo nemlig den, at der findes allerede store mangler af programmel, som kan næsten det, du står og mangler. Vi gør her dovenskaben til en dyd.</li>
<li>Når du mister interessen for dit projekt, skal du finde en, som vil overtage projektet. For at et projekt skal lykkes, og en løsning kan findes, kræver det, at du er meget engageret i projektet.</li>
<li>Behandl dine brugere som medudviklere. Medudviklere finder fejl, isolerer dem og finder på læsninger. Derved bliver fejlene fundet hurtigere. Man skal dog passe på; mange vil gerne hjælpe, siger de, men man skal ikke forvente at alle i virkeligheden gør det. Det er vigtigt at koordinatoren for projektet har adgang til et effektivt kommunikationsmedium, f.eks. Internettet.</li>
<li>Frigiv tidligt, frigiv ofte. Dog skal du altid første gang have en udgave, som har en vis funktionalitet, ellers er det umuligt at få andre med på vognen. Naturligvis vil tidlige udgaver indeholde mange fejl, men som nævnt tidligere vil fejlene hurtigt blive fundet. At frigive udgaver af programmellet sjældent har den psykologiske efftekt på brugerne, at de bliver mere skuffet, når de finder fejl. Et typisk tidsinterval mellem frigivelser er alt fra 1 dag til 6 uger. Det er en god idè at have to tråde af udvikling: en til de stabile udgaver og en til at afprøve de nye funktioner - dette anvendes ved udviklingen af Linux.</li>
<li>Vær andrig bange for at skære gamle funktioner og pensioneret kode væk. Det vil ofte give et simplere og mere effektivt program.</li>
</ul>
<p>Epilog: Denne artikel er i høj grad inspireret af Linux samfundets arbejdsmetoder og specielt Eric Raymonds teoretiske arbejder, der kan læses på <a href="https://web.archive.org/web/19991009185605/http://www.earthspace.net/~esr/">http://www.earthspace.net/~esr</a> og specifikt om Open Source på <a href="https://web.archive.org/web/19991009185605/http://www.opensource.org/">http://www.opensource.org</a>.</p>
<p>Det er oplagt at Open Source bryder med mange kendte udviklings strategier, men der er helt oplagt at nutiden og fremtiden er ved at vise styrken i det.</p>
]]></description></item></channel></rss>