Posts mit dem Label toolchain werden angezeigt. Alle Posts anzeigen
Posts mit dem Label toolchain werden angezeigt. Alle Posts anzeigen

Donnerstag, 21. März 2013

Automated pubmed searching with RSS

If you're regularly searching pubmed on a particular topic, you can make your life a lot more comfortable using automated searches. Everything that is required is a web browser and a RSS-aggregator, such as the soon-to-fade-out Google Reader, feedly, or a Tiny Tiny RSS instance (if you're geek enough to set one up for this purpose).

Here's how it works:

  1. Go to pubmed.
  2. Type in your favorite search query.
  3. Click "Search".
  4. After the result appeared, click on the button "RSS" below the query field.
  5. Adjust the settings to your liking and click "Create RSS".
  6. Use the xml-link to subscribe to this search in your favorite aggregator.
Et voila, you're done! Next time you log in to your feed aggregator, you'll see all the new articles that match the query. The cool thing is, you don't have to check the search on a regular basis anymore - your feed aggregator will keep track on all the new results as they tumble in via the feed. Unread items will be highlighted. If you use a mobile client, you can use the time on the train to browse through the list and star interesting articles for later reading. 

You can take this a step further, and subscribe to TOCs from your favorite journals. Never face a pile of unread TOC alerts in your inbox again. Every decent journal out there offers an RSS feed. 

Replace Google Reader with Tiny Tiny RSS

Google Reader was an essential part of my workflow for keeping up with the literature. I had configured several PubMed-searches as RSS-Feeds. For example, I created an automated search for olf*. Hence, every time a new article appeared on pubmed that contained that term, it would appear in my Google Reader. That was extremely convenient, as I could simply log in to Google Reader whenever I felt like reading new stuff, then browse the RSS with the pubmed query, star interesting abstracts, download those articles and push them to my cloud storage where I keep the PDFs. 
Now Google announced to shut down the Reader Service. Booooooh, bad Google! However, I can't afford to let the decision of some internet company disrupt my workflow ;) So I looked for alternatives, and found Tiny Tiny RSS. TT-RSS is a server-side application to be installed on some webserver. It provides similar service as Google Reader, and even an Android client!
It took me two hours to set it all up, including dusting off my Mysql knowledge and learning how to use systemd. I got along mostly with the install instructions from the TT-RSS website. The only thing which took some time was figuring out how to set up a MySQL database for ttrss, and configuring systemd to run the update daemon. In the end it was pretty straightforward. 

Now my workflow's saved! Happy! ;) 


Note to self: Here's the systemd-service file that is required to start the update daemon for ttrss. To enable it, store it at /lib/systemd/system/ttrss-update.service, and enable it permanently using systemctl enable ttrss-update.service.

[Unit]
Description=Update daemon for ttrss
After=network.target

[Service]
Type=simple
User=wwwrun
Group=www
ExecStart=/usr/bin/php /srv/www/htdocs/feeds/update.php --daemon

Restart=always
RestartSec=60

[Install]
WantedBy=multi-user.target


!!! Update!!! (April 12.2013): the script was missing a second hyphen before -update, which caused the update to be run exactly once on startup, and never again. Fixed.

Second Update Oct 30, 2013: Added Restart flag to the service that takes care of firing the update daemon up again if it exits.

Freitag, 6. Juli 2012

Migrating from SVN to Git

As I'm waiting for Martin to give me feedback on my most recent manuscript on a neuromorphic classifier, I had some time to do things I wanted to do for a long time, but always pushed back because there was something more important. In addition, today was Friday, and an very hot Friday in particular, so normal thinking was hardly possible - the perfect day for playing around with some nerd stuff like migrating my version control repository from SVN to Git!
I maintain code, figures, documents and all other stuff relevant to one project in a version control repository. I'm working on different machines remotely, e.g., the gaia cluster at FU, the server at KIP Heidelberg to which the neuromorphic hardware is connected, our local numbercrunchers and so on. I used to have a central SVN repository on our server, but this became the more cumbersome the more I had to deal with firewalls, limited bandwidth and working offline.
Briefly, I used two step-by-step guides: the one from John Albin, and the one in the Git Book. Both will essentially get you there, but the first one has a slightly more elegant solution to transform the authors, while the latter contains more details on what is actually going on. In addition, the Git Book is a good read to bridge the long, long time until a decent SVN repository is fully converted to Git. After all, if you migrate from SVN to Git you really want to know about the fundamental differences in Git compared to VCSs like SVN, and even more so the way Git stores your data.
Finally, where SVN needs 3.1 GB for the repo alone and another 8.5 GB for the checkout, I ended up with a git repository that contains the repo and the current version of all the stuff in a mere 2.9 GB. Wow. The entire process took three hours or so (plus some more hours of trial and error before ;) ). Now I'm hoping that Git will make it easier to keep all my data in sync across servers, irrespective the firewalls or stubborn svn clients insisting on correct https certificates, as long as I can ssh into them. But that's something for another day.
So finally this hot and humid Friday came to a productive end! Time to celebrate :) 

Donnerstag, 28. Juni 2012

From netbeans to eclipse for python development

Netbeans has been my favorite IDE for a very long time. It was unbeatable when I was still developing in Java, and when I switched to Python for my main work it also provided support for it. But lately the netbeans community seemed to have abandoned Python - at least, there is no built-in python support for any release of the 7.x series, and the available plugins are hackish and lack some of the functionality that was present still in 6.9.
So it was clear: Python has no future in netbeans. And this meant that netbeans had no future as my IDE ;)
I was inclined to actually believe the hype about eclipse - all eclipse users I know are very enthusiastic about telling you how great their IDE is. I already tried it several times, but never really got into it, always falling back to netbeans 6.9. With the recent release of Eclipse Juno I decided to give it another shot. 
Installation is no problem, you just have to unpack the zipped file and take care that the binary is in your PATH. Netbeans had this nice installer which creates directories for you and stuff, but that's not really an important point. Installation of plugins was a bit rough - Netbeans gives you a much smoother experience in this regard. But hey, it's a developer tool, and a Real Programmer should be able to figure out, right? ;)
What I didn't understand was the concept of the workspace, which eclipse forces you to choose on every startup. What the hell was so important about that workspace to justify asking me all the time which one I want to use? I never figured out until David Higgins explained to me at a recent workshop: The workspace is simply a place where your settings are stored, and has nothing to do with where your projects are located. For example, it allows you for example to use different settings when you're developing in Java and Python, or C++, for that matter. So I checked that "Don't ask anymore" box and was done with workspace selection  ;) .
I had to learn a few new shortcuts and customized other ones to be like Netbeans, which went smoothly once I discovered that hitting Ctrl-Shift-L twice gets me directly into the Keyboard Shortcuts dialog, which sports a nice quick filter widget to quickly identify any command you'd like Eclipse to perform. On the downside, I had to say goodbye to nice things like a new, separate console popping up for every process I start, or the more straightforward integration of SVN in netbeans. But then again, eclipse embraces Python while Netbeans just dumped support for it, so the decision to migrate is a no-brainer. And in addition I switched to Git anyway ;) 

Donnerstag, 19. Februar 2009

Have your python toolchain in $HOME

In my previous post I explained how to install scipy from source on openSUSE.

What makes it particularly nice is that I can now carry most of my toolchain in my $HOME. I make python include modules from within my $HOME by setting $PYTHONPATH to something like
/home/micha/mypython/lib64/site-packages
. The good thing is that you can install any python package in your $HOME by using the --prefix option to setup.py:
python setup.py install --prefix=$HOME/mypython


For even more python goodness I tell easy_install to put everything there by having a file called .pydistutils.cfg in my $HOME with the contents

[install]
prefix=/home/micha/mypython


So everytime I easy_install a package, it is automatically put into my $HOME directory. That makes it much easier to reinstall or upgrade the system. Since most python-related stuff is now in my $HOME and not in the system, rebuilding my python-toolchain basically consists of installing python and distutils. Isn't that great :)

Update: I learnt from Brandon Rhodes that virtualenv will set up everything for you automatically. Awesome python goodness.