Caclulating QR-Code URLs for the Actimel/Pokémon lottery

Einfaches Python-Skript zur Berechnung der QR-Codes für das Acitmel Pokemon Gewinnspiel: from hashlib import sha256 names = ['dragonite', 'fidough', 'fuecoco', 'gyarados', 'munchlax', 'bellibolt', 'greavard', 'charmeleon', 'charmander', 'bulbasaur', 'charizard', 'blastoise', 'ivysaur', 'pawmi', 'pichu', 'pikachu', 'quaxly', 'smoliv', 'raichu', 'sprigatito', 'squirtle', 'venusaur', 'wartortle'] for name in names: hsh = sha256(name.encode('utf-8')).hexdigest() print(f'{name: <{10}} | https://pokemon.actimel.de/welcome?scan={hsh}') This results in the following: Pokémon URL dragonite https://pokemon.actimel.de/welcome?scan=042ce75d492cb394999ff4fc039d13fa22678485056ab32812fdbd1b88480089 fidough https://pokemon.actimel.de/welcome?scan=2f67aac66c98287d52a3d4efc51b83c242c161889c7f42674eeda150ebdc771d fuecoco https://pokemon.actimel.de/welcome?scan=5a4647c1f3fa84997a6ddea1f4ad39461e218b0d8fc803df8fafe53600b46b9f gyarados https://pokemon.actimel.de/welcome?scan=7cb2e6f544eb21f608aa5d8e60de3fb58636c34a03d1ed1226dfb0abad88598e munchlax https://pokemon.actimel.de/welcome?scan=310a6e1a21da2d2d320237ccc713c93df80955f7933dd8a6a184ed23237ddfea bellibolt https://pokemon.actimel.de/welcome?scan=de776cea1f7b724768844115f77ff826ee20a0f8f0b7792130c4b35dbe297a08 greavard https://pokemon.actimel.de/welcome?scan=e240ed5c2cdbbefc3c48ea9a184665137cf8a553a5024fef78205338f4617a90 charmeleon https://pokemon.actimel.de/welcome?scan=dcc51a1369ed1884e6f26512b8811092181e07b3e386cebfed452fa51c70244e charmander https://pokemon.actimel.de/welcome?scan=8cbfa8573683626c1609d1373f23b63bbfa5692fccad285e0306a500fa4b28f9 bulbasaur https://pokemon.actimel.de/welcome?scan=b5b5652a5dd3d781e2f6f412223e843cacbf2872091f485ed5fd61aa967a3719 charizard https://pokemon.actimel.de/welcome?scan=73e512eccd9639bf632f1675f6a34a116f0abe5404dcebe98bf023be0e329d10 blastoise https://pokemon.actimel.de/welcome?scan=9041324a9605633b12b6b65b4357af286cfad675ed5f5b1f1a564b27df821511 ivysaur https://pokemon.actimel.de/welcome?scan=1f29ed0b79a8582771992cb656ea38e9c6fb16215d85f99b72af43a0722e163b pawmi https://pokemon.actimel.de/welcome?scan=fa48a2842a0b0f8f5372bf347533edca563ba867851374bd3d0d632df066e3e1 pichu https://pokemon.actimel.de/welcome?scan=fc23f358d8c9f72c56e093af3877723bb7d0b1f9d786d815acddd37a35a1012b pikachu https://pokemon.actimel.de/welcome?scan=43999461d22f67840fcd9b8824293eaa4f18146e57b2c651bcd925e3b3e4e429 quaxly https://pokemon.actimel.de/welcome?scan=6339e380b97b2ee89170ff4dcc51e19d2b5881a58ac7475cf7bf5f5369dd6ecb smoliv https://pokemon.actimel.de/welcome?scan=d2b8de5e99f0dc7d8a207861a0dcded1de5a8a1ccd45c94828fb11565b2f1305 raichu https://pokemon.actimel.de/welcome?scan=a9462f7c66b5833710cbb41d4ef19e4bd704b05c69b94f1bafb2e9b15bae1217 sprigatito https://pokemon.actimel.de/welcome?scan=5a68b137ceecaa8397262b9701c5ba0ed0b9d63927e4e14c17f56cd871134f0c squirtle https://pokemon.actimel.de/welcome?scan=43c9d997f68ee54a55f7a22062c895312250751d3505ef2da40d2a7cf32b39fe venusaur https://pokemon.actimel.de/welcome?scan=74ac4c00f18fe573707f30310dc80ab513408e593b64b00c0cdfdfc3c174b370 wartortle https://pokemon.actimel.de/welcome?scan=eb2af329c8d993e4f8ada53717e945cf652428690b0ba68ef6030ca857a28eec Have fun 😉. ...

June 14, 2024 · 1 min · Daniel Hufschläger

Suche nach den ersten hundert Primzahlen in C++

Suchen der Primzahlen kleiner 100 in C++. // basic io #include <iostream> using namespace std; int main ( int argc, const char* argv[] ) { int iCount = 0; int iDivisor = 1; // loop over all natural numbers for ( iCount = 1; iCount <= 100; ++iCount ){ // state if current number is a prime number int iPrime = 1; // loop over each divisor candidate for ( iDivisor = 2; iDivisor < iCount; ++iDivisor ) { // if divisor matches the current number -> change state if ( iCount % iDivisor == 0 ){ iPrime = 0; } } // if prime print to stdout if (iPrime == 1 ) { std::cout << iCount << std::endl; } } return 0; }

October 9, 2020 · 1 min · Daniel Hufschläger

CFD simulations using Scientific Python

Introduction For some simulation topics of my Ph.D., I had to learn/recapitulate some basics about simulations techniques and fluid simulations. The original procedure and code could be found at Archer (UK National Supercomputing Service). This is a simple example for applying the finite difference approach to determine the flow pattern (CFD1) in a cavity. For simplicity, we’re assuming a perfect liquid without viscosity, which also implies that there’re no vortices. The \(z\)-dimension of this setup was defined to be endless. We are interested in the directional velocity of the fluid. ...

December 18, 2016 · 4 min · Daniel Hufschläger

Octave Stapel- oder Batchverarbeitung von Dateien

Batchverarbeitung Programme wie MATLAB oder Octave sind schon recht hilfreiche Programme, wenn es darum geht Daten mathematisch auszuwerten oder zu visualisieren. Dabei ist es oftmals extrem nervig, wenn mehrere Dateien des gleichen Typs verarbeitet werden – also mittels Stapel- oder Batchverarbeitung – sollen um bspw. Trainingsdaten für einen Klassifikator zu verarbeiten etc.. Für MATLAB ist mir dazu mal eine 32-Bit-DLL untergekommen, aber leider funktioniert diese nicht unter Octave. Oct-Files - Funktionsumfang Daher habe ich mir ein oct-File geschrieben, welches genau diese Aufgabe übernimmt. Oct-Files sind dabei das Pendant zu den mex-Files von Matlab und stellen eine C++-API bereit um den Funktionsumfang von Octave zu erhöhen. ...

May 20, 2014 · 2 min · Daniel Hufschläger