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
| /* Sample bubble sort program in Rust. | |
| Tested to compile with rust-0.6. | |
| */ | |
| extern mod std; | |
| extern mod benchmark; | |
| use benchmark::Benchmark; | |
| #[cfg(std_swap)] | |
| fn swap(arr: &mut [uint], left: uint, right: uint) { | |
| use core::vec; |
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::fmt; | |
| use std::io::net::tcp::TcpStream; | |
| use std::io::net::ip::{Ipv4Addr, SocketAddr}; | |
| use std::io::buffered::BufferedStream; | |
| #[deriving(Clone)] | |
| pub struct RustBot { | |
| nick: ~str, | |
| user: ~str, | |
| stream: BufferedStream<TcpStream>, |
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
| //! Source file for the `game` crate. | |
| #![allow(dead_code)] | |
| /// The `Player` trait. | |
| pub trait Player { | |
| /// Gets called when it's time for this player to take their turn. | |
| /// | |
| /// The game is played by sending commands on `pipe` and checking | |
| /// the responses that are returned. | |
| fn take_turn(&self, pipe: &PlayerActionPipe, round: uint); |
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
| # grab latest version of libvips | |
| wget http://www.vips.ecs.soton.ac.uk/supported/7.40/vips-7.40.2.tar.gz | |
| tar xzvf vips-7.40.2.tar.gz | |
| cd vips-7.40.2 | |
| # install dependencies, JPG, PNG read/write libraries, EXIF library, etc | |
| sudo yum install -y glib2-devel libxml2-devel libpng-devel libjpeg-devel libexif-devel fftw-devel | |
| # configure and make | |
| ./configure |