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.Web; | |
using System.Web.Mvc; | |
using System.Linq.Expressions; | |
public static class CheckBoxListForExtensions | |
{ | |
public static MvcHtmlString CheckBoxListFor<TModel, TValue>(this HtmlHelper<TModel> html, Expression<Func<TModel, TValue>> expression, SelectList selectList) |
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.Speech.Synthesis | |
open System | |
type language = { | |
presents: string array | |
line: string | |
lastPrefix: string | |
suffix: int->string | |
} | |
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
let rec reverse str = | |
let a = Console.ReadLine() | |
if a <> "0" then | |
reverse a | |
printfn "%s" str | |
[<EntryPoint>] | |
let main argv = | |
reverse "" |
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
fizzbuzz xs = | |
let | |
fizz = cycle ["","","fizz"] | |
buzz = cycle ["","","","","buzz"] | |
f x i = if null x then show i else x | |
in | |
zipWith3 (\fz bz i-> f (fz++bz) i) fizz buzz xs | |
main = do | |
putStr $ unlines $ fizzbuzz [1..100] |
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
import Control.Monad | |
import Data.Bits | |
import Data.List | |
import Data.List.Split | |
import Data.Word | |
createMask::Int -> [Word8] | |
createMask mask = take 4 $ gen mask ++ repeat 0 | |
where | |
gen mask |
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
#include "Windows.h" | |
#include <iostream> | |
#include <thread> | |
using namespace std; | |
void WaitForKey(int vKey) | |
{ | |
while (!GetAsyncKeyState(vKey)); | |
} |
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
import Text.Read (readMaybe) | |
import System.Random (randomRIO) | |
data Move = Rock | Paper | Scissor deriving(Eq, Read, Show, Enum) | |
data Result = Victory | Defeat | Draw deriving(Show) | |
play Rock Scissor = Victory | |
play Paper Rock = Victory | |
play Scissor Paper = Victory | |
play a b |
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; | |
namespace CSharpFunctional | |
{ | |
[Serializable] | |
public class NoPatternException : Exception | |
{ | |
public NoPatternException() { } | |
public NoPatternException(string message) : base(message) { } | |
public NoPatternException(string message, Exception inner) : base(message, inner) { } |
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
import Data.List | |
import Data.Tree | |
import Control.Arrow (first) | |
import Data.Function (on) | |
toHierarchical :: String -> [(Int, [String])] | |
toHierarchical = map simplify . groupBy ((==) `on` fst) . map (first length . span (== '\t')) . lines | |
where | |
simplify = first head . unzip | |
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
import Keyboard | |
import Mouse exposing (position) | |
import Time exposing (Time, fps) | |
import Debug exposing(..) | |
import Signal | |
import Graphics.Element exposing (show) | |
import Graphics.Collage | |
import Color exposing (red, black) | |
import Window exposing (dimensions) |
OlderNewer