cp command implementation and benchmark in python, go, lua

I was wondering how much will be the speed difference between cp command, rsync and implementation in python, go, lua and so wrote this code. Background python has two versions one with gevent and without gevent. Both the version uses shutil for copying files and directory tree. go uses https://github.com/opesun/copyrecur for copying recursively. lua uses lfs - LuaFileSystem module. lfs has support for creating directory but not for files, in order to copy the files low level file opening and writing to file technique is used. [Read More]

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]

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]

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]

What I like about Python

Lynn Root asked in twitter what you like and like to improve in python https://twitter.com/roguelynn/status/259338864664125440. Following are my observation Likes Importance to documentation.. Clean syntax. Easy to get started for non CS background people. lot of smart programmers. Libraries like IPython, requests, flask. Creating libraries like pygments, sphinx, readthedocs to solve * REAL * problem. I would like/want to improve python.org site While programmers are reading docs.python.org, code snippets should be executable right from the page(I have plans to start this as personal project). [Read More]

How I got into HasGeek Crew

Background about me I am kracekumar, graduated from Amrita school of Engineering, Coimbatore in B.Tech IT (2007-2011). I am working with IBM India Pvt Ltd, Bangalore as Associate System Engineer from 14th July, 2011 til 16th July, 2012.(C# developer but never wrote single line of code in c# in IBM). I am GNU/Linux user for 3 years and developed application in PHP, Rails, Flask(all are hobby projects). Scene I was not happy with job at IBM and I had training bond for one year(14th July, 2011 to 13th July 2012), decided to resign from my job once bond period is over whether I have new job offer or not. [Read More]

python `in` operator use cases

Python *in* operator is membership test operator.*Examples:*List—- In [1]: python_webframeworks = ['flask', 'django', 'pylons', 'pyramid', 'brubeck'] In [2]: 'flask' in python_webframeworks Out[2]: True In [3]: 'web.py' in python_webframeworks Out[3]: False in operator iterates over the list of elements and returns True or False. What about nested list? In [4]: webframeworks = [['flask', 'django', 'pyramid'],['rails', 'sintara'],['zend', 'symfony']] In [5]: 'flask' in webframeworks Out[5]: False in isnt handy for nested list, unless it is overriden. [Read More]