Skip to content

Instantly share code, notes, and snippets.

@eholk
eholk / morse.js
Last active November 8, 2020 20:46
A Morse Code generator in Java Script
// Copyright 2014–2017, Eric Holk
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
int main(int argc, char **argv) {
ARGC = argc;
ARGV = argv;
int result = harlan_main();
printf("JITTIME: %f\n", double(g_memtime) / 1e9);
return result;
}
make
rustc --lib -O scirust.rs
matrix/matrix.rs:265:54: 266:9 error: cannot infer an appropriate lifetime due to conflicting requirements
matrix/matrix.rs:265 i: i, j: j, rows: rows, cols: cols, base: self
matrix/matrix.rs:266 }
matrix/matrix.rs:257:72: 267:5 note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the block at 257:72...
matrix/matrix.rs:257 -> SubMatrix_t<'self, T, TransposeMatrix<'self, T, M>> {
matrix/matrix.rs:258 assert!(rows > 0);
matrix/matrix.rs:259 assert!(cols > 0);
matrix/matrix.rs:260 assert!(i < self.num_rows());
#include <stdio.h>
int main() {
int label = 0;
goto stop;
while(1) {
switch(label) {
case 0:
(library
(harlan middle remove-lambdas)
(export remove-lambdas
M0 unparse-M0 parse-M0
M1 unparse-M1)
(import
(rnrs)
(only (chezscheme) pretty-print trace-define)
(nanopass)
(except (elegant-weapons match) ->)
macro_rules! foo (
// 24 in a row!
(!@#~=|%^&:/+*(){,}[;].$_x:ident) => { 5 }
)
fn main() {}
;; The first language in the middle end.
(define-language M0
(terminals
(region-var (r))
(variable (x name)))
(Rho-Type
(t)
x)
(Module
(m)
[155-99-220-127:HSBencher eholk]$ ghc-pkg list network
/usr/local/Cellar/ghc/7.6.3/lib/ghc-7.6.3/package.conf.d
/Users/eholk/.ghc/x86_64-darwin-7.6.3/package.conf.d
network-2.3.1.1
network-2.4.1.2
pub fn zero_matrix<T: Copy Ring, M: BasicMatrix<T> Create<T, M>>(n: uint, m: uint) -> M
{
Create::create::<T, M, M>(n, m, |_i, _j| Ring::zero::<T>())
}
// call site
__kernel void MyAdd_col(const double __global *A,
const double __global *B,
double __global *C,
unsigned long int N)
{
unsigned long int i = get_global_id(0);
for(unsigned long int j = 0; j < N; j++) {
if (j % 2 == 0)
get(C, N, i, j) = get(A, N, i, j) + get(A, N, i, j);