Posts

Showing posts from December, 2014

How To Enable Auto-Completion in Python Shell

Learn how to use TAB to auto-complete expressions in plain vannila Python shell.

If you need to have auto completion in Python shell (almost the same way as iPython), it's very easy.
Create a file named .pyreadline with the following content and put it in your home directory. #!python import rlcompleter, readline readline.parse_and_bind('tab: complete')Export the file as PYTHONSTARTUP variable; for example append it to .bashrc. echo "export PYTHONSTARTUP=~/.pyreadline" >…

How To Batch-set Environment Variables

Learn how to automatically (dump) set environment variables defined in a file.

Sometimes you have a file (usually called .env or .environment) with dozen of environment variables defined and you have to set those variables before running a command --for example this happens in Django projects with a .env file for settings.

The solution is easy:
export $(cat ENVIRONMENT_FILE | xargs) && YOUR_COMMAND

How To Add Logging To A Clojure Project

When deploying a Clojure application in a production environment, it is necessary to have logging enabled to be able to, in case of any failure, track down the problem using the logs later.

Clojure inhertis serveral logging frameworks from Java like Log4j and it has its own Clojure'esque wrapper around Java logging API called clojure.tools.logging.

This HowTo will help you get started with a working “loggable” Clojure project. Though the instructions assume that you're using Leiningen f…

Thoughts On JVM-based Forth Implementation

Image
Is it possible and worth to implement Forth on top of JVM?

Forth: A language which looks as weird as it is simple and powerful --and it looks extremely weird!

I, first, came to know Forth with help of my good friend Michael a.k.a. ttmrichter and immediately Forth placed itself on top of the favourite language pyramid in my mind, alongside only Lisp family. Since then, I've been eager to do serious coding in Forth. However, there's a problem: most of Forth'ers work in the system/chip …