Skip to main content

Posts

Showing posts with the label developer's life

A semantic fuzzer for Obsidian Sync... in spite of Claude

I guided Claude Code to build a fuzzer to find Obsidian Sync bugs. It runs Obsidian instances in containers and makes them edit notes while it cuts their network connection.  And it works: it finds amusingly short sequences of operations that trigger data loss, and that you can verify yourself by running them manually on your own phone and computer. I got a functional prototype in 30h, but the next 30h turned into a painful bug treadmill, where at every turn Claude broke as much as it fixed.  So  I wrote an experience report: what went wrong, why research (and Anthropic's own docs) suggests that this was to be expected, and how to salvage the good bits. I posted the full experience report in Substack ; Blogger is not keeping up with the world. 

In quick praise of Quinn "The Skimo"

Apple is dismal with their documentation, and their Feedback Assistant is a cruel joke and waste of time that makes users and devs work for free for one of the biggest companies in the world – and then ignores them anyway. So when you're diving for information among the layers of deprecated debris, you end up noticing and remembering the rare nice nugget.  I've been noticing the name of Quinn "The Skimo" appearing at the bottom of many random dives, I'd swear since before OS X. And I just found that I'm not the only one remembering him! People in Hacker News also noticed the same .  So, I just wanted to thank you, Quinn "The Skimo"! (Possibly I failed to notice others with less memorable signatures... there's a lesson here)

YOU could have invented the LMAX Disruptor... if only you were limited enough!

This is about a shocking realization I got while learning about the LMAX Disruptor – a data structure / architecture that got published in 2011 and made some waves across the web because it allowed LMAX to process +6M transactions per second on a single thread. In Java. Which was interesting because Java was (still?) supposed to be too slow for that kind of thing. By then I was already a couple of years out of the Java world and getting into embedded C, so I took a mental note to look into it just out of curiosity. But, as could be expected, the note was promptly forgotten. I'm now looking again into Java, so finally I managed to take a peek at the Disruptor. Shock: this is just a description of what I was implementing in C while I was still learning it! But it's not that I'm a genius; it's that this is probably the only way to do things when in a limited environment. In fact, the basic architecture is the one used typically in drivers and in Linux's NAPI networ...

GitFlow (and friends) with remotes: avoid the busywork

If your local feature branch tracks origin/feature , you are probably working extra, no matter your flow . There are lots of places online where one can learn about GitFlow, but it's seemingly always discussed in a local way; the details, subtle or not, about using GitFlow when you are pushing and pulling your changes through the network are never mentioned. Now, GitFlow is a bit long on the teeth, and some of the younger and simpler alternatives do take into consideration things as Pull (or Merge) Requests; lately some even want the original GitFlow to be considered harmful . But still, there's a common basic concept in GitFlow and the alternatives, which is local feature branches. How and when exactly to merge them back into a development branch is one of the big differences, but is rarely detailed. The goal of this post is to gather some tips on how to keep developing in the local feature branch while staying involved on a lively repository; and how to make easier t...

List the DTrace providers in your machine

I don't see any official way to list the DTrace providers; you can seemingly only list ALL the probes, the >300K of them (in my Mac right now), and then you have to deal with the multitude of providers instantiated multiple times for different PIDs. So here's a small AWK script to list the unique providers, how many instances of each are there, and how many providers are attached to each PID:

Fred Brooks vs Dijkstra?

In the 60's, Freed Brooks led the development of the IBM/360 system and its OS. The experience made him write the famous The Mythical Man-Month. Turns out that Dijkstra also wrote about that system in his EWD255. And everything he complained about on that system is the standard nowadays! Sounds like he considered that a lot of the complexity that should be fixed by the computer is being dumped on the programmer; that the features touted by the IBM/360’s OS are in fact partial fixes to the bad design of the computer:

6 tips to survive Codility tests

Well, it happened. When applying for a job, I got sent to a Codility test. And even though I already had some good practice with them, I managed to do badly in stupid ways – ways that 2 years ago I had already identified and even taken notes on. Just, in the heat of the moment I forgot about those rules of thumb. And in fact I think these hints should be given by Codility themselves – because otherwise you are practically ambushed, even more so if you didn't take the time to thoroughly explore how they work. So here are my hints-to-self, now for everyone. The summary is: don't think of Codility as a coding interview; this is primarily about getting something (anything!) working, ASAP.

Swapping bottom left and right panes (content and patch summary/file tree) in gitk

Gitk (as of git 2.4.2) has its bottom left and right panes the other way round to what I like: the bottom right shows the file tree or the patch summary, while the bottom left shows the contents of what is selected on the right. Isn't that kinda non-standard? There is no official way to swap those panes, so here's a little hacky patch to do it.

Towards functional

(another entry in the "let the greats make my points" series …) At some point I was getting uncomfortably close to the expressive possibilities of plain old C , and started learning C++. But C++ always had to me this air about it connecting it to UML excesses, to baroque Design Patterns for things that might have been expressed with a handful of words, to "big, spongy frameworks" (as Yegge said?)… the kind of things that made me wary of going into J2EE to begin with, some long time ago. 

Great minds think alike…

… or, "using quotes by well-known people to put forward possibly unpopular points" ;P Sometimes I have a fully formed opinion to write about; lots of times I don't, but I have an intuition of where I want to go. And those times seeing what some of the "greats" in the field think can be a bit of a beacon.

Eclipse CDT configuration for big, makefile-based projects

It's been kinda hard to get Eclipse to work well with big CDT projects (say, the Linux kernel, or even a BuildRoot project including the Linux kernel). The documentation for Eclipse is between non-existent and unhelpful, and I only could find a post that talked specifically about preparing an Eclipse project for the Linux kernel . But that post explains nothing, and does some arbitrary things. So this is the generalization of that.

Codility

Lately I came across Codility, a company which present themselves quite simply: “we test coders”. I had been thinking for some time about trying my hand at some coding competition, and was in the process of searching for a new job, so I became curious. But after a quick look at their website the curiosity became disdain. It all sounded like boasting to be a coarse-grained filter to separate the chaff from the wheat, quickly. Only that the chaff are people too. Sounded pretty dystopian. Probably this is a First World problem, but hey, after interviewing in a couple of places things seemed sufficiently bleached and dead inside as to not need any more automatic filter to dehumanize the interviewing / testing even more. Typically in my interviews I missed feeling anything that would make me want to work with the interviewers; I wanted to find someone with passion, instead of someone boringly fulfilling the recruiter role for a hollow company. And the Codility premise didn’t seem to hel...

Estimation questions in job interviews

I had heard about those questions in job interviews where you are asked to estimate on the spot something, though having no real data about it. There was some example about estimating the quantity of gas stations on the whole USA; I seem to remember that was for a Google job application. The guy had the guts to throw up numbers in a hunch with the handwaviest idea of how they could be good numbers… and, luckily, at the end the result was even not a bad approximation. I realize now that at the moment, when I read that, the “luckily” part is what stuck on me. While it’s true that the guy had the wit to back the numbers and/or the chutzpah to pick them out of thin air, and even though he also had some brillian moments to just turn around and cross-check some imagined number by using another set of assumptions … the thing is that finally he was near the true number. Luckily . It was fascinating, and rather intimidating. How in hell would I be able to do something like that?

My first hardware bug report?

I have found what looks like a hardware bug in the AT90CAN128! I guess I could be happy in a geeky way, but the number of hours spent trying to track the problem make it a bit difficult :P. The thing is that aborting a pending MOb in the CAN controller embedded in the AT90CAN128 can leave CONMOB in an unexpected state. I am not totally sure if this is a hardware bug… or could be Atmel's library at90CANlib_3_2 being buggy AND misleading.

Atmel Studio 6 and blank Solution Explorer

Atmel Studio 6, which is (ununderstandably!*) based on Visual Studio (2010?), suddenly stopped showing anything in the Solution Explorer pane. The pane was there, it just remained empty, blank, apart from the "Properties" button (and the "Show all files" button shows up too, depending on the frontmost pane).

Safari's Reading List protocol: CalDAV + XBELs

Safari on desktop and iOS has a feature called "Reading List". It is a way to store URLs in iCloud, synchronize them between Safaris, and mark them as read or not. Somewhat like Instapaper maybe. I was a bit surprised that there is no Chrome or Firefox extensions for tapping into Safari's Reading List. So I wanted to try poking a bit into the protocol, maybe something interesting would appear or someone could get some headstart from this. Safari always seem to start contacting p05-bookmarks.icloud.com, which resolves to the Akamai CDN, some p05-bookmarks.icloud.com.akadns.net. Luckily the IP always was the same, and there is no client certificate check, so I could mount a little Man In The Middle via /etc/hosts. Then, a couple of socats: one to pose as the original SSL server and resend the plaintext; and the second to receive the plaintext and send it to the original IP. The first socat shows everything that goes out of it (in plaintext) thanks to the -vx option. ...

Tcpflow and connections between local interfaces

Looks like tcpflow doesn't see connections between local interfaces. After a bit of digging, looks like such connections are "routed internally by the kernel", at least in Linux. And there are patches for Linux to force those packets out of one interface and in from another, but even that is only useful if you have an external network connecting both interfaces (looks like a simple crossover cable should be enough). http://www.ssi.bg/~ja/send-to-self.txt There is another option: using iptables to first make the packets leave the machine towards some external IP, and then using arpd to make a router send back those packets. http://serverfault.com/questions/127636/force-local-ip-traffic-to-an-external-interface And I see people reporting that tcpflow -i lo does work for them, capturing flows having local addresses even though different than 127.0.0.1. http://fixunix.com/tcp-ip/327123-capturing-tcpdump-local-traffic.html The interesting thing is that people seem...