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
using Distributed | |
@assert size(ARGS)[1] == 3 | |
@assert ARGS[3] == "verbose" || ARGS[3] == "quiet" | |
local_processes = parse(Int, ARGS[1]) | |
local_iterations = parse(Int, ARGS[2]) | |
local_verbose = ARGS[3] == "verbose" | |
Distributed.addprocs(local_processes) |
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
Activating environment at `~/julia/Snarl/Project.toml` | |
Testing Snarl | |
Status `/tmp/jl_DAlxOw/Project.toml` | |
[d06fb421] Snarl v0.1.0 `~/julia/Snarl` | |
[ade2ca70] Dates `@stdlib/Dates` | |
[8ba89e20] Distributed `@stdlib/Distributed` | |
[56ddb016] Logging `@stdlib/Logging` | |
[9a3f8284] Random `@stdlib/Random` | |
[1a1011a3] SharedArrays `@stdlib/SharedArrays` | |
[8dfed614] Test `@stdlib/Test` |
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
#' Compute rows and columns orders which move high values close to the diagonal. | |
#' | |
#' For a matrix expressing the cross-similarity between two (possibly different) | |
#' sets of entities, this produces better results than clustering (e.g. as done | |
#' by \code{pheatmap}). This is because clustering does not care about the order | |
#' of each two sub-partitions. That is, clustering is as happy with \code{((2, 1), | |
#' (4, 3))} as it is with the more sensible \code{((1, 2), (3, 4))}. As a result, | |
#' visualizations of similarities using naive clustering can be misleading. | |
#' | |
#' @param data A rectangular matrix. |
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
import dash | |
import dash_core_components as dcc | |
import dash_html_components as html | |
from dash.dependencies import Input, Output | |
import plotly.graph_objs as go | |
import pandas as pd | |
import numpy as np | |
from math import ceil | |
from math import floor |
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
mod code { | |
use macros; // compiler warning: unused import :-( | |
#[test] | |
fn asserts() { | |
assert_eq!(1, 1); | |
assert_ne!(1, 2); // compiler error: macro undefined :-( | |
} | |
} |
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
/// Intern a string using the task local interner. | |
pub fn intern(burrowed: &str) -> Intern { | |
do local_data::get(KEY_ARC_INTERNER) |maybe_arc_interner| { | |
match maybe_arc_interner { | |
None => fail!("no task local ARC for global interner"), | |
Some(arc_interner) => { | |
// TRICKY: Only obtain a read lock for the common case | |
// where the string was previously interned. | |
do arc_interner.read |interner| { | |
match interner.str_to_intern.find(&burrowed.to_str()) { |
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
src/anthill/intern.rs:71:24: 73:25 error: instantiating a type parameter with an incompatible type `intern::intern::Interner`, which does not fulfill `Send+Freeze` | |
src/anthill/intern.rs:71 do arc_interner.read |interner| { | |
src/anthill/intern.rs:72 interner.id_to_str[self.id].clone() | |
src/anthill/intern.rs:73 } | |
src/anthill/intern.rs:88:20: 108:21 error: instantiating a type parameter with an incompatible type `intern::intern::Interner`, which does not fulfill `Send+Freeze` | |
src/anthill/intern.rs:88 do arc_interner.read |interner| { | |
src/anthill/intern.rs:89 match interner.str_to_intern.find(&burrowed.to_str()) { | |
src/anthill/intern.rs:90 Some(intern) => *intern, | |
src/anthill/intern.rs:91 None => { | |
src/anthill/intern.rs:92 // TRICKY: If we didn't find it above, we need |
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
$ rustc --lib src/atom/crate.rs | |
src/anthill/atom.rs:3:4: 5:5 warning: missing documentation for a struct | |
src/anthill/atom.rs:3 pub struct Atom { | |
src/anthill/atom.rs:4 priv id: int, | |
src/anthill/atom.rs:5 } | |
src/anthill/crate.rs:4:7: 4:18 note: lint level defined here | |
src/anthill/crate.rs:4 #[warn(missing_doc)] | |
^~~~~~~~~~~ | |
warning: missing crate link meta `name`, using `crate` as default | |
warning: missing crate link meta `vers`, using `0.0` as default |
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
defmodule Mix.Tasks.Test do | |
use Mix.Task | |
@shortdoc "Run a project's tests" | |
@moduledoc """ | |
Run the tests for a project. | |
This task will preload the `test/test_helper.exs` which | |
should do all testing setup and then require all files |
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
defmodule Extension do | |
defmacro extends(module) do | |
# As above... | |
end | |
defmacro implements(module, protocol: protocol) do | |
quote do | |
defimpl unquote(protocol), for: unquote(module) do | |
import Extension |
NewerOlder