Project Euler – mathematical riddles which require some programming skills

Written by  on January 14, 2021

Took me a while to write about this, but I really love Project Euler. The page is a collection of math challenges, which require some programming (I saw just one which could have been computed by a closed formula without any help). The first ten are quite easy to solve and are more commonly known math problems. Prime numbers and combinatorics play a strong role. But then the difficulty rises quite quickly. Usually it takes me one to two hours to write a Python solution for one. If I would – like I should – write unit-tests for each single method and not for a few selected one, then I guess 50% more.

It’s great: each problem is a closed, separate problem, which requires some algorithmic thinking and – of course – some proper implementation. If you chose the wrong path time or space complexity will kill your ambitions quite quickly. But proper solutions are computed most of the time in less than a minute.
Most of the time I rely on basic python structures and common libraries. But I’ve also given NumPy, itertools, etc. a try. Speeds up the process quite a bit.
My next goal is to fix problem 47, because then I’ve handed in solutions for all of the first fifty problems.
The highest challenge (with also the highest difficulty level (for me) so far) was problem 668. Due to a really big (80 GiByte!) boolean array the computer had a hard time swapping memory. So it took almost 36 hours to finish. By the way: less than 900 people worldwide have solved this issue #tinyflakeofpride

Of course, several geniuses have dedicated pages to optimal solution strategies. Which is a nice idea. But I avoid them. Most of the times stepping back, thinking without a display about the problem and if the chosen approach was a good one, is more helpful. A solution by cheating is nothing which renders any reward.

https://github.com/luckytoilet/projecteuler-solutions

https://euler.stephan-brumme.com/24/

micro:bit v2 arrived :)

Written by  on January 4, 2021

Today (finally) my micro:bit v2 arrived. Had to unwrap it immediately after dinner and play around with the speech synthesis👌🏻 Some lines of microPython and the things got heated.
If you’re not creating anything nowadays, then it’s your own fault 🐒


Read more…

Fablab Freising

Written by  on December 30, 2020

I was always interested in continuing to tinker with 3d printers and the lasercutter. So I’ve checked which local labs are publicly available, because space at home is valuable and we have four smol ones which would like to attack any technical device ;3 Some years ago I did some prints and cuts in the FabLab Kiel, but never put any photos or reports here #sad.
The Fablab Freising looks great, very cool and friendly guys! And the fee to be a club member is also reasonable.
Read more…

digiKam workflow for proper renaming

Written by  on December 28, 2020
  1. Import the directories with the images. Takes usually several minutes for gigabytes of data.
  2. Press F2 for renaming. Use as scheme:
    [date:yyyyMMdd-hhmmss]{unique:3}
    Self-explaining and with a unique three digit suffix in case two identical filenames would appear. → “20200216-141529_001.JPG”

Dell Precision 3351: performance spikes on GPU0 for dwm.exe/csrss.exe (win10)

Written by  on October 15, 2020

Starting point: so, I have a brand-new laptop with a fresh Win10 and the apps lag while I move windows around the desktop. Great!

The first recommendations were already checked: Win is up to date; graphics driver for the integrated Intel GPU and for the Nvidia one as well. No, I won’t roll back the system and no, a “clean start” won’t fix this either.
Of course, I was also suspicious if the virusscanner or the dockingstation-three-monitor-setup is the issue. But come one: that are just 6 mio pixel and the hardware is top notch.

Mitigation:
0. open the “Dell Power Manager” and set the “Temperaturverwaltung” to “Optimiert” (before “Ruhig”)
1. configure via the Nvidia that their GPU shall be the preferred one for apps: “Grundprofil” = “Hochleistungs-GPU”; check as well if any app has preset the integrated GPU (change this!)
2. disable automatic scaling of applications: System > Display. Under the scaling drop-down, select the Advanced scaling settings link. Disable “fix blurry ..”
3. change the display settings to Performance: run “sysdm.cpl” and then “Advanced (Erweitert)” > “Performance (Leistung)” and then put everything to performance (radio button) and just enable “smooth font rendering”
4. change the graphic settings to “High Performance” for all “classic” and “universal” apps:
Problem is, that the dwm.exe and the csrss.exe use GPU0 no matter what you configure.

Note:
The idea to disable the integrated Intel GPU via UEFI/BIOS is not possible, because the Nvidia GPU is not a full replacement card, but relies on the iGPU ..

Outlook: prevent that meeting-requests get auto-deleted after processing

Written by  on October 8, 2020

Options > Mail > “Send messages”-block > uncheck “Delete meeting requests and ..”.

For the German version:

simple webscraper for last.fm with BeautifulSoup

Written by  on September 29, 2020

tl;dr:
Simple webscraper with Python and BeautifulSoup for one user’s favorite tracks (‘loved songs’) at last.fm.
Repository: github

full text:
Looks like last.fm is shutting down its services (one feature at at time, lol). They started this process more or less ten years ago.
I’ve realized that I would miss my curated list of favorite tracks and I am also very bad at remembering, so … let’s automate the process of grabbing that information from their public page. I know, they offer a REST API, but I wanted to use once BS4.
Since I had somehow two free hours fourteen days ago, I went full-speed to some tutorials, played with the get-requests and how to parse. And then spent the last minutes parsing the received “artist+track”-string into something usable. Alltogether four hours were spent and I am amazed by the result. Of course, by leveraging three quite powerful libraries (beautifulsoup4, requests, lxml) and skipping TDD (;) I’ve reached the goal quite fast. And since the script works (my 1500 loved songs are scraped in less than 60 seconds), I will also not spend additional effort to make it “pretty”.

“[Full Day Workshop] Kubeflow + BERT + GPU + TensorFlow + Keras + SageMaker”

Written by  on September 27, 2020

I’ve just spent the last eight hours attending a workshop about #SageMaker, #AutoPilot, #BERT, #Athena, #TensorFlow, #Spark, [..] and I am feeling a bit light-headed.
Of course, the talk and guidance given by @AntjeBarth and @ChrisFregly was really well prepared, but if you’re just a ML-beginner (like me) and if then over 9000 of new technologies drop, you have to work hard to follow the fast paced event.
Of course, I started my ML-journey in the summer of 2019, but it was more focussed on image-processing, not #NLP. I worked before with #Python, #Jupyter notebooks, TensorFlow and #Keras, but that whole SageMaker-thing was new to me.
And I see the potential: instead of running the stuff locally, you prepare, prototype and run your ML-app inside Amazon’s infrastructure. And that AutoPilot, which helps to quickstart the prototyping by trying several preprocessing-steps and models for you on your data, looks promising. Will definitely give it a second look.
Notes can be found at: https://github.com/marcelpetrick/KubeFlow_BERT_GPU_TensorFlow_Keras_SageMaker_Workshop (need lots of polishing, as always)

Crazy times we live in! And I am thankful for this block of time on a weekend 🙏

current workplace IV

Written by  on September 26, 2020

* development with C++ 17; Qt 5.12; CMake 3.16; Gradle as build-configurator and extool-packages for external dependencies
* product built for Win (10) and macOS (10.15); one graphical UI and two SDK (C and C#)
* TeamCity for CI; Gerrit (code-review); JIRA, Confluence, Rainbow & Outlook (communication)
* team-size fluctuates: 5 to 11 developers, PO, PM, ScrumMaster, 3 testers
* external stakeholders inside the company; medium company size; global distribution

* development happens in sprints of 4 weeks; DoR (Definition of ready) and DoD (Definition of done) are enforced for tickets; root-cause-analysis is done for bugs; capacity is evaluted before each sprint
* releases are created roundabout four times per year
* additionally to my role as SW-engineer I did the job of the “release responsible” in the last year (documentation preparation, test-management, release-creation, RC-handling)

GammaRay – another debugger for Qt

Written by  on September 24, 2020

Small OpenSource-tool from KDAB which can be used to alter the runtime-state of Qt-based programs. I’ve just used it (so far) with Qt for C++ and wonder if it would work with PyQt as well (TODO).
Changed parameters, layouts, styles, sizes, values are immediately applied and helpful to fine-tune especially layouts. It is some sophisticate debugger. Of course, with gdb you can alter values as well, but this Qt-aware tool offers for certain types (or layouts) just valid entries and ranges!

Code can be found here: https://github.com/KDAB/GammaRay/wiki/Getting-GammaRay
Some more documentation can be found here: https://www.kdab.com/development-resources/qt-tools/gammaray/
———————————————
Quick-start guide:
First of all: the Qt-version of the GammaRay and of the UUT (unit under test; the program) should match. If not, then runtime-issues up to crash are possible 🙂

As said: almost everything can be influenced, so for a limited task, I’ll show how to alter some style of ‘Cullendula’. Let’s set for it nice blue outlines for each widget!

0. start Cullendula
1. start GammaRay (bin/gammaray.exe for Win)
2. attach GammaRay to Cullendula via selecting it [1] and then switching (if not done automatically) to the proper build-version & -type of Qt [2]

———————————————
3. in the next window search for “stylesheet” (best done via the search-box)

———————————————
4. Now insert for styleSheet: “QWidget { border : 2px solid blue}” (without quotation marks!) and confirm with . The changes are applied immediately.

The same workflow can be applied almost everywhere to manipulate other properties .. good luck.
It’s a quite useful tool for layout-debugging. Also the measurement-tool can help to fine-tune margins .. or discuss color-values with stakeholders ..