Skip to content

Instantly share code, notes, and snippets.

;; Load CEDET.
;; See cedet/common/cedet.info for configuration details.
(load-file "~/.emacs.d/cedet-1.0pre6/common/cedet.el")
;; Enable EDE (Project Management) features
(global-ede-mode 1)
;; Enable EDE for a pre-existing C++ project
;; (ede-cpp-root-project "NAME" :file "~/myproject/Makefile")
#script for testing tiny
$PATH = "./tests/test-progs/"
format = ARGV[0] ||"pr2.{[a-z][0-9][0-9]}"
puts Dir.glob($PATH + format).sort
#ugly hack check wat the problem with gets
ARGV.clear
tiny_binary = "./tc"
#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/'
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
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
% Neural Netowrks Project
% srinivas muddana
% 9561 - 2909
% self organizing maps
function [initMap, map, elapsedTime, winNeurons] = testsomap(mapSize,ipData,epoochs)
initTime = clock;
#include <iostream>
#include <list>
#include <vector>
#include <stack>
#include <string>
// basic file operations
#include <iostream>
#include <sstream>
#include <fstream>
#include <time.h>
class Collection
def initialize
@map = Hash.new
end
def inc_frequency(word)
@map[word] = @map[word] ? (@map[word]+1) : 1
end
def add(word)
@muddana
muddana / sentiment_classifier.py
Created March 14, 2010 00:38
sentiment analysis of twitter data.
# 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
@muddana
muddana / twitter_streaming.rb
Created March 15, 2010 22:16
twitter streaming script
require 'rubygems'
require 'mongo'
require 'tweetstream'
USER = "<username>"
PASS = "<password>"
conn = Mongo::Connection.new
db = conn.db("dbname")
tweets = db.collection("collname")