Matthew's Blog

I have released the first version of monerocore, a Java library for manipulating some Monero related structures (like blocks and transactions).

It will be used to replace the native code in moneropool to make the build easier and more portable.

#monero #release

I have released an initial version of moneropool, a Monero mining pool written in Java using Netty and Spring.

This initial release works more like a solo mining proxy as there is no payout logic yet.

There's still a lot to do, but in the next few weeks I plan to make it feature complete and to rent some NiceHash to find a block on the Monero mainnet!

#monero #moneropool #release

After reading some comments on my previous post I decided to write a better version that counts includes per compilation unit instead of per file.

It turns out that gcc/cpp has an option -H which dumps out a tree of includes in a compilation unit, which means that we don't have to do any parsing ourselves.


Here's a shell one-liner for finding the most commonly included header files in a C project:

find -name '*.c' -o name '*.h' \
 | xargs awk -F '[<>]' '/#include/ { print $2 }' \
 | sort \ 
 | uniq -c \
 | sort -nr

Running it was surprisingly fast, only taking a few seconds to go through the Linux source tree. Here is some sample output:

  12000 linux/module.h
   8683 linux/kernel.h
   8560 linux/slab.h
   6617 linux/init.h
   5552 linux/types.h
   4867 linux/delay.h
   4454 linux/platform_device.h
   4207 linux/interrupt.h
   3869 linux/io.h

It may also work for C++ projects, but angled brackets being used for template parameters might upset it.

#bash #c #shell