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
/// This example demonstrates how print a numbered list of URLs from the Ubuntu Kernel PPA, | |
/// which can be used to automate the installation of Ubuntu kernels. | |
extern crate hyper; | |
use hyper::Client; | |
use hyper::header::Connection; | |
extern crate select; | |
use select::document::Document; | |
use select::predicate::{Name}; |
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
/* | |
* X-Box gamepad driver | |
* | |
* Copyright (c) 2002 Marko Friedemann <[email protected]> | |
* 2004 Oliver Schwartz <[email protected]>, | |
* Steven Toth <[email protected]>, | |
* Franz Lehner <[email protected]>, | |
* Ivan Hawkes <[email protected]> | |
* 2005 Dominic Cerquetti <[email protected]> | |
* 2006 Adam Buchbinder <[email protected]> |
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(alloc_system)] | |
extern crate alloc_system; | |
extern crate arrayvec; | |
use std::cmp::Ordering::{Less, Greater}; | |
use std::convert::From; | |
use std::io::{BufRead, Lines, StdinLock}; | |
// Used to eliminate dynamic heap allocations by allocating a fixed-sized vector on the stack. | |
use arrayvec::ArrayVec; |
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 rocket::request::{FromRequest, Request}; | |
use rocket::http::Status; | |
use rocket::Outcome; | |
const GZIP: u8 = 1; | |
const DEFLATE: u8 = 2; | |
const BROTLI: u8 = 4; | |
#[derive(Clone, Debug, PartialEq, Hash)] | |
pub enum PreferredEncoding { Brotli, Gzip, Uncompressed } |
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
#!/bin/php | |
<?php | |
/// TODO: | |
/// - Implement Backslash escapes | |
// An ADT-like type that can either be a normal value or a variable. | |
class Token { | |
// 0 = Normal; 1 = Variable; 2 = Error; 3 = None | |
public $kind = 0; | |
// Contains the string for the associated type. |
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 accept_encoding::AcceptEncoding; | |
use cacher::{CachedContent, Page, PageCache}; | |
use database::DBConnection; | |
use horrorshow::prelude::*; | |
use horrorshow::Template; | |
use rocket::State; | |
use rocket_contrib::Template as HandlebarTemplate; | |
macro_rules! request_content { | |
($cache:ident, $url:ident, $encoding:ident, $closure:expr) => { |
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::collections::{HashSet, HashMap}; | |
struct Person { | |
/// The unique name of this person that no other person may have. | |
name: String, | |
/// Use of a `HashSet` ensures that a friend is never listed twice. | |
friends: HashSet<usize>, | |
} | |
#[derive(Debug)] |
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, BufRead, BufReader, Write}; | |
use std::time::Instant; | |
fn main() { | |
// Obtain a buffered handle to standard input | |
let stdin = io::stdin(); | |
let mut stdin = BufReader::new(stdin.lock()); | |
// Mark the current time for a later duration comparison. | |
let start = Instant::now(); |
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::{stdin, stdout, BufRead, Error, Write}; | |
use std::fmt::{self, Display}; | |
fn main() { | |
// Create the account that we will emulate | |
let mut account = Account::new(); | |
// Print the first input message to the screen | |
print!("Enter your account name: "); | |
let stdout = stdout(); |