If you, like me, resent every dollar spent on commercial PDF tools,
you might want to know how to change the text content of a PDF without
having to pay for Adobe Acrobat or another PDF tool. I didn't see an
obvious open-source tool that lets you dig into PDF internals, but I
did discover a few useful facts about how PDFs are structured that
I think may prove useful to others (or myself) in the future. They
are recorded here. They are surely not universally applicable --
the PDF standard is truly Byzantine -- but they worked for my case.
# this fragment generates build/my_package.pc | |
# | |
# cmake -B build -DCMAKE_INSTALL_PREFIX=~/mylib | |
cmake_minimum_required(VERSION 3.0) | |
project(mylib | |
LANGUAGES C | |
HOMEPAGE_URL https://github.invalid/username/mylib | |
DESCRIPTION "example library" |
See the following links for further updates to Github Desktop for Ubuntu. These are official instructions. (also mentioned by fetwar on Nov 3, 2023)
For the sake of "maintaining the tradition" here is the updated version.
This code isn't meant to be pretty: it's just a simple implementation of some libuv features. Specifically:
- raw mode tty;
- streaming input from tty;
- writing output to tty (specifically: echoing the input hex-encoded);
- handling a signal (SIGTERM, ie,
kill pid
); - quitting on ctrl+c
- properly cleaning up after ourselves.
#include <stdio.h> | |
#include <stdint.h> | |
#include <pthread.h> | |
#include <uv.h> | |
/* Libuv multiple loops + thread communication example. */ | |
//rpath is needed because it is an argument to the linker (not compiler) about | |
//where to look | |
//gcc -Iinclude -g multi-uv-loops.c -o multi-uv-loops -L "./" -l uv -Xlinker -rpath -Xlinker "./" -lrt |
So I suddenly discovered that compile_commands.json files generated by the Bear tool contain duplicate entries despite the fact Bear's documentation says it should filter out duplicates. Probably that was result of the outdated (2 years old) version of the Bear - now I updated it but I had no time to check if this issue is already fixed.
How to filter out duplicate entries from a JSON array with thousands of elements? And preferably leave only the last element of the group because it contains the most up-to-date compilation parameters?
One way is just remove compile_commands.json and rebuild whole project - but that could be very tedious because on my machine it takes more than an hour to rebuild the project which I work on. And I have a dosen of different versions in separate directories... After some thinknig I recalled a tool called jq which is 'JSON query'. I had some doubts if I will be able to do my specific task with this tool so I went to documentation page: