View 1 - Fails to compile.rs
//Transform iterable collection of Strings to iterable collection of &str and pass to libMain()
fn main() {
xargo_lld_wrapper::libMain(std::env::args().map(|el| el.as_str()).collect::<Vec<_>>());
}
--
/Users/bRad/.cargo/bin/cargo test --color=always -- --nocapture
Compiling xargo-lld-wrapper v0.1.0 (file:///Users/bRad/Development/bg/experiments/rust/rpi3/xargo-lld-wrapper)
error: `el` does not live long enough
--> src/main.rs:4:68
View lib.rs
trait ArgsExtensionMethods {
fn getOutputFilename(self) -> Option<String>;
// fn removeOutputFile(&self) -> Args;
// fn removeNoStartFiles(&self) -> Args;
// fn removeWlSwitches(&self) -> Args;
}
//
impl<T> ArgsExtensionMethods for T where T: IntoIterator<Item=String> {
fn getOutputFilename(self) -> Option<String> {
self.skip_while(|ref el| *el != "-o").next()
View Steed_Issue
xargo run --target armv7-unknown-linux-steedeabihf
Compiling core v0.0.0 (file:///Users/bRad/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore)
Compiling std_unicode v0.0.0 (file:///Users/bRad/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd_unicode)
Compiling alloc v0.0.0 (file:///Users/bRad/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc)
Compiling collections v0.0.0 (file:///Users/bRad/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcollections)
Finished release [optimized] target(s) in 19.41 secs
Compiling rand v0.0.0 (file:///Users/bRad/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/librand)
Finished release [optimized] target(s) in 1.58 secs
Updating git repository `https://github.com/japaric/steed`
Updating git repository `https://github.com/redox-os/ralloc`
View workspace.sh
#!/bin/bash
# where to store the sparse-image
WORKSPACE=~/Documents/workspace.dmg.sparseimage
create() {
hdiutil create -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 60g -volname workspace ${WORKSPACE}
}
detach() {
View workspace.sh
#!/bin/bash
# where to store the sparse-image
WORKSPACE=~/Documents/workspace.dmg.sparseimage
create() {
hdiutil create -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 60g -volname workspace ${WORKSPACE}
}
detach() {
View gist:46a8e03da7e72a974465d4e916d00ff2
Socrates:hello bRad$ cargo build --target=armv7-unknown-linux-gnueabihf
Compiling hello v0.1.0 (file:///Users/bRad/Development/bg/experiments/rust/rpi3/hello)
error: linking with `arm-none-eabi-gcc` failed: exit code: 1
|
= note: "arm-none-eabi-gcc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-L" "/Users/bRad/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/armv7-unknown-linux-gnueabihf/lib" "/Users/bRad/Development/bg/experiments/rust/rpi3/hello/target/armv7-unknown-linux-gnueabihf/debug/deps/hello-482a13dcff2890d3.0.o" "-o" "/Users/bRad/Development/bg/experiments/rust/rpi3/hello/target/armv7-unknown-linux-gnueabihf/debug/deps/hello-482a13dcff2890d3" "-Wl,--gc-sections" "-pie" "-nodefaultlibs" "-L" "/Users/bRad/Development/bg/experiments/rust/rpi3/hello/target/armv7-unknown-linux-gnueabihf/debug/deps" "-L" "/Users/bRad/Development/bg/experiments/rust/rpi3/hello/target/debug/deps" "-L" "/Users/bRad/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/armv7-unknown-linux-gnueabihf/lib" "-Wl,
View gist:8a9dd3c97614f0257a0ae3d8351523e0
cat ~/.cargo/config
[target.arm-none-eabi]
linker = "arm-none-eabi-gcc"
Socrates:hello bRad$ cargo build --target=arm-none-eabi
error: failed to run `rustc` to learn about target-specific information
To learn more, run the command again with --verbose.
View RVOExperiment.cpp
#include <iostream>
using namespace std;
using Range = std::pair<double, double>;
using Range2D = std::pair<Range, Range>;
inline Range2D MakeIt(double xMin, double xMax, double yMin, double yMax)
{
return Range2D(Range(xMin, xMax), Range(yMin, yMax));
}
View gist:82a36ecf327e89e453efbc92a736d913
(IntroToTensorFlow) Socrates:udacity-sdc bRad$ python3
Python 3.6.0 |Anaconda 4.3.0 (x86_64)| (default, Dec 23 2016, 13:19:00)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/bRad/anaconda3/envs/IntroToTensorFlow/lib/python3.6/site-packages/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import *
File "/Users/bRad/anaconda3/envs/IntroToTensorFlow/lib/python3.6/site-packages/tensorflow/python/__init__.py", line 44, in <module>
View BowlingGame.cpp
//Can be called by client as follows: ScoreRollsByFrame({10, 3, 5, /* ... valid set of rolls */ })
//Note: Cast required since C++'s usual arithmetic conversions yield u16 + u8 -> i32 (!)
#include "range/v3/all.hpp"
uint16_t Score(const std::vector<uint8_t>& rolls, const uint8_t frame)
{
return frame > 10 || ranges::empty(rolls)
? 0
: static_cast<uint16_t>(ranges::accumulate(rolls
| ranges::view::take(rolls[0] + rolls[1] >= 10 ? 3 : 2), 0)