Skip to content

Instantly share code, notes, and snippets.

use std::collections::VecDeque;
use std::fmt::Debug;
use std::fs::File;
use std::io::Read;
use Opcode::*;
fn main() {
//let program =
// "3,26,1001,26,-4,26,3,27,1002,27,2,27,1,27,26,27,4,27,1001,28,-1,28,1005,28,6,99,0,0,5";
let mut program = String::new();
@vchekan
vchekan / Links
Last active March 12, 2020 01:04
Links
x=arange(0,24,0.1);
y=cos(pi*x/12)*10;
sigm=1/(1+exp(-y))*120+0.005;
plot(x,sigm);
grid();
show();
@vchekan
vchekan / blog_simulation_framework_2.cs
Created January 5, 2016 07:41
Simulation framework, step 2
public void Simulation()
{
var duration = TimeSpan.FromDays(3);
var rnd = new Random(1);
var costAccumulator = 0.0;
var clicks = 0;
var now = new DateTime(2010, 1, 1, 12, 0, 05);
var epoch = now + duration;
var actionQueue = new C5.IntervalHeap<Tuple<DateTime, ActorType>>(new ActionQueueComparer());
@vchekan
vchekan / blog_simulation_framework_1.cs
Last active January 5, 2016 07:20
Simulation framework, step 1
public void Simulation()
{
var duration = TimeSpan.FromDays(3);
var rnd = new Random(1);
var now = new DateTime(2010, 1, 1, 12, 0, 05);
var epoch = now + duration;
var actionQueue = new C5.IntervalHeap<Tuple<DateTime, ActorType>>(new ActionQueueComparer());
actionQueue.Add(Tuple.Create(now + TimeSpan.FromSeconds(10), ActorType.Timer));
@vchekan
vchekan / linux_perf
Last active December 22, 2015 17:30
Linux perf
yum install perf blktrace yum-utils trace-cmd
# Stat for a process
perf stat -p 80983 -a -- sleep 10
# Probe stack traces at 99Hz for a process for 10 sec
perf record -F 99 -p 80983 -g -- sleep 10
perf report [n | --stdio]
bin/kafka-run-class.sh kafka.tools.ConsumerOffsetChecker --group <group name>
@vchekan
vchekan / windbg clr
Last active April 20, 2018 15:04
Windbg for clr cheatsheet
### making a memory dump
adplus.exe -hang -iis -o c:\dumps
Symbol search path: srv*c:\symbols*http://msdl.microsoft.com/download/symbols
.loadby sos clr
!threads
!threadpool
~* e !clrstack ### show all clr stacks
.cls ### clear screen
@vchekan
vchekan / gist:4173488
Created November 30, 2012 02:50
ufraw batch convertor
ufraw-batch --wb=camera --exposure=auto --out-type=jpeg --out-path=converted *.CR2