Skip to content

Instantly share code, notes, and snippets.

View ch-hristov's full-sized avatar

Christo S. Christov ch-hristov

View GitHub Profile
@ch-hristov
ch-hristov / d8n-public.ipynb
Created January 2, 2024 21:34
d8n-public.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#SELECT json_object_keys(to_json((SELECT t FROM public.jobstatusitem t LIMIT 1) ) )
-------Random forests------
[14, 6, 18, 17, 12, 3, 19, 1, 9, 15, 8, 2, 7, 4, 5, 0, 20, 11, 13, 10, 16]
Most important features are
000 of
00 no
03 and
00am think
00 worked
00 for
0800 despite
var plot = new PlotModel();
plot.Axes.Add(new OxyPlot.Axes.CategoryAxis());
plot.Axes.Add(new OxyPlot.Axes.CategoryAxis());
OxyPlot.Series.ScatterSeries s;
plot.Series.Add(s = new OxyPlot.Series.ScatterSeries());
s.Points.Add(new ScatterPoint() { X = 1, Y = 2 });
s.Points.Add(new ScatterPoint() { X = 3, Y = 3 });
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <map>
#include <math.h>
using namespace std;
int arr[1000001];
try
{
using (var server = new NamedPipeServerStream(_identifier.ToString()))
using (var reader = new StreamReader(server))
{
server.WaitForConnection();
var arguments = new List<String>();
while (server.IsConnected)
arguments.Add(reader.ReadLine());
//https://www.hackerrank.com/contests/25-years-nbu/challenges/gcd-6
#include "stdafx.h"
#include <vector>
#include <algorithm>
#include <math.h>
#include <iostream>
@ch-hristov
ch-hristov / gist:770558a47b26aebff7a9
Created December 4, 2015 11:28
IronPython example
var engine = Python.CreateEngine();
var scope = engine.CreateScope();
scope.SetVariable("mol", new SmilesParser());
string script = "import clr\nk = mol.ParseMolecule(\"CCCCCC\")\nr = k.Count";
ScriptSource ss = engine.CreateScriptSourceFromString(script);
ss.Execute(scope);
var variable = scope.GetVariable("r");
MessageBox.Show(variable.ToString());
@ch-hristov
ch-hristov / gist:a4a6ca3b384a06a18add
Created November 5, 2015 20:18
Split string by delimiter C++
std::vector<std::string> split(const std::string &text, char sep) {
std::vector<std::string> tokens;
int start = 0, end = 0;
while ((end = text.find(sep, start)) != std::string::npos) {
tokens.push_back(text.substr(start, end - start));
start = end + 1;
}
tokens.push_back(text.substr(start));
return tokens;
}
@ch-hristov
ch-hristov / gist:c73299cef34ee29b01f5
Last active October 5, 2015 14:42
exponentiation by squaring
#include <iostream>
#include <cmath>
using namespace std;
int compute(int n,int exp){
if(exp==1)return n;
int r = exp % 2;
if(r) return compute(n*n,exp >> 1) * n;