If you are like me, your git repository checkouts have a tendency to accumulate lots of branches over time.
Git Bonsai is a command line tool to help you clean this bush.
Git Bonsai can perform the following tasks for you:
Fetch remote changes, then loop over all your tracking branches and update them to their remote counterparts.
List merged branches and let you select which ones to delete.
Do the same for duplicated branches (when you have multiple branches pointing to the same commit).
Pixel Wheels 0.19.0 is out! This is the first release of 2021, and it might be the last 0.x.0 release: the game is a bit light on content (12 vehicles, 6 tracks, 3 championships) but I want to "finish" this project so unless I change my mind, next version will be called 1.0.0.
The most important change is... music!
I spent much time on opengameart.org looking for free music and ended up picking 5 pieces from FoxSynergy:
I was surprised how adding music really gave the game a more "finished" feeling:
Hey, Pixel Wheels 0.18.0 is out! This version brings a new track to the game: "River". This track completes the "Country Life" championship: now all championships have two tracks. It's not much, but I think we can agree it's better than a one track championship, right?
0.18.0 also comes with Android TV support, making it easier for you to play the game in your living room.
Our computers are getting faster and faster, but compilation and startup times are still something we want to avoid.
One situation where waiting for compilation and startup to finish feels like a waste is when you are fine-tuning an aspect of your application. For example when you are adjusting spacing or colors in a user interface. Having to wait between each iteration not only costs us time, it also makes us less likely to do more experiments.
In this article I am going to show a few tricks to reduce these pains.
I just released Nanonote 1.3.0, my minimalist note-taking application! This release comes with two new features:
First a search bar, implemented by Pavol Oresky:
Second, the ability to reorder selected lines using Alt+Shift+Up and Alt+Shift+Down. This is very handy to order lists:
I just released Pixel Wheels 0.17.0. The main focus on this version has been the graphics, lot of work has been done on the various background tiles: roof, roads, trees, sidewalks, bridge, sand have been improved.
I spent way too long time working on the roof tiles in particular, to the point where I was starring at roofs every time I went outside, looking for inspiration. You can see the evolution of the tiles in this short time-lapse:
Today I want to present a testing technique I now use in Nanonote unit tests.
Nanonote main component is a QTextEdit with several "extensions" to provide custom behaviors such as indenting/unindenting selected lines with tab/shift+tab or moving selected lines up and down with alt+shift+arrow keys (next version feature, #spoileralert!).
Testing these extensions is not particularly difficult but it requires tedious setup to set the text, position the cursor, define the selection. Then you perform the action and have to write more tedious code to check the new text, cursor position and selection match your expectations. Not only is it tedious to write, it is also error-prone and hard to read.
I finally found the time and motivation to get a new version of Pixel Wheels out, so here comes 0.16.0.
Not many engine changes in this new version, mostly new content: first a new track: "Welcome". This track takes place in the countryside, so you'll race among fields and should spot an old tractor. As its name imply it's a simple track, designed to be the track new players begin with.
It is part of a new championship called "Country Life", which for now contains only this track, so it's very short... I plan to add a new track to it in the next version.
The other content addition is a new car: the Dark M.
It's a bit longer than the others. Maybe I should shorten it a bit, what do you think?
Let's say you need to parse and analyse some raw data, for example a log file, to generate a report.
An easy way to get started with this is to write some Python, Perl, Ruby or shell code to work on your file and print meaningful information about it.
To illustrate this article I am going to write a Python script to "analyze" the
var/log/syslog log file, whose entries look like this:
Apr 12 11:53:42 dozer org.kde.KScreen: kscreen.xrandr: #011Primary: false Apr 12 11:53:42 dozer org.kde.KScreen: kscreen.xrandr: Output 68 : connected = false , enabled = false Apr 12 11:53:43 dozer org.kde.KScreen: kscreen.xrandr: Emitting configChanged() Apr 12 11:53:47 dozer dbus-daemon: [system] Activating service name='org.kde.powerdevil.backlighthelper' requested by ':1.416652' (uid=1001 pid=7186 comm="/usr/lib/x86_64-linux-gnu/libexec/org_kde_powerdev" label="unconfined") (usi Apr 12 11:53:47 dozer org.kde.powerdevil.backlighthelper: QDBusArgument: read from a write-only object Apr 12 11:53:47 dozer org.kde.powerdevil.backlighthelper: message repeated 2 times: [ QDBusArgument: read from a write-only object] Apr 12 11:53:47 dozer dbus-daemon: [system] Successfully activated service 'org.kde.powerdevil.backlighthelper' Apr 12 11:54:04 dozer kernel: [716525.975149] usb 3-2: USB disconnect, device number 64 Apr 12 11:54:04 dozer kernel: [716525.975156] usb 3-2.1: USB disconnect, device number 65 Apr 12 11:54:04 dozer kernel: [716526.040164] usb 3-2.3: USB disconnect, device number 66 Apr 12 11:54:04 dozer upowerd: unhandled action 'unbind' on /sys/devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2.1/3-2.1:1.0/0003:046D:C046.0025 Apr 12 11:54:04 dozer upowerd: unhandled action 'unbind' on /sys/devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2.1/3-2.1:1.0 Apr 12 11:54:04 dozer upowerd: unhandled action 'unbind' on /sys/devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2.1 Apr 12 11:54:04 dozer acpid: input device has been disconnected, fd 6
The script is going to take the log entries from stdin, iterate on the lines and produce a report on stdout.
The first thing to do is to parse the log file. Since we read the log from stdin, we can start with something like this:
import sys def parse_line(line): # TODO def parse_log(): for line in sys.stdin.readlines(): entry = parse_line(line) if entry: yield entry def main(): for entry in parse_log(): print(entry) if __name__ == "__main__": main()
I don't know about you, but when I work in a git repository for a long time, I tend to accumulate branches, which I need to clean up.
There are a number of tools to do this, but since I have been teaching myself Rust I thought it was a good topic for a first "real" program. So here is "Git Bonsai", a command-line tool to help you keep your git repository clean and tidy by:
For example, given a repository like this:
$ git log --all --oneline --graph * f97c782 (HEAD -> master) Merging topic1 |\ | * f6bfa90 (topic1) Merging topic1-1 | |\ | | * 6943ed2 (topic1-1) Create topic1-1 | |/ | * 4ea41ff Create topic1 |/ | * eec4ebe (topic2) Create topic2 |/ * b8b1506 Init $ git branch * master topic1 topic1-1 topic2