This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <assert.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <inttypes.h> | |
#include <time.h> | |
#include "../common/lwindex_sscanf_unrolled.h" | |
#define ASSERT_EQ(a, b) \ | |
if (a != b) { \ | |
printf("Test failed: %s expected %d, got %d\n", #a, b, a); \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# @param {Integer[]} nums | |
# @return {Boolean} | |
def can_partition(nums) | |
sum = nums.sum | |
return false if sum.odd? | |
nums.sort! | |
nums.reverse! | |
half_sum = sum / 2 | |
dp = Set.new | |
0.upto(nums.size-1) do |i| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def iterate(target, max_mines) | |
lumber = 0 | |
lumber_increase = 0 | |
gold = 0 | |
gold_increase = 512 | |
seirei = 0 | |
mines = 0 | |
time = 0 | |
puts "Targeting %d, max mines %d" % [target, max_mines] | |
while lumber < target do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var args = require('system').args; | |
if (args.length !== 3) { | |
console.log(args[0] + ' <username> <password>'); | |
phantom.exit(); | |
} | |
var fs = require('fs'); | |
var page = require('webpage').create(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def combination_sum(candidates, target) | |
dp = Array.new(target+1) {Array.new} | |
candidates.each do |n| | |
n.upto(target) do |t| | |
next dp[t] << [n] if n == t | |
dp[t] += dp[t - n].map {|comb| comb.dup + [n]} | |
end | |
end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Node | |
attr_accessor :parent, :value, :width | |
attr_reader :left, :right | |
def initialize(value, left=nil, right=nil) | |
@value = value | |
@parent = nil | |
self.left = left | |
self.right = right | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Disable Commercial Repo | |
sed -i "s/^deb/\#deb/" /etc/apt/sources.list.d/pve-enterprise.list | |
apt-get update | |
# Add PVE Community Repo | |
echo "deb http://download.proxmox.com/debian/pve $(grep "VERSION=" /etc/os-release | sed -n 's/.*(\(.*\)).*/\1/p') pve-no-subscription" > /etc/apt/sources.list.d/pve-no-enterprise.list | |
apt-get update | |
# Remove nag | |
echo "DPkg::Post-Invoke { \"dpkg -V proxmox-widget-toolkit | grep -q '/proxmoxlib\.js$'; if [ \$? -eq 1 ]; then { echo 'Removing subscription nag from UI...'; sed -i '/data.status/{s/\!//;s/Active/NoMoreNagging/}' /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js; }; fi\"; };" > /etc/apt/apt.conf.d/no-nag-script |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <avisynth.h> | |
#include <windows.h> | |
#define AVS_INTERFACE_26 6 | |
typedef IScriptEnvironment * __stdcall CREATE_ENV(int); | |
const AVS_Linkage *AVS_linkage = NULL; | |
IScriptEnvironment * env; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 816c62dbcecd99a832090288c25190e5d398feb4 Mon Sep 17 00:00:00 2001 | |
From: Holy Wu <[email protected]> | |
Date: Sun, 11 Aug 2019 23:13:30 +0800 | |
Subject: [PATCH] Add parameter cachefile | |
--- | |
AviSynth/lsmashsource.cpp | 4 ++-- | |
AviSynth/lwlibav_source.cpp | 30 +++++++++++++++++------------- | |
VapourSynth/lsmashsource.c | 2 +- | |
VapourSynth/lwlibav_source.c | 3 +++ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
cd "$(dirname "$0")" >/dev/null && [ -f x264.h ] || exit 1 | |
echo "#define XSTR(x) STR(x)" | |
echo "#define STR(x) #x" | |
git rev-list HEAD | sort > config.git-hash | |
LOCAL_VER=`wc -l config.git-hash | awk '{print $1}'` | |
GIT_HEAD=`git branch --list | grep "*" | awk '{print $2}'` |
NewerOlder