Skip to content

Instantly share code, notes, and snippets.

View alpinskiy's full-sized avatar
💭
Don't try to be clever

Mikhail alpinskiy

💭
Don't try to be clever
View GitHub Profile
#include <Windows.h>
#include <cstdio>
LONG WINAPI ExceptionHandlerProc(_EXCEPTION_POINTERS *exceptionInfo) {
printf("Exception code %d", exceptionInfo->ExceptionRecord->ExceptionCode);
return EXCEPTION_CONTINUE_SEARCH;
}
PVOID ExceptionHandler;
#include <condition_variable>
#include <future>
#include <iostream>
#include <mutex>
#include <thread>
#include <vector>
using namespace std;
condition_variable CondVar;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Linq;
using System.Threading.Tasks;
namespace VirtualListLib
{
using System;
namespace UtcOffsetQuirks
{
public class Program
{
public static void Main(string[] args)
{
// Комментарии ниже - вывод программы, запущенной на
// компьютере с русской локалью 22 сентября 2014 года.
package main
import (
"bytes"
"fmt"
)
type Node string
type Graph struct {
package main
import (
"fmt"
"golang.org/x/net/html"
"log"
"net/http"
"net/url"
"os"
)
@alpinskiy
alpinskiy / gist:ea720be10782bb89403c
Created May 12, 2015 21:06
algo2-004 / Problem Set #3 / Question 5
(def v [0.05 0.4 0.08 0.04 0.1 0.1 0.23])
(declare mm)
(defn m [i j]
(cond
(< i (dec j)) (letfn [(f [r]
(+ (reduce + (subvec v i j))
(mm i r)
(mm (inc r) j)))]
(apply min (map f (range i j))))
using System;
using System.IO;
using System.Linq;
namespace NumberOfInversions
{
/// <summary>
/// Algorithms: Design and Analysis by Tim Roughgarden
/// Part 1, Programming Question - 1
/// </summary>
using System;
using System.Linq;
using System.IO;
namespace QuickSort
{
/// <summary>
/// Algorithms: Design and Analysis by Tim Roughgarden
/// Part 1, Programming Question - 2
/// </summary>
@alpinskiy
alpinskiy / gist:ef1f4705c70e4dde1443
Created January 20, 2015 20:42
Exception & thread safe event
using System;
using System.Threading;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
namespace CustomEvent
{