Skip to content

Instantly share code, notes, and snippets.

View niepiekm's full-sized avatar

Marek Niepiekło niepiekm

View GitHub Profile
@niepiekm
niepiekm / C++11
Last active September 11, 2015 09:25
Software optimisation from design to implementation – using std atomics
Recommended reading:
http://candidate.pp.ua/C++/
A Tour of C++ (http://www.stroustrup.com/Tour.html, http://candidate.pp.ua/C++/Bjarne%20Stroustrup%20A%20Tour%20of%20C++%20%282013%29.pdf)
C++ Programming Language (2013) (http://candidate.pp.ua/C++/Stroustrup%20Bjarne%20The%20C++%20Programming%20Language%20(2013).pdf)
Preparation material:
1. General C++ 11 talks
https://www.youtube.com/watch?v=nesCaocNjtQ
https://www.youtube.com/watch?v=xnqTKD8uD64
https://www.youtube.com/watch?v=fHNmRkzxHWs
@niepiekm
niepiekm / TDD
Created September 11, 2015 09:18
Books
Test-Driven Development in Microsoft® .NET (http://www.amazon.co.uk/gp/product/0735619484)
Test-Driven Development by Kent Beck (C++) (http://www.amazon.co.uk/gp/product/0321146530)
Blog
The Typemock Insider Blog (http://blog.typemock.com/)
Unit test study from Microsoft Research:
http://research.microsoft.com/en-us/projects/esm/nagappan_tdd.pdf
@niepiekm
niepiekm / aio.cpp
Last active October 23, 2015 21:29
class aio
// https://www.justsoftwaresolutions.co.uk/threading/multithreading-in-c++0x-part-8-futures-and-promises.html
class aio
{
class io_request
{
std::streambuf* is;
unsigned read_count;
std::promise<std::vector<char> > p;
public:
@niepiekm
niepiekm / elements.md
Created December 25, 2016 23:22 — forked from soveran/elements.md
Excerpts from The Elements of Programming Style. The source of this compilation is unknown.

The Elements of Programming Style

The following rules of programming style are excerpted from the book "The Elements of Programming Style" by Kernighan and Plauger, published by McGraw Hill. Here is quote from the book: "To paraphrase an observation in The Elements of Style by Strunk and White, the rules of programming style, like those of English, are sometimes broken, even by the best writers. When a rule is broken, however, you will usually find in the program some compensating merit, attained at the cost of the violation. Unless you are certain of doing as well, you will probably do best to follow the rules."

@niepiekm
niepiekm / OpenSSL RSA encryption sample
Created November 15, 2017 09:37 — forked from superwills/OpenSSL RSA encryption sample
Base64 encoding and RSA encryption sample
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <openssl/rsa.h>
#include <openssl/engine.h>
#include <openssl/pem.h>
// I'm not using BIO for base64 encoding/decoding. It is difficult to use.
// Using superwills' Nibble And A Half instead

1. Separation of immutable and mutable logic

Quite a lot of different people have been on the same trail of thought. Gary Bernhardt's formulation of a "functional core, imperative shell" seems to be the most voiced.

"Boundaries" - Gary Bernhardt

"Imperative shell" that wraps and uses your "functional core".. The result of this is that the shell has fewer paths, but more dependencies. The core contains no dependencies, but encapsulates the different logic paths. So we’re encapsulating dependencies on one side, and business logic on the other side. Or put another way, the way to figure out the separation is by doing as much as you can without mutation, and then encapsulating the mutation separately. Functional core — Many fast unit tests. Imperative shell — Few integration tests

https://www.youtube.com/watch?v=yTkzNHF6rMs

@niepiekm
niepiekm / bash_examples.md
Last active January 19, 2018 09:57
Linux bash examples

Print sorted and counted occurances of words in a file

$ cat commands | awk -F” ” ‘{print $4}’ | sort | uniq -c | sort -n

Print sorted and counted occurance of a 'word' in a file

cat some_commands | grep HINCRBY | awk ‘{print $5}’ | sort | uniq -c | sort -n

[alias]

hist = log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short
st = status
co = checkout
br = branch
cm = commit
cma = commit -C HEAD --amend
rs = reset --soft
rh = reset HEAD

One size doesn't fit all :) Submitted by Andrew Sowerby on Mon, 2016-02-15 13:44

Even if this isn't just a way of harvesting user details, which some reviewers seem to think it is, I can't see the point of this plugin.

You can achieve the same results by adjusting your -vmargs in the eclipse.ini, or in your shortcut or command line you use to start the application.

  1. Just add adequate heap settings:

e.g. Xms1024m and Xmx1024m, or more, depending on how hard you push eclipse