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
/// strategy: | |
/// - first copy the list of exprs -- the copy will just be used as a counter | |
/// - then, starting with all the exprs in a "left" list and an empty "right" list: | |
/// - move one expr at a time from "left" to "right", and decrement the counter _twice_ | |
/// - when the counter is zero, the halving is complete | |
/// - if there were an odd number of exprs, a compile error tells you about it | |
/// the macro is in continuation passing style, so you pass in a macro invocation and it will be called | |
/// twice, first with the "left" and then with the "right" (enclosed in square brackets) inserted as the last argument | |
macro_rules! halve { | |
// internal rules |
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
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css"> | |
<script src="http://cmx.io/v/0.1/cmx.js" charset="utf-8"></script> | |
<style>.cmx-user-scene4 .cmx-text-border .cmx-path {stroke: orange}</style> | |
<body> | |
<div style="max-width:1200px; -webkit-transform:rotate(0deg)"> | |
<scene id="scene1"> | |
<drawing t="translate(0,31)"> |
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(trace_macros)] trace_macros!(true); | |
macro_rules! doc_items { | |
(@distribute $docs:tt $($item:item)*) => { | |
$(doc_items!(@output $docs $item);)* | |
}; | |
(@output [$($doc:expr),*] $item:item) => { | |
$(#[doc=$doc])* | |
$item | |
}; |
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
static BUTTON: AtomicBool = AtomicBool::new(false); | |
#[entry] | |
fn main() { | |
let mut cp = cortex_m::Peripherals::take().unwrap(); | |
let dp = stm32f30x::Peripherals::take().unwrap(); | |
let mut flash = dp.FLASH.constrain(); | |
let mut rcc = dp.RCC.constrain(); |
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
fn toggle_between_A_and_B_while_keeping_value(&mut self) { | |
*self = match self { | |
E::A { value } => { E::B { value: mem::replace(value, S::dummy()) } } | |
E::B { value } => { E::A { value: mem::replace(value, S::dummy()) } } | |
}; | |
} |
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
macro_rules! group_attr { | |
(#[cfg($attr:meta)] $($yes:item)*) => { | |
$(#[cfg($attr)] $yes)* | |
} | |
} |
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
fn main() -> ! { | |
let (mut delay, mut leds): (Delay, Leds) = aux5::init(); | |
loop { | |
foreach!($ | |
state => [on off] | |
period => [500 100] | |
{ | |
for led in 0..8 { | |
leds[led].$state(); |
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
\section{References} | |
\vspace{-1.4em} | |
\setlength{\tabcolsep}{.075in} | |
\renewcommand{\arraystretch}{3} | |
\begin{tabular}{@{}l b{3.1in}} | |
\makecell[l]{ | |
Dr.\ Katherine J. Kuchenbecker \\ | |
Max Planck Institute for Intelligent Systems \\ | |
\plus 49 711 689-3510 \\ | |
\url{kjk@is.mpg.de} \\ |
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
\setlength{\tabcolsep}{.05in} | |
\renewcommand{\arraystretch}{3} | |
\begin{tabular}{@{}l b{3.1in}} | |
\makecell[l]{ | |
Dr.\@ Katherine J. Kuchenbecker \\ | |
Max Planck Institute for Intelligent Systems \\ | |
+49 711 689-3510 \\ | |
\url{kjk@is.mpg.de} \\ | |
\url{https://hi.is.mpg.de/person/kjk} | |
} & {\raggedright Dr.\@ Kuchenbecker was my academic advisor at the University of Pennsylvania from 2013-2018 and now directs the Haptic Intelligence Department at MPI-IS.\par} \\ |
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
\raggedright | |
\begin{tabular}{l m{3.25in}} | |
\makecell[l]{ | |
Dr. Katherine J. Kuchenbecker \\ | |
Max Planck Institute for Intelligent Systems \\ | |
+49 711 689-3510 \\ | |
\url{kjk@is.mpg.de} \\ | |
\url{https://hi.is.mpg.de/person/kjk} | |
} & | |
Dr. Kuchenbecker was my academic advisor at the University of Pennsylvania from 2013-2018 and now directs the Haptic Intelligence Department at MPI-IS. \\ \\ |
NewerOlder