How to become a programmer, or the art of Googling well

an epic revelation …


*Note: Please read all italicized technical words as if they were in a foreign language.

The fall semester of my senior year, I was having some serious self-confidence issues. I had slowly come to realize that I did not, in fact, want to become a researcher. Statistics pained me, and the seemingly endless and fruitless nature of research bored me. I was someone who was driven by results – tangible products with deadlines that, upon completion, had a binary state: success, or failure. Going into my senior year, this revelation was followed by another. All of my skills thus far had been cultivated for research. If I wasn’t going into research, I had… nothing.

At a liberal arts college, being a computer science major does not mean you are a “hacker”. It can mean something as simple as, you were shopping around different departments, saw a command line for the…

View original post 1,398 more words

Coding, configuration, Internet, Linux, Python, software, web

pep8_tonizer on for Notepad++ : Make your Python code PEP8-compliant on editor

[ Please take note that this is still in beta phase. In other words, it still has issues.]

This script can be used to make python code, that is being edited on Notepad++,  to comply with infamous PEP8 coding style  []
By default, autopep8 only makes whitespace changes. So does this script.

However, this script depends on following:

Continue reading

experience, personal

একজন টিপিকাল বাবা

আমি জানি ফেসবুকে এইরকম “নিউজ”/শোক-স্ট্যাটাস প্রায়ই আসে। আমরাও গা-সওয়া হয়ে গেছে।

তোমার ওমুকে মারা গেছে, আমি কি করতে পারি? ফাস্ট লাইফ, ফাস্ট স্ক্রলিং-ডাউন …

তবে আমার একটু বাড়তি কথা বলার আছে …

Continue reading

Coding, Python

Python fun #4: Create sorted list of all possible numbers using same digits (of a number)

Let’s say the number is 123.

Then the statement:

[int(''.join(x)) for x in permutations(list(str(123)))]

will create a sorted list of all possible numbers using ‘1’,’2′ and ‘3’.
which is, [123, 132, 213, 231, 312, 321]

What it is doing

The part, permutations(list(str(‘123’ is creating a permutated tuple list of splitted string ‘123’.
And the int(”.join(x)) is converting each tuple to back to Integer.

However, you need to

import permutations from itertools

so, the generalized version would be:

import permutations from itertools
[int(''.join(x)) for x in list(permutations(list(str(n))))]
Coding, Python, software

Python: Some Performance Scores

I just finished reading Sebastian Raschka’s analytic discussion of Pyhton tweaks where the author tested with Python version: 3.3.3

Now, as I am a huge “fan” of Pythonic 1-liners, I made a summary of the article containing 1-liner-analysis-result.

Adding elements to dictionaries
Adding keys “By exploiting thrown KeyError exceptions via an try-except loop” is slightly(~1.2x) faster than “(first,) checking if a key already exists in the Python dictionary using if-else loop”

Continue reading

Coding, Python

Python fun #3 : Directly Input from a text file to a processed 2-D list (in 1 statement)

Suppose you have input file like this(triangle.txt) to use as input …

with open('triangle.txt') as f:
    D = [[int(w) for w in line.split()] for line in f]

This will create a nice table-like 2-D list, i.e. a list of lists. The member list(s) can be of variable size. You can modify the int(w) for w in line.split() part to incorporate your processing.

Continue reading