Python parallel assignment

Python supports parallel assignment like >>> lang, version = "python", 2.7 >>> print lang, version python 2.7 values are assigned to each variable without any issues. >>> x, y, z = 1, 2, x + y Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'x' is not defined First python tries to evaluate x + y expression. Since x, y is defined in same line, python is unable to access the variable x and y, so NameError is raised. [Read More]

Setting up privoxy proxy server for browsing

I wanted to setup proxy server for browsing. Tried http://www.squid-cache.org/ felt cumbersome to configure though it has advanced features. Finally decided to setup http://www.privoxy.org/. I assume you have personal server where all the requests are forwarded. Installation __ Server Config__ sudo apt-get install privoxy sudo vim /etc/privoxy/config look for listen-address and add ip:port listen-address 78.12.204.2:8118 To enable logging for all requests uncomment debug 1(you will need to rotate log file using cronjob). [Read More]

2 weeks after installing Ubuntu 12.04 64bit in MacBook

Its been two weeks, since I installed Ubuntu 64 bit in MacBook. Let me say how I feel about. My setup isn’t complicated, I use sublime2, terminator, gnome-terminal, ipython, pypy-2.0beta, postgres, mosh, firefox-nightly, chromium, chrome, clementine, xchat-gnome, hotot(recent addition). Also installed nividia drivers for ubuntu. I am happy I installed ubuntu but had issue with right click and figured shift + F10 is short cut. Hate Hate Hate If you are using data-card you must have noticed default modem-manager is buggy. [Read More]

Stable Browser vs Fastest Browser

Firefox Vs Chrome Vs Chromium Chrome & Firefox are my current favourite browser. I was previously using chromium but stopped using because of this bug. Since then I switch between chrome and firefox. Chrome is fastest, better UI & UX. Firefox is stable. Today I faced issue with my flash player in chrome(Ubuntu 64 bit OS). All the youtube video starts playing at 2x - 3x speed. After few mins video plays in normal speed. [Read More]

Can PyPy be used for web application deployment ?

What is PyPy ? PyPy is an implementation of Python in Python which uses JIT(Just In Time) translation. Why to Use PyPy? According to benchmarks “It depends greatly on the type of task being performed. The geometric average of all benchmarks is 0.18 or 5.6 times faster than CPython”. Experience? I have used PyPy for sandboxing for my project pylive, tested flask with pypy, ported brubeck to work on pypy, tested lastuser in PyPy 2. [Read More]

How to run Python Linux commands in PyPy ?

I have been using PyPy from 1.6. Now PyPy 2.0beta1 is out. Most of python libraries which don’t have c extensions as dependencies work(exceptions are present). E.g: requests, fabric, gunicorn Install PyPy2.0beta1 Grab 32 or 64 bit pypy2.0 beta1. If you are using ubuntu grab libc2.5. `` bzip2 pypy-2.0-beta1-linux64-libc2.15.tar.bz2 `` `` tar -xvf pypy-2.0-beta1-linux64-libc2.15.tar `` <code>curl -O <a href="http://python-distribute.org/distribute_setup.py" target="_blank">http://python-distribute.org/distribute_setup.py</a></code> <code>curl -O <a href="https://raw.github.com/pypa/pip/master/contrib/get-pip.py" target="_blank">https://raw.github.com/pypa/pip/master/contrib/get-pip.py</a></code> `` ./pypy-2.0-beta1/bin/pypy distribute_setup.py `` `` . [Read More]

Why did I install Ubuntu in MacBook ?

Reasons

  • Mac doesn’t have package manager like synaptic. But you have App Store for apps.
  • You need to build xcode or gcc-installer to install any cocoa app.
  • I Use USB Data card as result I don’t have privilege to experience high speed broadband connection. As I have noticed OSX apps are heavy to download.
  • Linux fanboy :-)
linux  macbook  osx 

Post PC OS Hate

Smartphones & Tablets are new plastic papers. Android and IOS dominates the market. I own Android Phone because its cheap. When it comes to Gadgets I am conservative. I really don’t like Android much because its written in Java and need a better hardware to run Interpreted Languages, JS. Android runs from low end cheap 4000Rs phone to Nexus Phone. So wide variety of device headaches to developers. Every Android phone is one layer coated with device makers code, same with Linux distros. [Read More]

Microframeworks produces micro level progress in project

I created my first web app in PHP 5.2 with * no frameworks *, then learned drupal, tried codeigniter, joomla. Then I learned Rails for HappySchool project and learned Django since I am python lover. Tried Pylons and settled with Flask and experimenting brubeck. Flask is microframework built around werkzeug datastructures. Advantages Vs Disadvantages Learn in depth working of HTTP vs Time consuming Opportunity to create library vs Time consuming Less batteries available vs More development time It is highly loosely coupled which is good to replace the parts with best tools if available. [Read More]