This file contains 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.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Text; | |
using System.Text.RegularExpressions; | |
using System.Threading.Tasks; | |
namespace _01_Episodes | |
{ |
This file contains 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.Linq; | |
namespace ChoiceMaker | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
if (!args.Any()) |
This file contains 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
open System | |
module Decimal = | |
let Zero = 0M | |
let One = 1M | |
let ceil (d: decimal): decimal = System.Math.Ceiling(d) | |
let floor (d: decimal): decimal = System.Math.Floor(d) |
This file contains 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
public static MvcHtmlString SortedEnumDropDownListFor<TModel, TEnum>( | |
this HtmlHelper<TModel> htmlHelper, | |
Expression<Func<TModel, TEnum>> expression, | |
bool descending = false) | |
{ | |
var propertyInfo = (expression.Body as MemberExpression).Member as PropertyInfo; | |
var options = Enum.GetValues(typeof(TEnum)).Cast<TEnum>().Select(code => new SelectListItem() | |
{ | |
Selected = code.Equals((TEnum)propertyInfo.GetValue(htmlHelper.ViewData.Model)), | |
Text = code.ToString(), |
This file contains 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 CommonMark; | |
using System; | |
using System.IO; | |
using System.Linq; | |
namespace PipeDown | |
{ | |
class Program | |
{ | |
static void Main(string[] args) |
This file contains 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.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Text.RegularExpressions; | |
namespace EasyChallenge188_Dates | |
{ | |
class Program | |
{ |
This file contains 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.Collections.Generic; | |
using System.Linq; | |
using System.Security.Cryptography; | |
namespace Dice | |
{ | |
class Program | |
{ | |
static void Main(string[] args) |
This file contains 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)] | |
#[phase(plugin)] | |
extern crate regex_macros; | |
extern crate regex; | |
use regex::Regex; | |
use std::ascii::AsciiExt; | |
use std::collections::HashSet; | |
use std::io::{BufferedReader, File}; | |
use std::io::fs::PathExtensions; |
This file contains 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)] | |
#[phase(plugin)] | |
extern crate regex_macros; | |
extern crate regex; | |
use regex::Regex; | |
use std::ascii::AsciiExt; | |
use std::collections::{HashMap}; | |
use std::collections::hash_map::Entry::{Vacant, Occupied}; | |
use std::io::{BufferedReader, File}; |
This file contains 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::iter::Unfold; | |
fn main() { | |
let fib_seq = Unfold::new((0i64, 1i64), |state| { | |
// closures pretty much always borrow, so *dereference | |
// to get value instead of pointer | |
let (x, y) = *state; | |
let result = Some(x); | |
// again, set *value, not reference |
OlderNewer