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 mandelbrot.rs --emit=llvm-ir --target=riscv32imc-unknown-none-elf -C opt-level=3 */ | |
#![no_std] | |
#![feature(lang_items, start)] | |
use core::panic::PanicInfo; | |
extern "C" { | |
fn print_int(x: i32); | |
fn print_newline(); | |
} |
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
.text | |
.file "llvm-link" | |
.globl V66.V23.mul10 # -- Begin function V66.V23.mul10 | |
.p2align 2 | |
.type V66.V23.mul10,@function | |
V66.V23.mul10: # @V66.V23.mul10 | |
# %bb.0: # %entry | |
slawi %r4, %r3, 1 | |
slawi %r3, %r3, 3 | |
add %r3, %r3, %r4 |
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
" | |
let rec gcd m n = | |
if m = 0 then n else | |
if m <= n then gcd m (n - m) else | |
gcd n (m - n) in | |
() | |
" | |
.text | |
.file "gcd.ml.ll" | |
.globl V14.V6.gcd # -- Begin function V14.V6.gcd |
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
" | |
let rec dbl f = f +. f in | |
let rec yloop y = | |
if y >= 100 then () else | |
let rec xloop x y = | |
if x >= 100 then () else | |
let cr = dbl (float_of_int x) /. 100.0 -. 1.5 in | |
let ci = dbl (float_of_int y) /. 100.0 -. 1.0 in | |
let rec iloop i zr zi zr2 zi2 cr ci = | |
if i = 0 then print_int 1 else |
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
" | |
let rec fib n = if n <= 1 then n else | |
fib(n-1) + fib(n-2) in fib(3) | |
" | |
.text | |
.file "fib.ml.ll" | |
.globl V19.V9.fib # -- Begin function V19.V9.fib | |
.p2align 2 | |
.type V19.V9.fib,@function | |
V19.V9.fib: # @V19.V9.fib |
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 <ctype.h> | |
#include <memory.h> | |
#include <stdarg.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <time.h> | |
#include <unistd.h> | |
/* for SLD tata stream */ | |
typedef union { |
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 re | |
coq2 = [ | |
'Maps.v', | |
'Imp.v', | |
'Preface.v', | |
'Equiv.v', | |
'Hoare.v', | |
'Hoare2.v', |
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 numpy as np | |
import numpy.random as random | |
from numpy.testing import assert_allclose | |
from keras.models import Sequential, Model | |
from keras.layers import Input, Dense, Flatten, Concatenate | |
from rl.agents.dqn import DQNAgent | |
from rl.memory import SequentialMemory | |
from rl.processors import MultiInputProcessor |
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
%tex test http://physics.clarku.edu/sip/tutorials/TeX/intro.html | |
\documentclass[12pt]{article} | |
\usepackage{amsmath} % need for subequations | |
\usepackage{graphicx} % need for figures | |
\usepackage{verbatim} % useful for program listings | |
\usepackage{color} % use if color is used in text | |
\usepackage{subfigure} % use for side-by-side figures |
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
use std::io::{stdin, Read, Write}; | |
use std::str::FromStr; | |
#[allow(unused_imports)] | |
use std::{cmp, mem, process}; | |
#[allow(unused_imports)] | |
use std::collections::{HashSet, BTreeMap, BTreeSet}; | |
#[allow(unused_imports)] | |
use std::fs::File; | |
macro_rules! eprintln( |