Skip to content

Instantly share code, notes, and snippets.

View praveend's full-sized avatar

Praveen Devarao praveend

View GitHub Profile
@praveend
praveend / meetup.ipynb
Last active September 10, 2016 08:37
Bangalore Spark Enthusiast Spark Machine Learning meetup demo notebook code
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
/**
* Created by praveendevarao on 12/01/16.
*/
import org.apache.spark._
import org.apache.spark.storage.StorageLevel
import org.apache.spark.streaming._
import org.apache.spark.streaming.StreamingContext._
object WordCount {
@praveend
praveend / ConsumerPollTest.java
Created December 28, 2015 15:37
Kafka Consumer test
package com.ibm.kafka.test;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.clients.consumer.ConsumerRecords;
import org.apache.kafka.clients.consumer.KafkaConsumer;
import org.apache.kafka.common.PartitionInfo;
import org.apache.kafka.common.TopicPartition;
import java.util.Arrays;
import java.util.List;
# +----------------------------------------------------------------------+
# | Licensed Materials - Property of IBM |
# | |
# | (C) Copyright IBM Corporation 2006, 2007, 2008, 2009, 2010 |
# +----------------------------------------------------------------------+
# | Authors: Antonio Cangiano <cangiano@ca.ibm.com> |
# | : Mario Ds Briggs <mario.briggs@in.ibm.com> |
# | : Praveen Devarao <praveendrl@in.ibm.com> |
# +----------------------------------------------------------------------+
@praveend
praveend / active_record.rb
Created November 25, 2014 13:00
Patch to support ibm_db in rake create and drop database tasks
#--
# Copyright (c) 2004-2014 David Heinemeier Hansson
#
# 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:
/*
+----------------------------------------------------------------------+
| Licensed Materials - Property of IBM |
| |
| (C) Copyright IBM Corporation 2006, 2007,2008, 2009, 2010 |
+----------------------------------------------------------------------+
| Authors: Sushant Koduru, Lynh Nguyen, Kanchana Padmanabhan, |
| Dan Scott, Helmut Tessarek, Sam Ruby, Kellen Bombardier, |
| Tony Cairns, Manas Dadarkar, Swetha Patel, Salvador Ledezma |
| Mario Ds Briggs, Praveen Devarao, Ambrish Bhargava, |
@praveend
praveend / InsertTestMain.java
Created August 2, 2012 05:56
Insert test for Mongo
public class InsertTestMain {
public static void main(String[] args) throws Exception {
int number_of_threads = 10;
String database = "mongodb";
int numOfDocsToInsert = 10000;
String collectionName = "empCollection";
Mongo m = new Mongo();
@praveend
praveend / SelectTest.java
Created August 2, 2012 05:52
Read behaviour mongo
import java.io.IOException;
import java.net.UnknownHostException;
import com.mongodb.BasicDBObject;
import com.mongodb.DB;
import com.mongodb.DBCollection;
import com.mongodb.DBCursor;
import com.mongodb.Mongo;
import com.mongodb.MongoException;
@praveend
praveend / IBM_DB.gemspec
Created April 4, 2012 17:10
IBM_DB gemspec file
# +----------------------------------------------------------------------+
# | Licensed Materials - Property of IBM |
# | |
# | (C) Copyright IBM Corporation 2006, 2007,2008,2009,2010 |
# +----------------------------------------------------------------------+
require 'rubygems'
require 'pathname'
SPEC = Gem::Specification.new do |spec|
@praveend
praveend / databases.rake
Created January 21, 2012 16:58
databases.rake file with patch applied for supporting create and drop db operations for ibm_db adapter
require 'active_support/core_ext/object/inclusion'
db_namespace = namespace :db do
task :load_config => :rails_env do
require 'active_record'
ActiveRecord::Base.configurations = Rails.application.config.database_configuration
ActiveRecord::Migrator.migrations_paths = Rails.application.paths['db/migrate'].to_a
if defined?(ENGINE_PATH) && engine = Rails::Engine.find(ENGINE_PATH)
if engine.paths['db/migrate'].existent