I'm a fucking retard.
File descriptors are magic.
Yay!
I know how to do the scheduling in Kreeft!
Thank you epoll for being thread-safe.
epoll_ctl changes stuff. :v
Hmm.
ivykis looks cooler as it can be used with kqueue as well..
Oh wait beh callback-based.
Monocles are cool.
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
| defmodule Session do | |
| def get key, req do | |
| case :cowboy_req.cookie "session_id", req do | |
| { :undefined, req } -> { nil, req } | |
| { session_id, req } -> | |
| case :gen_server.call SessionStore, { :get, session_id, key } do | |
| { :ok, value } -> { value, req } | |
| nil -> { nil, req } | |
| end |
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
| fuck you chat |
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
| int main(){} |
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
| public static unsafe IEnumerable<double> MovingAverage(IList<double> list, int period) | |
| { | |
| double* doubles = stackalloc double[period]; | |
| double fraction = 1.0 / period; | |
| double sum = 0; | |
| for (int i = 0; i < period; i++) | |
| { | |
| double @double = list[i] * fraction; | |
| doubles[i] = @double; | |
| sum += @double; |
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
| private enum Kind { Get, Set }; | |
| private static string InterfaceGetOrSetMethod(PropertyInfo propertyInfo, Kind kind) | |
| { | |
| var kindString = Kind == Kind.Get ? "get" : "set"; | |
| if (propertyInfo.GetMethod == null) | |
| return ""; | |
| var accessModifier = propertyInfo.Accessmodifier(); |
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
| 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 |
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
| -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]) |
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
| #region constructor | |
| public OrderViewModel() | |
| { | |
| } | |
| #endregion constructor |
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
| -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"), |
OlderNewer