Skip to content

Instantly share code, notes, and snippets.

View amodm's full-sized avatar

Amod Malviya amodm

View GitHub Profile
/*
* Sample code to test what happens when a debugger sets a breakpoint.
*
* Written for #WeekendDevPuzzle dated 2022-01-15
* https://twitter.com/amodm/status/1482206401103818756
*
* Steps to execute this:
* # compile program
* gcc -o testdebugcrash testdebugcrash.c
* # run program
Download the data from https://www.kaggle.com/cityofLA/los-angeles-traffic-collision-data/downloads/traffic-collision-data-from-2010-to-present.csv/24
Write a program to read the above data into memory in two formats:
1. Object oriented - for every record
2. Columnar format - a separate array for every attribute
Once the data set has been read into memory, the program should ask for a zip code.
After getting that input, the program should output the number of collisions that happened in that zipcode two times (along with time taken to process):
1. Using the object oriented in-memory store
@amodm
amodm / jsfiddle-logger.js
Last active May 17, 2017 09:48
console.log to output window on jsFiddle
// Hotlink: https://rawgit.com/amodm/09a3350ec3162b8fe27d76bc24cca373/raw/6bce576080dba78ef49fddbbda28f2e421b2caea/jsfiddle-logger.js
//
// You may need to call initJsFiddleLogger() explicitly
//
const existingConsoleLog = console && console.log;
const jsFiddleLogger = function(message) {
if (existingConsoleLog) {
existingConsoleLog(message);
}
if (typeof message === 'object') {