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
| PS C:\Users\Austin\Rust\wingui> cargo rustc -p winapi -- -Ztime-passes | |
| Compiling winapi v0.2.4 | |
| time: 0.225; rss: 66MB parsing | |
| time: 0.066; rss: 71MB configuration 1 | |
| time: 0.000; rss: 71MB recursion limit | |
| time: 0.003; rss: 71MB gated macro checking | |
| time: 0.000; rss: 71MB crate injection | |
| time: 0.011; rss: 73MB macro loading | |
| time: 0.000; rss: 73MB plugin loading | |
| time: 0.000; rss: 73MB plugin registration |
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
| use std::io::{self, Read, Write}; | |
| fn xor(x: char, y: char) -> char { | |
| // Rust lacks the ternary operator. | |
| // Since if-blocks are expressions, it'd be redundant. | |
| if x != y { '1' } else { '0' } | |
| } | |
| fn or(x: char, y: char) -> char { | |
| if x == '1' || y == '1' { '1' } else { '0' } |
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
| #![feature(phase)] | |
| #![no_std] | |
| #![feature(globs)] | |
| #[phase(plugin, link)] | |
| extern crate "std" as std; | |
| #[prelude_import] | |
| use std::prelude::*; | |
| use std::collections::HashMap; | |
| struct Foo<'a> { |
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
| trait Prepend<T> { | |
| fn prepend(&mut self, t: T); | |
| } | |
| impl<S: Str> Prepend<S> for String { | |
| fn prepend(&mut self, s: S) { | |
| unsafe { | |
| self.as_mut_vec().prepend(s.as_slice().as_bytes()); | |
| } | |
| } |
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
| use std::num::FloatMath; | |
| struct Tri { | |
| sides: [Option<f32>, ..3], | |
| angles: [Option<f32>, ..3], | |
| ambiguous: Option<Box<Tri>>, | |
| } | |
| impl Tri { | |
| fn from_vec(vals: &[Option<f32>]) -> Tri { |
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
| Reading data from 'callgrind.out.3548'... | |
| -------------------------------------------------------------------------------- | |
| Profile data file 'callgrind.out.3548' (creator: callgrind-3.10.0.SVN) | |
| -------------------------------------------------------------------------------- | |
| I1 cache: | |
| D1 cache: | |
| LL cache: | |
| Timerange: Basic block 0 - 29927136284 | |
| Trigger: Program termination | |
| Profiled target: ./img-dup --dir=/home/austin/Dropbox/ (PID 3548, part 1) |
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
| package org.logician.sorta | |
| import scala.util.Random | |
| import scala.math | |
| import scala.collection.mutable | |
| import scala.collection.mutable.ArrayBuffer | |
| /** | |
| * Created with IntelliJ IDEA. | |
| * User: Austin |
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
| private final LinkedBlockingQueue<Message> messageQueue = new LinkedBlockingQueue<Message>(); | |
| // The sender argument is an enum describing who sent the message: the user, the app, or the person on the other end. | |
| public void sendMessage(String address, String message, Sender sender) { | |
| messageQueue.offer(Message.create(address, message, sender)); | |
| startSenderThread(); | |
| } | |
| private Thread senderThread; |
NewerOlder