marcelpetrick
Replace the Sansa Clip (Clip+ or Clip Zip) firmware to make it scrobbleable
Work of 5 min (?)
Maybe even less if you know how to handle a mouse, the keyboard and a browser … 😉
First step is to exchange the firmware with Rockbox. A very good OSS mp3-player software for several different device kinds which enhances the hardware. You can even play Doom on your player!
- set the device to MSC-mode (MTP or Auto does not work)
- get the firmware for you device: Firmware thread at the Sansa-forums
- get and run the rockbox-installer
- select device and mount-point; pick the firmware-binary; select your options (bootloader and firmware yes; no games, no themes, no fonts …): “finish”, done
The second step is to enable scrobbling:
- got to your players settings (after restarting it and select “Settings > Playback Settings > last.fm log” with “enable”)
Play some tunes and afterwards connect you device to the PC and run QTScrobbler (note: Qt not QT! We are not in a hurry ;))
Qt Linguist: Extract all new strings
Task to achieve is: get all the new strings from the project, but the target user does not want to use Qt Linguist!
0. run lupdate (like always)
1. run
1 |
$ grep -C 2 "<translation type=\"unfinished\"></translation>" Language_EN.ts | grep "<source>" > ~/Desktop/newStrings.txt |
Remove multiple newlines from a file
===========================
Warning 20150507: Just noticed, that the sed-expression also filters identical “not empty” lines from you file! This is not what I wanted. So if you have code with array-initialisations which use the same lines or multiple consecutive calls of the same function, then be careful and check the result of the following command with diff!
Hint 20150508: take a look at this code-snippet. Just copy&paste&compile&run.
===========================
Task to achieve is: remove the superfluous double or triple empty lines between functions. One empty line as separator is acceptable. Two are annoying ..
Workflow is: filter the original source-file and put it into a new file. Remove the old one and replace it.
1 |
$ cat source.cpp | sed '$!N; /^\(.*\)\n\1$/!P; D' > source_tmp.cpp && rm source.cpp && mv source_tmp.cpp source.cpp |
Maybe I should put it into a shellscript which parses the given directory recursively and applies this to all *., *cpp, *.hpp ..
stats for the masses pt. II: gitstats
To appraise the tenth anniversary of Git, I want to introduce another tool for measuring the performance for whole repositories: gitstats.
I ran it over quite huge repos and small ones, precompiled for Linux and self-built for OSX and its capabilities and output are really nice. You can even truncate certain timeframes from the visualised data, etc. Output is HTML.
For a small example I ran it over one upcoming project – since I am the lone contributor, some graphs are really lonely.
External link <- can be down.
Tell OSX to search in the current folder by default
This is one of the most annoying things I encountered while working with OSX: you start filtering the current view and then notice the system is including the whole Mac into the search. Then you click on “<current foldername>” and fixed it. For now, not forever!
Fixable forever by picking “Search the Current Folder” in “Finder > Preferences > Advanced”
useless data pt. II
If you ever wondered how many times you compiled your project {today, the last week, ..} and got no answer: here is a clue.
Add the command “date >> someTextFile.txt” as custom command to QtCreator as build step before make is executed.
This will insert everytime you compile a new line with the current time into a textfile. Processing that data is your own task.
Small hint: if you are lazy and just want some alltime-stats use “wc compileDates.txt” 😉
Edit 20150407:
If you are just interested in the date, use this:
1 2 3 4 5 6 7 8 |
marcelpetrick$ cat compileDates.txt | cut -c 1-10 | uniq -c 14 Thu Mar 26 31 Fri Mar 27 16 Mon Mar 30 20 Tue Mar 31 48 Wed Apr 1 41 Thu Apr 2 16 Tue Apr 7 |
Get an overview which SilverFast8-version was used to process your photos
It is very interesting to see which SilverFast8-version was used for scanning and processing the photos you have digitalized.
The following crude bash-chain-command relies on the GNU-tools, exiftool and some intermedite files. It is not sophisticated or using any syntactic sugar: it just works*.
(* means: has a lot of improvement-potential)
abilities:
- checks for exiftool first: if not available (missed the installation?), then abort
- checks all original SF8-output-types: tif, jpg, jp2 and dng
- searchs stupidly for the “Software”-tag; if other software touched the files that can be missing
- collects the data into files “versions.txt” and “uniqed.txt” which are not deleted after the run!
1 2 3 4 |
type exiftool >/dev/null 2>&1 || { echo >&2 "required exiftool is not installed. Aborting"; exit 1; } && find . -type f \( -name "*.tif" -o -name "*.jpg" -o -name "*.jp2" -o -name "*.dng" \) -exec exiftool "{}" \; | grep "Software : SilverFast" > versions.txt && sort versions.txt | uniq -c | sort -nr > uniqed.txt && cat uniqed.txt |
example output:
1 2 3 4 5 6 7 8 9 10 11 12 |
234 Software : SilverFast 8.0.1 r20 (Feb 6 2013) 92 Software : SilverFast 8.0.1 r30 (Sep 11 2013) 69 Software : SilverFast 8.0.1 r20 (Feb 8 2013) 58 Software : SilverFast 8.0.1 r24 (Apr 23 2013) 24 Software : SilverFast 8.0.1 r19 (Jan 15 2013) 23 Software : SilverFast 8.0.1 r35 (Nov 25 2013) 23 Software : SilverFast 8.0.1 r21 (Feb 13 2013) 20 Software : SilverFast 8.0.1 r42 (Mar 6 2014) 19 Software : SilverFast 8.0.1 r50 (Jul 15 2014) 18 Software : SilverFast 8.2.0 r1 (Oct 9 2014) 17 Software : SilverFast 8.0.1 r54 (Sep 12 2014) 14 Software : SilverFast 8.0.1 r51 (Aug 4 2014) |
ps. Just noticed that SF6-files are also checked correctly.
stats for the masses: gitinspector
I am always quite fond of statistics.
Sometimes there is a feeling that the pace of the project is slowing down, but in fact bigger changes take more time and therefore ‘look’ sluggish. But with some real analysis tool you can verify or invalidate this. Never underestimate the truth rock-hard data provides.
The downside is: is someone tweaks his output, because he is aware of the measurement, the stats can be distorted.
tl;dr
gitinspector is a Python-script which creates some output about the authors, their activity, .. as command-line-message or even HTML.
Easy to use (download, extract, run) and versatile.
I can’t provide any useful example-output, because for most of my repositories I am the sole author.
CHDK or “upgrade your old digital camera with new features”
Canon Hack Development Kit is an alternative firmware for a lot of Canon cameras licensed under the GPL.
I decided to upgrade my fairly outdated 6 MegaPixel “Canon Ixus800” because the new “live view histogram”-feature sounded quite promising. Also: why not testing: loading and running scripts; like for motion detection(!); RAW-output; ..?
Installation was quite simple:
- format the SD-card via the camera’s menu (of course: backup your old pictures/videos 😉
- download; extract and copy the needed files to the root of the card via PC: URL
- restart Ixus800, go to “Play”-mode; press “up” then “upgrade firmware” and confirm
- done … wow … another great project. Kudos to all contributors!
Qt-inheritance: hitting rock bottom
- missing semicolon
- missing Q_Object
- missing “public” for the inherited class
- ctor/dtor private ..