zero-width space character ​

The zero-width space (ZWSP) is a non-printing character used in computerized typesetting to indicate word boundaries to text processing systems when using scripts that do not use explicit spacing, or after characters (such as the slash) that are not followed by a visible space but after which there may nevertheless be a line break. Normally, it is not a visible separation, but it may expand in passages that are fully justified.

The zero-width space character is very useful for html layout and controlling word wrapping in case of long words, urls, emails, etc. With the ​ character you have full control over word wrapping within your html pages.

To show the effect of the zero-width space, the following words have been separated with zero-width spaces.


To add the zero-width space character to your string you can use the following PHP function. The addZWSP function will split the string into parts of 8 char length.

function addZWSP ($str)
// zero-width space character
$zwsp = "​";
$tiles = str_split ($str, 8);
$del = "";
$ret = "";
foreach ($tiles as $tile)
$ret .= $del . $tile;
$del = $zwsp;
return $ret;

How to get an RSS Feed for any YouTube Channel

If you want to get updates on YouTube Channels into your RSS Feed-Reader, you have to do some easy steps.

1. Open the YouTube channel you want to track in your preferred browser
2. Copy the channel name from the URL into the YouTube Channel Name Converter and click “Get Channel ID”
3. Copy the Channel ID from the page
4. Replace the CHANNEL_ID from with your Channel Id from the YouTube Channel Name Converter.
5. Copy the RSS Feed URL ( to your RSS Feed reader.


If you want to add multiple YouTube channels into your RSS reader, it could be helpful to use the YouTube Subsription Manager to export your YouTube subscriptions into a single xml file. This “OPML File” can be imported to several RSS readers.

OPML (Outline Processor Markup Language) is an XML format for outlines (defined as “a tree, where each node contains a set of named attributes with string values”[1]). Originally developed by UserLand as a native file format for the outliner application in its Radio UserLand product, it has since been adopted for other uses, the most common being to exchange lists of web feeds between web feed aggregators.

Export and import dump file from MySql inside console

If you want to create a dump file of a mysql database you can use the mysqldump command which is part of the mysql installation. This great utility can perform a backups of your mysql database, producing a set of SQL statements that can be executed to reproduce the original database table data.

Open your terminal or command prompt and run the following command to create a mysql backup file from the selected database.

mysqldump -u mysql_user -p DATABASE_NAME > backup.sql

Note: You have to grants all privileges to mysql_user before performing mysqldump.

To import the backup you can perform the following command:

mysql -u mysql_user -p DATABASE < backup.sql

This is just a simple example. You find more information aout mysqldump at

Force drop user in Oracle database

If you want to drop a oracle user with the DROP USER statement to remove a database user and optionally remove the user’s objects you can execute ‘drop user @USERNAME cascade’. But if you have a problem to drop the user and you get the error “ORA-01940: cannot DROP a user that is currently logged in”. The problem is that the user is not connected according to v$session. I suspect that it’s related to my replication, and the user is a propagator. How do I get around this ORA-01940 error?

When you drop a user, Oracle Database also purges all of that user’s schema objects from the recycle bin.

open_count integer;
-- prevent any further connections
EXECUTE IMMEDIATE 'alter user @USERNAME account lock';
--kill all sessions
FOR session IN (SELECT sid, serial#
FROM v$session
WHERE username = '@USERNAME')
-- the most brutal way to kill a session
EXECUTE IMMEDIATE 'alter system kill session ''' || session.sid || ',' || session.serial# || ''' ';
-- killing is done in the background, so we need to wait a bit
INTO open_count
FROM v$session WHERE username = '@USERNAME';
EXIT WHEN open_count = 0;
-- finally, it is safe to issue the drop statement
EXECUTE IMMEDIATE 'drop user @USERNAME cascade';

Java – Show System Properties

You can use Properties to configure your java application. The Java platform itself uses System Properties to maintain its own configuration. With the java.lang.System class you can access the Properties object that describes the configuration of the java environment. In System Properties you can find information about the current user, the current version of the Java runtime, the CPU and the character used to separate components of a file path name. To list all System Properties you can use the following snippet.

Iterator iterator = System.getProperties().keySet().iterator();
while (iterator.hasNext())
String key = (String);
String value = System.getProperties().getProperty(key);
System.out.println (key + " " + value);

On my machine the result looks like this:

java.vm.specification.vendor Oracle Corporation
user.variant Windows 10
sun.jnu.encoding Cp1252
java.library.path C:\Tools\jre\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Users\jentsch\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\local\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\jentsch\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\app\oracle\product\11203\client64\bin;C:\app\oracle\product\11203\client32\bin;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Program Files (x86)\CheckPoint\Endpoint Security\Endpoint Common\bin;C:\Program Files\PuTTY;C:\Android;C:\Windows\System32;C:\Program Files\TortoiseGit\bin;C:\Users\jentsch\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm;C:\Program Files\nodejs;C:\Program Files\TortoiseSVN\bin;C:\Users\jentsch\AppData\Local\Microsoft\WindowsApps;C:\Program Files\apache-maven-3.2.5\bin;C:\Program Files\Java\jdk1.8.0_141\bin;C:\Program Files\Microsoft VS Code\bin;C:\Toolsl\Gource\cmd;C:\Tools\ffmpeg-3.4.1-win64-static\bin;C:\Users\jentsch\AppData\Roaming\npm;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl;. Java Platform API Specification
java.class.version 52.0 HotSpot 64-Bit Tiered Compilers
os.version 10.0
user.home C:\Users\jentsch
user.timezone Europe/Berlin
file.encoding Cp1252
java.specification.version 1.8
java.class.path drivers\derby-;drivers\derbyclient-;drivers\h2-1.4.197.jar;drivers\hsqldb-2.4.0.jar;drivers\jtds-1.3.1.jar;drivers\mariadb-java-client-2.2.4.jar;drivers\mssql-jdbc-6.4.0.jre7.jar;drivers\postgresql-42.2.2.jre6.jar;drivers\sqlite-jdbc-3.20.1.jar jentsch
java.vm.specification.version 1.8 org.test.commandline.Main migrate
java.home C:\Tools\jre 64
user.language en
java.specification.vendor Oracle Corporation
user.language.format de
awt.toolkit mixed mode
java.version 1.8.0_172
java.ext.dirs C:\Tools\jre\lib\ext;C:\Windows\Sun\Java\lib\ext
sun.boot.class.path C:\Tools\jre\lib\resources.jar;C:\Tools\jre\lib\rt.jar;C:\Tools\jre\lib\sunrsasign.jar;C:\Tools\jre\lib\jsse.jar;C:\Tools\jre\lib\jce.jar;C:\Tools\jre\lib\charsets.jar;C:\Tools\jre\lib\jfr.jar;C:\Tools\jre\classes
java.vendor Oracle Corporation
file.separator \
java.vendor.url.bug UnicodeLittle
sun.cpu.endian little
sun.desktop windows
sun.cpu.isalist amd64

This code snippet have been written for JDK 8. Examples and practices described in this page don’t take advantage of improvements introduced in later releases.

Rename git branch locally and remotely

In case you have created a branch with a wrong name and pushed your branch to the remote git repository you can follow these steps to change the name of your branch.

git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push –set-upstream origin new_branch # Push the new branch, set local branch to track the new remote

Please note, if you use the name of the branch somewhere in your build scripts or somewhere else like SonarQube you have to change it there also.

Get rotation from its “natural” orientation on your android device

Up to API Level 7 you can use android.view.Display.getOrientation() to get the rotation of the screen from its default orientation. But this method was deprecated in API level 8.

But now you can use


The returned value is:

  • Surface.ROTATION_0 (no rotation)
  • Surface.ROTATION_90
  • Surface.ROTATION_180
  • Surface.ROTATION_270
  • If your device has a naturally portrait screen, and the user has turned it on its side to go into a landscape orientation, the value returned here may be either Surface.ROTATION_90 or Surface.ROTATION_270 depending on the direction it was turned.

    With this simple line of code you can get the information about the screen orientation related to the default. This could be helpful, if you want to deal with your Sensor.

    Android Activity without UI

    Is it possible to create a Android activity without UI?

    Yes it is. Android provides a theme for this requirement. Add the following line to your AndroidManifest.xml and call finish() at the end of the Activity’s onCreate() method.



    public static final class – Added in API level 3
    int Theme_NoDisplay
    Default theme for activities that don’t actually display a UI; that is, they finish themselves before being resumed.

    Constant Value: 16973909 (0x01030055)

    How to know if the app goes to Background

    With API Level 14 – Android 4.0, there is a Method in Application which is called onTrimMemory. The onTrimMemory is executed by the system with different levels ( TRIM_MEMORY_COMPLETE, TRIM_MEMORY_MODERATE, TRIM_MEMORY_BACKGROUND, TRIM_MEMORY_UI_HIDDEN, TRIM_MEMORY_RUNNING_CRITICAL, TRIM_MEMORY_RUNNING_LOW, or TRIM_MEMORY_RUNNING_MODERATE). The interesting level is “TRIM_MEMORY_UI_HIDDEN”. This level can be used to know that the app is going to background.

    The following example is a demonstration of the Application.onTrimMemory Method:

    public class MyApplication extends Application {
    // ...
    public void onTrimMemory(int level) {
    if (level == TRIM_MEMORY_UI_HIDDEN) {
    // ...

    With this simple piece of code, you can check if your app is being sent to the background!

    How to Format cells in Excel for Android

    Not a snippet, but a needed Information when using Microsoft Android Calc

    How to Format cells in Excel for Android. (Sceenshot made on a german device)

    Some more informations are available in the video at Excel for Android is very similar to Microsoft Excel for Windows. But some differences can confuse sometimes. The short video shows you how to get up and running with Microsoft Calc for Android.