This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There are three ways to install Python libraries: | |
(1) Use apt-get, aptitude or similar utilities. | |
(2) Use easy_install or pip (install pip first, its not available by default) | |
(3) If you download some .tar.gz file, unzip it and then type sudo python setup.py install | |
Manually messing with paths and moving files around is the first step to headaches later. Do not do it. | |
For completeness I should mention the portable, isolated way; that is to create your own virtual environment for Python. | |
(1) Run sudo apt-get install python-virtualenv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var el = $('.workshopper>code'); | |
var str = ''; | |
for(var i = 0 ; i < el.length ; i++){ | |
if(el[i].innerHTML.indexOf('npm install -g') !== -1) | |
str += 'sudo npm install -g' + el[i].innerHTML.substr(14) + '\n'; | |
}; | |
console.log(str); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var spans = document.querySelectorAll('element'); | |
obj = []; | |
for(var i = 0, l = spans.length; i < l; i++){ | |
obj.push(spans[i].textContent || spans[i].innerText); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PARAMETERS FOR ALGORITHMS | |
(1) Time Complexity - | |
Asymptotic Analysis | |
(2) Space Complexity or Memory Usage - | |
(a) In Place ( Constant Memory ) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Classification of Algorithms | |
Contents | |
Classification by purpose | |
By implementation | |
By design paradigm | |
By complexity | |
Classification by purpose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorting is a key to CS theory, but easy to forget. I had an itch to review the algorithms in Wikipedia (strange, I know), and here are my notes: | |
High-level thoughts | |
Some algorithms (selection, bubble, heapsort) work by moving elements to their final position, one at a time. You sort an array of size N, put 1 item in place, and continue sorting an array of size N – 1 (heapsort is slightly different). | |
Some algorithms (insertion, quicksort, counting, radix) put items into a temporary position, close(r) to their final position. You rescan, moving items closer to the final position with each iteration. | |
One technique is to start with a “sorted list” of one element, and merge unsorted items into it, one at a time. | |
Complexity and running time | |
Factors: algorithmic complexity, startup costs, additional space requirements, use of recursion (function calls are expensive and eat stack space), worst-case behavior, assumptions about input data, caching, and behavior on already-sorted or nearly-sorted data | |
Worst-case behav |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Path to your oh-my-zsh installation. | |
export ZSH=/home/deadcoder0904/.oh-my-zsh | |
# Set name of the theme to load. | |
# Look in ~/.oh-my-zsh/themes/ | |
# Optionally, if you set this to "random", it'll load a random theme each | |
# time that oh-my-zsh is loaded. | |
#ZSH_THEME="agnoster" | |
#ZSH_THEME="cobalt2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<bits/stdc++.h> | |
#define min(x,y) x<y?x:y | |
using namespace std; | |
int min_index(int a[],int n){ | |
int low=0,high=n-1; | |
while(low<=high){ | |
if(a[low]<=a[high]) |
NewerOlder