This file contains hidden or 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
C:\Users\Trent\Desktop\blah\hello_world>cargo update gl -v | |
Updating git repository `https://github.com/bjz/gl-rs` | |
Unable to update https://github.com/bjz/gl-rs | |
Caused by: | |
failed to clone into: C:\Users\Trent\.cargo\git\db\gl-rs-5020f97825182d66 | |
Caused by: | |
[2] SSL is not supported by this copy of libgit2. |
This file contains hidden or 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
C:\Users\Trent\Desktop\blah\hello_world>cargo update gl -v | |
Updating git repository `https://github.com/bjz/gl-rs` | |
Unable to update https://github.com/bjz/gl-rs | |
Caused by: | |
failed to clone into: C:\Users\Trent\.cargo\git\db\gl-rs-5020f97825182d66 | |
Caused by: | |
[2] SSL is not supported by this copy of libgit2. |
This file contains hidden or 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
cargo.toml: | |
[package] | |
name = "hello_world" | |
version = "0.0.1" | |
authors = ["PudgePacket <[email protected]>"] | |
[dependencies.gl] | |
git = "https://github.com/bjz/gl-rs" |
This file contains hidden or 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
pub enum VertexData { | |
GeoVert(GeometericVertex), | |
TexVert(TextureVertex), | |
VertNml(VertexNormals), | |
PmSVert(ParameterSpaceVertex), | |
} | |
impl fmt::Show for VertexData { | |
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { | |
match *self { |
This file contains hidden or 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
pub enum LineType { | |
GeometericVertexLine(GeometericVertex), | |
FaceLine(Face), | |
Failed, | |
Unused, | |
} | |
// Geometric vertex (v) | |
pub struct GeometericVertex { | |
pub x: f64, |
This file contains hidden or 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
// Geometric vertex (v) | |
pub struct GeometericVertex { | |
pub x: f64, | |
pub y: f64, | |
pub z: f64, | |
} | |
fn new_make_geometric_vertex<Y, T: Index<uint,Y>>(d: T) -> GeometericVertex { | |
GeometericVertex { x: d[0], y: d[1], z: d[2] } | |
} |
This file contains hidden or 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 line_type_from_reg<T>(line: &str, x:fn(&str) -> Option<T>) -> LineType { | |
match x(line) { | |
Some(y) => Failed, | |
None => Failed, | |
} | |
Failed | |
} |
This file contains hidden or 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
E:\Github\Rusticle\src\types\utils.rs:139:14: 139:20 error: missing lifetime specifier [E0106] | |
E:\Github\Rusticle\src\types\utils.rs:139 static rs: [(&Regex,fn(&str) -> LineType), ..1] = [(&GeometericVertexRegex,vert_from_reg)]; | |
^~~~~~ | |
error: aborting due to previous error | |
[Finished in 0.3s] |
This file contains hidden or 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
using System; | |
using System.Text.RegularExpressions; | |
using System.Linq; | |
namespace fun { | |
class MainClass { | |
public static void Main (string[] args) { | |
var input = Console.ReadLine (); | |
Console.WriteLine (input.Contains ("+") ? Enumerable.Aggregate (from n in (new Regex (@"\d+|\.\d+|\d+\.").Matches (input).OfType<Match> ())select (n.ToString ()), (acc, x) => (float.Parse (acc) + float.Parse (x)).ToString()) : ""); | |
} |
This file contains hidden or 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
def make_counter(starting_value): | |
count = starting_value | |
def counter(): | |
nonlocal count | |
count += 1 | |
return count | |
return counter | |
my_counter = make_counter(5) | |
my_counter() |