<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>MartinsM - Personal blog</title><link href="http://mednis.info/" rel="alternate"></link><link href="http://mednis.info/feeds/all.atom.xml" rel="self"></link><id>http://mednis.info/</id><updated>2016-02-06T16:00:00+02:00</updated><entry><title>How to install COBRApy in Lubuntu 15.10</title><link href="http://mednis.info/how-to-install-cobrapy-in-lubuntu-1510.html" rel="alternate"></link><updated>2016-02-06T16:00:00+02:00</updated><author><name>MartinsM</name></author><id>tag:mednis.info,2016-02-06:how-to-install-cobrapy-in-lubuntu-1510.html</id><summary type="html">&lt;div class="highlight"&gt;&lt;pre&gt;sudo su
aptitude install python-pip
aptitude install python-dev
&lt;/pre&gt;&lt;/div&gt;


&lt;h2&gt;Install libSBML&lt;/h2&gt;
&lt;p&gt;The next step failed for me, but one can try:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;pip install python-libsbml
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;This method worked for me:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;sh -c &lt;span class="s2"&gt;&amp;quot;echo &amp;#39;deb http://download.opensuse.org/repositories/home:/fbergman:/libsbml/xUbuntu_15.10/ /&amp;#39; &amp;gt;&amp;gt; /etc/apt/sources.list.d/python-libsbml.list&amp;quot;&lt;/span&gt;
apt-get update
apt-get install python-libsbml
&lt;/pre&gt;&lt;/div&gt;


&lt;h2&gt;Install COBRApy dependencies&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;apt-get install python-glpk
apt-get install python-numpy
apt-get install python-scipy
apt-get install glpk-utils
apt-get install libglpk-dev
&lt;/pre&gt;&lt;/div&gt;


&lt;h2&gt;Install COBRApy&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;pip install cobra
apt-get install ipython
&lt;/pre&gt;&lt;/div&gt;


&lt;h2&gt;Test COBRApy&lt;/h2&gt;
&lt;p&gt;In python console run:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;cobra.test&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;test_all&lt;/span&gt;
&lt;span class="n"&gt;test_all&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;Ran&lt;/span&gt; &lt;span class="mi"&gt;83&lt;/span&gt; &lt;span class="n"&gt;tests&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="mf"&gt;66.987&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;
&lt;span class="n"&gt;OK&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;skipped&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;As it is noted in the title these instructions work on Ubuntu. Unfortunately I couldn't get COBRApy to pass tests on Fedora 23 because it can't locate glpk. Any help in comments is appreciated.&lt;/p&gt;</summary><category term="Ubuntu"></category><category term="COBRA"></category></entry><entry><title>Python Pandas reindex and new index</title><link href="http://mednis.info/python-pandas-reindex-and-new-index.html" rel="alternate"></link><updated>2016-01-19T00:55:00+02:00</updated><author><name>MartinsM</name></author><id>tag:mednis.info,2016-01-19:python-pandas-reindex-and-new-index.html</id><summary type="html">&lt;p&gt;The answer comes from &lt;a href="http://stackoverflow.com/questions/10943478/pandas-reindex-dataframe-with-datetime-objects#10943545"&gt;stackoverflow.com&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;So if you have a DataFrame with index &lt;strong&gt;[0, 1, 2]&lt;/strong&gt;, then doing a &lt;strong&gt;reindex([2, 1, 0])&lt;/strong&gt; will return the rows in reverse order. Doing something like &lt;strong&gt;reindex([8, 9, 10])&lt;/strong&gt; does not make a new index for the rows; rather, it will return a DataFrame with NaN values, since there are no rows with indices 8, 9, or 10.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;To generate new index for existing rows try this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;index&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;</summary><category term="Python"></category><category term="Pandas"></category></entry><entry><title>How to manage printers in Fedora</title><link href="http://mednis.info/how-to-manage-printers-in-fedora.html" rel="alternate"></link><updated>2016-01-15T09:00:00+02:00</updated><author><name>MartinsM</name></author><id>tag:mednis.info,2016-01-15:how-to-manage-printers-in-fedora.html</id><summary type="html">&lt;p&gt;In browser open &lt;strong&gt;http://localhost:631&lt;/strong&gt;&lt;/p&gt;</summary><category term="Fedora"></category></entry><entry><title>Fedora 23 long boot time</title><link href="http://mednis.info/fedora-23-long-boot-time.html" rel="alternate"></link><updated>2016-01-11T18:00:00+02:00</updated><author><name>MartinsM</name></author><id>tag:mednis.info,2016-01-11:fedora-23-long-boot-time.html</id><summary type="html">&lt;p&gt;First rows of &lt;strong&gt;systemd-analyze blame&lt;/strong&gt; reveal that &lt;em&gt;mlocate-updatedb.service&lt;/em&gt; takes more than one minute during boot process:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;1min 34.881s mlocate-updatedb.service
1min 13.159s plymouth-quit-wait.service
     13.293s firewalld.service
      8.945s dev-sda5.device
      8.904s systemd-udev-settle.service
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;I found the solution on &lt;a href="http://unix.stackexchange.com/questions/113670/can-i-just-disable-updatedb"&gt;stackexchange.com&lt;/a&gt;. The first answer by &lt;a href="http://unix.stackexchange.com/users/7453/slm"&gt;slm&lt;/a&gt; suggests to simply remove &lt;em&gt;mlocate&lt;/em&gt;. Quoting the answer:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;First find out where the program is located on disk.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;type &lt;/span&gt;updatedb
updatedb is /usr/bin/updatedb
&lt;/pre&gt;&lt;/div&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Next find out what package provides &lt;em&gt;updatedb&lt;/em&gt;.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;rpm -qf /usr/bin/updatedb
mlocate-0.26-3.fc19.x86_64
&lt;/pre&gt;&lt;/div&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;See if anything requires &lt;em&gt;mlocate&lt;/em&gt;.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;rpm -q --whatrequires mlocate
no package requires mlocate
&lt;/pre&gt;&lt;/div&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Nothing requires it so you can remove the package.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;dnf remove mlocate
&lt;/pre&gt;&lt;/div&gt;


&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I followed the instructions and now my Fedora 23 boots faster:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;21.899s plymouth-quit-wait.service
10.138s systemd-udev-settle.service
 7.866s dev-sda5.device
 5.571s firewalld.service
 4.935s systemd-journald.service
&lt;/pre&gt;&lt;/div&gt;</summary><category term="Fedora"></category></entry><entry><title>How to install LaTeX and XeLaTeX in Fedora 23</title><link href="http://mednis.info/how-to-install-latex-and-xelatex-in-fedora-23.html" rel="alternate"></link><updated>2016-01-10T18:00:00+02:00</updated><author><name>MartinsM</name></author><id>tag:mednis.info,2016-01-10:how-to-install-latex-and-xelatex-in-fedora-23.html</id><summary type="html">&lt;p&gt;XeLaTeX requires a number packages. First become root, then run this command:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;dnf -y install texlive
    texlive-latex
    texlive-xetex
    texlive-collection-latex
    texlive-collection-latexrecommended
    texlive-xetex-def
    texlive-collection-xetex
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Total download size: 182 M&lt;/p&gt;
&lt;p&gt;Installed size: 307 M&lt;/p&gt;
&lt;p&gt;Only if needed:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;dnf -y install texlive-collection-latexextra
&lt;/pre&gt;&lt;/div&gt;</summary><category term="Fedora"></category><category term="Latex"></category></entry><entry><title>Use gi.require_version('Gtk', '3.0') before import</title><link href="http://mednis.info/use-girequire_versiongtk-30-before-import.html" rel="alternate"></link><updated>2015-12-21T09:30:00+02:00</updated><author><name>MartinsM</name></author><id>tag:mednis.info,2015-12-21:use-girequire_versiongtk-30-before-import.html</id><summary type="html">&lt;p&gt;On recent Fedora importing Gtk the following way&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;gi.repository&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Gtk&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;gives the following error:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;./hclean.py:27: PyGIWarning: Gtk was imported without specifying a version first.
Use gi.require_version&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Gtk&amp;#39;&lt;/span&gt;, &lt;span class="s1"&gt;&amp;#39;3.0&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; before import to ensure that the right version gets loaded.
from gi.repository import Gtk
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;The error is fixed by requiring the Gtk version:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;gi&lt;/span&gt;
&lt;span class="n"&gt;gi&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;require_version&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;Gtk&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;&amp;quot;3.0&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;gi.repository&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Gtk&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Now the program starts without errors.&lt;/p&gt;
&lt;p&gt;Solution found on &lt;a href="http://www.programcreek.com/python/example/72048/gi.require_version"&gt;programcreek.com&lt;/a&gt;.&lt;/p&gt;</summary><category term="python"></category><category term="Gtk"></category></entry><entry><title>How to disable SElinux on Fedora 23</title><link href="http://mednis.info/how-to-disable-selinux-on-fedora-23.html" rel="alternate"></link><updated>2015-12-15T10:00:00+02:00</updated><author><name>MartinsM</name></author><id>tag:mednis.info,2015-12-15:how-to-disable-selinux-on-fedora-23.html</id><summary type="html">&lt;p&gt;Use the &lt;strong&gt;getenforce&lt;/strong&gt; or &lt;strong&gt;sestatus&lt;/strong&gt; commands to check the status of SELinux.&lt;/p&gt;
&lt;p&gt;On systems with SELinux disabled, the SELINUX=disabled option is configured in /etc/selinux/config&lt;/p&gt;
&lt;p&gt;As root open the file &lt;strong&gt;/etc/selinux/config&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;su -
gedit /etc/selinux/config
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;img alt="SElinux config file" src="http://mednis.info/images/2015-12-15_how-to-disable-selinux-on-fedora23/selinux_config.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;Change the line &lt;strong&gt;SELINUX=enforcing&lt;/strong&gt; to &lt;strong&gt;SELINUX=disabled&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Reboot your system. After reboot, confirm that the &lt;strong&gt;getenforce&lt;/strong&gt; command returns &lt;strong&gt;Disabled&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Sources:
&lt;a href="https://docs.fedoraproject.org/en-US/Fedora/22/html/SELinux_Users_and_Administrators_Guide/sect-Security-Enhanced_Linux-Working_with_SELinux-Enabling_and_Disabling_SELinux.html"&gt;docs.fedoraproject.org&lt;/a&gt;.&lt;/p&gt;</summary><category term="Fedora"></category><category term="SElinux"></category></entry><entry><title>Things to do after fresh Fedora 23 installation</title><link href="http://mednis.info/things-to-do-after-fresh-fedora-23-installation.html" rel="alternate"></link><updated>2015-12-02T13:51:00+02:00</updated><author><name>MartinsM</name></author><id>tag:mednis.info,2015-12-02:things-to-do-after-fresh-fedora-23-installation.html</id><summary type="html">&lt;p&gt;Become root and run update&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;su -
dnf update
&lt;/pre&gt;&lt;/div&gt;


&lt;h2&gt;RPM Fusion repository&lt;/h2&gt;
&lt;p&gt;&lt;a href="http://rpmfusion.org/Configuration"&gt;http://rpmfusion.org/Configuration&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Install the missing software&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;dnf install gnome-tweak-tool gimp inkscape thunderbird bluefish filezilla vlc python-openoffice epiphany

dnf install VirtualBox
dnf install dconf-editor
&lt;/pre&gt;&lt;/div&gt;


&lt;h2&gt;Software for development&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;dnf groupinstall &amp;quot;Development Tools&amp;quot;
&lt;/pre&gt;&lt;/div&gt;


&lt;h2&gt;Scientific software&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;dnf install numpy scipy python-matplotlib python-pandas python-ipython
&lt;/pre&gt;&lt;/div&gt;


&lt;h2&gt;Upgrade SciPy&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;dnf install python-pip blas-devel lapack-devel gcc-c++ rpm-build
dnf groupinstall &amp;quot;Development Tools&amp;quot;
pip install --upgrade scipy
&lt;/pre&gt;&lt;/div&gt;


&lt;h2&gt;Install scikit-learn&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;pip install -U scikit-learn
&lt;/pre&gt;&lt;/div&gt;</summary><category term="Fedora"></category><category term="After install"></category></entry><entry><title>How to upgrade SciPy on Fedora 23</title><link href="http://mednis.info/how-to-upgrade-scipy-on-fedora-23.html" rel="alternate"></link><updated>2015-10-19T12:58:00+03:00</updated><author><name>MartinsM</name></author><id>tag:mednis.info,2015-10-19:how-to-upgrade-scipy-on-fedora-23.html</id><summary type="html">&lt;p&gt;As it was with Fedora 22, the Fedora 23 still ships with SciPy version 0.14.1. To upgrade SciPy please run the following commands as root:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;dnf install python-pip
dnf install blas-devel
dnf install lapack-devel
dnf install gcc-c++
dnf groupinstall &amp;quot;Development Tools&amp;quot;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;If you now try to upgrade scipy you will get the following error&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;g++: error: /usr/lib/rpm/redhat/redhat-hardened-cc1: No such file or directory
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;On Fedora 23 one has also to install rpm-build to avoid errors during compilation of scipy:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;dnf search rpm-build
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Finally uninstall scipy 0.14.1, download 0.16.0, compile it and install. All with the following command:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;pip install --upgrade scipy
&lt;/pre&gt;&lt;/div&gt;</summary><category term="Fedora"></category><category term="SciPy"></category></entry><entry><title>How to play encrypted DVDs on Fedora 22</title><link href="http://mednis.info/how-to-play-encrypted-dvds-on-fedora-22.html" rel="alternate"></link><updated>2015-09-08T19:27:00+03:00</updated><author><name>MartinsM</name></author><id>tag:mednis.info,2015-09-08:how-to-play-encrypted-dvds-on-fedora-22.html</id><summary type="html">&lt;p&gt;Solution found here: &lt;a href="http://forums.fedoraforum.org/showthread.php?t=304745"&gt;http://forums.fedoraforum.org/showthread.php?t=304745&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;First become root:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;su -
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Then execute these 7 commands:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;dnf install dh-autoreconf
git clone git://git.videolan.org/libdvdcss
cd libdvdcss/
autoreconf -i
./configure --prefix=/usr
make
make install
&lt;/pre&gt;&lt;/div&gt;</summary><category term="Fedora"></category></entry><entry><title>LibreOffice: Readonly content cannot be changed</title><link href="http://mednis.info/libreoffice-readonly-content-cannot-be-changed.html" rel="alternate"></link><updated>2013-09-19T10:41:00+03:00</updated><author><name>MartinsM</name></author><id>tag:mednis.info,2013-09-19:libreoffice-readonly-content-cannot-be-changed.html</id><summary type="html">&lt;p&gt;By default Libre/Open Office will not allow you to delete form fields in Microsoft &lt;em&gt;.doc&lt;/em&gt; or &lt;em&gt;.docx&lt;/em&gt; files. When you try to get rid of form fields, you will get an error message like one below.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Readonly content cannot be changed" src="http://mednis.info/images/2013-09-19_libreoffice_readonly_content/libre_office_readonly.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;People have been annoyed (including me) about this anti feature of protecting MS Word documents since the early versions of OpenOffice.org. Many internet forums and discussions advise to check filesystem permissions or to enable document editing using "Edit File" button.&lt;/p&gt;
&lt;p&gt;&lt;img alt="File Edit button" src="http://mednis.info/images/2013-09-19_libreoffice_readonly_content/libre_office_edit_document.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;However, the problem is not with editing the text. It is possible to change formatting, add &amp;amp; delete texts unless you try to mess with form elements. Input fields can not be moved, resized or deleted. Try to select and delete a checkbox or input field and you will get the infamous "Readonly content cannot be changed" error box. Also, enabling Form Controls doesn't help.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The solution&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="Formatting Aids" src="http://mednis.info/images/2013-09-19_libreoffice_readonly_content/libre_office_formatting_aid.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;The solution is called "Cursor in Protected areas" and is hidden in "Formatting Aids" options.
Go to Main menu -&amp;gt; Tools -&amp;gt; Options.&lt;/p&gt;
&lt;p&gt;Under &lt;em&gt;LibreOffice.org Writer&lt;/em&gt;, choose "Formatting Aids" and uncheck the "enable" box for "Cursor in Protected areas".
Once you do that, you will be able to delete form fields.&lt;/p&gt;
&lt;p&gt;Solution found in: &lt;a href="http://prajapatinilesh.wordpress.com/2008/02/25/open-office-is-not-allowing-us-to-change-the-content/"&gt;Nilesh Prajapati's blog&lt;/a&gt;.
Read also &lt;a title="Mendeley’s LibreOffice Plugin not working in Fedora 18" href="http://mednis.info/wp/?p=80"&gt;how to fix Mendeley plugin for LibreOffice&lt;/a&gt;.&lt;/p&gt;</summary><category term="LibreOffice"></category></entry><entry><title>Using Android phone without Google account</title><link href="http://mednis.info/using-android-phone-without-google-account.html" rel="alternate"></link><updated>2013-09-16T11:31:00+03:00</updated><author><name>MartinsM</name></author><id>tag:mednis.info,2013-09-16:using-android-phone-without-google-account.html</id><summary type="html">&lt;p&gt;If you have ever wondered how usable Android phone is without having Google account, most probably you have already discovered the ugly truth - Android phone is a trap. There is no visible chance to have a &lt;em&gt;smartphone&lt;/em&gt; (with apps and so on) without having Gmail account. Majority of &lt;em&gt;Alternative Markets&lt;/em&gt;, like GetJar, are available only from Google Play.
Sadly, most developers publish their Android apps only in Play store. You can't download or buy their apps from developers websites. You can't even download APK files to your computer using fake gmail account. And when you give up and enter your Gmail credentials in your Android phone there is no turning back - you can't just disconnect your phone from Google.&lt;/p&gt;
&lt;p&gt;In this article I share my experience and guidelines on using Android phone avoiding Google Play store.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step one&lt;/strong&gt; (reinstall)
Root your phone and get rid of the original firmware! I would recommend to install the fully free Android distribution Replicant from &lt;a href="http://replicant.us/" target="_blank"&gt;replicant.us&lt;/a&gt;. However the list of devices they support is quite short. My HTC Desire is not among supported devices so I have not tried it. For the rest there is &lt;a href="http://www.cyanogenmod.org/" target="_blank"&gt;Cyanogenmod&lt;/a&gt; which provides firmware from many Android phones, including my HTC Desire.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step two&lt;/strong&gt; (don't spoil it)
On Cyanogenmod (and any new Android phone) during the first bootup, you will be asked to enter Gmail credentials. NEVER EVER do it. Do not enter false email, just skip the process. Earlier releases of Cyanogenmod shipped without Google-essential apps, and if one wanted them there was a method how to install them. The latest Cyanogenmod ships with built in GMail, Market, Talk, Google search and Car Home. It is impossible to uninstall these apps. The only thing you can do is to never configure your gmail account in your phone.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step three&lt;/strong&gt; (install apps)
Using computer or the built-in web browser go to &lt;a href="https://f-droid.org/" target="_blank"&gt;f-droid.org&lt;/a&gt;. Download and install F-Droid. It is a market-like app containing only free, open source Android apps.
Here is the list of apps that I have found to be useful:
&lt;ul&gt;
&lt;li&gt;Web browser  &lt;strong&gt;&lt;a href="https://f-droid.org/repository/browse/?fdid=org.zirco"&gt;Zirco&lt;/a&gt;&lt;/strong&gt; (because you can't trust the built-in browser);&lt;/li&gt;
&lt;li&gt;Firewall &lt;strong&gt;&lt;a href="https://f-droid.org/repository/browse/?fdid=com.googlecode.droidwall"&gt;DroidWall&lt;/a&gt;&lt;/strong&gt;. There is also the newer AFWall+ which is based on DroidWall but it was not working on my phone;&lt;/li&gt;
&lt;li&gt;Maps &amp;amp; Navigation app &lt;strong&gt;&lt;a href="https://f-droid.org/repository/browse/?fdid=net.osmand.plus"&gt;OsmAnd&lt;/a&gt;&lt;/strong&gt;. You can get the latest version from their own &lt;a href="http://download.osmand.net/releases/" target="_blank"&gt;server&lt;/a&gt;, but it is also on F-Droid;&lt;/li&gt;
&lt;li&gt;RSS reader &lt;strong&gt;&lt;a href="https://f-droid.org/repository/browse/?fdid=de.shandschuh.sparserss"&gt;Sparse rss&lt;/a&gt;&lt;/strong&gt;;&lt;/li&gt;
&lt;li&gt;GPS tracking app &lt;a href="https://f-droid.org/repository/browse/?fdid=com.aripuca.tracker" target="_blank"&gt;Aripuca GPS Tracker&lt;/a&gt;. This is the only GPS tracking app that works properly on my phone and is available outside of Google PLay. I have also tried GPSLogger and OSMTracker, but no luck with them (keeps crashing and rebooting my phone after several minutes of working);&lt;/li&gt;
&lt;li&gt;Tor (anonymity) client &lt;a href="https://f-droid.org/repository/browse/?fdid=org.torproject.android" target="_blank"&gt;Orbot&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;File synchronization &lt;strong&gt;&lt;a href="https://f-droid.org/repository/browse/?fdid=com.owncloud.android"&gt;ownCloud&lt;/a&gt;&lt;/strong&gt;. On Google Play you have to pay for this app. In F-Droid it is for free;&lt;/li&gt;
&lt;/ul&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What is not working&lt;/strong&gt;
I still have not found a solution to synchronize phone address book and calendar with my ownCloud server.&lt;/p&gt;</summary><category term="android"></category><category term="google"></category></entry><entry><title>htaccess allow IP addresses</title><link href="http://mednis.info/htaccess-allow-ip-addresses.html" rel="alternate"></link><updated>2013-09-10T15:52:00+03:00</updated><author><name>MartinsM</name></author><id>tag:mednis.info,2013-09-10:htaccess-allow-ip-addresses.html</id><summary type="html">&lt;p&gt;If your website is under construction, you can simply edit .htaccess file to disallow visits to your website.
Here is the code :&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&amp;amp;lt;Limit GET POST PUT&amp;amp;gt;
order deny,allow
deny from all
allow from 12.245.67.190
&amp;amp;lt;/Limit&amp;amp;gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;allow from 12.245.67.190&lt;/strong&gt; command allows access to your server only from 12.245.67.190 IP address.&lt;/p&gt;
&lt;p&gt;You can allow more IP’s to access your website :
&lt;code&gt;&amp;lt;Limit GET POST PUT&amp;gt;
order deny,allow
deny from all
allow from 12.245.67.190
allow from 12.245.67.192
&amp;lt;/Limit&amp;gt;&lt;/code&gt;
This practice is good in case you are modifying your website (performing a new joomla installation) and don’t want others to see the process.&lt;/p&gt;
&lt;p&gt;Original source: &lt;a href="http://htaccessfile.com/htaccess-allow-ip-addresses" title="http://htaccessfile.com/htaccess-allow-ip-addresses"&gt;http://htaccessfile.com/htaccess-allow-ip-addresses&lt;/a&gt;&lt;/p&gt;</summary><category term="web"></category></entry><entry><title>Running Mendeley Desktop in Fedora 19</title><link href="http://mednis.info/running-mendeley-desktop-in-fedora-19.html" rel="alternate"></link><updated>2013-09-05T11:26:00+03:00</updated><author><name>MartinsM</name></author><id>tag:mednis.info,2013-09-05:running-mendeley-desktop-in-fedora-19.html</id><summary type="html">&lt;p&gt;By default Mendeley Desktop refuses to work. For me the solution was to install QtWebKit and QtSvg packages.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;yum -y install qtwebkit
yum -y install qt5-qtsvg
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;See also &lt;a href="http://mednis.info/mendeleys-libreoffice-plugin.html"&gt;how to fix Mendeley’s LibreOffice Plugin&lt;/a&gt;.&lt;/p&gt;</summary><category term="Fedora"></category></entry><entry><title>How to add manual entries to Gnome Shell Launcher</title><link href="http://mednis.info/how-to-add-manual-entries-to-gnome-shell-launcher.html" rel="alternate"></link><updated>2013-06-01T14:45:00+03:00</updated><author><name>MartinsM</name></author><id>tag:mednis.info,2013-06-01:how-to-add-manual-entries-to-gnome-shell-launcher.html</id><summary type="html">&lt;p&gt;With gnome-shell, you'll need to create a .desktop file in '~/.local/share/applications/' which will then allow you to add the application to the gnome-shell dash.&lt;/p&gt;
&lt;p&gt;My .desktop file for Sublime Text looks like this:&lt;/p&gt;
&lt;table class="highlighttable"&gt;&lt;tr&gt;&lt;td class="linenos"&gt;&lt;div class="linenodiv"&gt;&lt;pre&gt; 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21&lt;/pre&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class="code"&gt;&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="cp"&gt;#!/usr/bin/env xdg-open&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Desktop&lt;/span&gt; &lt;span class="n"&gt;Entry&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;Version&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;1.0&lt;/span&gt;
&lt;span class="n"&gt;Type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;Application&lt;/span&gt;
&lt;span class="n"&gt;Name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;Sublime&lt;/span&gt; &lt;span class="n"&gt;Text&lt;/span&gt;
&lt;span class="n"&gt;GenericName&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;Text&lt;/span&gt; &lt;span class="n"&gt;Editor&lt;/span&gt;
&lt;span class="n"&gt;Comment&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;Sophisticated&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="n"&gt;editor&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;code&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;markup&lt;/span&gt; &lt;span class="n"&gt;and&lt;/span&gt; &lt;span class="n"&gt;prose&lt;/span&gt;
&lt;span class="cp"&gt;#Exec=/opt/sublime_text/sublime_text %F&lt;/span&gt;
&lt;span class="n"&gt;Exec&lt;/span&gt;&lt;span class="o"&gt;=/&lt;/span&gt;&lt;span class="n"&gt;home&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;workspace&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;sublime_text_3&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;sublime_text&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="n"&gt;F&lt;/span&gt;
&lt;span class="n"&gt;Terminal&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;false&lt;/span&gt;
&lt;span class="n"&gt;MimeType&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;plain&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;Icon&lt;/span&gt;&lt;span class="o"&gt;=/&lt;/span&gt;&lt;span class="n"&gt;home&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;workspace&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;sublime_text_3&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;Icon&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;48&lt;/span&gt;&lt;span class="n"&gt;x48&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;sublime&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;png&lt;/span&gt;
&lt;span class="n"&gt;Categories&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;TextEditor&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="n"&gt;Development&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;StartupNotify&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;true&lt;/span&gt;
&lt;span class="n"&gt;Actions&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;Window&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="n"&gt;Document&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Desktop&lt;/span&gt; &lt;span class="n"&gt;Action&lt;/span&gt; &lt;span class="n"&gt;Window&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;Name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;New&lt;/span&gt; &lt;span class="n"&gt;Window&lt;/span&gt;
&lt;span class="n"&gt;Exec&lt;/span&gt;&lt;span class="o"&gt;=/&lt;/span&gt;&lt;span class="n"&gt;home&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;workspace&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;sublime_text_3&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;sublime_text&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Desktop&lt;/span&gt; &lt;span class="n"&gt;Action&lt;/span&gt; &lt;span class="n"&gt;Document&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;Name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;New&lt;/span&gt; &lt;span class="n"&gt;File&lt;/span&gt;
&lt;span class="n"&gt;Exec&lt;/span&gt;&lt;span class="o"&gt;=/&lt;/span&gt;&lt;span class="n"&gt;home&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;workspace&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;sublime_text_3&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;sublime_text&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;command&lt;/span&gt; &lt;span class="n"&gt;new_file&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;

&lt;p&gt;Original source &lt;a title="linuxquestions.org" href="https://www.linuxquestions.org/questions/showthread.php?s=f8f1ededac4451385d6be370aec13d73&amp;amp;p=4350120#post4350120"&gt;here&lt;/a&gt;.&lt;/p&gt;</summary><category term="Gnome"></category></entry><entry><title>How to download a complete website</title><link href="http://mednis.info/how-to-download-a-complete-website.html" rel="alternate"></link><updated>2013-05-28T09:43:00+03:00</updated><author><name>MartinsM</name></author><id>tag:mednis.info,2013-05-28:how-to-download-a-complete-website.html</id><summary type="html">&lt;p&gt;If you ever need to download an entire Web site, wget can do the job:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;wget \
     --recursive \
     --no-clobber \
     --page-requisites \
     --adjust-extension \
     --convert-links \
     --restrict-file-names=windows \
     --domains example.com \
     --no-parent http://example.com.lv/thefolder/
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;The options are:
&lt;code&gt;--recursive&lt;/code&gt;download the entire Web site.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;--domains example.com&lt;/code&gt; don't follow links outside example.com.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;--no-parent&lt;/code&gt; don't follow links outside the directory thefolder/.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;--page-requisites&lt;/code&gt; get all the elements that compose the page (images, CSS and so on).&lt;/p&gt;
&lt;p&gt;&lt;code&gt;--html-extension&lt;/code&gt; save files with the .html extension.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;--convert-links&lt;/code&gt; convert links so that they work locally, off-line.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;--restrict-file-names=windows&lt;/code&gt; modify filenames so that they will work in Windows as well.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;--no-clobber&lt;/code&gt; don't overwrite any existing files (used in case the download is interrupted and resumed).&lt;/p&gt;
&lt;p&gt;Also note that in wget 1.12, –html-extension is renamed to –adjust-extension&lt;/p&gt;
&lt;p&gt;The orignal resource: &lt;a href="http://www.linuxjournal.com/content/downloading-entire-web-site-wget" title="http://www.linuxjournal.com/content/downloading-entire-web-site-wget" target="_blank"&gt;http://www.linuxjournal.com/...&lt;/a&gt;&lt;/p&gt;</summary><category term="web"></category></entry><entry><title>Mendeley's LibreOffice Plugin</title><link href="http://mednis.info/mendeleys-libreoffice-plugin.html" rel="alternate"></link><updated>2013-05-14T22:29:00+03:00</updated><author><name>MartinsM</name></author><id>tag:mednis.info,2013-05-14:mendeleys-libreoffice-plugin.html</id><summary type="html">&lt;p&gt;Got this error:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sun&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;lang&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;DisposedException&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{{{&lt;/span&gt;&lt;span class="n"&gt;Message&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;Binary URP bridge disposed during call&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Context&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sun&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;star&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;uno&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XInterface&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mf"&gt;@7f&lt;/span&gt;&lt;span class="mi"&gt;9191447838&lt;/span&gt;&lt;span class="p"&gt;}}}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;I solved this by installing Python support for LibreOffice.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;yum install python-openoffice
&lt;/pre&gt;&lt;/div&gt;</summary><category term="LibreOffice"></category><category term="Fedora"></category></entry><entry><title>gtk import Segmentation fault</title><link href="http://mednis.info/gtk-import-segmentation-fault.html" rel="alternate"></link><updated>2013-04-30T17:19:00+03:00</updated><author><name>MartinsM</name></author><id>tag:mednis.info,2013-04-30:gtk-import-segmentation-fault.html</id><summary type="html">&lt;p&gt;When I tried to run my program (&lt;a href="http://biosystems.lv/moderator2/" title="ModeRator - The Model Comparator"&gt;ModeRator&lt;/a&gt;) I get this error:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;usr&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;lib64&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;python2&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;site&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;packages&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;gobject&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;constants&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;py&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;24&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="ne"&gt;Warning&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;g_boxed_type_register_static&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;assertion&lt;/span&gt; &lt;span class="err"&gt;`&lt;/span&gt;&lt;span class="n"&gt;g_type_from_name&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="s"&gt;&amp;#39; failed&lt;/span&gt;
  &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;gobject._gobject&lt;/span&gt;
&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;usr&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;lib64&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;python2&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;site&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;packages&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;gtk&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;2.0&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;gtk&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;__init__&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;py&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="ne"&gt;Warning&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;specified&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;size&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="nb"&gt;type&lt;/span&gt; &lt;span class="sb"&gt;`PyGtkGenericCellRenderer&amp;#39; is smaller than the parent type&amp;#39;s `&lt;/span&gt;&lt;span class="n"&gt;GtkCellRenderer&lt;/span&gt;&lt;span class="s"&gt;&amp;#39; class size&lt;/span&gt;
  &lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;gtk&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;_gtk&lt;/span&gt;
&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;usr&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;lib64&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;python2&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;site&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;packages&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;gtk&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;2.0&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;gtk&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;__init__&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;py&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="ne"&gt;Warning&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;g_type_get_qdata&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;assertion&lt;/span&gt; &lt;span class="err"&gt;`&lt;/span&gt;&lt;span class="n"&gt;node&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;NULL&lt;/span&gt;&lt;span class="s"&gt;&amp;#39; failed&lt;/span&gt;
  &lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;gtk&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;_gtk&lt;/span&gt;
&lt;span class="n"&gt;Segmentation&lt;/span&gt; &lt;span class="n"&gt;fault&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;core&lt;/span&gt; &lt;span class="n"&gt;dumped&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;I 'fixed' the problem by disabling the import of matplotlib&lt;/p&gt;
&lt;p&gt;It turns out that it is possible to import only one of them:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;gi.repository&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;GObject&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Gtk&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;or&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;matplotlib.pyplot&lt;/span&gt; &lt;span class="kn"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;plt&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Comment out one of these lines end the error is gone!
Better explanation of problems like this is found here: &lt;a href="http://blog.rabbitvcs.org/archives/312"&gt;http://blog.rabbitvcs.org/archives/312&lt;/a&gt;.&lt;/p&gt;</summary><category term="Gtk"></category><category term="matplotlib"></category></entry><entry><title>Gtk color names</title><link href="http://mednis.info/gtk-color-names.html" rel="alternate"></link><updated>2013-04-16T21:17:00+03:00</updated><author><name>MartinsM</name></author><id>tag:mednis.info,2013-04-16:gtk-color-names.html</id><summary type="html">&lt;p&gt;To use color names (not codes or objects) in Gtk GUI applications, one have use X11 color names.&lt;/p&gt;
&lt;p&gt;There is no dedicated list of Gtk/Gdk/Gnome color names. GTK is using X11 color names.&lt;/p&gt;</summary><category term="Python"></category><category term="SBML"></category></entry><entry><title>Enable Dell Latitude WiFi on Debian</title><link href="http://mednis.info/enable-dell-latitude-wifi-on-debian.html" rel="alternate"></link><updated>2013-04-08T11:28:00+03:00</updated><author><name>MartinsM</name></author><id>tag:mednis.info,2013-04-08:enable-dell-latitude-wifi-on-debian.html</id><summary type="html">&lt;p&gt;I partly followed instructions on this page: &lt;a href="http://wiki.debian.org/wl" title="wiki.debian.org"&gt;http://wiki.debian.org/wl&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In terminal (as root):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;aptitude install broadcom-sta-dkms
modprobe -r b44 b43 b43legacy ssb brcmsmac
modprobe wl
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Run this command to verify:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;iwconfig
&lt;/pre&gt;&lt;/div&gt;</summary><category term="Debian"></category></entry><entry><title>How to create an SBML file using libSBML in Python</title><link href="http://mednis.info/how-to-create-an-sbml-file-using-libsbml-in-python.html" rel="alternate"></link><updated>2012-09-25T16:31:00+03:00</updated><author><name>MartinsM</name></author><id>tag:mednis.info,2012-09-25:how-to-create-an-sbml-file-using-libsbml-in-python.html</id><summary type="html">&lt;p&gt;This tutorial is intended as a quick introduction on how to create an SBML file using libSBML. For a full developer's guide, please see &lt;a href="http://sbml.org/Software/libSBML/docs/python-api/"&gt;libSBML Python API&lt;/a&gt; has no title attribute.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;libsbml&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;
&lt;span class="n"&gt;document&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;SBMLDocument&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;document&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;createModel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c"&gt;# SBML level and version&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;First you have to create compartments&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="n"&gt;c1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;createCompartment&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;c1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;Forest&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;c1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;comp_FOREST&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Set the volume of compartments&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="n"&gt;c1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setVolume&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Continue with other compartments&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="n"&gt;c2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;createCompartment&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;c2&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;Meadow&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;c2&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;comp_Meadow&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;c2&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setVolume&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;When you have finished with compartments, proceed with species.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="n"&gt;s1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;createSpecies&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;s1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;Foxes&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;s1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;spec_FOXES&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;s1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setCompartment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;comp_FOREST&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;s1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setInitialAmount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;s2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;createSpecies&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;s2&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;Rabbits&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;s2&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;spec_RABBITS&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;s2&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setCompartment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;comp_FOREST&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;s2&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setInitialAmount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;s3&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;createSpecies&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;s3&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;Snakes&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;s3&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;spec_Snakes&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;s3&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setCompartment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;comp_Meadow&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;s3&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setInitialAmount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;When you are done with compartments and species, create reactions.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="n"&gt;r1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;createReaction&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;r1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;Foxes eat rabbits&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;r1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;R1&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Create reactants and products&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="n"&gt;reac1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;r1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;createReactant&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;reac1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setSpecies&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;spec_RABBITS&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;prod1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;r1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;createProduct&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;prod1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setSpecies&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;spec_FOXES&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;if necessary, set Stoichiometry&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="n"&gt;reac1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setStoichiometry&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c"&gt;# 2 rabbits&lt;/span&gt;
&lt;span class="n"&gt;prod1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setStoichiometry&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c"&gt;# 1 fox&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Notice that we create seemingly independent objects for comprartments, reaction, reactant and product. We set some values to the properties of these objects and never actually add these elements to the model. Thats because they are automatically added. You can try this inside a loop and it will still work.&lt;/p&gt;
&lt;p&gt;Now when you have done whith your model you have to add it to the document.
document.setModel(model)&lt;/p&gt;
&lt;p&gt;If you wish you can add optional information.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;My test model&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;MyModelID&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Save to file.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="n"&gt;writeSBMLToFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;document&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;name_of_your_model.xml&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;That's it! Copy&amp;amp;paste this code and try it yourself!
Please note that this tutorial is really basic. For more comprehensive examples, please see the examples/ folder in the libSBML source tree.&lt;/p&gt;</summary><category term="Python"></category><category term="SBML"></category></entry><entry><title>How to install libSBML in Ubuntu 12.04 with Python bindings</title><link href="http://mednis.info/how-to-install-libsbml-in-ubuntu-1204-with-python-bindings.html" rel="alternate"></link><updated>2012-01-13T12:41:00+02:00</updated><author><name>MartinsM</name></author><id>tag:mednis.info,2012-01-13:how-to-install-libsbml-in-ubuntu-1204-with-python-bindings.html</id><summary type="html">&lt;h2&gt;Install compiler&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;apt-get install build-essential
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;On a fresh ubuntu 12.04 setup you will need to install some additional packages&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;apt-get install python2.7-dev
apt-get install libxml2-dev
apt-get install swig
&lt;/pre&gt;&lt;/div&gt;


&lt;h2&gt;Compile and install libSBML&lt;/h2&gt;
&lt;p&gt;Go to the directory where you have exctracted libsbml source and run these 3 commands&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;./configure --with-python
make
make install
&lt;/pre&gt;&lt;/div&gt;</summary><category term="Ubuntu"></category><category term="SBML"></category></entry></feed>