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
<?xml version="1.0" encoding="UTF-8" ?> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<!-- This file was created with the aha Ansi HTML Adapter. https://github.com/theZiz/aha --> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="application/xml+xhtml; charset=UTF-8"/> | |
<title>/tmp/115f219</title> | |
</head> | |
<body> | |
<pre> |
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
; ModuleID = 'binsearch_bench.cgu-0.rs' | |
source_filename = "binsearch_bench.cgu-0.rs" | |
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" | |
target triple = "x86_64-unknown-linux-gnu" | |
%str_slice = type { i8*, i64 } | |
%"test::Bencher" = type { %"core::option::Option<test::stats::Summary>", [0 x i8], i64, [0 x i8], i8, [7 x i8] } | |
%"core::option::Option<test::stats::Summary>" = type { i64, [0 x i64], [14 x i64] } | |
%closure = type { %"collections::vec::Vec<usize>"*, [0 x i8] } | |
%"collections::vec::Vec<usize>" = type { %"alloc::raw_vec::RawVec<usize>", [0 x i8], i64, [0 x i8] } |
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
#![feature(test, rand)] | |
extern crate test; | |
extern crate rand; | |
use test::Bencher; | |
use rand::{Rng, XorShiftRng}; | |
pub fn heapsort_new<T, F>(v: &mut [T], is_less: &mut F) | |
where F: FnMut(&T, &T) -> bool | |
{ | |
// This binary heap respects the invariant `parent >= child`. |
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
#![feature(test)] | |
#![feature(core_intrinsics)] | |
extern crate test; | |
use test::Bencher; | |
use std::cmp; | |
use std::cmp::Ordering; | |
use std::intrinsics; | |
fn binary_search(ss: &[usize], search: usize) -> Result<usize, usize> | |
{ |
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
pub struct K8055<'a> { | |
ctx: usb::Context, | |
dev: usb::Device<'a>, | |
hd: Option<usb::DeviceHandle<'a>>, | |
state: State | |
} | |
impl<'a> K8055<'a> { | |
/// Create a new K8055 instance with the first card found on the system. | |
/// |
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
## | |
+@############# ################# | |
## |
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
{-# LANGUAGE FlexibleInstances #-} | |
import Codec.Picture.Repa | |
import qualified Data.Array.Repa as R | |
import qualified Data.Array.Repa.Unsafe as RU | |
import qualified Data.Vector.Unboxed as VU | |
import Data.Array.Repa.Repr.ForeignPtr (F) | |
import Data.Array.Repa ((:.), Array, (:.)(..), Z(..), DIM3) | |
import System.Environment | |
import Data.Word | |
import Criterion.Main |
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(mandelbrot). | |
-export([main/1]). | |
-define(LIM_SQR, 4.0). | |
-define(ITER, 50). | |
-define(SR, -1.5). | |
-define(SI, -1). | |
main([Arg]) -> | |
N = list_to_integer(Arg), | |
io:put_chars(["P4\n", Arg, " ", Arg, "\n"]), |
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 Mandelbrot do | |
defmacrop lim_sqr do 4.0 end | |
defmacrop iter do 50 end | |
defmacrop sr do -1.5 end | |
defmacrop si do -1 end | |
def main do | |
n = 16000 | |
IO.write('P4\n#{n} #{n}\n') | |
row = fn(y) -> Process.spawn(fn() -> row(0, si()+y*2/n, n, 0, [], 7) end) end |
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 Main where | |
import Data.Array.Repa | |
import Data.Array.Repa.IO.DevIL | |
import Data.Word | |
import Directory | |
import Control.Monad.IO.Class | |
expTable:: Int -> Double -> [Double] | |
expTable sx m = [exp(fromIntegral i / m) | i <- [0..sx]] |