Skip to content

Instantly share code, notes, and snippets.

@pgsin
pgsin / concatT.cs
Created February 28, 2017 14:38
BaseLibS.Utils.StringUtils.Concat
using System;
using System.Collections.Generic;
using System.Text;
namespace Test {
public class Program {
static void Main() {
Console.WriteLine(Concat(",",new List<string> {"a","b","c"}));
}
using System;
using System.IO;
namespace RandSeed {
class Program {
static void Main() {
string seeds, ms, ns;
int seed, m, n;
Console.Write("Seed: ");
seeds = Console.ReadLine();
@pgsin
pgsin / gsl_permutation_next.test.c
Created April 11, 2017 15:45
benchmark data set
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
#include<assert.h>
typedef struct
{
size_t size;
size_t *data;
} gsl_permutation;
@pgsin
pgsin / polindrom.benchmark.log
Last active April 21, 2017 12:40
Log file (BenchmarkDotNet) of CR question "Project Euler Problem #4 - Palindromic number"
// ***** BenchmarkRunner: Start *****
// Found benchmarks:
// PalindromNumber.LargestPalindromeOriginal: DefaultJob
// PalindromNumber.LargestPalindromeDenis: DefaultJob
// PalindromNumber.LargestPalindromeEric: DefaultJob
// PalindromNumber.LargestPalindromePgs: DefaultJob
// PalindromNumber.LargestPalindromeDavislor: DefaultJob
// PalindromNumber.LargestPalindromeDavislor2: DefaultJob
// Validating benchmarks:
using System;
using System.Collections.Generic;
using System.Linq;
using BenchmarkDotNet.Reports;
using BenchmarkDotNet.Running;
using BenchmarkDotNet.Attributes;
namespace Test {
public class PalindromNumber {
//Thanks to @Velial and @Denis
import requests
import json
import pandas as pd
import os
from IPython.display import display, HTML
pd.set_option("display.max_rows",10)
base_dir = "C:/Users/Pavel/Documents/Projects/hipsci/data/"
base_url = "http://www.hipsci.org/lines/api/cellLine/"
using System;
namespace FloatFloatTest {
class Program {
static void Main() {
float first = BitConverter.ToSingle(BitConverter.GetBytes(0x4540FDA8), 0);
float second = BitConverter.ToSingle(BitConverter.GetBytes(0x3E19A9C4), 0);
Console.WriteLine(BitConverter.ToString(BitConverter.GetBytes(first)) + " | " + first);
Console.WriteLine(BitConverter.ToString(BitConverter.GetBytes(second)) + " | " + second);
@pgsin
pgsin / math.exp.test.md
Last active October 16, 2017 15:06
Implementations of Math.Exp() and Math.Log() differ between OSes

I used Mono C# compiler version 5.2.0.0

mcs Program.cs

of this code

using System;

namespace Test {
    public class Program {
@pgsin
pgsin / commands.sh
Last active February 14, 2018 17:12
ffmpeg -i input_video.mp4 -ss 00:00:30 -to 00:00:40 -c:v copy cropped.mp4
convert -depth 8 -resize 50% -background none plate.svg plate.png
ffmpeg -i cropped.mp4 -i plate.png -filter_complex "overlay=0:446:enable=between(t\,1\,9)" plated.mp4
ffmpeg -i plated.mp4 -vf drawtext="fontfile=Arial.ttf: text='Everything is empty, all lies, except this infinite sky': fontcolor=black: fontsize=12: x=200: y=476" result.mp4
>polyA_1
AAAAAAAAAAAAAAAAAAA