Skip to content

Instantly share code, notes, and snippets.

View Sentient07's full-sized avatar

Ramana Sundararaman Sentient07

View GitHub Profile
@Sentient07
Sentient07 / DumpData.py
Created July 15, 2015 17:54
Searching by deposition date
""" *******************************************************************************
Prints out the query results in a HTML format or in a dump file
in an HTML format the function will paginate the data
numResidues = total # of residues in query
Result_Set = set of results to be printed
Per_Page = number of results to show per page
toFile = file to dump results to
************************************************************************** """
from __future__ import with_statement
from threading import Thread, Lock
@Sentient07
Sentient07 / Hello.java
Last active November 2, 2015 13:58
How pointers behave inside containers..
import java.util.*;
public class Hello{
public static void main(String []args){
System.out.println("Hello World");
ArrayList<String> a1 = new ArrayList<String>();
ArrayList<String> b1 = a1;
b1.add("hello");
b1.add("yo!");
System.out.println(a1.toString());
@Sentient07
Sentient07 / simpleFTP.java
Created August 31, 2014 04:38
Simple FTP server
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ftpjava;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
class UserProfiles(models.Model):
user = models.ForeignKey(User, unique=True)
follows = models.ManyToManyField(User, related_name='followers', symmetrical=False)
description = models.TextField(verbose_name=_("description"))
place = models.TextField(verbose_name=_("place"))
reputation = models.IntegerField(auto_created=True, default=0)
prof_pic = models.FilePathField(path="/home/ramana/PycharmProjects/social-network/static/images")
@Sentient07
Sentient07 / gpu-traceback.py
Last active February 29, 2016 02:56
Errors when tested theano/tensor/tests/*.py
Using gpu device 0: GeForce GT 750M (CNMeM is disabled, CuDNN not available)
../Users/Ramana/projects/theano/Theano/theano/tensor/tests/test_opt.py:4021: UserWarning: Tile op is deprecated, use tile function instead.
f = theano.function([var], Tile(ndim)(var, (1,)*ndim), mode=mode)
..F...........FF....FEE.............ERROR (theano.gof.opt): EquilibriumOptimizer max'ed out by 'gpu_merge'. You can safely raise the current threshold of 5.000000 with the theano flag 'optdb.max_use_ratio'.
ERROR (theano.gof.opt): EquilibriumOptimizer max'ed out by 'gpu_merge'. You can safely raise the current threshold of 5.000000 with the theano flag 'optdb.max_use_ratio'.
ERROR (theano.gof.opt): EquilibriumOptimizer max'ed out by 'gpu_merge'. You can safely raise the current threshold of 5.000000 with the theano flag 'optdb.max_use_ratio'.
...........................FFF..F.......FFF....FF..S.S..S.....FF..........FFFFFFFFF.....FFF...FFFFFFFF............ERROR (theano.gof.opt): Optimization failure due to: local_gpu_subtensor
ERR
@Sentient07
Sentient07 / serialisation.py
Created March 11, 2016 14:17
An example where serialization throws maximum recursion depth exceeded RuntimeError
class Node():
pass
nodes = []
for i in range( 100 ):
n = Node()
nodes.append( n )
@Sentient07
Sentient07 / large-graphs.py
Created March 13, 2016 23:34
A failing example of large graph in theano due to max recursion depth error
#!/usr/bin/python
import theano.tensor as T
import theano
from cgt.utils import Message
import time
import cgt
if __name__ == '__main__':
a = T.scalar(name='a', dtype='int64') #
b = T.scalar(name='b', dtype='int64')
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
name: "CaffeNet"
layer {
name: "data"
type: "Input"
top: "data"
input_param { shape: { dim: 10 dim: 3 dim: 227 dim: 227 } }
}
layer {
name: "conv1"
type: "Convolution"
name: "CIFAR10_full_deploy"
# N.B. input image must be in CIFAR-10 format
# as described at http://www.cs.toronto.edu/~kriz/cifar.html
layer {
name: "data"
type: "Input"
top: "data"
input_param { shape: { dim: 1 dim: 3 dim: 32 dim: 32 } }
}
layer {