Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Finally focussing

rightfold rightfold

🎯
Finally focussing
  • Utrecht, Netherlands
View GitHub Profile
View gist:9116363
SELECT D.id, D.name
FROM Driver AS D
, Route AS R
JOIN Schedule AS S
ON S.driverID <> D.id
AND S.routeID <> R.id
WHERE R.numberOfStops <= 10
View yeah.cs
#region constructor
public OrderViewModel()
{
}
#endregion constructor
View echo.erl
-module(echo).
-export([go/1, loop/0]).
go(T) ->
Pid2 = spawn(echo, loop, []),
Pid2 ! {self(), hello},
receive
{Pid2, Msg} ->
utils:sleep(T * 1000),
io:format("P! ~w~n",[Msg])
View numbergame.erl
-module(numbergame).
-export([play/0]).
play() ->
intro(),
game_loop(get_int(), 666).
intro() ->
io:format("Welcome to this 'game'.~n"),
io:format("Enter numbers to narrow down onto what I am hard coded for~n"),
View a.hs
readInput :: Int -> IO (Int, Paint, Ring)
readInput i = do
ln <- getLine
let ls = split " " ln
r = ((read $ head ls) :: Double)
t = ((read $ last ls) :: Double)
return (i, Paint t, Ring (r + 1) 1)
View round_1a.hs
import Data.List.Split (splitOn)
import Control.Monad ((>=>))
newtype Circle = Circle { circleRadius :: Double } deriving (Eq, Show)
newtype Paint = Paint { remainingMl :: Double } deriving (Eq, Show)
data Ring = Ring { ringRadius :: Double
, ringThickness :: Double
} deriving (Eq, Show)
View jsPlumb_poc.html
<!doctype html>
<html><head></head>
<head>
<style type="text/css">
div.block {
background-color: #36C;
min-width: 200px;
height: 100px;
float: left;
View gist:11324960
namespace ErSharp {
public sealed class Sender<T> {
private BlockingCollection<T> Queue;
internal Sender(BlockingCollection<T> queue) {
Queue = queue;
}
public void Send(T value) {
queue.Add(value);
View Return_T_no_matter_what.c++
T& value( ) const {
typedef decltype( std::addressof( storage ) ) storage_address_t;
typedef typename std::conditional<std::is_const<T>::value, const void, void>::type void_t;
typedef typename std::remove_const<storage_address_t>::type address_t;
return *static_cast<T*>( static_cast<void_t*>( const_cast<address_t>( std::addressof( storage ) ) ) );
}
View LoveLetter.fs
// Learn more about F# at http://fsharp.net
// See the 'F# Tutorial' project for more help.
open System.Linq
open System.Collections.Generic
open System
type Card =
| Guard