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
ID3 Pseudocode | |
id3(examples, attributes) | |
''' | |
examples are the training examples. attributes is a list of | |
attributes that may be tested by the learned decison tree. Returns | |
a tree that correctly classifies the given examples. Assume that | |
the targetAttribute, which is the attribute whose value is to be | |
predicted by the tree, is a class variable. | |
''' |
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
# input | |
# values stored in array v | |
# wighets stored in array wt | |
#length of array n | |
# knapsack capcity stored in w | |
#A naive recursive implementation of 0-1 Knapsack Problem | |
# Returns the maximum value that can be put in a knapsack of | |
# capacity W | |
def knapSack(w, wt, v, n): |
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
#Dynamic Programming based Python Program for 0-1 Knapsack problem | |
# Returns the maximum value that can be put in a knapsack of capacity W | |
def knapSack(W, wt, val, n): | |
K = [[0 for x in range(W+1)] for x in range(n+1)] | |
#build table k[][] in bottom up manner |
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
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |
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
namespace HelloWorld; | |
class Greeting | |
{ | |
public static function say() | |
{ | |
echo "Hello World!"; | |
} | |
} |
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
<?php | |
echo HelloWorld\Greeting::say()."\n"; |
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
wget -P ~/.local/share/fonts https://github.com/ryanoasis/nerd-fonts/releases/download/v3.0.2/JetBrainsMono.zip \ | |
&& cd ~/.local/share/fonts \ | |
&& unzip JetBrainsMono.zip \ | |
&& rm JetBrainsMono.zip \ | |
&& fc-cache -fv |