Skip to content

Instantly share code, notes, and snippets.

View apsun's full-sized avatar

Andrew Sun apsun

View GitHub Profile
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
namespace RenameDate
{
class Program
{
#NoEnv
#Warn
#NoTrayIcon
#SingleInstance Force
SendMode Input
;-------------------------------------------------------------------------------
;-------------------------------------Setup-------------------------------------
;-------------------------------------------------------------------------------
MsgLines := 0
#NoEnv
#Warn
#NoTrayIcon
#SingleInstance Force
#Include CommonFunctions.ahk
SendMode Input
; Change the following line to match your computer locale!
; If you don't change it, there will be issues
; when the all programs category is already expanded.
; In order to tack on a layer on abstraction, this script
; wraps many commonly used AHK commands as functions.
WarningMsgBox(title, message)
{
MsgBox, 48, %title%, %message%
}
InfoMsgBox(title, message)
{
MsgBox, 64, %title%, %message%
#NoEnv
#Warn
#NoTrayIcon
#SingleInstance force
#Include CommonFunctions.ahk
SendMode Input
;-----------------------------------------------------------------------------------------------
;------------------------------------------Toggle on/off----------------------------------------
;-----------------------------------------------------------------------------------------------
import java.util.HashMap;
import java.util.Map;
public class Georgify {
private static final Map<Character, String> NEIGHBOR_KEYS;
static {
NEIGHBOR_KEYS = new HashMap<>(26);
// Top row
NEIGHBOR_KEYS.put('q', "wa");
import java.util.Arrays;
public class LongestIncreasingSubsequence {
public static int[] longestIncreasingSubsequence(int[] input) {
int[] indices = new int[input.length];
int[] lengths = new int[input.length];
int mainIndex = -1;
for (int i = 0; i < input.length; ++i) {
int maxIndex = i, maxLength = 0;
for (int j = 0; j < i; ++j) {
#ifndef UNICODE
#define UNICODE
#endif
#ifndef _UNICODE
#define _UNICODE
#endif
#include <SDKDDKVer.h>
#include <Windows.h>
#include <comdef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int read_stdin_ignore_nl(char *output_buf, int size) {
int i = 0, c;
while (i < size) {
c = getchar();
if (c == EOF) {
fprintf(stderr, "Reached EOF, expected %d chars, got %d\n", i, size);
import com.badlogic.gdx.utils.Json;
import com.badlogic.gdx.utils.JsonValue;
import com.crossbowffs.luabridge.LuaArrayIterator;
import com.crossbowffs.luabridge.LuaMapIterator;
import com.crossbowffs.luabridge.LuaUtils;
import org.luaj.vm2.*;
/**
* A {@link LuaTable} serializer module for {@link Json}. Note that if
* the table is an array (see {@link LuaUtils#isArray(LuaTable)}),