Author: Mathias Lipowski

Wakeboarden und Wasserski für jedermann

Wo kann man Wakeboarden?

Cableparks
Wakeboarding und Wasserski lässt sich in an zahlreichen Wasserskianlage (den sogenannten Cableparks) fahren. Allein in Deutschland gibt es über 80 Anlagen für dieses Vergnügen.

Boote
Neben Cableparks ist es auch möglich, sich hinter einem Boot über das Wasser ziehen zu lassen. An vielen Seen gibt es hierfür Anbieter, die diesen Spaß stundenweise anbieten und man weder einen Sportbootführerschein, noch ein Boot besitzen muss. Für Anfänger ist der Cablepark jedoch vorzuziehen.

Ab welchem Alter kann man Wakeboarden?

Ein festes Alter zum Wakeboarden festzulegen ist schwierig. Hier kommt es immer darauf an: was traut man seinem Kind zu bzw. was traut sich das Kind selbst zu. Wichtig ist auf jeden Fall, dass das Kind selbstständig schwimmen kann und damit im Cablepark eigenständig an Land kommt. Ein Schnupperkurs sollte hier Klarheit verschaffen. Dabei wird meist mit Wasserski begonnen, um ein Gefühl für den Zug und den Verlauf der Bahn zu bekommen. Mit ausreichender Sicherheit kann dann auf ein Wakeboard gewechselt werden. Was auch immer hilft: Vorkenntnisse im Skifahren oder Snowboarden (allerdings ist das kein Muss). Und wie bei jeder Sportart gilt: je früher, desto besser. Und am wichtigsten: es muss Spaß machen!

Welche Ausrüstung ist erforderlich?

Für den Anfang ist keine eigene Ausrüstung erforderlich. An den Cableparks kann man fast immer das notwendige Equipment ausleihen. Angefangen beim Neoprener (besonders empfehlenswert an kühlen Tagen), über Schwimmweste, bis hin zum wichtigsten: Wasserski oder Wakeboard ist hier alles verfügbar.

Pro-Tipp: wer handwerklich begabt ist, der kann sich seine Ausrüstung natürlich auch selbst bauen 😉

Photo by KaLisa Veer on Unsplash

Flutter: generating *.g.dart files for json serialization

The full documentation for this is available on flutter.dev

When creating json_serializable classes the first time, you’ll get errors similar to what is shown in the image below.

IDE warning when the generated code for a model class does not exist yet.

These errors are entirely normal and are simply because the generated code for the model class does not exist yet. To resolve this, run the code generator that generates the serialization boilerplate.

There are two ways of running the code generator.

One-time code generation

By running 

flutter pub run build_runner build

in the project root, you generate JSON serialization code for your models whenever they are needed. This triggers a one-time build that goes through the source files, picks the relevant ones, and generates the necessary serialization code for them.

While this is convenient, it would be nice if you did not have to run the build manually every time you make changes in your model classes.

Generating code continuously

watcher makes our source code generation process more convenient. It watches changes in our project files and automatically builds the necessary files when needed. Start the watcher by running

flutter pub run build_runner watch

in the project root.

It is safe to start the watcher once and leave it running in the background.

Source: https://flutter.dev/docs/development/data-and-backend/json#code-generation

Sourcetree keeps asking for password

When Sourcetree keeps asking for password when committing or pushing data to a server, the following solution worked for me:

Go to terminal in your project folder and enter:

git config credential.helper store
git pull

Input your username and password and press enter. That’s it.

Source (somewhere in between the lines):
https://community.atlassian.com/t5/Sourcetree-questions/Sourcetree-keeps-asking-for-login-and-password/qaq-p/146765#M18512

PNG – deactivate interlace to avoid ‘libpng warning: Interlace handling should be turned on when using png_read_image’

I stumbled appon a warning message that was thrown by PHP when handling images with GD lib (e.g. imagecreatefrompng()). The message shown was:

libpng warning: Interlace handling should be turned on when using png_read_image

This message even exists, when deactivating ‘interlace’ with the help of:

imageinterlace($img, false);

The only solution is to deactivate for the processed image(s). This is possible with ImageMagick. To deactivate interlace on all images of a folder, the following command can be used:

magick mogrify -interlace none *.png

I used ImageMagick on macos and installed it with with HomeBrew:

brew install imagemagick

Composer – PHP Fatal error: Allowed memory size of ## bytes exhausted

Composer may sometimes fail on some commands with this message:

PHP Fatal error: Allowed memory size of ## bytes exhausted <...

In this case, the PHP memory_limit should be increased.

Note: Composer internally increases the memory_limit to 1.5G.

To get the current memory_limit value, run:

php -r "echo ini_get('memory_limit').PHP_EOL;"

Try increasing the limit in your php.ini file (ex. /etc/php5/cli/php.ini for Debian-like systems):

; Use -1 for unlimited or define an explicit value like 2G
memory_limit = -1

Composer also respects a memory limit defined by the COMPOSER_MEMORY_LIMIT environment variable:

COMPOSER_MEMORY_LIMIT=-1 composer.phar <...>

Or, you can increase the limit with a command-line argument:

php -d memory_limit=-1 composer.phar <...>

This issue can also happen on cPanel instances, when the shell fork bomb protection is activated. For more information, see the documentation of the fork bomb feature on the cPanel site.

Source: https://getcomposer.org/doc/articles/troubleshooting.md

Xcode fails to generate source files from intent definition files when using the Legacy Build System

The workaround for this problem is the following: First, add a Run Script phase before the Compile Sources phase of your target:

xcrun intentbuilderc generate -input ${SRCROOT}/PATH/TO/Intents.intentdefinition -output ${SRCROOT}/Intents -classPrefix "" -language Swift -swiftVersion 5.0

Then, add all of the generated files from the output path specified in the command above to all required targets in your project.

Source: https://developer.apple.com/documentation/xcode_release_notes/xcode_11_4_release_notes

Change default reading font in Outlook from Times New Roman to Calibri (or any other)

I use Outlook 2016 and some emails are shown in Times New Roman, even if the default font was set to Calibri. This is the case, when HTML mails do not have any CSS style. In this case, Outlook uses the default fall back font Times New Roman. It took me some time to realise that there is no setting for this in Outlook.

But: the related setting can be found in Word 2016 (yes, Word!).

To change the setting, open Word and go to:

File > Options > Advanced > General section > Web Options… > Fonts tab > Proportional font …

There you can change the setting with Times New Roman font to any other font. After the change you have to restart Outlook. Each unformated HTML mail should now be displayed in the selected font.

Photo by Federica Galli on Unsplash.

Background tasks in iOS

As already discussed in Background task in iOS action extension, it sometimes becomes necessary to perform time consuming tasks in the background. This is really important, if such a task would block the user interaction. Especially for action and share extensions, this might lead to some waiting time before a task completes and the extension disappears. After several attempts to realise a working solution, the following code help to extends an App’s background execution time.

This code was described in the article Extending Your App’s Background Execution Time.

Extending the background execution time in an app

func performTask()
{
   // Perform the task on a background queue.
   DispatchQueue.global().async {
      // Request the task assertion and save the ID.
      self.backgroundTaskID = UIApplication.shared.
                 beginBackgroundTask (withName: "Perform Long Task") {
         // End the task if time expires.
         UIApplication.shared.endBackgroundTask(self.backgroundTaskID!)
         self.backgroundTaskID = UIBackgroundTaskInvalid
      }
            
      // Run task synchronously.
      self.performLongTask()
            
      // End the task assertion.
      UIApplication.shared.endBackgroundTask(self.backgroundTaskID!)
      self.backgroundTaskID = UIBackgroundTaskInvalid
   }
}

Extending the background execution time in an extension

func performTask()
{
   // Perform the task in background.
   let processinfo = ProcessInfo()
   processinfo.performExpiringActivity(withReason: "Long task") { (expired) in
      if (!expired) {
         // Run task synchronously.
         self.performLongTask()
      }
      else {
         // Cancel task.
         self.cancelLongTask()
      }
   }
}

As mentioned in the documentation, the ProcessInfo code block is called a second time if the system need to suspend the process:

If your block is still executing and the system need to suspend the process, the system executes your block a second time with the expired parameter set to true. Your block must be prepared to handle this case. When the expired parameter is true, stop any in-progress tasks as quickly as possible.

Source: https://developer.apple.com/documentation/foundation/processinfo/1617030-performexpiringactivity

Important: it’s important that the tasks are executed synchronously. When the end of the block is reached, the thread will terminate and end the execution of your task. If your tasks are asynchron, you can use a loop like shown below to wait inside the background thread until the asynchron task is finished:

// Keep background thread alive until asynchron task ends.
repeat {
    sleep(1)
} while(taskIsRunning)

General thoughts on using background tasks in iOS

A good summary of background tasks is available at https://forums.developer.apple.com/thread/85066


Photo by Jonathan Borba on Unsplash.