Skip to content

Instantly share code, notes, and snippets.

@sithu
sithu / upload.js
Created February 17, 2014 22:33 — forked from sintaxi/upload.js
// to test...
// curl -T path/to/file.tar.gz http://localhost:8000
var http = require('http')
var fs = require('fs')
http.createServer(function(req, rsp){
var file = fs.createWriteStream("mynewfile")
@sithu
sithu / upload.js
Created February 17, 2014 23:31 — forked from sintaxi/upload.js
// to test...
// curl -T path/to/file.tar.gz http://localhost:8000
var http = require('http')
var fs = require('fs')
http.createServer(function(req, rsp){
var file = fs.createWriteStream("mynewfile")
Class Main {
public void bfs()
{
// BFS uses Queue data structure
Queue queue = new LinkedList();
queue.add(this.rootNode);
printNode(this.rootNode);
rootNode.visited = true;
while(!queue.isEmpty()) {
Node node = (Node)queue.remove();
// Check student implement these logics!
// index.js
// (1 pt)
function post(request, response) {
// read 'name and email from the request.body'
// get new session id
// set new session id as the 'session_id' cookie in the response
// replace "Logged In" response with response.end(login.hello(newSessionId));
};
@sithu
sithu / gradle-how-to.groovy
Created April 21, 2014 18:42
Gradle How-To
# sudo add-apt-repository ppa:cwchien/gradle
# sudo apt-get update
# sudo apt-get install gradle
# Runnable class
apply plugin: 'java'
jar {
manifest {
attributes 'Main-Class': 'com.foo.bar.MainClass'
@sithu
sithu / App.java
Created August 6, 2014 21:28 — forked from max747/App.java
package sandbox.spring;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class App {
public static void main(String[] args) {
ApplicationContext context =
new ClassPathXmlApplicationContext("applicationContext.xml");
SampleBean sample = context.getBean(SampleBean.class);
@sithu
sithu / PollServiceClient.java
Created March 22, 2015 18:23
Poll Service Client
package edu.sjsu.cmpe273.lab2;
import io.grpc.ChannelImpl;
import io.grpc.transport.netty.NegotiationType;
import io.grpc.transport.netty.NettyChannelBuilder;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.logging.Logger;
@sithu
sithu / lab_output
Last active August 29, 2015 14:22
LAB: IO Pattern & Strategies
### Test 1 Output
ubuntu@ip-172-31-3-94:~/IO-LAB/FIO-CFG$ fio rread-latency.cfg
rread-latency-test: (g=0): rw=randread, bs=16K-16K/16K-16K, ioengine=libaio, iodepth=1
fio 1.59
Starting 1 process
rread-latency-test: Laying out IO file(s) (1 file(s) / 10240MB)
Jobs: 1 (f=1): [r] [100.0% done] [28397K/0K /s] [1733 /0 iops] [eta 00m:00s]
rread-latency-test: (groupid=0, jobs=1): err= 0: pid=1813
read : io=2044.1MB, bw=34900KB/s, iops=2181 , runt= 60001msec
slat (usec): min=14 , max=2010 , avg=18.95, stdev= 7.17
@sithu
sithu / application.cpp
Created October 9, 2015 07:22 — forked from harrisonhjones/application.cpp
Spark Community - kokoro - Web Browser Issue
// Original Spark Community Thread: http://community.spark.io/t/how-to-access-the-core-via-we-browser/9711
// Code adapted from: http://arduino.cc/en/Tutorial/WebServer
/* Includes ------------------------------------------------------------------*/
#include "application.h"
SYSTEM_MODE(AUTOMATIC);
TCPServer server = TCPServer(80);
# Artie - Artie Server
#
# Real-time messaging service
description "artie"
start on filesystem
stop on runlevel S
respawn