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
static inline int ext2_inode_is_fast_symlink(struct inode *inode) | |
{ | |
int ea_blocks = EXT2_I(inode)->i_file_acl ? | |
(inode->i_sb->s_blocksize >> 9) : 0; | |
return (S_ISLNK(inode->i_mode) && | |
inode->i_blocks - ea_blocks == 0); | |
} |
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
#!/bin/sh | |
feh --bg-scale /home/prudhvi/Downloads/wallpaper.jpg | |
while true; do | |
xsetroot -name "`date '+%a %Y-%m-%d %H:%M:%S'`" | |
sleep 1 | |
done & | |
exec /usr/bin/dwm |
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
bin/mallet import-dir --input /opt/data/* --output ~/obama.mallet | |
bin/mallet train-classifier --input ~/media_elections.mallet --trainer MaxEnt --output-classifier ~/media_elections.classifier --training-portion 0.9 | |
bin/mallet classify-dir --input /opt/data --output - --classifier ~/obama.classifier |
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
#! /usr/bin/python | |
def merge(a, size): | |
for i in range(0, len(a), size): | |
tmp = a[i:size + i];print tmp; | |
newtmp = [] | |
for j in range(0, len(tmp)): | |
newtmp.append(tmp.pop(tmp.index(min(tmp)))) | |
print newtmp | |
a[i:size + i] = newtmp |
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
#! /usr/bin/python | |
import unittest | |
class Trie(object): | |
""" Trie implementation in python | |
""" | |
def __init__(self, ): | |
""" So we use a dictionary at each level to represent a level in the hashmap |
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 <vector> | |
using namespace std; | |
template <class T> | |
class Heap { | |
vector<T> list; | |
void bubbleUp(); |
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 <algorithm> | |
#include <string> | |
using namespace std; | |
int main(){ | |
int 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
#include <iostream> | |
#include <algorithm> | |
#include <string> | |
#include <cstdlib> | |
using namespace std; | |
int main(){ | |
int 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
#include <iostream> | |
#include <algorithm> | |
#include <string> | |
#include <cstdlib> | |
using namespace std; | |
int main(){ | |
int 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
# Transform days spent to log(1 + x) | |
y1_data$DaysInHospital_Y2 <- log1p(y1_data$DaysInHospital_Y2) | |
# Divide the set, 80% for train and 20% for test | |
indexes <- sample(1:nrow(y1_data), size=0.2*nrow(y1_data)) | |
test <- y1_data[indexes,] | |
train <- y1_data[-indexes,] | |
# Remove unwanted features from both the sets | |
train <- subset(train, select=-c(MemberID_t, YEAR_t, DaysInHospital, trainset, DaysInHospital_Y3, age_05, PayDelay_max, PayDelay_min, PayDelay_stdev, LOS_max, LOS_min, |
OlderNewer