Skip to content

Instantly share code, notes, and snippets.

View Viswanathantv's full-sized avatar

Viswanathan Viswanathantv

View GitHub Profile
@Viswanathantv
Viswanathantv / Typo
Created November 26, 2014 02:54
Typo
^Croot@DesiBody:~/desibody# sails lift
info: Starting app...
error: A hook (`orm`) failed to load!
error: SyntaxError: Unexpected token x
at Object.parse (native)
at Database.read (/usr/local/lib/node_modules/sails/node_modules/sails-disk/lib/database.js:200:18)
at Array.async.auto.checkData [as 0] (/usr/local/lib/node_modules/sails/node_modules/sails-disk/lib/database.js:59:12)
at /usr/local/lib/node_modules/sails/node_modules/async/lib/async.js:459:38
http://104.131.4.231:1337/learn/find?base_exercise=Warmup
http://104.131.4.231:1337/learn/find?base_exercise=Pushup
http://104.131.4.231:1337/learn/find?base_exercise=Crunch
http://104.131.4.231:1337/learn/find?base_exercise=Squat
http://104.131.4.231:1337/learn/find?base_exercise=Cooldown
http://104.131.4.231:1337/learn/find?base_exercise=Science%20of%20DB
@Viswanathantv
Viswanathantv / Movie lens
Last active August 29, 2015 14:09
Machine learning
cd simple-app
../sbt/sbt package
../spark/bin/spark-submit --class "SimpleApp" --master local[*] target/scala-2.10/simple-project_2.10-1.0.jar
python bin/rateMovies
cd machine-learning/python
usb/spark/bin/spark-submit MovieLensALS.py usb/data/movielens/medium/ ../personalRatings.txt
@Viswanathantv
Viswanathantv / caide
Created November 11, 2014 13:12
java
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://104.131.4.231:1337/scoreboard/find");
try {
String data = "{\n" +
"\n" +
"\"where\": {\n" +
"\"age\":{\n" +
"\"<\" : 30\n" +
"} \n" +
Mainactivity.java
static final String ClientID = "OXLAh5px6k1X1iryA6OzrdhAABYz1625";
static final String Tenant = "linez";
static final String Callback = "http://YOUR_APP/callback";
static final String Connection = "google-oauth2"; //change to "paypal", "linkedin", etc or leave empty to show the widget
All functionality is encapsulated in the AuthenticationActivity class. Calling it requires just a couple lines of code:
Intent authActivity = new Intent(MainActivity.this,
{
"error": "(DataError) time zone \"None\" not recognized\n 'SELECT count(DISTINCT trip_us.driver_id) AS user_count, sum(trip_us.drive_time) AS drive_time, sum(trip_us.distance) AS distance \\nFROM trip_us, (SELECT driver.driver_id AS driver_id \\nFROM driver \\nWHERE driver.application_id = %(application_id_1)s) AS driver_query \\nWHERE trip_us.driver_id = driver_query.driver_id AND local_time(trip_us.timestamp, trip_us.timezone) >= %(local_time_1)s AND local_time(trip_us.timestamp, trip_us.timezone) <= %(local_time_2)s' {'local_time_2': '2014-09-07', 'application_id_1': 'umano_app', 'local_time_1': '2014-09-01'}"
}
http://api.zendrive.com/v1/score?apikey=2RifMKrPczDex1jlfEFOwfnNkOtfIJs5&start_date=2014-9-01&end_date=2014-9-07
@Viswanathantv
Viswanathantv / node
Created July 20, 2014 09:19
implementation in node
var msgpack = require('msgpack-js');
var unirest = require('unirest');
var http = require('http');
var net = require('net');
var clients = {};
var Buffer = require('buffer').Buffer;
{
"Cube9 Ventures" : {
"Devices" : {
"PL2014000001" : {
"HWVersion" : "0000001",
"ModuleInfo" : "Module info comes here",
"Date Of Installation" : "24/07/2014",
"Controls" : {
class User
include Mongoid::Document
include Mongoid::Timestamps
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
## Database authenticatable
field :email, type: String, default: ""
rails g scaffold OPHTHALMOLOGY name:string hospital_no:integer complaints:string present_history:string past_history:string pallor:string oedema:string bp:string pulse:string cardiovascular_system:string respiratory_system:string respiratory_system:string alimentary_system:string central_nervous_system:string position_of_head:string position_of_eyeball:string ocular_movements:string visual_activity:string retinoscopy_bcva:string eyebrows_eyelashes:string lids:string conjuctiva_cornea:string anterior_chamber:string iris:string lens:string pupil:string pupillary_reactions:string ciliary_tenderness:string introcular_pressure:string lacrimal_sac:string fundus_examination:string silt_lamp_examination:string diagnosis:string