Skip to content

Instantly share code, notes, and snippets.

@dmitryvk
dmitryvk / Cargo.toml
Created March 29, 2020 17:07
Gtk-rs async `alert` example
[package]
name = "async-ui"
version = "0.1.0"
authors = ["Dmitry Kalyanov <Kalyanov.Dmitry@gmail.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
futures = "0.3.4"
@dmitryvk
dmitryvk / Program.cs
Last active November 5, 2019 13:17
Program that demonstrates HttpRequestException from HttpClient.PostAsync after Keep-Alive timeout
namespace HttpClientTest
{
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Threading;
class Program
{
static void Main(string[] args)
@dmitryvk
dmitryvk / MonoTxScope.csproj
Last active April 9, 2019 10:06
Mono Transaction Scope
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ProjectGuid>{17C90BFF-D5EB-4FF4-BB67-BCCA7535E6A1}</ProjectGuid>
<OutputType>Exe</OutputType>
<TargetFramework>net472</TargetFramework>
<AssemblyTitle>MonoTxScope</AssemblyTitle>
<Product>MonoTxScope</Product>
<Copyright>Copyright © 2019</Copyright>
</PropertyGroup>
<ItemGroup>
@dmitryvk
dmitryvk / Program.cs
Created December 28, 2018 11:58
Reduced reproduction of data race inside Mono's System.Web.Caching.Cache
namespace ConsoleApplication10
{
using System;
using System.Linq;
using System.Reflection;
using System.Threading;
using System.Web.Caching;
internal class Program
{
@dmitryvk
dmitryvk / Global.asax.cs
Created December 18, 2018 10:47
Mono-async-EndRequest
namespace WebApplication2
{
using System;
using System.Threading.Tasks;
using System.Web;
public class MvcApplication : HttpApplication
{
public MvcApplication()
{
1535632227632 geckodriver INFO geckodriver 0.21.0
1535632227636 geckodriver INFO Listening on 127.0.0.1:26017
1535632227780 mozrunner::runner INFO Running command: "/usr/bin/firefox" "-marionette" "-start-debugger-server" "43839" "-foreground" "-no-remote" "-profile" "/tmp/rust_mozprofile.UxXQkDyAeQcH"
1535632250049 addons.manager DEBUG Application has been upgraded
1535632250063 addons.manager DEBUG Loaded provider scope for resource://gre/modules/addons/XPIProvider.jsm: ["XPIProvider", "XPIInternal"]
1535632250066 addons.manager DEBUG Loaded provider scope for resource://gre/modules/LightweightThemeManager.jsm: ["LightweightThemeManager"]
1535632250080 addons.manager DEBUG Loaded provider scope for resource://gre/modules/addons/GMPProvider.jsm
1535632250082 addons.manager DEBUG Loaded provider scope for resource://gre/modules/addons/PluginProvider.jsm
1535632250082 addons.manager DEBUG Starting provider: XPIProvider
1535632250083 addons.xpi D
true
#!/usr/bin/python
import re
import random
import json
class Lexicon:
def __init__(self):
self.pos = {}
def add_pos_tag(self, word, tag):
self.pos[word.lower()] = tag
#include <gtk/gtk.h>
int main (int argc, char * argv[])
{
gtk_init(&argc, &argv);
GtkListStore* store = gtk_list_store_new(1, G_TYPE_VALUE);
GValue v = { 0 };
GtkTreeIter iter;
gtk_list_store_append(store, &iter);
#!/bin/sh
echo '#include <boost/date_time/gregorian/gregorian.hpp>' > pch-benchmark.h
echo '#include "pch-benchmark.h"' > pch-benchmark.cpp
rm -fv pch-benchmark.h.gch pch-benchmark.o
echo -n "bare preprocessing (with cpp): "
time=$((time cpp pch-benchmark.cpp > /dev/null) 2>&1 | grep real | cut -f 2)
echo $time
echo -n "bare preprocessing (with g++ -E): "