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
%/ | |
% Developer : Srinivas Muddana ([email protected]) | |
% All code (c)2012 Srinivas Muddana. all rights reserved | |
% | |
% do a = a*-1 if(a<0); | |
% can add a ternary operator too.?? | |
function do(varargin) | |
%expr = size(2*length(varargin) -1) ; | |
expr = ''; | |
for(ii = 1:length(varargin)) |
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
WORD_FEATURES = [] | |
def overwrite_word_features(): | |
WORD_FEATURES = [1, 3, 5 ] | |
overwrite_word_features() | |
print WORD_FEATURES # prints [] | |
#This took me a while to guess what could have been happening and was confirmed upon googling. the correct way to do is | |
WORD_FEATURES = [] |
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
require 'rubygems' | |
require 'mongo' | |
require 'tweetstream' | |
USER = "<username>" | |
PASS = "<password>" | |
conn = Mongo::Connection.new | |
db = conn.db("dbname") | |
tweets = db.collection("collname") |
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
# down the test/train data : http://www.stanford.edu/~alecmgo/cs224n/twitterdata.2009.05.25.c.zip | |
#into a folder "corpus" at the level of this file (else u need to change inside the code for now) | |
import nltk | |
import random | |
import re | |
import gc | |
from pymongo import Connection | |
#method defs |
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
class Collection | |
def initialize | |
@map = Hash.new | |
end | |
def inc_frequency(word) | |
@map[word] = @map[word] ? (@map[word]+1) : 1 | |
end | |
def add(word) |
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 <list> | |
#include <vector> | |
#include <stack> | |
#include <string> | |
// basic file operations | |
#include <iostream> | |
#include <sstream> | |
#include <fstream> | |
#include <time.h> |
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
% Neural Netowrks Project | |
% srinivas muddana | |
% 9561 - 2909 | |
% self organizing maps | |
function [initMap, map, elapsedTime, winNeurons] = testsomap(mapSize,ipData,epoochs) | |
initTime = clock; |
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
filename = "test_mail.rb" | |
file = File.new("./"+filename, "r") | |
filecontent = "" | |
file.each do |line| | |
filecontent << line | |
end | |
encodedcontent = [filecontent].pack("m") # base64 | |
marker = "TESTBOUNDARY" | |
body = <<MESSAGE_BODY |
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
require 'rubygems' | |
require 'ruby2ruby' | |
require 'ruby_parser' | |
require 'pp' | |
code_str = File.read('./test.rb') | |
parser = RubyParser.new | |
sexp = parser.process code_str | |
#puts sexp.inspect |
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
#some script for loading models and other stuff | |
require 'rubygems' | |
require 'active_record' | |
require 'yaml' | |
#require 'app/helpers/application_helper' | |
MODEL_PATH = './app/models/' | |
LIB_PATH = './app/lib/' |
NewerOlder