This was taken from http://rxwiki.wikidot.com/101samples, because I wanted to be able to read it more comfortable with syntax highlighting.
Here's the unedited original, translated to Github Markdown glory:
This was taken from http://rxwiki.wikidot.com/101samples, because I wanted to be able to read it more comfortable with syntax highlighting.
Here's the unedited original, translated to Github Markdown glory:
javascript:(function() { | |
function copyToClipboard(text) { | |
if (window.clipboardData && window.clipboardData.setData) { | |
/*IE specific code path to prevent textarea being shown while dialog is visible.*/ | |
return clipboardData.setData("Text", text); | |
} else if (document.queryCommandSupported && document.queryCommandSupported("copy")) { | |
var textarea = document.createElement("textarea"); | |
textarea.textContent = text; |
The issue concerns the behaviour of Excel's RTD feature when:
The expected behaviour is that the RTD server gets a DisconnectData call for the relevant RTD topic.
The observed behaviour is that the RTD server does not get a DisconnectData call.
# -*- coding: utf-8 -*- | |
import aioamqp | |
connection = None | |
protocol = None | |
async def disconnected(exception): | |
global connection, protocol |
package main | |
import ( | |
"bytes" | |
"exec" | |
"log" | |
"os" | |
) | |
// Pipeline strings together the given exec.Cmd commands in a similar fashion |
[BenchmarkTask(platform: BenchmarkPlatform.X86, jitVersion: BenchmarkJitVersion.LegacyJit)] | |
[BenchmarkTask(platform: BenchmarkPlatform.X64, jitVersion: BenchmarkJitVersion.LegacyJit)] | |
[BenchmarkTask(platform: BenchmarkPlatform.X64, jitVersion: BenchmarkJitVersion.RyuJit)] | |
public class FromEventBenchmark | |
{ | |
readonly Control control = new Control(); | |
[Benchmark] | |
public void FromEventPattern() | |
{ | |
Observable.FromEventPattern<EventHandler, EventArgs>(h => control.SizeChanged += h, h => control.SizeChanged -= h).Select(p => p.EventArgs) |
#!/bin/sh | |
# | |
# This script can clone/checkout a single folder from git repository | |
# - Might be used for checking out micro-services from monolithic git repository | |
# | |
# - You can even do checkout into home directory, for example | |
# git-sparse-clone.sh [email protected]:readdle/fluix-web.git /home/login login | |
# | |
# This will cause the shell to exit immediately if a simple command exits with a nonzero exit value. |
import time | |
import numpy as NP | |
from redis import StrictRedis as redis | |
# a 2D array to serialize | |
A = 10 * NP.random.randn(10000).reshape(1000, 10) | |
# flatten the 2D NumPy array and save it as a binary string | |
array_dtype = str(A.dtype) |
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/ | |
# generate server.xml with the following command: | |
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes | |
# run as follows: | |
# python simple-https-server.py | |
# then in your browser, visit: | |
# https://localhost:4443 | |
import BaseHTTPServer, SimpleHTTPServer | |
import ssl |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Net.NetworkInformation; | |
using System.Net; | |
namespace AvailablePort | |
{ | |
class Program |