July 12, 2023

Adventures in Po Files

I’m an Italian translator for the newsboat program. Basically what I need to do is find changed and new strings to translate. Changed strings are marked with the fuzzy attribute when the .po file is updated. It’s pretty easy just to search for the word fuzzy in vim. Searching for added strings is a bit more annoying, a message can be split on multiple lines so just grepping for "" in the message string returns a of stuff which does not need to be translated. Read more

May 31, 2023

SQL Creating SQL

I needed to update a relational database table’s values from another database table referencing each other and came out with an interesting way to solve this. The ideas is to generate other SQL as text as output, in my case a series of update statements. I guess an example could help to explain the whole thing better. We have 2 tables: CREATE TABLE FIRST (ID INT, COL1 VARCHAR); And Read more

April 5, 2023

Pipe Into Vim

You can pipe stuff stuff into vim. I didn’t know about this, but take a look at the second usage example in the output of vim -h: ~ $ vim -h VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Jan 29 2023 18:57:15) Usage: vim [arguments] [file ..] edit specified file(s) or: vim [arguments] - read text from stdin or: vim [arguments] -t tag edit file where tag is defined or: vim [arguments] -q [errorfile] edit file with first error Just pass - to open up a new buffer with the output of something. Read more

March 1, 2023

Summing Stuff

I needed to sum up some shopping expenses. It looked like a problem that should have already been solved, so using a search engine I stumbled upon this Stack-Overflow question’s answers. I’ve found it really smart and simple, so I thought to write something in here. The answers are pretty good explaining in details how the thing works, and of course you can always use man to know more about a program you don’t know, especially with standard commands like cut or paste. Read more

February 6, 2023

mpv

The mpv program is a great media player. Really, you should definetly try it. I use it most of the times to play audio, but it supports videos as well. You just use it like this: mpv file.mp3 That’s it. It’s scriptable and supports a large number of formats. Cool features I didn’t know There are some killer features I wasn’t aware I found in the man page. Resuming playback Sometimes it’s nice to resume playing from where you left off, expecially whith long tracks or movies. Read more

© Mauro Scomparin 2020 - 2023

Powered by Hugo & Kiss.