Skip to content

Instantly share code, notes, and snippets.

View andr1972's full-sized avatar

Andrzej Borucki andr1972

View GitHub Profile
@andr1972
andr1972 / Coord.cs
Created February 3, 2017 07:51
INdex 2D
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace run2d
{
public class ComplexComparer : IComparer<Coord>
{
@andr1972
andr1972 / booksApp.cpp
Created February 4, 2017 18:50
Control expand in one instead of two directons
#ifdef WX_PRECOMP
#include "wx_pch.h"
#endif
#ifdef __BORLANDC__
#pragma hdrstop
#endif //__BORLANDC__
#include "booksApp.h"
#include "booksMain.h"
// #![feature(const_fn)]
extern crate winapi;
extern crate kernel32;
extern crate user32;
extern crate libc;
extern crate encoding;
use winapi::windef::HWND;
use winapi::windef::HDC;
use winapi::windef::HMENU;
@andr1972
andr1972 / a.bat
Created August 13, 2017 05:34
Rust_intermediate_hello
cargo rustc -- --emit mir
cargo rustc -- --emit llvm-ir
cargo rustc -- --emit asm
@andr1972
andr1972 / IterDelTree.cpp
Created August 14, 2017 21:43
Iterative deleting tree
#include <stack>
#include <iostream>
#include <stdint.h>
#include <random>
#include <algorithm>
using namespace std;
const int height = 10000;
uint8_t choos[height];
@andr1972
andr1972 / debugged.cpp
Created September 19, 2017 21:51
Simple WinDebug loop
#include <cstdio>
#include <cstdlib>
#include <string>
using namespace std;
int main() {
for (unsigned int i = 0; i < 10; i++) {
fprintf(stderr, "Hello, world!\n");
}
return 0;
}
@andr1972
andr1972 / Errors
Created October 4, 2017 14:29
HBase cmake error
root@securecluster:/usr/src/hbase/hbase-native-client/fastnative# clear
root@securecluster:/usr/src/hbase/hbase-native-client/fastnative# make
[ 20%] Linking CXX executable fastnative
/usr/local/lib/libfolly.a(dynamic.o): In function `folly::dynamic::typeName(folly::dynamic::Type)':
/usr/src/folly-2017.09.04.00/folly/dynamic.cpp:307: undefined reference to `google::LogMessageFatal::LogMessageFatal(char const*, int)'
/usr/src/folly-2017.09.04.00/folly/dynamic.cpp:307: undefined reference to `google::LogMessage::stream()'
/usr/src/folly-2017.09.04.00/folly/dynamic.cpp:307: undefined reference to `google::LogMessageFatal::~LogMessageFatal()'
/usr/local/lib/libfolly.a(dynamic.o): In function `folly::dynamic::destroy()':
/usr/src/folly-2017.09.04.00/folly/dynamic.cpp:316: undefined reference to `google::LogMessageFatal::LogMessageFatal(char const*, int)'
@andr1972
andr1972 / Finder.cpp
Last active January 29, 2018 01:31
Ask how to share thread data
#include "Finder.h"
#include <algorithm>
#include <random>
#include <chrono>
#include <thread>
#include <string>
FinderForTx::FinderForTx()
{
}
@andr1972
andr1972 / ReplacementTrees.cpp
Created March 15, 2018 23:21
Tree with posssiblity replacement subtree with other subtree,
#include <memory>
#include <string>
#include <vector>
#include <assert.h>
using namespace std;
class Node
{
vector<shared_ptr<Node>> childs;
@andr1972
andr1972 / miniCas.cpp
Last active September 14, 2018 02:48
Algebraic substitution trees, expand variables to subtree with cloning
#include <memory>
#include <string>
#include <vector>
#include <assert.h>
using namespace std;
enum Type { tEmpty, tNum, tVar, tFrac, tProd, tSum };
enum Precedence { precStart, precSum, precFrac, precAtom };