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
# Set Paths | |
#----------------------------------------------------------- | |
export PATH="/usr/local/bin:$PATH" | |
export PATH="$HOME/bin:$PATH" | |
# Define system proxy connections to remote resources (predix) | |
#------------------------------------------------------------- | |
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile | |
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* |
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 <iostream> | |
#include<string> | |
#include<vector> | |
#include<sstream> | |
using namespace std; | |
struct TokenFreq { |
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
function permute(string) { | |
function recur(string, prefix) { | |
if (string.length === 0) { | |
console.log(prefix , "from if ") | |
return [prefix]; | |
} else { | |
var out = []; | |
for (var i = 0; i < string.length; i++) { | |
var pre = string.substring(0, i); | |
var post = string.substring(i + 1); |
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
// this how a controller will look if your uploading multiple files | |
$scope.uploadFiles = function (files) { | |
$scope.files = files; | |
if (files && files.length) { | |
Upload.upload({ | |
url: 'https://angular-file-upload-cors-srv.appspot.com/upload', | |
data: { | |
files: files | |
} |
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
function check(str){ | |
var word = str.split(""); | |
var max = 0; | |
var arr1 = []; | |
var arr2 = []; | |
var letter = 0; | |
var counter = 0; | |
for(var i=0; i< word.length; i++){ | |
if(word[letter] === word[i]){ |
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
function nthtoLast (SLL, n){ | |
if(SLL.head === null){ | |
return -1; | |
}else{ | |
var len = 0, | |
current = SLL.head; | |
while(current.next !== null){ | |
current = current.next; | |
len ++ ; |
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
function removeDuplicates(SSL){ | |
if(this.head === null){ | |
return false; | |
}else { | |
var current = this.head; | |
var obj = {}; | |
while(current.next !== null){ | |
// going to use an object to check if | |
if(current.next.value in obj){ | |
//we are going to do the swap |
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
function binarySearch(array, key) { | |
var lo = 0, | |
hi = array.length - 1, | |
mid, | |
element; | |
while (lo <= hi) { | |
mid = Math.floor((lo + hi) / 2); | |
element = array[mid]; | |
if (element < key) { | |
lo = mid + 1; |
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
function rSigma (num){ | |
if(num === 0){ | |
return num; | |
} else { | |
return num + rSigma(num-1); | |
} | |
} | |
rSigma(5); |
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
function isPalindrome(str){ | |
var i=0, | |
j= str.length-1 | |
while(i <j){ | |
if(str[i] == " "){ | |
i++; | |
}else if(str[j] ==" "){ | |
j--; | |
}else { | |
if(str[i].toLowerCase() === str[j].toLowerCase()){ |