Skip to content

Instantly share code, notes, and snippets.

@ony
ony / message produced by a lot of software
Created October 6, 2012 14:20
dl-open.c:666 RT_CONSISTENT
Inconsistency detected by ld.so: dl-open.c: 666: _dl_open: Assertion `_dl_debug_initialize (0, args.nsid)->r_state == RT_CONSISTENT' failed!
@ony
ony / PoolSample.cs
Created October 10, 2012 07:02
Sample of how to use generic pool of structs
//
// Main.cs
//
// Author:
// Nikolay Orlyuk <virkony@gmail.com>
//
// Copyright (c) 2012 (c) Nikolay Orlyuk
//
// This program is free software; you can redistribute it and/or modify
@ony
ony / djvubook.bash
Created October 10, 2012 07:53
Assemble DjVu book from set of different images (including multi-page tiffs)
#!/bin/bash
# djvubook
#
# Author:
# Nikolay Orlyuk <virkony@gmail.com>
#
# Copyright (c) 2012 (c) Nikolay Orlyuk
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
(use '[clojure.core.match :only [match]])
(defn evaluate [env [sym x y]]
(match [sym]
['Number] x
['Add] (+ (evaluate env x) (evaluate env y))
['Multiply] (* (evaluate env x) (evaluate env y))
['Variable] (env x)))
(def environment {"a" 3, "b" 4, "c" 5})
@ony
ony / cide.sh
Last active August 29, 2015 14:09
Console IDE - script to ease work with CMake projects and test builds
#!/bin/bash
# Copyright (C) 2014 Nikolay Orliuk <virkony@gmail.com>
# Distributed under the terms of the GNU General Public License v2
#
# Console IDE - just a script to ease work with CMake projects and test builds
# under different GCC compiler versions.
#
# .ciderc - file in the current or closest parent folder may be used to customize work
#
# example from my leveldb-tl:
@ony
ony / bootstrap.hpp
Created November 26, 2014 23:40
Bootstrapping in C++ using variadic templates for parallel estimators application
template <typename T>
struct estimate { T mean, lbound, ubound, stdev; }
template <typename T, typename... Rs>
std::tuple<estimate<Rs>...> bootstrap(std::vector<T> &sample, size_t resamples,
std::function<Rs(std::vector<T>)>... estimators)
{
const size_t n = sample.size();
// re-sample and estimate our sample
@ony
ony / two_iterator_kinds.cpp
Last active August 29, 2015 14:16
Multiple iterators over single container
#include <cstdio>
using namespace std;
struct range
{
int a, b;
struct n_iter
{
int x;
@ony
ony / build-tags.md
Last active August 29, 2015 14:23
Arbitrary build tags for Exherbo

Background

Sometimes it is not enough to handle dependencies on ::installed packages only through versions. This might be either due to ABI change or due to switch of compiler. To track that information we can tag installed packages with additional information that should mark dependency in ::installed repository as unsatisfied.

GHC (Haskell) packages

@ony
ony / gcc-5.3.0-issues.md
Last active January 8, 2016 17:37
Issues found with turning GCC 5.3.0 as a default compiler for Exherbo Linux

dev-lang/node-4.2.4:0::arbor

../deps/cares/src/ares_query.c: In function 'ares__generate_new_id':
../deps/cares/src/ares_query.c:104:16: internal compiler error: in create_tmp_var, at gimple-expr.c:519
 unsigned short ares__generate_new_id(rc4_key* key)

Builds normally without graphite options: -floop-interchange -ftree-loop-distribution -floop-strip-mine -floop-block

@ony
ony / PythonBaiscsCheatsheet.ipynb
Last active December 16, 2016 06:31
Just review of python basic
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.