Skip to content

Instantly share code, notes, and snippets.

Strikeskids

Block or report user

Report or block Strikeskids

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gradescope-helper.js
// ==UserScript==
// @name Gradescope Keyboard Shortcuts
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Keyboard shortcuts to make grading faster.
// @author Strikeskids
// @match https://www.gradescope.com/*grade
// @grant none
// ==/UserScript==
View frankenpickle-exploit.py
#!/usr/bin/env python
# Written by Strikeskids
from __future__ import print_function
from pwn import *
from time import sleep
import random, string, pickle
from copy import deepcopy
from hashlib import md5
@Strikeskids
Strikeskids / Icpc.java
Created Feb 21, 2018
Template for writing ACM ICPC solutions in Java
View Icpc.java
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class Icpc {
public static void main(String... args) throws Exception {
View flow.md

The basic steps are listed below. They are described in more detail afterwards.

  1. Update master
  2. Use a work branch
  3. Clean up your work before sharing
  4. Pull request so that people get notified (or merge)
  5. Clean up your workspace to start again

When doing work, always make sure to update and checkout a new branch. This way, we keep the main branch clean.

View fourier.path.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<script src="http://cdnjs.cloudflare.com/ajax/libs/mathjs/1.2.0/math.js"></script>
<style id="jsbin-css">
#source {
display: none;
}
View stdinstdout.py
while True:
cmd = raw_input()
noprint =False
noexec =False
if cmd[0]=='x':
noprint=True
if cmd[0]=='p':
noexec=True
if not noexec:
View bit.html
<h1 id="binary-indexed-trees-and-segment-trees">Binary Indexed Trees and Segment Trees</h1>
<h2 id="the-problem">The Problem</h2>
<p>We want to have a data structure that allows us to do two things</p>
<ol>
<li>Make queries of the form <code>f(a[i], ..., a[j])</code> for <code>i &lt;= j</code> (the <strong>query</strong>)</li>
<li>Update <code>a[i] = v</code> for some <code>i</code> (the <strong>update</strong>)</li>
</ol>
<p>Naively, one could do this in such a way that either the query or the update is <code>O(1)</code> and the other is <code>O(n)</code>. The most basic method would be to simply store <code>a[i]</code> and then for the query, simply compute the function in <code>O(n)</code>. However, that will obviously not be good enough for practical applications. </p>
<h2 id="segment-trees">Segment Trees</h2>
<p>Segment trees provide a way to efficiently and easily perform both the query and the update in <code>O(log n)</code>. The key to how this works is that the cumulative totals are stored in a tree
View bit.md

Binary Indexed Trees and Segment Trees

The Problem

We want to have a data structure that allows us to do two things

  1. Make queries of the form f(a[i], ..., a[j]) for i <= j (the query)
  2. Update a[i] = v for some i (the update)

Naively, one could do this in such a way that either the query or the update is O(1) and the other is O(n). The most basic method would be to simply store a[i] and then for the query, simply compute the function in O(n). However, that will obviously not be good enough for practical applications.

View eighth.js
(function() {
var form = document.querySelector('form[name=activity_select_form]')
var matches = document.location.href.match(/\/bids\/([0-9]*)/)
if (form && matches[1]) {
form.innerHTML += '<input type="hidden" name="bid" value="' + matches[1] + '" />'
form.action = 'https://iodine.tjhsst.edu/api/eighth/signup_activity'
form.target = '_blank'
form.addEventListener('submit', setTimeout.bind(null, window.history.back.bind(window.history), 1000))
document.querySelector('div.blurb').innerHTML += ' API Signup enabled.'
}
View DataLogger.java
package com.sk.bot;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.AbstractCollection;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
You can’t perform that action at this time.