I hereby claim:
- I am Xyene on github.
- I am tbrindus (https://keybase.io/tbrindus) on keybase.
- I have a public key whose fingerprint is A820 1E45 7FA2 F46C 8E6D 64DB 68D2 26AF B0EA 8BAB
To claim this, I am signing this object:
/** | |
* A random number generator based on the simple and fast xor-shift pseudo | |
* random number generator (RNG) specified in: | |
* Marsaglia, George. (2003). Xorshift RNGs. | |
* http://www.jstatsoft.org/v08/i14/xorshift.pdf | |
* Translated from: | |
* http://www.codeproject.com/Articles/9187/A-fast-equivalent-for-System-Random. | |
*/ | |
@SuppressWarnings("SuspiciousNameCombination") | |
public class Random extends java.util.Random { |
# These instructions assume a clean install of a Debian image from the Windows store | |
sudo mkdir /code | |
sudo chmod 777 /code | |
cd /code | |
sudo apt install -y git vim | |
git clone https://github.com/Xyene/wsl-dotfiles.git | |
cd wsl-dotfiles |
package jmorse; | |
import java.io.*; | |
import java.util.*; | |
import javax.sound.sampled.*; | |
public class Morse { | |
private static final int DOT = 200, DASH = DOT * 3, FREQ = 800; | |
private static String[] morse = {".-", "-...", "-.-.", "-..", ".", "..-.", "--.", "....", "..", ".---", "-.-", ".-..", "--", "-.", "---", ".--.", "--.-", ".-.", "...", "-", "..-", "...-", ".--", "-..-", "-.--", "--.."}; |
import com.google.common.collect.Sets; | |
import org.apache.commons.lang.ArrayUtils; | |
import org.apache.commons.lang.StringUtils; | |
import org.bukkit.ChatColor; | |
import org.bukkit.command.*; | |
import org.bukkit.entity.Player; | |
import org.bukkit.plugin.Plugin; | |
import org.bukkit.plugin.SimplePluginManager; | |
import java.lang.annotation.ElementType; |
#define MAX_CMDLINE 8191 | |
wchar_t result[MAX_CMDLINE]; | |
memset(result, 0, sizeof(result)); | |
BOOL needquote = FALSE; | |
for (int i = 2; i < argc; i++) { | |
wchar_t *arg = argv[i]; | |
wprintf(L"arg %d = %ls\n", i, arg); |
from piazza_api import Piazza | |
import time | |
import requests | |
import json | |
EMAIL = 'you@mail.utoronto.ca' | |
PASSWORD = 'hunter2' | |
WEBHOOK_URL = 'https://hooks.slack.com/services/#####/##########' | |
CLASS_NAME = 'CSC209' | |
NETWORK_ID = 'jbcmehb923110u' |
I hereby claim:
To claim this, I am signing this object:
import net.minecraft.server.v1_4_R1.CrashReport; | |
import net.minecraft.server.v1_4_R1.MinecraftServer; | |
import org.apache.commons.lang.exception.ExceptionUtils; | |
import org.bukkit.Bukkit; | |
import org.bukkit.craftbukkit.v1_4_R1.CraftServer; | |
import org.bukkit.plugin.Plugin; | |
import org.bukkit.plugin.PluginLogger; | |
import org.bukkit.plugin.java.JavaPlugin; | |
import org.json.simple.JSONObject; | |
import org.json.simple.JSONValue; |
This is the recommended way to run the DMOJ on Windows, but requires the Windows Subsystem for Linux (WSL) that was added in the Windows 10 Anniversary Update. You will need to enable the subsystem before proceeding.
Open Bash by tying bash
in command prompt, or running it directly.
We'll need a couple of packages to get started, after which we can begin setting up the judge.
init.yml specifies signatures for all methods, e.g.:
int findSwapPairs(int, int[], int, int[])
functions:
findSwapPairs: (I[II[I[I[I[I)I
There are two types of functions: functions that the grader calls from C->Java, and functions that Java calls that are implemented in C. The latter is slightly easier to discuss.
We can autogenrate Java classes binding those methods statically, e.g.: