Skip to content

Instantly share code, notes, and snippets.

@isopropylcyanide
isopropylcyanide / flink-cancel-all.sh
Created November 2, 2018 07:56
This bash script cancels all the Flink jobs that are submitted to the cluster sequentially.
@isopropylcyanide
isopropylcyanide / ObjectMapperUtil.java
Created June 20, 2018 10:20
Nested Property Object Mapper. Using reflection, takes an object and returns a map<string, string> where key is all the properties (nested inclusive) and value is the object value
import java.lang.reflect.Field;
import java.lang.reflect.ParameterizedType;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.IntStream;
import org.apache.commons.lang3.ClassUtils;
@isopropylcyanide
isopropylcyanide / littlechecker.py
Last active January 7, 2024 16:50 — forked from rajarsheem/littlechecker.py
A little code checker tool in python for Java,C,Cpp. Handles compile error, runtime error, accepted, wrong, TLE.
import os
import filecmp
import re
codes = {200: 'success', 404: 'file_name not found',
400: 'error', 408: 'timeout'}
class program:
"""Class that handles all nitty gritties of a user program"""
@isopropylcyanide
isopropylcyanide / Bash script to create user accounts.
Last active January 26, 2023 09:39 — forked from thimbl/script.sh
Shell script to create user accounts
#!/bin/bash
ROOT_UID=0
SUCCESS=0
E_USEREXISTS=70
# Run as root, of course. (this might not be necessary, because we have to run the script somehow with root anyway)
if [ "$UID" -ne "$ROOT_UID" ]
then
echo "Must be root to run this script."
exit $E_NOTROOT
@isopropylcyanide
isopropylcyanide / apriori.cpp
Last active June 21, 2018 06:58
Data Mining : Apriori Frequent Pattern Identification using C++
#include <bits/stdc++.h>
using namespace std;
#define inputFile "apriorinput"
#define _MIN_SUPPORT 2
vector<set<int> > inputVec;
set<int> allItems;
/*