Skip to content

Instantly share code, notes, and snippets.

View vadixidav's full-sized avatar
🦀
Rust ❤️

Geordon Worley vadixidav

🦀
Rust ❤️
View GitHub Profile
Compiling gpi v0.3.0 (file:///home/vadix/project/library/gpi)
src/mep.rs:105:18: 105:22 error: cannot infer an appropriate lifetime for automatic coercion due to conflicting requirements
src/mep.rs:105 mep: self,
^~~~
src/mep.rs:104:9: 104:17 note: first, the lifetime cannot outlive the expression at 104:8...
src/mep.rs:104 Box::new(ResultIterator{
^~~~~~~~
src/mep.rs:104:9: 104:17 note: ...so that a type/lifetime parameter is in scope here
src/mep.rs:104 Box::new(ResultIterator{
^~~~~~~~
src/mep.rs:105:18: 105:22 error: cannot infer an appropriate lifetime for automatic coercion due to conflicting requirements
src/mep.rs:105 mep: self,
^~~~
src/mep.rs:104:9: 104:17 note: first, the lifetime cannot outlive the expression at 104:8...
src/mep.rs:104 Box::new(ResultIterator{
^~~~~~~~
src/mep.rs:104:9: 104:17 note: ...so that a type/lifetime parameter is in scope here
src/mep.rs:104 Box::new(ResultIterator{
^~~~~~~~
src/mep.rs:105:18: 105:22 note: but, the lifetime must be valid for the expression at 105:17...
src/mep.rs:105:18: 105:22 error: cannot infer an appropriate lifetime for automatic coercion due to conflicting requirements
src/mep.rs:105 mep: self,
^~~~
src/mep.rs:104:9: 104:17 note: first, the lifetime cannot outlive the expression at 104:8...
src/mep.rs:104 Box::new(ResultIterator{
^~~~~~~~
src/mep.rs:104:9: 104:17 note: ...so that a type/lifetime parameter is in scope here
src/mep.rs:104 Box::new(ResultIterator{
^~~~~~~~
src/mep.rs:105:18: 105:22 note: but, the lifetime must be valid for the expression at 105:17...
Compiling gpi v0.3.0 (file:///home/vadix/project/library/gpi)
src/mep.rs:105:18: 105:22 error: cannot infer an appropriate lifetime for automatic coercion due to conflicting requirements
src/mep.rs:105 mep: self,
^~~~
src/mep.rs:101:5: 110:6 help: consider using an explicit lifetime parameter as shown: fn compute<'a>(&'a self, inputs: &[Param], outputs: usize)
-> Box<Iterator<Item = Param>+ 'a>
src/mep.rs:101 fn compute<'a>(&self, inputs: &[Param], outputs: usize) -> Box<Iterator<Item=Param> + 'a> {
src/mep.rs:102 //Ensure we have enough opcodes to produce the desired amount of outputs, otherwise the programmer has failed
src/mep.rs:103 assert!(outputs <= self.program.len());
src/mep.rs:104 Box::new(ResultIterator{
function drawwave(first,second,duration,firstoffset,firstheight)
hold off;
a = csvread(first);
a(1) = [];
b = csvread(second);
b(1) = [];
mina = min(a);
maxa = max(a);
rangea = maxa - mina;
a = a - mina;
extern crate num;
use num::Float;
use std::ops::{Add, Sub, Neg, Mul, Div};
//Trait that implements all the functions necessary for any n-dimensional particle
pub trait Vector<'a, 'b, D>: Sized + Clone
where D: Float, &'a Self: Add<&'b Self, Output=Self> + Sub<&'b Self, Output=Self> + Neg<Output=Self> +
Mul<D, Output=Self> + Div<D, Output=Self>
{
fn displacement(&self) -> D;
pub trait CrossPhysicsParticle<V, D>: PhysicsParticle<V, D>
where V: CrossVector<D>, D: Float
{
//Apply lorentz forces between two PhysicsParticle objects based on quanta, position, and velocity
fn lorentz(&mut self, rhs: &mut Self) {
let delta = rhs.position() - self.position();
let distance = delta.displacement();
let force = rhs.velocity().cross(&self.velocity().cross(&delta)) * self.quanta() * rhs.quanta() /
distance.powi(3);
pub trait CrossPhysicsParticle<V, D>: PhysicsParticle<V, D>
where V: CrossVector<D>, D: Float
{
//Apply lorentz forces between two PhysicsParticle objects based on quanta, position, and velocity
fn lorentz(&mut self, rhs: &mut Self) {
let delta = rhs.position() - self.position();
let distance = delta.displacement();
let force = rhs.velocity().cross(&self.velocity().cross(&delta)) * self.quanta() * rhs.quanta() /
distance.powi(3);
for i in 0..sballs.len() {
for j in i..sballs.len() {
Ball::gravitate(&mut sballs[i].ball, &mut sballs[j].ball);
}
}
acme
ambiance-radiance-colors-suite
atlauncher
atom-editor
aurget
autokey-data
autokey-gtk
autokey-qt
bf
brackets