Skip to content

Instantly share code, notes, and snippets.

using System;
class A
{
public string ToUpper() => "A";
}
class Program
{
static void Main(string[] args)
using System;
using System.Dynamic;
class LookImUsingRuby
{
static void Main(string[] args)
{
var x = new { Foo = 1, Bar = "data" }; // anonymous object!
Console.WriteLine(x.Foo); // this is type-checked because within this method, we know Foo exists
@gulbanana
gulbanana / SuggestionBox.cs
Created August 25, 2016 07:18
SuggestionBox control
public class SuggestionBox : Control
{
static SuggestionBox() { DefaultStyleKeyProperty.OverrideMetadata(typeof(SuggestionBox), new FrameworkPropertyMetadata(typeof(SuggestionBox))); }
public static DependencyProperty SelectedItemProperty =
DependencyProperty.Register("SelectedItem", typeof(string), typeof(SuggestionBox), new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, (d, bv) => (d as SuggestionBox).OnSelectedItemChanged()));
public string SelectedItem
{
get { return (string)GetValue(SelectedItemProperty); }
@gulbanana
gulbanana / buildlog.txt
Created December 16, 2016 11:53
msbuild log
This file has been truncated, but you can view the full file.
Microsoft (R) Build Engine version 15.1.458.808
Copyright (C) Microsoft Corporation. All rights reserved.
C:\Program Files\dotnet\sdk\1.0.0-preview4-004233\MSBuild.dll.exe /Logger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,C:\Program Files\dotnet\sdk\1.0.0-preview4-004233\dotnet.dll /m /t:Build /v:m /verbosity:diag .\netcoretest.csproj
Build started 16/12/2016 7:41:20 PM.
Environment at start of build:
ConEmuConfig =
PLINK_PROTOCOL = ssh
DISPLAY = needs-to-be-defined
CscToolExe = C:\Program Files\dotnet\sdk\1.0.0-preview4-004233\RunCsc.cmd
"D039LL9"
""
""
"| ***R1*** "
"| "
"| ***Z1*** rise "
"|------------| "
" |0---------->|"
" ***I1*** ***DR*** "
"END"
A future blog will certainly be covering this issue in detail, but as an important aside, novelists who write about cops seek a great deal of information in order to honor the accuracy of what law enforcement does to protect and serve. But it is often difficult to find this information with any specificity, since it is proprietary, for the most part, to those who work in law enforcement. Thanks will *not* go, therefore, to realpolice.net, which has a forum section wherein officers are supposedly glad to provide information about police work to writers. I was met with condescension and mean-spirited insults, (bordering on misogyny and homophobia), as well as the ultimate double standard when my rebuttal to a particularly haughty officer resulted in the deletion of my post, since it was a "personal attack." Ironic, considering it was self-defense from the attack on me by a particular officer. Police, police thyself.
@gulbanana
gulbanana / puzzle.cs
Created November 11, 2018 08:33
puzzle.cs
using System;
using System.Threading.Tasks;
class Program
{
static void Main(string[] args)
{
Task throwException() => throw new Exception();
var worker = Task.Factory.StartNew(async () => await throwException());
/*******************************/
/* approach 1: structured data */
/*******************************/
function calc(state, x) {
return calcSubPart(state, x-1) + calcSubPart(state, x-1);
}
function calcSubPart(state, y) {
return state * y;
}
=============
Melanie Lucas
=============
* Elemental (Paperbark)
* Summer Court
Needle: Strategist (+1: give someone relevant advice / +All: sacrifice short-term success for a long-term benefit)
Thread: Growth (+1: learn something unexpected / +All: rather than overcoming a problem, change yourself so that it's not one)
Touchstone: The Cypress Society, UMBC's mixed undergrad/postgrad philosophy club. Not a formal debate club, but an informal group that meets at late-night coffee shops to argue about history and politics.

I have had the privilege of leading the Labor Party for nearly four years. They have not been easy times and it has not been an easy job. It is a man-killing job and would be impossible if it were not for the help of my colleagues and members of the movement.

No Labor Minister or leader ever has an easy job. The urgency that rests behind the Labor movement, pushing it on to do things, to create new conditions, to reorganise the economy of the country, always means that the people who work within the Labor movement, people who lead, can never have an easy job. The job of the evangelist is never easy.

Because of the turn of fortune's wheel your Premier (Mr McGirr) and I have gained some prominence in the Labor movement. But the strength of the movement cannot come from us. We may make plans and pass legislation to help and direct the economy of the country. But the job of getting the things the people of the country want comes from the roots of the Labor movement - the people who support it.

When I sat at a