Blur the page behind the overlay using CSS

If you use elements such as overlays (which is the rule in times of GDPR actionism) and want to soften the area behind the overlay, for example, you often come across the problem of the stacking context . For example, if you have elements positioned absolutely or in a fixed position, they are suddenly displayed differently than without an applied filter. But there is a remedy.

.­.­.

Quick Tip: Split Testing with Apache

You don't have to use a powerful tool like Google Optimize for simple URL split tests, you can also solve the Apache via .htaccess. The following code snippet distributes its visitors evenly to both versions for the two pages https://vielhuber.de/test1.php (variant 1) and https://vielhuber.de/test2.php (variant 2). The randomization is based on the current server time.

.­.­.

Via the notation of branched functions

Curly brackets are used in the notation of function definitions with case distinction. We pursue the simple question of whether this representation can also be eliminated and the function can be reduced to a notation that does without it. For example, the function

$$f: \mathbb{R} \to \mathbb{R}, f(x) = \left\{\begin{matrix} 42, & \text{falls } x = 0 \\ x, & \text{sonst} \end{matrix}\right.$$

with the help of the four basic arithmetic operations using a one-line term

.­.­.

Date series in Google Sheets

When visualizing data in Google Sheets, you run into the problem that the \(x\) axis cannot automatically fill in the missing gaps in text values ​​(such as in calendar weeks). To solve the problem, one generates a continuous series of dates, counts the cells that occur and then visualizes the cumulative sums.

.­.­.

Quick Tip: PHP clearstatcache

Find the mistake:

72aaa2dbd201d49fc2ee429ebf68f15b

.­.­.

Google Translation API Hacking

Google offers the Google Translation API with a usage-based cost structure as part of its Google Cloud. There is also an undocumented API that can be used without a key , but which refuses to work after just a few requests. When using the website translation function of Google Chrome, it is noticeable that pages can be translated in very good quality without noticeable limitation.

.­.­.

Quick tip: Git auto-tagging

If you link Github with Composer , it is mandatory to assign a version number via git tag . The following command line command determines the current day and increases it (according to SemVer ) by a version number. For example, version 1.1.0 follows after 1.0.9. If no tag is assigned, the version is automatically tagged with 1.0.0. Tools like flimsy or git hooks shorten this desert of symbols.

8cd852c96ec1e60e8a5ac1f3614b2397

.­.­.

Edit MySQL trigger

Unfortunately, MySQL does not offer the ALTER TRIGGER function. To edit an existing trigger, you must first delete it and then regenerate it. The CREATE TRIGGER statement can be read out indirectly via the information_schema . This allows us to change triggers via a detour. To do this, you make your changes in the result of the following SELECT command (change database and trigger name beforehand) and execute the query.

.­.­.

Trigger change events in VanillaJS

VanillaJS has been on par with the veteran jQuery in almost all areas since ES6 and is now far superior. So it pays off to gradually migrate legacy code away from jQuery. However, you have to be careful when triggering manual change events. For example, document.addEventListener does not trigger on jQuery.change () . The following overview summarizes the special features.

.­.­.

Control cookies with PHP and JS

The setting of cookies by your own or third-party scripts can be finely controlled with the help of PHP and JavaScript. Although this is not a sufficient solution for the implementation of cookie solutions according to the court ruling against Planet49 (here it is crucial that tracking tools such as Google Analytics do not even track and consequently do not set cookies), it can make sense be to generally whitelist / blacklist cookies.

.­.­.

Deactivate devices via script in Windows

In order to save electricity or reduce your own monitoring paranoia, it is advisable to completely disconnect unused devices on your own computer from the electricity. Devices such as sound boxes or webcams can be deactivated / activated in the classic way via the device manager. The whole thing also works via script. The standard way of doing this used to be devcon . Windows 10 now offers a more convenient way of doing this via PowerShell .

.­.­.

Skype Background Blur

Skype has a nice, somewhat hidden function: in the case of video transmissions, the background can be blurred automatically by clicking on the video button and using the " Blur my background " function. With the help of artificial intelligence, this works with any camera even without depth information. The whole thing then looks more professional and fades out private or unimportant things in the background.

.­.­.

SVG export from Illustrator

SVGs play a central role in today's web. They have not only displaced icon fonts, but also offer the possibility of manipulation via CSS or JavaScript. If you want to save a vector graphic for the web from Adobe Illustrator as SVG, you have to make some settings to avoid pitfalls and reduce loading times, which I will present in the following article.

.­.­.

Project Euler: Lattice paths

Project Euler is a series of exciting programming problems, often with a mathematical background. The problems are often posed in such a way that sophisticated algorithms have to be developed in order to achieve the goal in a reasonable run time. Today we solve problem 15: Lattice paths , for which you can find the solution with simple combinatorial means.

.­.­.

Automatic WordPress updates

WordPress has natively implemented background updates since version 3.7 and automatically activated them for minor releases. With the help of filters you can control the behavior more precisely, what exactly is automatically updated. A permanent, fully automatic installation of all minor, major, plug-in, theme and translation updates is not intended, but can easily be done otherwise.

.­.­.

OPcache PHP bootup optimization

For websites that are based on WordPress , Joomla or Laravel , for example, and have no user-specific content, it is advisable to keep all pages in a static HTML cache and only regenerate the cache manually (or automatically) when changes are made in the backend. However, if the page contains dynamic content that depends on sessions and cookies or also on language and location, OPcache is suitable .

.­.­.

Google Sheets: Expanding Formulas

In order to expand formulas to entire columns within Google Sheets, we recommend using the useful ARRAYFORMULA function. Unfortunately, this does not work in combination with some other important functions such as QUERY or INDIRECT , which is why there is complete individual programming of the logic with the help of Google Apps Script or, alternatively, manual copying of the formula down to the last line.

.­.­.

The Simpson Paradox

The Simpson paradox is one of the easily understandable and at the same time astonishing phenomena in statistics. It occurs whenever groups of data show a particular trend, but that trend is reversed when the groups are combined. With the help of a simple example, the paradox can be understood immediately.

.­.­.

Quick tip: Google Tag Manager

The Google Tag Manager has established itself as the de facto standard for the integration of tracking scripts. On the one hand, this clearly separates the responsibilities (online marketing vs. programming) and, on the other hand, you can quickly set up and modify tracking via an additional deployment channel. Here are two little tips for setting up triggers.

.­.­.

Quick tip: FRITZ! Box WLAN hotspot

From FRITZ! OS 07.10 onwards, if the internet fails, the FRITZ! Box can temporarily use the wireless hotspot of a cell phone as a fallback. The function is hidden under Internet> Access data> Internet provider> Existing access via WLAN . The FRITZ! Box then works as a router itself and provides a network with its own address range. When the Internet is available again, you simply reset the setting. I also had to check the options WLAN> Radio network> 2.4 GHz frequency band active and Internet> Access data> IPv6> IPv6 support active .

.­.­.

Flower of Life

The Flower of Life is a familiar, flower-like, geometric pattern that has been found in temples, manuscripts, and for quite some time in popular culture for thousands of years. The pattern also plays a role in esotericism. We will ignore all of this at this point and concentrate on the simple construction of the geometric shape, which is composed of several evenly distributed, overlapping circles.

.­.­.

Email delaying in Outlook

Despite all prophecies of doom around Slack and Discord, the asynchronous communication medium e-mail is the dominant communication medium in the business sector worldwide. In addition to Inbox Zero from Merlin Mann, there are numerous other strategies for dealing with the daily flood of e-mails, including so-called e-mail delaying, i.e. the delayed delivery of e-mails.

.­.­.

A spiral of numbers

For the past few days, I've been studying the following question on StackExchange about a spiral of integers. We are looking for a closed formula for the coordinates of the \(n\) -th element in the following integer spiral, which extends from the origin outwards and further and further into infinity:

..  9 10 11 12
23  8  1  2 13
22  7  0  3 14
21  6  5  4 15
20 19 18 17 16
.­.­.

Read rights in Google Sheets

When working with Google Sheets , fine, user-based rules for editing worksheets, columns and rows can be defined within a spreadsheet. Unfortunately, there is no way to restrict reading rights. However, this would be very helpful in many scenarios. So you only show your customers those tickets that concern them or the employees only the projects they are working on.

.­.­.

Yarn plug'n'play

npm is the default package manager for Node.js. Facebook has long been developing an alternative package management solution called Yarn . Yarn seems to be slowly disappearing from the Github readmes as the standard solution and the stats on the official site show that only a fraction of the packages are carried out by Yarn. Nevertheless, it is worth thinking outside the box.

.­.­.

Convert PDF to LaTeX


The typesetting system \(\TeX\) was developed in 1977 by the legendary Donald E. Knuth . The software package \(\LaTeX\) is still part of the standard repertoire when creating scientific papers. With the following two tools, already generated PDFs and handwritten notes can be converted fully automatically into TeX. The results are very promising.

.­.­.

The simulation argument

Nick Bostrom's simulation argument is impressively simple and clear. It does not try to prove that we are living in a simulation, but instead elegantly formulates three possibilities, one of which must be true. Elon Musk also advocates a similar thesis, which made the idea known to a broad public. The official paper is over 14 years old and just as many pages are short. The central statement is easy to understand and compact.

.­.­.

Critical bug when using WPML + ACF

The powerful WPML plugins for multilingualism and Advanced Custom Fields for your own fields are standard equipment in many installations. It is annoying when malfunctions and data loss occur in combination. The bug reports on the subject are a few years old and unanswered ( here and here and here and here and here ). I've just taken a closer look at the problem.

.­.­.

File upload in the Facebook In App Browser

On some Android phones, both the Facebook and Instagram in-app browsers (as of today) behave incorrectly if an upload field within an advertised or linked landing page had the accept attribute specified. The button was therefore without function. If you open the page in the external, normal browser outside of the Facebook app, everything is fine. This is annoying (especially since it has been reported for a long time ), but can be solved with a workaround.

.­.­.

Chrome Devtools: Move DOM elements

Google Chrome's developer tools are among the most powerful on the browser market. New features pour in every month, which Google presents in compressed form on YouTube . But often it is the little things in life that delight. If you want to delete DOM elements in Google Chrome, you can do this with the delete key. But only today did I notice that DOM elements can also be moved easily using drag & drop:

.­.­.

Quick tip: git status --r

A golden rule in the git universe is: "Do commit early and often". If the night was a little longer, or if you just want an overview of the current situation on your own computer, the command takes you

d8a38f92d0baa14f9d4568826c13ad46

a "git status" for all repositories that are in the current folder or in any subfolder and accumulates the values ​​in a nice overview:

.­.­.

LAMP stack in the Windows Subsystem for Linux

When looking for the optimal development environment, Windows 10 offers complete solutions such as XAMPP , WAMP and MAMP , native installation by hand, and virtualization solutions such as Vagrant ( Scotch Box ) and Docker ( Devilbox , Laradock ). But because of my requirements such as free configurability, real wildcard SSL certificates, access from all end devices in the local network as well as high stability and performance, all solutions failed - except for one.

.­.­.

Tricks for Laravel Eloquent Relationships

One of Laravel's strengths is its elegant syntax. If you have a lot of models and relationships in Laravel (due to a lot of tables in the database), traversing can often end in less elegant code. In the course of time, three small extensions have proven themselves for me, which I will briefly introduce below. We just use some inheritance, magic methods and custom collections.

.­.­.

Prevent public access to .git

Version management Git is now standard in almost every web project and in every environment (including production). Git always creates the subfolder .git and if this is on the level of the public folder of the website, you can publicly access sensitive files (for example, calling /.git/logs/HEAD shows the last commits) . It explains in detail how you can clone a third-party (!) Git repository without a directory listing.

.­.­.

Node.js / npm / Composer without root

In an older blog post I described how to host Node.js for free using Heroku . Now I will show you a way how you can install Node.js , npm and Composer on any other shared host without root rights with a few lines of code. With it you can install packages, deploy Vue.js applications or just start an Express.js server. We always work in the user directory and use nvm - the Node Package Manager.

.­.­.

Bug in associative arrays in PHP <7.2

In PHP <7.2 you can create arrays that can no longer be accessed properly:

91367d1c4636fd753b381406024e303c

You can do some things with it.

.­.­.

Execute commands directly after SSH connection

The following command establishes a connection to a server via SSH, executes some commands (for example, changes to a subdirectory and sends a git status ) and leaves the shell open. The .bashrc file is loaded, which enables colored subshells. The trick is to save a temporary file / tmp / initfile with the desired commands, to start a subshell (in our case bash) with the command --init-file. Within this initfile, the same file is deleted again immediately so as not to leave any traces.

.­.­.

Network drive as administrator

If you integrate a network drive in Windows Explorer, this does not apply system-wide but only for the current user account. This means that you cannot access this network drive in an application that runs with administrator rights. You can change that easily: Create a new DWORD (32 bit) called EnableLinkedConnections with the value 1 in the registry under HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Policies \ System and restart. Integrated network drives are then visible everywhere.

.­.­.

Quick Tip: Include folder as drive

If you want to quickly reach a local folder under Windows that you use over and over again, you can simply assign it your own drive letter. There is only a detour via "Connect network drive", since you cannot specify the path C: \ Users \ David \ Downloads, for example. As a solution, enter the so-called administrative share of the drive, which exists by default for every folder: In the above example this would be \\ localhost \ c $ \ Users \ David \ Downloads .

.­.­.

Catch frogs

A frog jumps around on the number line and you try to catch it. Jumping and catching always alternate. The frog starts at position \(s \in \mathbb{Z}\) and with each move it jumps a distance of \(z \in \mathbb{Z}\) (if \(z>0\) , it jumps to the right, otherwise if to the left). \(z\) is the same for every jump. Snapping consists of specifying an integer position. One knows neither \(z\) nor \(s\) . We show that there is a way of always catching the frog.

.­.­.

Long filenames on Windows 10

It is not only when using npm under Windows that you come across a limit that is now almost 30 years old, which restricts paths to folders and files to a maximum of 255 characters. It's not NTFS's fault, it's LFN . This leads to annoying bugs and incompatibility between operating systems. In times of WSL, this is a regrettable condition, which luckily you can fix yourself in the registry for some time.

.­.­.

Laravel queues on localhost

In the PHP framework Laravel within productive environments, workers and supervisors ensure that the jobs stored in Redis, for example, are processed. If you want to be completely independent of this on localhost, you either use the sync driver to always execute the jobs immediately. This has the disadvantage that the current PHP process is blocked and the request hangs until the job has been processed.

.­.­.

Quick tip: Bundle goals in Google Analytics

With the help of the JavaScript library analytics.js from Google Analytics, any events on websites can be tracked. These events are, for example, an exact measurement of the length of stay, the maximum scroll depth of the visitors or other individual actions such as submitting forms. If you later want to evaluate advertising campaigns or carry out A / B tests, for example, you create so-called target projects.

.­.­.

Pragmatic cache invalidation

Server-side rendering is now part of the standard repertoire of websites and applications. Browsers like Google Chrome also tend to cache as much as possible in order to minimize the loading times of further calls. The cache invalidation of CSS / JS / image files can be solved with the help of mod_pagespeed , Expires / Cache control header, a cache manifest or very pragmatically and directly through individual parameters after the file name.

.­.­.

Bitbucket and SSH keys

The provider Bitbucket does not offer (even in the fee-based Standard and Premium tariffs ) the possibility of storing SSH keys with write permissions at the repository level. Storing your personal SSH key on the production server is not an option, otherwise you can access all other projects that you are currently working on from there. There are so-called access keys , but these only allow reading rights.

.­.­.

Windows Sysinternals via network drive

The tools from Sysinternals by Mark Russinovich should not be missing on any Windows computer. If you always want to have the latest version at hand, you can integrate it as a network drive. The command net use s: \\ live.sysinternals.com \ DavWWWRoot on the command line is sufficient (as a normal user). Nice tools such as PsList, PsKill or Process Explorer are then available on the S drive.

.­.­.

Quick Tip: Google Sheets and Calendar Weeks

When outputting calendar weeks on a certain date, you have to be careful in Google Sheets (just like in Microsoft Excel). The function = CALENDAR WEEK (TODAY ()) calculates using the American standard, for which the first day of the year is always assigned to calendar week 1. This is defined differently in Germany: Here the first calendar week is the week from which at least 4 days fall into the new year. In Google Sheets you can solve the problem (among other exciting alternatives like = SHORTEN ((TODAY () - DATE (YEAR (TODAY () - REST (TODAY () - 2; 7) +3); 1; REST (TODAY ( ) -2; 7) -9)) / 7) and the modified = CALENDAR WEEK (TODAY (); 21) ) easily with the specially designed function = ISOWEEKNUM (TODAY ()) .

.­.­.

Self-signed SSL certificates in Chrome 58

Since Let's Encrypt , encrypted websites are now standard. Even with local development, SSL certificates have become indispensable (for example, navigator.geolocation requires SSL encryption locally). Since version 58 of Chrome, support for CN (Common Name) has been discontinued and SAN (Subject Alternative Name) has been made mandatory. As a result, Chrome suddenly no longer accepts all conventionally created SSL certificates.

.­.­.

Twice the age of two people

Consider two people \(A\) and \(B\) who are not born on the same day and \(A\) younger than \(B\) . Show: There are exactly two age constellations \(a,b \in \mathbb{N}\) , for which applies: \(2\cdot a = b\) . We first set \(d \in \mathbb{R}^+\) as the age difference between \(A\) and \(B\) at the birth of \(A\) with \( d = d_0 + d_1 \) , \( d_0 \in \mathbb{N}_0, d_1 \in \mathbb{R}, d_1 \in [0;1[\) . We now consider an arbitrary point in time \(x \in \mathbb{R}^+\) after the birth of \(A\) with \(x = x_0 + x_1\) , \(x_0 \in \mathbb{N}_0, x_1 \in \mathbb{R}, x_1 \in [0;1[\) .

.­.­.

Git and empty folders

Since Git knows no folders, only files, empty folder structures do not end up in the repository. However, since many frameworks and projects absolutely need this, they should end up there. A common practice is to create so-called placeholder files (often called .gitkeep), which implicitly specify the folder structure. These files can be created easily and, if desired, also ensure that other files in the folders are ignored.

.­.­.

Free Node.js hosting with Heroku

Hosting for Node.js is still not very widespread, especially in German-speaking countries. The American cloud company Heroku offers a solution here - and even free of charge . You always notice the paradigm "Build apps ... not infrastructure" and still have hardly any restrictions. As an example, we are implementing a small cron job based on PhantomJS that scraps a website every day and sends the page title by email.

.­.­.

Cantor's pairing function

In addition to the diagonal arguments , Georg Cantor also developed the Cantor pairing function \(\mathbb{N}^2 \to \mathbb{W}, \quad c(x,y) = \binom{x+y+1}{2}+x = z\) , which encodes any two numbers \(x,y \in \mathbb{N}\) in a new number \(z \in \mathbb{N}\) . For example, \(c(3,4)=\binom{3+4+1}{2}+3 = \binom{8}{2}+3=\frac{8!}{6!\cdot 2!} +3 = 31 = z\) a unique coding of the numbers \(3\) and \(4\) in the number \(31\) . Show: The set of values \(\mathbb{W} = \mathbb{N}\) , ie \(z\) assumes all natural numbers.

.­.­.

The earth and the pea

\(r_1 = 6370km\) at the earth (as a sphere with \(r_1 = 6370km\) ) and a pea (as a sphere with \(r_2 = 2mm\) ) and \(r_2 = 2mm\) a rope over the equator so that it lies tightly on the surface. Now you lengthen both ropes by one meter each. Both ropes should now lie fully extended over the equator again - they no longer lie completely on the surface, but float over the equator. How high above the surface does the rope float above the earth, how high above the pea?

.­.­.

Probabilities on the analog clock

In what% of the time of a day are all three hands of an analog watch in the right half of the dial? First, look at the hour hand, which is on the right-hand side every 12 of 24 hours (50%). From this time, the minute hand will be on the right-hand side (25%) in 6 of 12 hours. Of these 6 hours, the second hand spends 3 hours on the right side (12.5%).

.­.­.

Laravel: Working with Eloquent Relationships

Laravel makes communication with the database a lot easier with Eloquent. When working with Eloquent Relationships you should be aware when calling dynamic variables (with the help of the magic methods of PHP) that the instances of the models do not reflect new changes, but are stored permanently when they are first called.

.­.­.

Bitbucket: Delete folder from Git history

When hosting Git on Bitbucket, there is a hard limit of 2 GB - if this is exceeded, you only have read-only access to the repository. To prevent this, for example, you can retrospectively remove large folders or files from your commits. But also in other cases (if access data has entered the history or node_modules has slipped back to master) you have to retrospectively manipulate the history of Git, contrary to its nature.

.­.­.

Integrate SSL certificate from DomainFactory on IIS

In the age of Let's Encrypt , encrypted websites are now standard. However, wildcard or extended certificates with particularly trustworthy owner validation are also often required. The provider DomainFactory offers inexpensive SSL certificates that can also be used externally. The setup on a current IIS succeeds without CSR with the help of OpenSSL . In the following I will briefly show which steps are required for this.

.­.­.

Paradoxical winning strategy when guessing numbers

Thomas M. Cover asked the following astonishing question in 1987 in "Open Problems in Communication and Computation": Player \(X\) writes two different and randomly chosen natural numbers \(A\) and \(B\) to two different ones Piece of paper and put it face down on a table. Player \(Y\) now randomly selects one of these pieces of paper, sees the number and now has to decide whether this number is smaller or larger than the other number that is still face down on the table.

.­.­.

Soccer & Linear Algebra

When a soccer game starts, the ball lies in the center of the field and is then moved around the field for 45 minutes by shifting and turning. At the beginning of the second half, the ball is again on the center of the field. We show with simple means of linear algebra that either an infinite number of points on the surface are always in exactly the same position as in the original state or exactly 2.

.­.­.

Laravel: Blade Template Debugging

When debugging blade templates in Laravel 5. * you often get meaningless error messages referring to cached views. In the past, everyone was better: The debugging view in version 4 contained more helpful functions and was also visually nicer. With a few lines of code you can get this functionality back with the help of whoops ("PHP errors for cool kids").

.­.­.

Harmonious display of logos with JavaScript

Whether references, partners or customers - there are many cases in which you want to display several logos next to each other harmoniously. The proportions of the logos are mostly inconsistent. Often you follow your gut feeling for the size representation in the design, but there is also an exact calculation method for a visually appealing representation by equating the areas of the logos. In the following example you can do this with just a few lines of JavaScript.

.­.­.

Check variables in PHP / JS for existence

When working with variables in PHP and JavaScript, one often comes across the query whether a variable is empty. It is worthwhile to know the native functions and their differences for checking purposes. Annoyingly, there is no easy way to intuitively check whether a variable is present or not. The matrix below illustrates what is meant by this. However, what you want can be retrofitted using small helper functions.

.­.­.

Massive phone calls with sipgate.io

Sipgate has created an exciting cloud API with sipgate.io , with which one has a multitude of possibilities around Internet telephony. An account is free of charge, and there is also the option of setting any free sender number in the Feature Store free of charge. The documentation from sipgate.io is still expandable, but with a little reading into the official Sipgate API you can quickly realize exciting things.

.­.­.

Recursion in SQL

Relational database management systems based on SQL are only conditionally suitable for hierarchical or recursive queries. Other systems such as ArangoDB are better here (there was a great talk about this at GOTO 2016 ). However, you can also generate recursive queries in SQL with the help of common table expressions and thus query classic parent / child tables for all ancestors and descendants.

.­.­.

WordPress: Deactivate archive pages

According to w3techs.com , around 27.4% of all websites worldwide are currently operated with the help of WordPress. In very many cases, these are not blogs. WordPress automatically generates numerous, often unused URLs and produces so many links indexed by Google that the website operator did not even have on the screen. All of this can be deactivated with a simple command.

.­.­.

Rename PDF form fields in bulk

If, like me, you get into the trouble of renaming thousands of form field names, the JavaScript console included in Acrobat is ideal. In this you can not only execute any JavaScript code, but also access all content within the PDF (including form fields). Since there is no native function for renaming in the JS API, the form fields are copied with all their properties and given a new name.

.­.­.

Shopware: repair variant changes

In Shopware 5, a known problem has still not been resolved: If you create an article with interdependent variants with mutually exclusive configuration options, it can happen that some combinations cannot be selected in the front end and therefore cannot be ordered. With the help of a plugin, the problem can be easily fixed at the moment.

.­.­.

One line for the infinity of prime numbers

There are numerous proofs of the infinity of prime numbers - the well-known Euclid theorem from the Book of Elements is not missing from any basic number theory course. In the American Mathematical Monthly (issue 122) in 2015 Sam Northshield published a no less elegant contradiction proof in the form of a one-liner, which I do not want to withhold from you (with brief comments).

.­.­.

Brighten up the Windows command line

The disdainful Windows command prompt can be visually enhanced in a few simple steps. So you can not only adapt the color and size of the command line, but also expand it functionally (increasing the buffer, installing a large set of UNIX tools). Although the command prompt does not come close to PowerShell 6.0 or the new Windows 10 Bash Shell , it does not need to hide for everyday tasks.

.­.­.

Dynamic URLs in Joomla

In content management systems, URLs are often not always fixed in advance and are therefore not statically created in advance (as a contribution or menu item), but address objects from the database. Similar to WordPress ( as described here ) it is also possible in Joomla to build dynamic URL structures (independent of the internal alias system). Either JRouter can be used here - or you can use a one-liner in .htaccess.

.­.­.

JavaScript PasteJacking

With the help of JavaScript, modern browsers can read and write to the user's clipboard, i.e. they can also manipulate it. The underlying technology is already old hat, but it is only recently that more and more attacks (under the name of "PasteJacking") have been circulating on the network that take advantage of this possibility for the inexperienced user. An implementation in JavaScript is banal.

.­.­.

Swap columns in PostgreSQL

Swapping SQL table columns is part of the standard repertoire with MySQL - this is not (yet) supported with PostgreSQL. Although the official wiki devotes its own article to the problem, it does not show any practical solution that also supports views, indices and triggers. The following class does this job (for both MySQL and PostgreSQL) either on the command line - or alternatively directly in Laravel 5.

.­.­.

Quick Tip for Windows Explorer

If you want to quickly open the command prompt in a folder in Windows Explorer, click (one level higher) with the right mouse button and hold down the Shift key on the folder and then select "Open command prompt here" from the context menu. I just found out another, faster method when you are inside the folder: Here you click into the current folder path, type "cmd" and confirm with Enter.

.­.­.

WordPress Categories: Tree View / Inheritance

If you work with hierarchical categories (taxonomies) in WordPress, you will notice that, on the one hand, the display of the checked categories in the backend is confusing and, on the other hand, posts do not automatically end up in the parent category if they are placed in the child category. Both can be straightened out with just a few lines of code using the powerful hook system (in the form of an action and a filter).

.­.­.

PHP 7 and the Spaceship Operator

In addition to new features such as type hinting for scalar data types or optimized performance , PHP 7 also brings many new, useful language extensions with it. The "Spaceship Operator" has finally made it into the world of PHP (Ruby and Perl programmers have known it for a long time). \($a <=> $b\) returns \(0\) if and only if both operands are equal, \(1\) if the left one is larger and \(-1\) otherwise.

.­.­.

IIS 7.5 PHP FastCGI timeout

If you integrate PHP via FastCGI on the IIS 7.5, each script is aborted after 600 seconds (i.e. 10 minutes) by default. A change of the known variable "max_execution_time" in the php.ini has no influence on this, you (also) have to adjust the FastCGI settings. The IIS offers a convenient interface for managing the relevant variables.

.­.­.

Paradox of stochastics

Conditional probability theory entails beautiful tasks with counterintuitive solutions. In addition to the well-known sibling problem, I will now briefly deal with another example: "I now have two children. One of them is a boy and was born on a Thursday. What is the probability that the other child is also a boy?"

.­.­.

Git, Shopware and empty folders

The Git file version control system is lean, fast, and portable. Git always handles objects, namely files. Folders are only created if there are files in them, otherwise Git will not even record them. This has unpleasant side effects in some projects. For example, the Shopware shop system relies on strict adherence to the folder structure in order to function.

.­.­.

Shopware: Individual shipping costs

Shopware has a powerful shipping cost module that you can specifically intervene in the calculation. In our case, we want to implement the following scenario: The shipping costs per article are initially determined according to the weight of the article (the weight limits are specified). Only for special exceptions should it be possible to set fixed shipping costs for each item.

.­.­.

Bring your own device

You can hardly ignore it if you want to work flexibly and independently: the cloud. There are probably quite a number of people who are already using the cloud without realizing it. With streaming, for example, all of the content is stored in the cloud and can be accessed when required. Netflix is ​​an example here that is becoming increasingly popular in Germany. Or the synchronization of desktop PCs or laptops with all mobile devices is also largely done via the cloud.

.­.­.

Dynamic permalinks in WordPress

The WordPress permalink system can be adapted very well to your own needs with the help of structure tags . The setting% postname% is probably the most common and practicable solution. However, if you want to implement real dynamic links, you first have to expand the system with your own code.

.­.­.

Corrupt hyperlinks in Word and Excel

One would think that when hyperlinks are opened from a Word / Excel document, the standard browser is started with the desired URL. Strangely enough, this is not the case - which leads to unpleasant side effects and makes links for session / cookie-based login-protected pages in the said Office programs impossible.

.­.­.

A paradox for Father's Day

For today's Father's Day, a daughter is giving her father a picture that she has painted herself, which her father had longed for. The daughter says: "I will give you the picture that you have wished for and my present will be a surprise". The father pauses and ponders the truth of this statement.

.­.­.

Integrate dynamic scripts with and without HTTPS

If you include unencrypted scripts in the <head> area and call up a page with an existing SSL certificate encrypted, these scripts are blocked and therefore not executed. If you simply leave out the protocol, all scripts are automatically called up in encrypted form if the website is accessed via https: // - otherwise unencrypted.

.­.­.

Usability in drop-down menus

When working with multi-dimensional dropdown menus, one often runs into the problem that wrong submenus are opened accidentally or the desired submenu is accidentally closed. This effect occurs when the mouse pointer leaves the corresponding menu at the top level while navigating to an already expanded submenu.

.­.­.

Shopware: Deactivate variants automatically

In Shopware , the entire article is deactivated for a real order if all variants have a stock level less than or equal to 0. In order to implement this on a variant basis, I programmed a small plugin, the Bootstrap.php of which I will provide below.

.­.­.

Double password query with SSL

The following constellation always leads to an unpleasant side effect: If you protect your site with htaccess / htpasswd and at the same time force an SSL connection, you always have to enter the same password twice (once for http and again after successful entry for https). With the help of the configuration sections introduced in Apache 2.4, the problem can easily be dealt with.

.­.­.

Multi-line strings in JavaScript

When programming with JavaScript one often stumbles over the inability to realize multi-line strings by also entering them in several lines in the code. While the task in other languages ​​such as PHP or Ruby is not a problem, with JavaScript you can initially only get around with workarounds, the use of which is decided by personal taste or browser support.

.­.­.

Artificial intelligence - does it already exist?

Anyone who takes a look at the technical innovations of the last two years will find words like smart technologies or artificial intelligence (AI) again and again. But on closer inspection, we see that most devices are still far from artificial intelligence. Smart home systems such as those from Amazon or Google are particularly often associated with AI.

.­.­.

The technology behind online casinos

For a number of years they have literally been sprouting up out of the ground: online casinos. Countless providers enable gambling fans to indulge in their favorite leisure activity on the Internet around the clock. Anyone who used to like to go to the casino can now save themselves the trip and simply switch on the computer. But how exactly does this principle actually work?

.­.­.

mail () in PHP with UTF-8 and umlauts

Sending e-mails with PHP is best implemented with powerful classes such as PHPMailer . Convenient wrapper functions make it possible to use UTF-8 content, embed images and send encrypted attachments with just a few lines of code. If you want to save yourself the overhead and, contrary to the recommendation, use the PHP function mail () , you will run into problems when using umlauts and UTF-8 at the latest.

.­.­.

Google PageSpeed ​​Insights vs. Google Analytics

Validation tools such as the W3C Markup Validation Service or Google PageSpeed ​​Insights are helpful for objectively evaluating the code and performance of a website. Google in particular influences an entire industry with concepts such as above the fold - and also provides strict but useful guidelines for image compression and caching. But it can happen that Google steps on its own feet.

.­.­.

Welcome JavaScript 2.0

JavaScript dominates the web and ECMAScript, the core of the language is growing up. The new specification (ES6 or JS2), which is expected in the middle of this year, brings numerous innovations with it that can already be tried out today. Firefox currently has the best support , but polyfills through so-called transpilers such as Google Traceur are also possible. The following is a brief overview of the new features of ES6.

.­.­.

0,99999... = 1?

Whether in school or at university: An interesting question that \( 0,99999... = 1 \) and then includes the question of whether the following equation is true: \( 0,99999... = 1 \) . Although infinity \(0,99999... = A\) in the left part of the equation, we give it a name: \(0,99999... = A\) . After multiplication by the factor \(10\) and simple algebraic transformations, we get a first astonishing insight.

.­.­.

SQL: poor performance despite index

I was just confronted with the following performance problem of an SQL database: In an SQL table called "users" with ~ 1,000,000 entries, the determination of the number of registrations today took an unacceptable 28 seconds. The times of the registrations were saved in the “Ymd H: i: s” format in the “created” column.

.­.­.

Small chess problem

In addition to the well-known knight problem and queen problem, there are many other exciting questions in the world of chess. I touched on two small curiosities in a previous blog entry . If you deal mathematically with chess problems, you will quickly discover that mathematics gives very simple and illuminating answers for many questions.

.­.­.

Files available online with OneDrive

If OneDrive, Dropbox, Google Drive, OwnCloud, Box.net: Regardless of which box you store your files in - the services are almost the same. The clients available for all desktop and mobile systems, the standard unencrypted files and the sharing options differ only marginally. But the OneDrive, which has been integrated into the system since Windows 8.1, has a special feature: only files available online.

.­.­.

PHP: File access with umlauts under Windows

Files on web servers should always be without spaces (not "this is a picture.jpg"), without umlauts or special characters (not "football.jpg"), without backslashes (not "Arbeit \ Auto.jpg") and in lowercase (not "" test.JPG "). Recently, however, I had to access and process a large number of preset files with any file name for a customer project.

.­.­.

SQL query to determine a ranking list

Today I came across the following task while working on a customer project: Take an SQL table "user" with the columns "id" and "score" and determine a ranking list of all users sorted by "score" in which users with the get the same ranking with the same score. This task can be solved intuitively and easily by using user-defined variables .

.­.­.

Facebook SDK: Check tokens on the server side

When working with the Facebook SDK (more precisely when implementing a Facebook login function within a REST interface), the token that the client received from Facebook must first be checked for validity by the server before further operations are carried out .

.­.­.

Chrome DevTools: Addressing DOM elements

Whether Chrome, Firefox, Opera, Safari or even Internet Explorer: While sophisticated developer tools were a unique selling point of Firefox and the popular Firebug plug-in until a few years ago, powerful developer tools are now part of the standard scope of every browser, in which there is a lot to discover gives.

.­.­.

Access to the file system using SQL

I just came across a nice option in MySQL to tap into the file system and obtain valuable information, for example about the existence of files and folders or their contents. This can be very helpful as an alternative to the php function file_exists , as the information about the existence of the file (s) can still be used in the query for further sorting and aggregation functions.

.­.­.

Animated backgrounds with canvas

Animated vector backgrounds can add variety to a web landscape characterized by full-screen photos and videos. It would be nice if this would go hand in hand with loading times and broad hardware and software support. One solution is: canvas. The HTML element controlled by JavaScript is supported by all current browsers and reproduced with high performance on mobile devices.

.­.­.

Fixed aspect ratio for HTML elements

As a web developer, one often gets the embarrassment of working with HTML elements that by themselves - in contrast to the img element, for example - have neither a fixed size nor a fixed aspect ratio. Often you want to achieve that these objects behave responsively, but the proportion between width and height is maintained. CSS does not offer an intuitive solution here by default. But with the help of the vertical padding property you can achieve your goal.

.­.­.

Court ruling on the use of stock photos

After the Regional Court of Cologne rowed back in the RedTube scandal last week and were never allowed to approve the surrender of the controversial IP addresses, it delivers another highly controversial and questionable judgment with the decision 14 O 427/13: The author of Stock- Photos from a certain picture agency must also be named via the direct access of its pictures via their URL.

.­.­.

Goodbye Block & Inline - Welcome HTML5

The innovations of the HTML5 specification are numerous and many of them are already supported by the majority of the browser landscape - below I want to highlight an interesting change to the rules for nesting elements. HTML has always distinguished between block and inline elements. The Document Type Definition of HTML4, for example, names h1, p, and div as block elements and a, span, img as inline elements.

.­.­.

HTTP logging on IIS and Apache

Both Apache on Unix and IIS on Windows systems log HTTP requests out-of-the-box in file form. Requests to your own website should not only be regularly evaluated and analyzed manually and automatically (e.g. by log file analyzers such as AWStats ) to protect against hacking attacks. The paths of the relevant log files in widely used configurations are, for example, as follows:

  • /var/log/apache2/access.log (Example: Ubuntu 12.04, Apache 2.2)
  • C:\inetpub\logs\LogFiles\W3SVC1\u_ex<YYMMDD>.log (Example: Windows Server 2012 R2, IIS 8.5)
.­.­.

Joomla, IIS and the directory rights

When integrating Joomla 3.2 on a Windows Server 2008 R2 with IIS 7.5, problems with directory rights often arise, which are often inadequately solved with settings that are too generous. The following solution is safe and fully functional:

  • The group IIS_IUSRS needs the rights for C: \ inetpub \ wwwroot \: read & execute, display folder contents, read, write
  • The IIS_IUSRS group needs the rights for C: \ Windows \ Temp \: Read & Execute, Show folder contents, Read, Write
  • The user IUSR must be in the IIS_IUSRS group (Computer Management> Local Users and Groups> Groups)

If you need further special directory rights for all files uploaded via PHP (e.g. for SSH or FTP), you can also set these for the folder C: \ Windows \ Temp \. If you upload a file via PHP, PHP first copies this file into the temporary and then into the final path. If the file has landed in the temporary directory, it inherits its rights and retains them after moving to the final directory.

.­.­.

Anonymous online: Impossible?

In times of the NSA scandal, it is not only network-savvy users who are wondering whether and how one can navigate the network anonymously in order to escape the data collection frenzy of the authorities and secret services. However, this often leads to errors and incorrect assumptions. A central misconception is the reduction of anonymity to the obfuscation of the IP address.

.­.­.

McFIT - new logo, new image

The discount fitness chain McFIT has given itself a makeover. While a bright yellow mascot in the form of a banana adorned the blue lettering, a yellow bow on an anthracite-colored background is now skilfully looped into one another and thus forms an abstract structure. The FDP colors blue and yellow give way not only to the logo, but also to all other McFIT brand print items.

.­.­.

Photoshop: travel back in time

When the brothers Thomas and John Knoll started developing Adobe Photoshop in 1987, I was not yet born. Today, in 2013, the software is one of the most popular programs in general and the undisputed market leader in image processing. Thanks to Adobe and the Computer History Museum, the software will now be preserved for posterity in a very special form.

.­.­.

Curiosities in the game of kings

Chess has fascinated people for centuries - its rules are easy to learn and its unbelievable depth is only accessible to experienced players (unfortunately, I am not one of them). In the following, I will deal with two brief questions: Is it possible, through a correct sequence of moves, to get to a position in which the black king is attacked by two white queens at the same time? Is this also possible with two white towers?

.­.­.

Docu-soap instead of blockbuster: 48fps

Movies are usually recorded and played back at 24 full frames per second - but the almost 100 year old standard format “24p” seems to wobble. In order to prevent the unsightly side effects (e.g. the strong jerking when panning the camera at medium speed) of the 24fps projection, people have been working on doubling the frame rate to 48 frames per second and more for some time.

.­.­.

Check spelling on websites

Automated spelling and grammar checking is now standard equipment in word processing programs - but checking the spelling of a website automatically has been relatively cumbersome up to now. Google Chrome is taking a first step in this direction with an integrated check in multi-line input fields (textarea). Now there is a service that makes this possible for entire websites.

.­.­.

Telephone Numbers in Links - a Security Risk?

A few weeks ago I reported on how you can enable your visitors to open the phone app on mobile devices by tapping a phone number. A possibility has now emerged to irrevocably block the SIM card or reset the device to the factory settings without any action on the part of the user.

.­.­.

Interesting email curiosities

Should domain names and email addresses always be lowercase to make sure you get where you want to go? Or is this completely irrelevant? For example, Google's mail servers have curious settings with interesting effects, which I will briefly introduce in the following article.

.­.­.

Design of the stock exchange prices in the daily topics

I closely follow the design of various programs on German television. Hardly any program retains its corporate design permanently. The evening ritual of the meeting in front of the television screen at 10:15 p.m. on the topics of the day has been causing me stomach ache lately: a completely confusing color scheme has been chosen for several months when presenting the current stock exchange prices.

.­.­.

Link phone numbers correctly

If you optimize your own website for mobile devices, you should not only pay attention to different screen sizes, optimized loading times and special features in the operation (such as hover effects), but also address the special capabilities of the devices. This also includes (some people may have forgotten) making phone calls.

.­.­.

Duplicate content on blogs

The same content on different websites is penalized by Google in many cases - nevertheless the Google algorithm is intelligent and recognizes whether the elements in the header and footer remain the same or whether entire test passages can be reached twice under different URLs. The exciting question is how Google deals with blog article overview pages.

.­.­.

Increase WordPress security

The security of the currently most popular content management system WordPress can be significantly increased by turning two small screws. It only takes 5 minutes and two lines of code. Although the problem can be solved with a variety of plugins, I am deliberately limiting myself to plugin-free solutions.

.­.­.