Skip to content

Instantly share code, notes, and snippets.

View kumpera's full-sized avatar

Rodrigo Kumpera kumpera

View GitHub Profile
import sys
def my_print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False):
r = ""
for o in objects:
r = r + str(o) + str(sep)
r = r + end
file.write(r)
diff --git a/vowpalwabbit/conditional_contextual_bandit.cc b/vowpalwabbit/conditional_contextual_bandit.cc
index c9041e7e3..29200a31a 100644
--- a/vowpalwabbit/conditional_contextual_bandit.cc
+++ b/vowpalwabbit/conditional_contextual_bandit.cc
@@ -420,70 +420,74 @@ void learn_or_predict(ccb& data, multi_learner& base, multi_ex& examples)
auto decision_scores = examples[0]->pred.decision_scores;
- // for each slot, re-build the cb example and call cb_explore_adf
- size_t slot_id = 0;
tijuca-91:build rokumper$ make test_with_output
[ 3%] Built target allreduce
[ 76%] Built target vw
[ 82%] Built target vw-unit-test.out
[ 85%] Built target test_search
[ 87%] Built target search_generate
[ 89%] Built target gd_mf_weights
[ 91%] Built target library_example
[ 92%] Built target ezexample_train
[ 94%] Built target ezexample_predict_threaded
tijuca-91:wasm rokumper$ make test-debugger
dotnet build DebuggerTestSuite
Microsoft (R) Build Engine version 15.8.169+g1ccb72aefa for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Restore completed in 45.88 ms for /Users/kumpera/src/mono/sdks/wasm/Mono.WebAssembly.DebuggerProxy/Mono.WebAssembly.DebuggerProxy.csproj.
Restore completed in 131.01 ms for /Users/kumpera/src/mono/sdks/wasm/ProxyDriver/ProxyDriver.csproj.
Restore completed in 131.09 ms for /Users/kumpera/src/mono/sdks/wasm/DebuggerTestSuite/DebuggerTestSuite.csproj.
Mono.WebAssembly.DebuggerProxy -> /Users/kumpera/src/mono/sdks/wasm/Mono.WebAssembly.DebuggerProxy/bin/Debug/netstandard2.0/Mono.WebAssembly.DebuggerProxy.dll
ProxyDriver -> /Users/kumpera/src/mono/sdks/wasm/ProxyDriver/bin/Debug/netcoreapp2.1/ProxyDriver.dll
tijuca:aot-sample rokumper$ ~/.jsvu/sm runtime.js --regression mini_tests_basic.dll
Loaded: mini_tests_basic.dll
Loaded: mscorlib.dll
initializing mono runtime
>>mono_wasm_runtime_ready
WASM: Initializing.....
WASM: Arguments: --regression,mini_tests_basic.dll
WASM: Test run: image=mini_tests_basic.dll, opts=peephole,branch,inline,cfold,consprop,copyprop,deadce,linears,cmov,intrins,loop,aot,exception,float32,gshared,simd,alias-analysis
WASM: Running... CallsTests:test_0_return ()
WASM: Running... CallsTests:test_2_int_return ()
WASM: bad aray class 0x950060 name object
WASM: * Assertion at /Users/kumpera/src/mono/mono/metadata/class.c:4057, condition `m_class_get_rank (ac)' not met
WASM:
uncaught exception: abort() at jsStackTrace@/Users/kumpera/src/mono/sdks/wasm/aot/mono.js:1033:13
stackTrace@/Users/kumpera/src/mono/sdks/wasm/aot/mono.js:1050:12
abort@/Users/kumpera/src/mono/sdks/wasm/aot/mono.js:14232:44
_abort@/Users/kumpera/src/mono/sdks/wasm/aot/mono.js:7221:7
_mono_log_write_logfile@aot-driver.js line 82 > WebAssembly.Module:wasm-function[6162]:0x18269b2
_structured_log_adapter@aot-driver.js line 82 > WebAssembly.Module:wasm-function[5013]:0x17cf2e6
_monoeg_g_logstr@aot-driver.js line 82 > WebAssembly.Module:wasm-function[5413]:0x17e8a55
@kumpera
kumpera / trait.cs
Created August 17, 2018 13:57
Traits for C#
interface BinaryOp {
int Apply (int a, int b);
}
struct Multiply {
public int Apply (int a, int b) {
return a * b;
}
}
using System;
namespace SimpleJit.CIL
{
public enum Opcode : byte
{
Nop = 0x00,
Break = 0x01,
This file has been truncated, but you can view the full file.
// The Module object: Our interface to the outside world. We import
// and export values on it. There are various ways Module can be used:
// 1. Not defined. We create it here
// 2. A function parameter, function(Module) { ..generated code.. }
// 3. pre-run appended it, var Module = {}; ..generated code..
// 4. External script tag defines var Module.
// We need to check if Module already exists (e.g. case 3 above).
// Substitution will be replaced with actual code on later stage of the build,
// this way Closure Compiler will not mangle it (e.g. case 4. above).
// Note that if you want to run closure, and also to use Module
using System;
namespace SimpleJit.CIL
{
public enum Opcode : byte
{
Nop = 0x00,
Break = 0x01,