Skip to content

Instantly share code, notes, and snippets.

@bobthemighty
bobthemighty / glossary.md
Last active August 29, 2015 14:17
DDD Glossary

Command

Commands encapsulate requests to DO something in the system. Each command uses the imperative tense ("CreateWidget", "MakeCustomerHappy", "UseTheForce"). A command is an immutable value object with no behaviour of its own. Commands are processed by Command Handlers. Each command must have exactly one command handler.

class CreateWidgetCommand
{
   function __construct($widgetColour, $widgetHeight, $widgetWidth){ ...}
 
will_respond_with(
{
status: 200,
headers: {
'Content-Type': 'application/atom+xml'
},
schema: {
# this is the document we expect the mock server to return.
example: '<atom:entry>
<atom:title>Atom-Powered Robots Run Amok</atom:title>
<!doctype html>
<html lang="en_GB" ng-app="ogs">
<head>
using(var cn = new SqlConnection(MA_CONNECSHUNS))
using (var cmd = new SqlCommand(MA_QUERIES, cn))
{
cn.Open();
using (var reader = cmd.ExecuteReader())
while (reader.Read())
{
SqlXml xml = reader.GetSqlXml(1);
using (var xr = xml.CreateReader())
@bobthemighty
bobthemighty / funky.fsx
Last active August 29, 2015 13:59
Funky num
module FunkyInt64 =
(* This is Thomas Wang's int64 hash function *)
let hash (k:int64) =
let k = uint64 k
let k = k |> (~~~) |> ((+) (k <<< 21))
let k = (k ^^^ (k >>> 24))
let k = (k + (k <<< 3 )) + (k <<< 8)
let k = k ^^^ (k >>> 14)
let k = k + (k <<< 2) + ( k <<< 4 )
Private Sub Command1_Click()
If Text1.Text = xCode Then
Unload Me
Form1.Show
Else
y = MsgBox("Incorrect", 17, "Access Denied")
If y = 1 Then Text1.Text = ""
End If
End Sub

OGS is a safe place for people to learn and have fun. If you act with that spirit, we will have no problems.

  1. Play fairly. If you have lost, then lose gracefully. Cheating will not be tolerated.
  2. Hate speech of any kind, whether related to gender, race, or sexual preference will not be tolerated and may earn an immediate ban.
  3. Trash-talking between friends is positively encouraged, but bullying, harassment, or aggression will be met with sanctions.

Other than that, OGS is a free speech zone with the following caveats:

  • We would request that heated debates about politics and culture are kept in the off-topic room, and out of the main chat.
  • If your comments or profanity are offensive to other people, either change the subject or take the conversation private.
  • You may not spam advertisements for commercial activity or personal projects