Skip to content

Instantly share code, notes, and snippets.

@jugalps
jugalps / engine.c
Created May 23, 2022 09:15 — forked from druska/engine.c
Quant Cup 1's winning order book implementation
/*****************************************************************************
* QuantCup 1: Price-Time Matching Engine
*
* Submitted by: voyager
*
* Design Overview:
* In this implementation, the limit order book is represented using
* a flat linear array (pricePoints), indexed by the numeric price value.
* Each entry in this array corresponds to a specific price point and holds
* an instance of struct pricePoint. This data structure maintains a list
@jugalps
jugalps / benchmark-commands.txt
Created May 16, 2018 05:50 — forked from jkreps/benchmark-commands.txt
Kafka Benchmark Commands
Producer
Setup
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test-rep-one --partitions 6 --replication-factor 1
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test --partitions 6 --replication-factor 3
Single thread, no replication
bin/kafka-run-class.sh org.apache.kafka.clients.tools.ProducerPerformance test7 50000000 100 -1 acks=1 bootstrap.servers=esv4-hcl198.grid.linkedin.com:9092 buffer.memory=67108864 batch.size=8196
#define _GNU_SOURCE 1
#include <sched.h> // sched_setaffinity
#include <stdint.h>
#include <stdio.h>
#include <limits.h>
#include <stdlib.h>
#include <stdint.h>
#include <pthread.h>
#include <assert.h>
#include <sys/time.h>
@jugalps
jugalps / lab2.hs
Last active August 29, 2015 14:10 — forked from eccstartup/lab2.hs
module Lab2 where
------------------------------------------------------------------------------------------------------------------------------
-- Lab 2: Validating Credit Card Numbers
------------------------------------------------------------------------------------------------------------------------------
import Data.Char
-- ===================================
-- Ex. 0
-- ===================================
@jugalps
jugalps / jmeter-server.sh
Last active November 14, 2018 21:21 — forked from kamermans/jmeter-server.sh
Apache Jmeter Server init script for RedHat (tested on jmeter 2.11)
#!/bin/sh
#
# Startup script for the Apache JMeter server
# Original source: https://code.google.com/p/jmeter-utils/source/browse/wiki/jmeter.init.redhat?spec=svn2&r=2
#
# chkconfig: - 85 15
# description: Apache JMeter server
# processname: tomcat
# pidfile: /var/run/$JMETER.pid
# config:
@jugalps
jugalps / FileUploadServlet.java
Created November 13, 2013 03:45 — forked from keesun/FileUploadServlet.java
Servlet 3.0's FileUpload Sample
@WebServlet("/upload")
@MultipartConfig(location = "/tmp")
public class FileUploadServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
getServletContext().getRequestDispatcher("/WEB-INF/views/fileUpload.jsp").forward(req, res);
}
@Override
@jugalps
jugalps / eclipse.ini
Last active December 22, 2015 08:39 — forked from justingarrick/eclipse.ini
-nosplash
--launcher.defaultAction
openFile
-vm
C:/JDK7/jre/bin/server/jvm.dll #Windows
#/Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/bin/java #OS X
-vmargs
-Xincgc
-Xss1m
-Duser.name=FirstName LastName