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
int: W; | |
int: C; | |
set of int: WAREHOUSE = 1..W; | |
set of int: CLIENT = 1..C; | |
array[WAREHOUSE] of int: max_demand; | |
array[WAREHOUSE] of float: fixed_cost; | |
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 "globals.mzn"; | |
int: N; | |
int: T; | |
set of int: WORKERS = 1..N; | |
set of int: TASKS = 1..T; | |
array[TASKS, WORKERS] of int: costs; |
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 "globals.mzn"; | |
int: N; | |
int: E; | |
set of int: NODES = 1..N; | |
set of int: EDGES = 1..E; | |
array[EDGES] of int: from; | |
array[EDGES] of int: to; |
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
alias CPSolver.IntVariable | |
alias CPSolver.Model | |
alias CPSolver.Constraint | |
alias CPSolver.Constraint.Factory | |
alias CPSolver.Constraint.NotEqual | |
alias CPSolver.Constraint.Equal | |
import CPSolver.Variable.View.Factory # For linear | |
x = IntVariable.new(0..3, name: "x") | |
y = IntVariable.new(0..3, name: "y") |
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
-module(bit_vector). | |
-export([new/1, get/2, set/2, clear/2, flip/2, print/1]). | |
new(Size) -> | |
Words = (Size + 63) div 64, | |
{?MODULE, Size, atomics:new(Words, [{signed, false}])}. | |
get({?MODULE, _Size, Aref}, Bix) -> |
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
cd minisearch | |
## Note the path for solver executable | |
minisearch --stdlib-dir ./share/minizinc --solver /snap/minizinc/254/bin/fzn-gecode n_queens.mzn | |
Solution 1: | |
8 queens, CP version: | |
. Q . . . . . . | |
. . . Q . . . . | |
. . . . . Q . . | |
. . . . . . . Q |
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
async function loadScript(url) { | |
let response = await fetch(url); | |
let script = await response.text(); | |
eval(script); | |
} | |
loadScript("https://cdn.jsdelivr.net/pako/1.0.3/pako.min.js") |
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
## Commands to create lttng session/channel, start, stop and view results | |
### Create session 'test-0131' and channel 'ejabberd', specify the buffer size (4M) | |
lttng create test-0131 | |
sudo lttng enable-channel ejabberd -u --subbuf-size=4M --session=test-0131 | |
## Enable tracepoints (function_call and function_return) | |
sudo lttng enable-event -u org_erlang_dyntrace:function_return -c ejabberd | |
sudo lttng enable-event -u org_erlang_dyntrace:function_call -c ejabberd |
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
1> l(dyntrace). | |
{module,dyntrace} | |
2> Match = [{'_', [], [{return_trace}]}]. %% Enable return trace for functions of any arity | |
[{'_',[],[{return_trace}]}] | |
3> erlang:trace_pattern({'_','_','_'}, Match, []). %% Trace all functions | |
2411 | |
4> erlang:trace(all, true, [call,{tracer,dyntrace,[]}]). %% Trace function calls with dyntrace (i.e. LTTng) |
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
#!/bin/sh | |
# | |
# %CopyrightBegin% | |
# | |
# Copyright Ericsson AB 1996-2012. All Rights Reserved. | |
# | |
# The contents of this file are subject to the Erlang Public License, | |
# Version 1.1, (the "License"); you may not use this file except in | |
# compliance with the License. You should have received a copy of the | |
# Erlang Public License along with this software. If not, it can be |