David Kalnischkies: Winning the Google Open Source Lottery
- which even ended up topping Hacker News around New Year's Eve who would have thought that apt and reproducibility bugs are top news ;)
realloc()ating way too much.
It also turned out that recent changes on the master branch had made most uses of fast-import synchronous, making the whole process significantly slower.
This is where we started from on 0.4.0:
And on the master branch as of be75326:
An interesting thing to note here is that the glibc allocator runaway memory use was, this time, more pronounced on 0.4.0 than on master. It was the opposite originally, but as I mentioned in the past ASLR is making it not happen exactly the same way each time.
While I m here, one thing I failed to mention in the previous posts is that all these measurements were done by cloning a local mercurial clone of mozilla-central, served from localhost via HTTP to eliminate the download time from hg.mozilla.org. And while mozilla-central itself has received new changesets since the first post, the local clone has not been updated, such that all subsequent clone tests I did were cloning the exact same repository under the exact same circumstances.
After last blog post, I focused on the low hanging fruits identified so far:
So where does that put us?
git-remote-hg process stays well under 2GB during the whole clone, with no spike at the end.git-cinnabar-helper now uses more memory, but the sum of both processes is less than what it used to be, even when compensating for the glibc memory allocator issue. One thing to note is that while the git-cinnabar-helper memory use goes above 2GB at the end of the clone, a very large part is due to the pack window size being 1GB on 64-bits (vs. 32MB on 32-bits). Memory usage should stay well under the 2GB address space limit on a 32-bits system.malloc, calloc, free and realloc (down from 2.7 billions in be75326). The number of allocator calls done by the git-remote-hg process is down to 2.25 billions (from 2.34 billion in be75326).
Surprisingly, while more things were moved to the helper, it still made less allocations than in be75326: 345 millions, down from 363 millions. Presumably, this is because the number of commands processed by the fast-import code was reduced.
Let s now take a look at the various metrics we analyzed previously (the horizontal axis represents the number of allocator calls that happened before the measurement):
A few observations to make here:
free()d yet) has gone significantly down as well.malloc, calloc, realloc etc. and the lower bound is the same, but removing the size of allocations passed as input to realloc (in practical words, this pretends reallocs never happened and that the final size for a given reallocated pointer is the one that counts)
So presumably, some of the changes led to more short-lived allocations. Considering python uses its own allocator for sizes smaller than 512 bytes, it s probably not so much of a problem. But let s look at the distribution of buffer sizes (including all sizes given to realloc).
(Bucket size is 16 bytes)
What is not completely obvious from the logarithmic scale is that, in fact, 98.4% of the allocations are less than 512 bytes with the current master (35c18e7), and they were 95.5% with be75326. Interestingly, though, in absolute numbers, there are less allocations smaller than 512 bytes in current master than in be75326 (1,194,268,071 vs 1,214,784,494). This suggests the extra allocations that happen during some phases are larger than that.
There are clearly less allocations across the board (apart from very few exceptions), and close to an order of magnitude less allocations larger than 1MiB. In fact, widening the bucket size to 32KiB shows an order of magnitude difference (or close) for most buckets:
An interesting thing to note is how some sizes are largely overrepresented in the data with buckets of 16 bytes, like 768, 1104, 2048, 4128, with other smaller bumps for e.g. 2144, 2464, 2832, 3232, 3696, 4208, 4786, 5424, 6144, 6992, 7920 While some of those are powers of 2, most aren t, and some of them may actually represent objects sized with a power of 2, but that have an extra PyObject overhead.
While looking at allocation stats, I got to wonder what the lifetimes of those allocations looked like. So I scanned the allocator logs and measured the distance between when an allocation is made and when it is freed, ignoring reallocs.
To give a few examples of what I mean, the following allocation for p gets a lifetime of 0:
The following a lifetime of 1:void *p = malloc(42); free(p);
And the following a lifetime of 1 as well:void *p = malloc(42); void *other = malloc(42); free(p);
(that is, it is not counted as twovoid *p = malloc(42); p = realloc(p, 84); free(p);
malloc/free pairs)
The further away the free is from the corresponding malloc, the larger the lifetime. And the largest the lifetime can ever be is the total number of allocator function calls minus two, in the hypothetical case the very first allocation is freed as the very last (minus two because we defined the lifetime as the distance).
What comes out of this data:
malloc and a free.reallocating them either.git-remote-hg python process, and will instead focus on the planned metadata storage changes. They will allow to share the metadata more easily (allowing faster and more straightforward gecko-dev graft), and will allow to import manifests earlier, which, as mentioned already, will help reduce memory use, but, more importantly, will allow to do more actual work while downloading the data. On slow networks, this is crucial to make clones and pulls faster.
Here are the notes I took while manually expanding an non-LVM encrypted
RAID1 array on an Ubuntu machine.
My original setup consisted of a 1 TB drive along with a 2 TB drive, which
meant that the RAID1 array was 1 TB in size and the second drive had 1 TB of
unused capacity. This is how I replaced the old 1 TB drive with a new 3 TB
drive and expanded the RAID1 array to 2 TB (leaving 1 TB unused on the new 3
TB drive).
/dev/sdc) to use up all of
the capacity on that drive:
$ parted /dev/sdc
unit s
print
mkpart
print
Then I initialized the partition table and creating the EFI partition
partition on the new drive (/dev/sdd):
$ parted /dev/sdd
unit s
mktable gpt
mkpart
Since I want to have the RAID1 array be as large as the smaller of the two
drives, I made sure that the second partition (/home) on the
new 3 TB drive had:
mkpart
toggle 2 raid
and then deleted the temporary partition on the old 2 TB drive:
$ parted /dev/sdc
print
rm 3
print
mdadm /dev/md10 --create --level=1 --raid-devices=2 /dev/sdd1 missing
and added it to /etc/mdadm/mdadm.conf:
mdadm --detail --scan >> /etc/mdadm/mdadm.conf
which required manual editing of that file to remove duplicate entries.
cryptsetup -h sha256 -c aes-xts-plain64 -s 512 luksFormat /dev/md10
cryptsetup luksOpen /dev/md10 chome2
I took the UUID for the temporary RAID partition:
blkid /dev/md10
and put it in /etc/crypttab as chome2.
Then, I formatted the new LUKS partition and mounted it:
mkfs.ext4 -m 0 /dev/mapper/chome2
mkdir /home2
mount /dev/mapper/chome2 /home2
eatmydata nice ionice -c3 rsync -axHAX --progress /home/* /home2/
making use of
wrappers that preserve system reponsiveness
during I/O-intensive operations.
chome in /etc/crypttab./dev/md1 in /etc/mdadm/mdadm.conf./home mount using: df -h.mdadm --zero-superblock /dev/sdc1
and then change the second partition of the old drive to make it the same
size as the one on the new drive:
$ parted /dev/sdc
rm 2
mkpart
toggle 2 raid
print
before adding it to the new array:
mdadm /dev/md1 -a /dev/sdc1
umount /home
cryptsetup luksClose chome
mdadm --stop /dev/md10
mdadm --stop /dev/md1
before running this command:
mdadm --assemble /dev/md1 --name=mymachinename:1 --update=name /dev/sdd2
and updating the name in /etc/mdadm/mdadm.conf.
The last step was to regenerate the initramfs:
update-initramfs -u
before rebooting into something that looks exactly like the original RAID1
array but with twice the size.
| Series: | Craft #2 |
| Publisher: | Tor |
| Copyright: | October 2013 |
| ISBN: | 1-4668-0204-9 |
| Format: | Mobi |
| Pages: | 350 |
People that know me know that I do whatever I can in order to avoid watching videos online if there's any other way to get to the content. It may be that I'm too old-fashioned, or that I have low attention and prefer to use a media where I can quickly scroll up and down a paragraph, or that I feel the time between bits of content is just a useless transition or whatever...
But I bit. And I loved it.
A couple of days ago, OS News featured a post titled From the AT&T Archives: The UNIX Operating System. It links to a couple of videos in AT&T's Youtube channel.
I watched
Here is my monthly update covering what I have been doing in the free software world (previous month):
diffoscope is our in-depth and content-aware diff utility that can locate and diagnose reproducibility issues.
strip-nondeterminism is our tool to remove specific non-deterministic results from a completed build.
buildinfo.debian.net is my experiment into how to process, store and distribute .buildinfo files after the Debian archive software has processed them.
Pillow fight
For some time I struggled how to tell this short story so it started with
some trolls (clever, but still despiteful, or maybe just with too much energy)
who made a pillow with a picture of the initial systemd author, Lennart Poettering,
and put it on the sofas of the CCC Hamburg hackerspace
Which I perceived as clever trolling, as it really was a harmless pillow, which one could
use to innocently punch Lennart in the face, or rather not, as denial of this was easy
and included, eg of course this pillow was also suitable for hugging!
For some time, I didn't know how to react. Some clever person just turned the
pillow cover upsidedown, so at least we had a white pillow instead. But still,
I wanted a better reaction
And then I met Lennart at devconf.cz in Brno and realized, that I would meet
him again the following weekend in Brussels so on Saturday morning of FOSDEM 2017
I embarrassed Lennart (and myself) a little, but it was very much worth it! And so he signed it:
To put this into perspective or why I think the original pillow was a bad idea:
some people hate systemd, fine (though I do think systemd is a fine piece of
software, but you can surely disagree about this), just, please keep in mind:
"hate/fight the game, not the players".
Connection
Each component of the hifi has a mains input and a mains plug that is used to
power the next component. The element where the main power lead goes in is the
radio component,
which has a remote control receiver, a watch and a timer, and will power on the
rest of the system when turned on by its power button, the remote control, or
the alarm function.
I disconnected the cassette and cd player modules, and plugged the Raspberry Pi
phone charger/power supply in the free plug behind the amplifier
module,
at the end of the (now very short) power lead chain.
I also connected the audio output of the Raspberry Pi to the CD input of my
stereo. The advantage of CD over AUX is that the remote control buttons for
switching audio sources don't cover the AUX inputs.
With alsamixer I adjusted the output volume to match that of the radio
component, so that I can switch between the two without surprising jumps in
volume. I used alsactl store to save the mixer levels.
Now when I turn the hifi on I also turn the Raspberry Pi on, and when I turn
the hifi off, I also cut power from the Raspberry Pi.
Operating system
Operating system install instructions:
ssh file on the boot partitionssh pi@raspberrypi password raspberrysudo raspi-config to change the hostname, the password, and to enlarge the
root partition to include all the rest of the space available in the SD
card.apt install mpd
/etc/mpd.conf. The changes I made are:
Make mpd accessible from my local network:
bind_to_address "any"
zeroconf_enabled "yes" zeroconf_name "stereo"
password "SECRET@read,add,control,admin" default_permissions "read,add,control"
device option in the audio_output configuration.
use_mmap is cargo-culted from
the archlinux wiki.
audio_output
type "alsa"
name "My ALSA Device"
device "hw:0,0" # optional
use_mmap "yes"
/var/lib/mpd/music:
#!/bin/sh rsync -avz --filter=". sync-stereo.filter" --copy-links --prune-empty-dirs --delete ./ pi@stereo:/var/lib/mpd/music ssh pi@stereo "chmod u=rwX,go=rX -R /var/lib/mpd/music"
sync-stereo.filter rules file for rsync:
hide /_archive include */ include **.mp3 hide *
$ mpc -h stereo status UltraCat - Unexpected Little Happenings [playing] #15/22 0:03/4:06 (1%) volume: 80% repeat: off random: on single: off consume: off
Welcome to the second post in rambling random R recommendation series, or R4 for short.
Two days ago I posted the initial (actual) post. It provided context for why we need package registration entries (tl;dr: because R CMD check now tests for it, and because it The Right Thing to do, see documentation in the posts). I also showed how generating such a file src/init.c was essentially free as all it took was single call to a new helper function added to R-devel by Brian Ripley and Kurt Hornik.
Now, to actually use R-devel you obviously need to have it accessible. There are a myriad of ways to achieve that: just compile it locally as I have done for years, use a Docker image as I showed in the post -- or be creative with eg Travis or win-builder both of which give you access to R-devel if you're clever about it.
But as no good deed goes unpunished, I was of course told off today for showing a Docker example as Docker was not "Easy". I think the formal answer to that is baloney. But we leave that aside, and promise to discuss setting up Docker at another time.
R is after all ... just R. So below please find a script you can save as, say, ~/bin/pnrrs.r. And calling it---even with R-release---will generate the same code snippet as I showed via Docker. Call it a one-off backport of the new helper function -- with a half-life of a few weeks at best as we will have R 3.4.0 as default in just a few weeks. The script will then reduce to just the final line as the code will be present with R 3.4.0.
#!/usr/bin/r
library(tools)
.find_calls_in_package_code <- tools:::.find_calls_in_package_code
.read_description <- tools:::.read_description
## all what follows is from R-devel aka R 3.4.0 to be
package_ff_call_db <- function(dir)
## A few packages such as CDM use base::.Call
ff_call_names <- c(".C", ".Call", ".Fortran", ".External",
"base::.C", "base::.Call",
"base::.Fortran", "base::.External")
predicate <- function(e)
(length(e) > 1L) &&
!is.na(match(deparse(e[[1L]]), ff_call_names))
calls <- .find_calls_in_package_code(dir,
predicate = predicate,
recursive = TRUE)
calls <- unlist(Filter(length, calls))
if(!length(calls)) return(NULL)
attr(calls, "dir") <- dir
calls
native_routine_registration_db_from_ff_call_db <- function(calls, dir = NULL, character_only = TRUE)
if(!length(calls)) return(NULL)
ff_call_names <- c(".C", ".Call", ".Fortran", ".External")
ff_call_args <- lapply(ff_call_names,
function(e) args(get(e, baseenv())))
names(ff_call_args) <- ff_call_names
ff_call_args_names <-
lapply(lapply(ff_call_args,
function(e) names(formals(e))), setdiff,
"...")
if(is.null(dir))
dir <- attr(calls, "dir")
package <- # drop name
as.vector(.read_description(file.path(dir, "DESCRIPTION"))["Package"])
symbols <- character()
nrdb <-
lapply(calls,
function(e)
if (startsWith(deparse(e[[1L]]), "base::"))
e[[1L]] <- e[[1L]][3L]
## First figure out whether ff calls had '...'.
pos <- which(unlist(Map(identical,
lapply(e, as.character),
"...")))
## Then match the call with '...' dropped.
## Note that only .NAME could be given by name or
## positionally (the other ff interface named
## arguments come after '...').
if(length(pos)) e <- e[-pos]
## drop calls with only ...
if(length(e) < 2L) return(NULL)
cname <- as.character(e[[1L]])
## The help says
##
## '.NAME' is always matched to the first argument
## supplied (which should not be named).
##
## But some people do (Geneland ...).
nm <- names(e); nm[2L] <- ""; names(e) <- nm
e <- match.call(ff_call_args[[cname]], e)
## Only keep ff calls where .NAME is character
## or (optionally) a name.
s <- e[[".NAME"]]
if(is.name(s))
s <- deparse(s)[1L]
if(character_only)
symbols <<- c(symbols, s)
return(NULL)
else if(is.character(s))
s <- s[1L]
else ## expressions
symbols <<- c(symbols, deparse(s))
return(NULL)
## Drop the ones where PACKAGE gives a different
## package. Ignore those which are not char strings.
if(!is.null(p <- e[["PACKAGE"]]) &&
is.character(p) && !identical(p, package))
return(NULL)
n <- if(length(pos))
## Cannot determine the number of args: use
## -1 which might be ok for .External().
-1L
else
sum(is.na(match(names(e),
ff_call_args_names[[cname]]))) - 1L
## Could perhaps also record whether 's' was a symbol
## or a character string ...
cbind(cname, s, n)
)
nrdb <- do.call(rbind, nrdb)
nrdb <- as.data.frame(unique(nrdb), stringsAsFactors = FALSE)
if(NROW(nrdb) == 0L length(nrdb) != 3L)
stop("no native symbols were extracted")
nrdb[, 3L] <- as.numeric(nrdb[, 3L])
nrdb <- nrdb[order(nrdb[, 1L], nrdb[, 2L], nrdb[, 3L]), ]
nms <- nrdb[, "s"]
dups <- unique(nms[duplicated(nms)])
## Now get the namespace info for the package.
info <- parseNamespaceFile(basename(dir), dirname(dir))
## Could have ff calls with symbols imported from other packages:
## try dropping these eventually.
imports <- info$imports
imports <- imports[lengths(imports) == 2L]
imports <- unlist(lapply(imports, [[ , 2L))
info <- info$nativeRoutines[[package]]
## Adjust native routine names for explicit remapping or
## namespace .fixes.
if(length(symnames <- info$symbolNames))
ind <- match(nrdb[, 2L], names(symnames), nomatch = 0L)
nrdb[ind > 0L, 2L] <- symnames[ind]
else if(!character_only &&
any((fixes <- info$registrationFixes) != ""))
## There are packages which have not used the fixes, e.g. utf8latex
## fixes[1L] is a prefix, fixes[2L] is an undocumented suffix
nrdb[, 2L] <- sub(paste0("^", fixes[1L]), "", nrdb[, 2L])
if(nzchar(fixes[2L]))
nrdb[, 2L] <- sub(paste0(fixes[2L]), "$", "", nrdb[, 2L])
## See above.
if(any(ind <- !is.na(match(nrdb[, 2L], imports))))
nrdb <- nrdb[!ind, , drop = FALSE]
## Fortran entry points are mapped to l/case
dotF <- nrdb$cname == ".Fortran"
nrdb[dotF, "s"] <- tolower(nrdb[dotF, "s"])
attr(nrdb, "package") <- package
attr(nrdb, "duplicates") <- dups
attr(nrdb, "symbols") <- unique(symbols)
nrdb
format_native_routine_registration_db_for_skeleton <- function(nrdb, align = TRUE, include_declarations = FALSE)
if(!length(nrdb))
return(character())
fmt1 <- function(x, n)
c(if(align)
paste(format(sprintf(" \"%s\",", x[, 1L])),
format(sprintf(if(n == "Fortran")
"(DL_FUNC) &F77_NAME(%s),"
else
"(DL_FUNC) &%s,",
x[, 1L])),
format(sprintf("%d ,", x[, 2L]),
justify = "right"))
else
sprintf(if(n == "Fortran")
" \"%s\", (DL_FUNC) &F77_NAME(%s), %d ,"
else
" \"%s\", (DL_FUNC) &%s, %d ,",
x[, 1L],
x[, 1L],
x[, 2L])
,
" NULL, NULL, 0 ")
package <- attr(nrdb, "package")
dups <- attr(nrdb, "duplicates")
symbols <- attr(nrdb, "symbols")
nrdb <- split(nrdb[, -1L, drop = FALSE],
factor(nrdb[, 1L],
levels =
c(".C", ".Call", ".Fortran", ".External")))
has <- vapply(nrdb, NROW, 0L) > 0L
nms <- names(nrdb)
entries <- substring(nms, 2L)
blocks <- Map(function(x, n)
c(sprintf("static const R_%sMethodDef %sEntries[] = ",
n, n),
fmt1(x, n),
" ;",
"")
,
nrdb[has],
entries[has])
decls <- c(
"/* FIXME: ",
" Add declarations for the native routines registered below.",
"*/")
if(include_declarations)
decls <- c(
"/* FIXME: ",
" Check these declarations against the C/Fortran source code.",
"*/",
if(NROW(y <- nrdb$.C))
args <- sapply(y$n, function(n) if(n >= 0)
paste(rep("void *", n), collapse=", ")
else "/* FIXME */")
c("", "/* .C calls */",
paste0("extern void ", y$s, "(", args, ");"))
,
if(NROW(y <- nrdb$.Call))
args <- sapply(y$n, function(n) if(n >= 0)
paste(rep("SEXP", n), collapse=", ")
else "/* FIXME */")
c("", "/* .Call calls */",
paste0("extern SEXP ", y$s, "(", args, ");"))
,
if(NROW(y <- nrdb$.Fortran))
args <- sapply(y$n, function(n) if(n >= 0)
paste(rep("void *", n), collapse=", ")
else "/* FIXME */")
c("", "/* .Fortran calls */",
paste0("extern void F77_NAME(", y$s, ")(", args, ");"))
,
if(NROW(y <- nrdb$.External))
c("", "/* .External calls */",
paste0("extern SEXP ", y$s, "(SEXP);"))
)
headers <- if(NROW(nrdb$.Call) NROW(nrdb$.External))
c("#include <R.h>", "#include <Rinternals.h>")
else if(NROW(nrdb$.Fortran)) "#include <R_ext/RS.h>"
else character()
c(headers,
"#include <stdlib.h> // for NULL",
"#include <R_ext/Rdynload.h>",
"",
if(length(symbols))
c("/*",
" The following symbols/expresssions for .NAME have been omitted",
"", strwrap(symbols, indent = 4, exdent = 4), "",
" Most likely possible values need to be added below.",
"*/", "")
,
if(length(dups))
c("/*",
" The following name(s) appear with different usages",
" e.g., with different numbers of arguments:",
"", strwrap(dups, indent = 4, exdent = 4), "",
" This needs to be resolved in the tables and any declarations.",
"*/", "")
,
decls,
"",
unlist(blocks, use.names = FALSE),
## We cannot use names with '.' in: WRE mentions replacing with "_"
sprintf("void R_init_%s(DllInfo *dll)",
gsub(".", "_", package, fixed = TRUE)),
" ",
sprintf(" R_registerRoutines(dll, %s);",
paste0(ifelse(has,
paste0(entries, "Entries"),
"NULL"),
collapse = ", ")),
" R_useDynamicSymbols(dll, FALSE);",
" ")
package_native_routine_registration_db <- function(dir, character_only = TRUE)
calls <- package_ff_call_db(dir)
native_routine_registration_db_from_ff_call_db(calls, dir, character_only)
package_native_routine_registration_db <- function(dir, character_only = TRUE)
calls <- package_ff_call_db(dir)
native_routine_registration_db_from_ff_call_db(calls, dir, character_only)
package_native_routine_registration_skeleton <- function(dir, con = stdout(), align = TRUE,
character_only = TRUE, include_declarations = TRUE)
nrdb <- package_native_routine_registration_db(dir, character_only)
writeLines(format_native_routine_registration_db_for_skeleton(nrdb,
align, include_declarations),
con)
package_native_routine_registration_skeleton(".") ## when R 3.4.0 is out you only need this line/usr/bin/r as I happen to like littler a lot, but you can use Rscript the same way.
Easy enough now?
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.

Demonstration of a Lapdance Wikipedia
Illustration of an open jeep, sadly its a military one wikipedia
We needed a router and wifi access point in the office, and
simultaneously both I and my co-worker Ivan needed such a thing at our
respective homes. After some discussion, and after reading articles in
Ars Technica about building PCs to act as routers, we decided to do
just that.
| Component | Model | Cost |
|---|---|---|
| Barebone | Qotom Q190G4, VGA, 2x USB 2.0, 134x126x36mm, fanless | 130 |
| CPU | Intel J1900, 2-2.4GHz quad-core | - |
| NIC | Intel WG82583, 4x 10/100/1000 | - |
| Memory | Crucial CT102464BF160B, 8GB DDR3L-1600 SODIMM 1.35V CL11 | 40 |
| SSD | Kingston SSDNow mS200, 60GB mSATA | 42 |
| WLAN | AzureWave AW-NU706H, Ralink RT3070L, 300M 802.11b/g/n, half mPCIe | 17 |
| mPCIe adapter | Half to full mPCIe adapter | 3 |
| Antennas | 2x 2.4/5GHz 6dBi, RP-SMA, U.FL Cables | 7 |
/home/ansible/.ssh/authorized_keys file
with one that contains only your public ssh key.ansible@10.0.0.4, and verify that sudo id
works without password. Except you can't do this, unless you put in
your ssh key in the authorized keys file above.minipc-router.yml as wanted, and run the playbook. Then reboot the
router again.roles/router/files/ferm.conf as
you wish.ansible
user's authorized keys file for ssh. This is because we built this
for ourselves first. If there's interest by others in using the
images, we'll solve this.
All this racism, it's just not cricket. Or is it? One of the most remarkable cricketers to play for England in recent times, Kevin Pietersen, dubbed "the most complete batsman in cricket" by The Times and "England's greatest modern batsman" by the Guardian, was born in South Africa. In the five years he was contracted to the Hampshire county team, he only played one match, because he was too busy representing England abroad. His highest position was nothing less than becoming England's team captain.
Are the British superior to every other European citizen?
One of the implications of the rhetoric coming out of London these days is that the British are superior to their neighbours, entitled to have their cake and eat it too, making foreigners queue up at Paris' Gare du Nord to board the Eurostar while British travelers should be able to walk or drive into European countries unchallenged.
This superiority complex is not uniquely British, you can observe similar delusions are rampant in many of the places where I've lived, including Australia, Switzerland and France. America's Donald Trump has taken this style of politics to a new level.
Look in the mirror Theresa May: after British 10-year old schoolboys Robert Thompson and Jon Venables abducted, tortured, murdered and mutilated 2 year old James Bulger in 1993, why not have all British schoolchildren fingerprinted and added to the police DNA database? Why should "security" only apply based on the country where people are born, their religion or skin colour?
In fact, after Brexit, people like Venables and Thompson will remain in Britain while a Dutch woman, educated at Cambridge and with two British children will not. If that isn't racism, what is?
Running foreigner's off the roads
Theresa May has only been Prime Minister for less than a year but she has a history of bullying and abusing foreigners in her previous role in the Home Office. One example of this was a policy of removing driving licenses from foreigners, which has caused administrative chaos and even taken away the licenses of many people who technically should not have been subject to these regulations anyway.
Shouldn't the DVLA (Britain's office for driving licenses) simply focus on the competence of somebody to drive a vehicle? Bringing all these other factors into licensing creates a hostile environment full of mistakes and inconvenience at best and opportunities for low-level officials to engage in arbitrary acts of racism and discrimination.
Of course, when you are taking your country on the road to nowhere, who needs a driving license anyway?
What does "maximum control" over other human beings mean to you?
The new British PM has said she wants "maximum control" over immigrants. What exactly does "maximum control" mean? Donald Trump appears to be promising "maximum control" over Muslims, Hitler sought "maximum control" over the Jews, hasn't the whole point of the EU been to avoid similar situations from ever arising again?
This talk of "maximum control" in British politics has grown like a weed out of the UKIP. One of their senior figures has been linked to kidnappings and extortion, which reveals a lot about the character of the people who want to devise and administer these policies. Similar people in Australia aspire to jobs in the immigration department where they can extort money out of people for getting them pushed up the queue. It is no surprise that the first member of Australia's parliament ever sent to jail was put there for obtaining bribes and sexual favours from immigrants. When Nigel Farage talks about copying the Australian immigration system, he is talking about creating jobs like these for his mates.
Even if "maximum control" is important, who really believes that a bunch of bullies in Westminster should have the power to exercise that control? Is May saying that British bosses are no longer competent to make their own decisions about who to employ or that British citizens are not reliable enough to make their own decisions about who they marry and they need a helping hand from paper-pushers in the immigration department?
Echoes of the Third Reich
Most people associate acts of mass murder with the Germans who lived in the time of Adolf Hitler. These are the stories told over and and over again in movies, books and the press.
Look more closely, however, and it appears that the vast majority of Germans were not in immediate contact with the gas chambers. Even Gobels' secretary writes that she was completely oblivious to it all. Many people were simply small cogs in a big bad machine. The clues were there, but many of them couldn't see the big picture. Even if they did get a whiff of it, many chose not to ask questions, to carry on with their comfortable lives.
Today, with mass media and the Internet, it is a lot easier for people to discover the truth if they look, but many are still reluctant to do so.
Consider, for example, the fingerprint scanners installed in British post offices and police stations to fingerprint foreigners and criminals (as if they have something in common). If all the post office staff refused to engage in racist conduct the fingerprint scanners would be put out of service. Nonetheless, these people carry on, just doing their job, just following orders. It was through many small abuses like this, rather than mass murder on every street corner, that Hitler motivated an entire nation to serve his evil purposes.
Technology like this is introduced in small steps: first it was used for serious criminals, then anybody accused of a crime, then people from Africa and next it appears they will try and apply it to all EU citizens remaining in the UK.
How will a British man married to a French woman explain to their children that mummy has to be fingerprinted by the border guard each time they return from vacation?
The Nazis pioneered biometric technology with the tracking numbers branded onto Jews. While today's technology is electronic and digital, isn't it performing the same function?
-Wl,--no-insert-timestamp to set it to 0 (though see caveats below):
$ i686-w64-mingw32.static-gcc -Wl,--no-insert-timestamp hello.c -o hello.exe
$ md5sum hello.exe
298f98d74e6e913628a8b74514eddcb2 hello.exe
$ /opt/mxe/usr/bin/i686-w64-mingw32.static-gcc -Wl,--no-insert-timestamp hello.c -o hello.exe
$ md5sum hello.exe
298f98d74e6e913628a8b74514eddcb2 hello.exe
$ cd repro/
$ i686-w64-mingw32.static-gcc hello.c -o hello.exe && i686-w64-mingw32.static-strip hello.exe
$ md5sum hello.exe
6e07736bf8a59e5397c16e799699168d hello.exe
$ i686-w64-mingw32.static-gcc hello.c -o hello.exe && i686-w64-mingw32.static-strip hello.exe
$ md5sum hello.exe
6e07736bf8a59e5397c16e799699168d hello.exe
$ cd ..
$ cp -a repro repro2/
$ cd repro2/
$ i686-w64-mingw32.static-gcc hello.c -o hello.exe && i686-w64-mingw32.static-strip hello.exe
$ md5sum hello.exe
6e07736bf8a59e5397c16e799699168d hello.exe
$ cd /opt/mxe/
$ cp -a ./usr/i686-w64-mingw32.static/lib/libSDL2.a /tmp
$ rm -rf * && git checkout .
$ make sdl2
$ md5sum ./usr/i686-w64-mingw32.static/lib/libSDL2.a /tmp/libSDL2.a
68909ab13181b1283bd1970a56d41482 ./usr/i686-w64-mingw32.static/lib/libSDL2.a
68909ab13181b1283bd1970a56d41482 /tmp/libSDL2.a
$ cd /usr/srx/mxe
$ make sdl2
$ md5sum usr/i686-w64-mingw32.static/lib/libSDL2.a /tmp/libSDL2.a
c6c368323927e2ae7adab7ee2a7223e9 usr/i686-w64-mingw32.static/lib/libSDL2.a
68909ab13181b1283bd1970a56d41482 /tmp/libSDL2.a
$ ls -l ./usr/i686-w64-mingw32.static/lib/libSDL2.a /tmp/libSDL2.a
-rw-r--r-- 1 me me 5861536 mars 23 21:04 /tmp/libSDL2.a
-rw-r--r-- 1 me me 5862488 mars 25 19:46 ./usr/i686-w64-mingw32.static/lib/libSDL2.a
$ apt-get install reprotest disorderfs faketime
$ reprotest 'make hello' 'hello'
...
will vary: environment
will vary: fileordering
will vary: home
will vary: kernel
will vary: locales
will vary: exec_path
will vary: time
will vary: timezone
will vary: umask
...
--- /tmp/tmpk5uipdle/control_artifact/
+++ /tmp/tmpk5uipdle/experiment_artifact/
--- /tmp/tmpk5uipdle/control_artifact/hello
+++ /tmp/tmpk5uipdle/experiment_artifact/hello
stat
@@ -1,8 +1,8 @@
Size: 8632 Blocks: 24 IO Block: 4096 regular file
Links: 1
-Access: (0755/-rwxr-xr-x) Uid: ( 1000/ me) Gid: ( 1000/ me)
+Access: (0775/-rwxrwxr-x) Uid: ( 1000/ me) Gid: ( 1000/ me)
Modify: 1970-01-01 00:00:00.000000000 +0000
Birth: -
# => OK except for permissions
$ reprotest 'make hello && chmod 755 hello' 'hello'
=======================
Reproduction successful
=======================
No differences in hello
c8f63b73265e69ab3b9d44dcee0ef1d2815cdf71df3c59635a2770e21cf462ec hello
$ reprotest 'make hello CFLAGS="-g -O2"' 'hello'
# => lots of differences, as expected
linux32 (because MXE would then recompile all the host compiler tools for 32-bit):
$ reprotest --dont-vary build_path,kernel 'touch src/sdl2.mk && make sdl2 && cp -a usr/i686-w64-mingw32.static/lib/libSDL2.a .' 'libSDL2.a'
=======================
Reproduction successful
=======================
No differences in libSDL2.a
d9a39785fbeee5a3ac278be489ac7bf3b99b5f1f7f3e27ebf3f8c60fe25086b5 libSDL2.a
$ reprotest --dont-vary build_path,kernel 'make clean && make sdl2 sdl2_gfx sdl2_image sdl2_mixer sdl2_ttf libzip gettext nsis' 'usr'
# => changes in installation dates
# => timestamps in .exe files (dbus, ...)
# => libicu doesn't look reproducible (derb.exe, genbrk.exe, genccode.exe...)
# => apparently ar timestamp variations in libaclui
ar differences may go away at FreeDink link time since I'm aiming at a static build.
Let's try!
First let's see how FreeDink behaves with stable dependencies.-Wl,--no-insert-timestamp and strip the binaries in a first step.$ cd freedink/
$ reprotest --dont-vary build_path 'mkdir cross-woe-32/ && cd cross-woe-32/ && export PATH=/opt/mxe/usr/bin:$PATH && LDFLAGS='-Wl,--no-insert-timestamp' ../configure --host=i686-w64-mingw32.static --enable-static && make -j$(nproc) && make install-strip DESTDIR=$(pwd)/destdir' 'cross-woe-32/destdir/usr/local/bin'
# => executables are identical!
# Same again, just to make sure
$ reprotest --dont-vary build_path 'mkdir cross-woe-32/ && cd cross-woe-32/ && export PATH=/opt/mxe/usr/bin:$PATH && LDFLAGS='-Wl,--no-insert-timestamp' ../configure --host=i686-w64-mingw32.static --enable-static && make -j$(nproc) && make install-strip DESTDIR=$(pwd)/destdir' 'cross-woe-32/destdir/usr/local/bin'
--- /tmp/tmp2yw0sn4_/control_artifact/bin/freedink.exe
+++ /tmp/tmp2yw0sn4_/experiment_artifact/bin/freedink.exe
@@ -2,20 +2,20 @@
00000010: b800 0000 0000 0000 4000 0000 0000 0000 ........@.......
00000020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000030: 0000 0000 0000 0000 0000 0000 8000 0000 ................
00000040: 0e1f ba0e 00b4 09cd 21b8 014c cd21 5468 ........!..L.!Th
00000050: 6973 2070 726f 6772 616d 2063 616e 6e6f is program canno
00000060: 7420 6265 2072 756e 2069 6e20 444f 5320 t be run in DOS
00000070: 6d6f 6465 2e0d 0d0a 2400 0000 0000 0000 mode....$.......
-00000080: 5045 0000 4c01 0a00 e534 0735 0000 0000 PE..L....4.5....
+00000080: 5045 0000 4c01 0a00 0000 0000 0000 0000 PE..L...........
00000090: 0000 0000 e000 0e03 0b01 0219 00f2 3400 ..............4.
000000a0: 0022 4e00 0050 3b00 c014 0000 0010 0000 ."N..P;.........
000000b0: 0010 3500 0000 4000 0010 0000 0002 0000 ..5...@.........
000000c0: 0400 0000 0100 0000 0400 0000 0000 0000 ................
-000000d0: 00e0 8900 0004 0000 7662 4e00 0200 0000 ........vbN.....
+000000d0: 00e0 8900 0004 0000 89f8 4e00 0200 0000 ..........N.....
000000e0: 0000 2000 0010 0000 0000 1000 0010 0000 .. .............
000000f0: 0000 0000 1000 0000 00a0 8700 b552 0000 .............R..
00000100: 0000 8800 d02d 0000 0050 8800 5006 0000 .....-...P..P...
00000110: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000120: 0060 8800 4477 0100 0000 0000 0000 0000 . ..Dw..........
00000130: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000140: 0440 8800 1800 0000 0000 0000 0000 0000 .@..............
stat
@@ -1,8 +1,8 @@
Size: 5121536 Blocks: 10008 IO Block: 4096 regular file
Links: 1
Access: (0755/-rwxr-xr-x) Uid: ( 1000/ me) Gid: ( 1000/ me)
-Modify: 2017-03-26 01:26:35.233841833 +0000
+Modify: 2017-03-26 01:27:01.829592505 +0000
Birth: -
# With MXE:
$ reprotest 'i686-w64-mingw32.static-gcc hello.c -I /opt/mxe/usr/i686-w64-mingw32.static/include -I/opt/mxe/usr/i686-w64-mingw32.static/include/SDL2 -L/opt/mxe/usr/i686-w64-mingw32.static/lib -lmingw32 -Dmain=SDL_main -lSDL2main -lSDL2 -lSDL2main -Wl,--no-insert-timestamp -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion -o hello && chmod 700 hello' 'hello'
# => different
# => maybe because it imports the build timestamp from -lSDL2main
# With Debian's MinGW (but without SOURCE_DATE_EPOCH):
$ reprotest 'i686-w64-mingw32-gcc hello.c -I /opt/mxe/usr/i686-w64-mingw32.static/include -I/opt/mxe/usr/i686-w64-mingw32.static/include/SDL2 -L/opt/mxe/usr/i686-w64-mingw32.static/lib -lmingw32 -Dmain=SDL_main -lSDL2main -lSDL2 -lSDL2main -Wl,--no-insert-timestamp -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion -o hello && chmod 700 hello' 'hello'
=======================
Reproduction successful
=======================
No differences in hello
0b2d99dc51e2ad68ad040d90405ed953a006c6e58599beb304f0c2164c7b83a2 hello
# Let's remove -Dmain=SDL_main and let our main() have precedence over the one in -lSDL2main:
$ reprotest 'i686-w64-mingw32.static-gcc hello.c -I /opt/mxe/usr/i686-w64-mingw32.static/include -I/opt/mxe/usr/i686-w64-mingw32.static/include/SDL2 -L/opt/mxe/usr/i686-w64-mingw32.static/lib -lmingw32 -lSDL2main -lSDL2 -lSDL2main -Wl,--no-insert-timestamp -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion -o hello && chmod 700 hello' 'hello'
=======================
Reproduction successful
=======================
No differences in hello
6c05f75eec1904d58be222cc83055d078b4c3be8b7f185c7d3a08b9a83a2ef8d hello
$ LANG=C i686-w64-mingw32.static-ld --version # MXE
GNU ld (GNU Binutils) 2.25.1
Copyright (C) 2014 Free Software Foundation, Inc.
$ LANG=C i686-w64-mingw32-ld --version # Debian
GNU ld (GNU Binutils) 2.27.90.20161231
Copyright (C) 2016 Free Software Foundation, Inc.
main().
So FreeDink is nearly reproducible, except for this build timestamp issue that pops up in all kind of situations.
In the worse case I can zero it out, or patch MXE's binutils until they upgrade.
More importantly, what if I recompile FreeDink and the dependencies twice?
$ (cd /opt/mxe/ && make clean && make sdl2 sdl2_gfx sdl2_image sdl2_mixer sdl2_ttf glm libzip gettext nsis)
$ (mkdir cross-woe-32/ && cd cross-woe-32/ \
&& export PATH=/opt/mxe/usr/bin:$PATH \
&& LDFLAGS="-Wl,--no-insert-timestamp" ../configure --host=i686-w64-mingw32.static --enable-static \
&& make V=1 -j$(nproc) \
&& make install-strip DESTDIR=$(pwd)/destdir)
$ mv cross-woe-32/ cross-woe-32-1/
# Same again...
$ mv cross-woe-32/ cross-woe-32-2/
$ diff -ru cross-woe-32-1/destdir/ cross-woe-32-2/destdir/
[nothing]
src/freedinkedit.exe.
make INSTALL="$(which install) install -p" could help for static files, but not generated ones.$ export SOURCE_DATE_EPOCH=$(date +%s) \
&& reprotest --dont-vary build_path \
'make ... && find destdir/ -newermt "@$ SOURCE_DATE_EPOCH " -print0 xargs -0r touch --no-dereference --date="@$ SOURCE_DATE_EPOCH "' 'cross-woe-32/destdir/'
make install MKDIR_P="mkdir -p -m 755" (1).mkdir -p -m ... does not set permissions for intermediate directories.
Randall Munroe recently mapped how he communicated with his social circle. As I got older recently, I had an opportunity to create a similar statistics that shows how people close to me chose to fulfil their social obligations (given the current geographic circumstances):

Communication variants
gnu-efi. This currently does not extend to the randomly generated embedded certificate though they also plan to address that soon.
About a year ago I bought a new workstation computer for myself at
home. It s a Tuxedo XUX_Cube which is advertised as gaming PC. But I ordered a
slightly atypical non-gamer configuration:
cat
/proc/mdstat on that box.
So at some point I wanted something like smart-notifier, but
for Linux Software (MD) RAIDs. And since I found nothing, I did what
Open Source guys usually do in such cases: I wrote it myself
of course in Perl and called it systray-mdstat.
First I wondered about which build system would be most suitable for that
task, but in the end I once again went with Dist::Zilla for the upstream build
system and hence dh-dist-zilla for the Debian packaging.
Ideas for the actual implementation were taken from Wouter s fdpowermon for the systray icon framework in Perl and Myon s mdstat Xymon plugin for an already proven logic to
parse /proc/mdstat. (Both, Wouter and Myon have stated in
a GnuPG-signed e-mail that I copied less code than would validate
their copyrights, so I was able to license it under a single license,
namely GNU GPL version 3.)
As of now, systray-mdstat is also available as package in
Debian Unstable. It won t make it to Stretch as its first line of code
has been written after the soft-freeze for Stretch was already in
place.
Maintaining Debian packages of Perl modules usually can be done with
the common git-buildpackage (aka gbp) workflow with its three
git branches master (or debian),
upstream and pristine-tar:
upstream contains the upstream code as imported from
upstream s release tar-balls.pristine-tar contains the binary diffs between the
contents of the upstream branch and the original
tar-ball. This mostly contains meta-data (timestamps, permissions,
file owners, etc.) as git doesn t store them.master (or debian) which contains
upstream plus packaging.upstream branch is used (and then maybe called
master while the Debian packaging branch is then called
debian).
But the files needed for a proper so called CPAN distribution of a
Perl module often contain redundant information (version numbers,
required modules, etc.) which needs to be maintained. And for that,
many people prefer Don t Repeat Yourself (DRY) as a
principle.
Dist::Zilla
One nice and common tool for that is Dist::Zilla or short dzil. It generates most
redundant but required data out of a central source, e.g.
Dist::Zilla s dist.ini or the contained .pm
files, etc. dzil build creates tar ball which contains
all files necessary by CPAN.
But now we have a dilemma: Debian expects those generated files inside
the upstream branch while the files are only generated
from other files in that branch. There are multiple solutions, but all
of them involve committing generated files to the git repository:
upstream branch. Disadvantage:
You ll likely later forget which files were generated and which
weren t.master (original code), upstream (original
code + stuff generated by dzil build, maybe imported with
git-import-orig), pristine-tar and a
debian (based on upstream) branches.run-parts tool) was initially maintained in the latter
way.
But especially in cases where we just need a Perl module packaged as
.deb without uploading it to CPAN (e.g. project-internal
modules), this is a tedious workflow and overkill. It would be much
nicer if debhelper would just call dzil to generate all
the stuff it needs to build the package.
dh-dist-zilla
Well, you can
do that now, at least with Debian Jessie. This is what dh-dist-zilla does: It is a debhelper sequence plugin which calls
dzil build and dzil clean in the right
moment and takes care that all dh_auto_* commands look in
the directory with the generated files instead of the rather clean
project root directory.
To use dh-dist-zilla, you just need to add a build-dependency on it
and the Dist::Zilla plugins you use, and add --with
dist-zilla to your minimal dh-style
debian/rules file:
#!/usr/bin/make -f %: dh $@ --with dist-zillaThat s it. With regards to workflow and git branches, you may still want to use separate branches for upstream work and debian work, and you may want to continue to use pristine-tar, but you don t have to commit generated files to git anymore and you can maintain a clean master branch with nearly no redundancy. And if you need to generate to final upstream tar ball for you debian package, just call
dh get-orig-source or maybe easier to
use with tab completion dh_dist_zilla_origtar.
This is how the librun-parts-perl package is maintained
nowadays. There s otherwise not much difference to the old,
classically maintained versions.
More DRY
Next step in the DRY evolution is to reduce redundancies between
upstream (Dist::Zilla based) packaging and the Debian packaging. There
are a few tools available, partially brand new, partially not yet
packaged:
dh-dzil-refresh which combines
dh-make-perl s refresh subcommand with Dist::Zilla.
http://social.gl-como.it/photos/valhalla/image/81b600789aa02a91fdf62f54a71b1ba0
A new release of RcppTOML is now on CRAN. This release fixes a few parsing issues for less frequently-used inputs: vectors of boolean or date(time) types, as well as table array input.
RcppTOML brings TOML to R. TOML is a file format that is most suitable for configurations, as it is meant to be edited by humans but read by computers. It emphasizes strong readability for humans while at the same time supporting strong typing as well as immediate and clear error reports. On small typos you get parse errors, rather than silently corrupted garbage. Much preferable to any and all of XML, JSON or YAML -- though sadly these may be too ubiquitous now. TOML is making good inroads with newer and more flexible projects such as the Hugo static blog compiler, or the Cargo system of Crates (aka "packages") for the Rust language.
Courtesy of CRANberries, there is a diffstat report for this release. More information is on the RcppTOML page page. Issues and bugreports should go to the GitHub issue tracker.Changes in version 0.1.2 (2017-03-26)
- Dates and Datetimes in arrays in the input now preserve their types instead of converting to numeric vectors (#13)
- Boolean vectors are also correctly handled (#14)
- TableArray types are now stored as lists in a single named list (#15)
- The README.md file was expanded with an example and screenshot.
- Added file
init.cwith calls toR_registerRoutines()and R_useDynamicSymbols(); also use.registration=TRUEinuseDynLibinNAMESPACE- Two example files were updated.
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
Next.