This file contains hidden or 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
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION | |
| 0. You just DO WHAT THE FUCK YOU WANT TO. |
This file contains hidden or 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
| // This was written for Chandni 14-Dec-2011 | |
| // | |
| // Problem Statement: | |
| // | |
| // Assuming you have two files, d1.txt and d2.txt. You would like to remove all | |
| // entries from d2.txt that also appear in d1.txt | |
| d1 = read_csv('d1.txt'); | |
| d2 = read_csv('d2.txt', ', ')'; |
This file contains hidden or 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
| javascript:(function(){try{var%20url=encodeURIComponent(location.href);var%20ifr=document.createElement('iframe');ifr.style.position='absolute';ifr.style.top=10+'px';ifr.style.left=10+'px';ifr.style.width=450+'px';ifr.style.height=100+'px';ifr.style.border='none';ifr.style.backgroundColor="#fff";ifr.src='http://www.facebook.com/plugins/like.php?href='+url+'&show_faces=true&width=450&action=like&colorscheme=light';ifr.scrolling='no';ifr.frameborder=0;document.getElementsByTagName('body')[0].appendChild(ifr);}catch(e){}})(); |
This file contains hidden or 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
| #!/bin/bash | |
| # dcyoutube.shyoutube-url [Output MP3 Name] | |
| URL=$1 | |
| FILENAME=`youtube --get-filename $URL` | |
| if [ -z $2]; then | |
| NAME=`youtube -e $URL` | |
| else |
This file contains hidden or 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
| // Three ways of generating a Vandermonde matrix: | |
| function y = vandermonde1(x) | |
| n = length(x) | |
| for i = 1:n | |
| y(:, i) = x^(i-1) | |
| end | |
| endfunction | |
| function y = vandermonde2(a) |
This file contains hidden or 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
| // One Dimensional Random Walk | |
| // http://en.wikipedia.org/wiki/Random_walk | |
| PossibleSteps = [1, -1] // Assuming you can only go ahead by one step or backwards by one step | |
| Start = 0 // Start at 0 on the number line | |
| NumberOfSteps = 1000 | |
| StepsTaken = sample(NumberOfSteps, PossibleSteps); // Take a random step ahead or back | |
| n = length(StepsTaken) |
This file contains hidden or 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
| // See http://en.wikipedia.org/wiki/Fizz_buzz | |
| List = 1:100; | |
| Fizz = find(modulo(List, 3) == 0); | |
| Buzz = find(modulo(List, 5) == 0); | |
| FizzBuzz = find(modulo(List, 3*5) == 0); | |
| strList = string(List); | |
| strList(Fizz) = "Fizz"; | |
| strList(Buzz) = "Buzz"; |
NewerOlder