Notes
One of the student in Rutherford’s class was very hard working. Rutherford had noticed it and asked one evening:
- Do you work in the mornings too?
- Yes, -proudly replies the student(, he was sure that he would be commended)
- But when do you think? Mr. Rutherford replied. :)
If you want to repeat a character N times on a bash shell, say for example your
variable name is aaaaa
; Then a simple way to do it is not writting it
repeatedly 5, do this:
Initial Prompt: me@me $
Step 1 : Alt + N
Prompt : (arg: N)
Ex : Alt + 5 ==> (arg: 5)
Step 2 : (arg: N)
Final Status: me@me $ aaaaa
Below is comment for one of the answers from the link by @instantsetsuna:
In some courts, a witness is asked if they will tell "The truth, the whole
truth, and nothing but the truth, so help me God"; as God is considered to be
the one with authority when it comes to knowing if you're telling the truth. In
the case of databases, we can say "The data depends on the key, the whole key
and nothing but the key, so help me Codd". Ted Codd is the one who came up with
the idea of relational databases - things relying on keys, etc., so he would be
the authority to go by in the case of relational databases.
The usual algorithm related coding challenges are all over the place in the internet. But I saw some projects, in a way we could also put it as challenges which helps in learning a lot of new things. Below I am trying to compile a list of similar kind of projects:
-
NAND2Tetris: Building a Modern Computer from First Principles
-
Linux From Scratch: Linux From Scratch (LFS) is a project that provides you with step-by-step instructions for building your own custom Linux system, entirely from source code.
Brian Kernighan famously wrote:
Everyone knows that debugging is twice as hard as writing a program in the first place. So if you’re as clever as you can be when you write it, how will you ever debug it?
— The Elements of Programming Style, 2nd edition, chapter 2
To shift a block of text left or right:
Initial text:
To shift the block of text from line 3 to 6 two tab length to right:
:3,5>>
Shifting lines 5 and 6 to right, one tab length:
:5,6<
Final text:
Straight forward method to relocate virtualenv folder to a different directory from the documentation
It does not work in all situation as per what we can see in the Github issues and it is also mentioned in their documentation itself that, this feature may be removed in future releases.
But I had this problem that I was not able use pip to get the packages installed
through pip freeze
. It says that the python executable path was wrong as it pointed
to the old path.
I got the code below from SO
Got to run the below code after activating the virutalenv(source old-venv/bin/activate
)
import pip #needed to use the pip functions
for i in pip.get_installed_distributions(local_only=True):
print(i)
This actually helped me in getting the list of packages without directly using pip.