ii. ;9ABH,
SA391, .r9GG35&G
&#ii13Gh; i3X31i;:,rB1
iMs,:,i5895, .5G91:,:;:s1:8A
33::::,,;5G5, ,58Si,,:::,sHX;iH1
Sr.,:;rs13BBX35hh11511h5Shhh5S3GAXS:.,,::,,1AG3i,GG
.G51S511sr;;iiiishS8G89Shsrrsh59S;.,,,,,..5A85Si,h8
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
import numpy as np | |
import random | |
import os, subprocess | |
class Perceptron: | |
def __init__(self, N): | |
# Random linearly separated data | |
xA,yA,xB,yB = [random.uniform(-1, 1) for i in range(4)] | |
self.V = np.array([xB*yA-xA*yB, yB-yA, xA-xB]) | |
self.X = self.generate_points(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
struct retval myread(int fd_id, void *buf, size_t nbytes) { | |
struct retval retval; | |
retval.errno = NO_ERROR; | |
retval.val_h = (int*) FAILED; | |
retval.val_l = (int*) FAILED; | |
if (fd_id <= FREE_FD || fd_id >= OPEN_MAX) { | |
retval.errno = EBADF; | |
return retval; | |
} |
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
def __truedive__(self,fraction): | |
if fraction.numerator == 0: | |
print('Cannot divide by 0') | |
exit() | |
else: | |
return(Fraction(self.numerator*fraction.denominator,self.denominator*fraction.numerator)) |
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
- Haskell Mergesort | |
- Copyright (C) 2014 by Kendall Stewart | |
First we define a couple of helper functions that | |
will be useful in splitting the list in half: | |
> fsthalf :: [a] -> [a] | |
> fsthalf xs = take (length xs `div` 2) xs |
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
[user] | |
name = Pavan Kumar Sunkara | |
email = [email protected] | |
[core] | |
editor = vim | |
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol | |
excludesfile = ~/.gitignore | |
[sendemail] | |
smtpencryption = tls | |
smtpserver = smtp.gmail.com |
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
cc=gcc | |
cflags=-std=gnu99 -g -Wall | |
target: libsm.a dsm test_client | |
libsm.a: libsm.o | |
ar rvs libsm.a libsm.o | |
libsm.o:sm.c sm.h message.h message.c mem.h mem.c | |
$(cc) $(cflags) -c sm.c -o libsm.o |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 <stdlib.h> | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <fcntl.h> | |
#include <sys/stat.h> | |
#include <sys/mman.h> | |
#include <unistd.h> | |
int main(int argc, const char *argv[]) | |
{ |
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
# Run command file for percol | |
# X / _ / X | |
# percol.view.PROMPT = ur"<bold><yellow>X / _ / X</yellow></bold> %q" | |
# Emacs like | |
percol.import_keymap({ | |
"C-h" : lambda percol: percol.command.delete_backward_char(), | |
"C-d" : lambda percol: percol.command.delete_forward_char(), | |
"C-k" : lambda percol: percol.command.kill_end_of_line(), |