isSubstring(String A, String B) {
for i = 0 to len(A)-len(B) {
j = 0;
while j < len(B) and A[i+j] == B[j] {
j = j + 1;
}
if j == len(B) {
return True;
}
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
/** | |
* Boyer-Moore string pattern matching | |
* | |
* @author Douglas | |
*/ | |
import java.util.Map; | |
import java.util.HashMap; | |
public class BoyerMoore |
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
from pybrain.structure import RecurrentNetwork, FullConnection, LinearLayer, SigmoidLayer | |
from pybrain.datasets import SupervisedDataSet | |
from pybrain.supervised.trainers import BackpropTrainer | |
#Define network structure | |
network = RecurrentNetwork(name="XOR") | |
inputLayer = LinearLayer(2, name="Input") | |
hiddenLayer = SigmoidLayer(3, name="Hidden") |
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
/** | |
-#Copyright (c) 2013 Douglas Vaz, Sharvari Bhosale | |
-# | |
-#Permission is hereby granted, free of charge, to any person obtaining a copy | |
-#of this software and associated documentation files (the "Software"), to deal | |
-#in the Software without restriction, including without limitation the rights | |
-#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
-#copies of the Software, and to permit persons to whom the Software is | |
-#furnished to do so, subject to the following conditions: | |
-# |
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
prefix=@prefix@ | |
exec_prefix=@exec_prefix@ | |
libdir=@libdir@ | |
includedir=@includedir@ | |
Name: gmp | |
Description: GNU Multiple Precision Arithmetic Library | |
URL: http://gmplib.org | |
Version: @PACKAGE_VERSION@ | |
Libs: -L${libdir} -lgmp |
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/sh | |
#Add pkg-config support to GMP | |
#http://gmplib.org/list-archives/gmp-discuss/2013-May/005329.html | |
echo "Creating gmp.pc.in..." | |
echo """prefix=@prefix@ | |
exec_prefix=@exec_prefix@ | |
libdir=@libdir@ | |
includedir=@includedir@ |
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
#include "linux_io.h" | |
#include <stdio.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <fcntl.h> | |
#include <wchar.h> | |
int main(void) | |
{ |
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
#!/usr/bin/python3 | |
''' | |
Copyright (c) 2014 Douglas Vaz | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
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
import math | |
def ExtendedEuclid(m, b, verbose=False): | |
a1, a2, a3 = 1, 0, m | |
b1, b2, b3 = 0, 1, b | |
if(verbose): | |
print("Q\tA1\tA2\tA3\tB1\tB2\tB3") | |
q = None |
I hereby claim:
- I am douglas-vaz on github.
- I am mistcrafter (https://keybase.io/mistcrafter) on keybase.
- I have a public key whose fingerprint is 8F57 F022 A6B3 175A 5695 13C0 5B97 A84B 8B6E 4651
To claim this, I am signing this object: