This file contains hidden or 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
> library(forecast) | |
> train = read.csv("c.csv") | |
> T<-train[which(train$name == 'btc'), ] | |
> Train<-T[ with(T, order(ts)),] | |
> head(Train) | |
# name ts usd_value volume | |
# 1 btc 1.558271e+12 7912.8 23649292230 | |
# 15 btc 1.558272e+12 7955.9 23741378790 | |
# 29 btc 1.558272e+12 7940.0 23816540813 | |
# 43 btc 1.558272e+12 7942.9 23891912844 |
This file contains hidden or 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 perceptual_loss(x): | |
m_vgg(opt_img_v) | |
outs = [V(o.features) for o in sfs] | |
losses = [gram_mse_loss(o, s) for o,s in zip(outs, targ_styles)] | |
cnt_loss = F.mse_loss(outs[3], targ_vs[3])*1000000 | |
style_loss = sum(losses) | |
return cnt_loss + style_loss |
This file contains hidden or 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
fn describe<F: FnOnce()>(message: &str, func: F) { | |
println!("{}", message); | |
func(); | |
} | |
fn it<F: FnOnce()>(message: &str, func: F) { | |
println!(" - {}", message); | |
func(); | |
} |
This file contains hidden or 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
function expand_ecss(s) { | |
var properties_to_be_prefixed = ["transform", | |
"transform-origin", "tap-highlight-color", "ruby-position", | |
"transition-duration", "transition-property", "transition", | |
"justify-content", | |
"animation-fill-mode", "align-self", "align-items", "box-sizing", | |
"appearance", "box-shadow", "animation"] | |
var specific = { | |
background: ["linear-gradient"], | |
display: ["flex"], |
This file contains hidden or 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 debug = true | |
function scale_animation_and_transition_durations(factor) { | |
var cssRuleCode = document.all ? 'rules' : 'cssRules' | |
var ss = document.styleSheets | |
for (var i = 0, size = ss.length; i < size; i++) { | |
var r = ss[i][cssRuleCode] | |
for (var j = 0, s = r.length; j < s; j++) { | |
var rule = r[j] | |
var sel = rule.selectorText; | |
["animationDuration", "transitionDuration"].forEach(function(f) { |
This file contains hidden or 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
cp Chromium\ Framework Chromium\ Framework.old | |
perl -0777pe 's/\x39\xc8\x76\x09\x3b\x7b\x28\x76\x04\x31\xc0\xeb\x64/\x66\x66\x66\x66\x2e\x0f\x1f\x84\x00\x00\x00\x00\x00/' Chromium\ Framework > Chromium Framework.new | |
mv Chromium\ Framework.new Chromium\ Framework |
This file contains hidden or 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
| | |
| boot.s | |
| | |
| boot.s is loaded at 0x7c00 by the bios-startup routines, and moves itself | |
| out of the way to address 0x90000, and jumps there. | |
| | |
| It then loads the system at 0x10000, using BIOS interrupts. Thereafter | |
| it disables all interrupts, moves the system down to 0x0000, changes | |
| to protected mode, and calls the start of system. System then must | |
| RE-initialize the protected mode in it's own tables, and enable |
This file contains hidden or 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
$pushed = [] | |
def push(*args) $pushed = args; args.map {|r| "push #{r}" } end | |
def pop_pushed; $pushed.reverse.map {|r| "pop #{r}" } end | |
puts DATA.read.gsub(/^\s*jmp\s*[^\n]*/, '%error "Dijkstra said: No!"').gsub(/=([^\n]*)/) {|c| (eval $1).join("\n ") } | |
__END__ | |
BITS 64 | |
section .text | |
global math |
This file contains hidden or 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
constexpr uchar I_REX_B_41 = 0x41; | |
constexpr uchar I_REX_W_48 = 0x48; | |
constexpr uchar I_REX_WXB_4b = 0x4b; | |
constexpr uchar I_REX_WRXB_4f = 0x4f; | |
// INTEL: Opcodes | |
constexpr uchar I_PUSH_BP_55 = 0x55; | |
constexpr uchar I_LEA_8d = 0x8d; | |
constexpr uchar I_MOV_r8_rm8_8a = 0x8a; | |
constexpr uchar I_MOV_r64_r64_8b = 0x8b; |
This file contains hidden or 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
// calculate time left if we're more than 10% done | |
NSString *timeString = nil; | |
float percentLeft = (float)([theCanvas eventCount]-[theCanvas currentPlaybackEvent])/(float)[theCanvas eventCount]; | |
NSTimeInterval now = [NSDate timeIntervalSinceReferenceDate]; | |
if( percentLeft < 0.9f && now-_lastTimeWeEstimated > 5.0 ) { | |
_lastTimeWeEstimated = now; | |
NSTimeInterval timeLeft = (now-_exportStartTime)*(percentLeft/(1.0f-percentLeft)); | |
int hours = timeLeft/(60.0*60.0); | |
timeLeft -= (double)hours*60.0*60.0; | |
int mins = timeLeft/60.0; |
NewerOlder