How to convert C# DateTime.Ticks into Unix timestamp

C# DateTime.Ticks ConverterWith the .NET frameworks DateTime functions you can do a lot of nice things. The handling turns out, in my opinion, very pleasant. The only requirement: You find yourself in a pure .NET environment. When other systems come into play, the trouble begins. But why is it that you can not compare DateTime.Ticks with the PHP mktime()-function?
If you request the “timestamp” from a DateTime-object (DateTime.Ticks), so you get back the number of ticks since 01.01.0001 00:00. A tick in turn is 100 nanoseconds long.
A Unix timestamp, as produced by mktime() for example, is to the contrary, the number of seconds since 01/01/1970. A direct comparison is not possible. So you have to convert between the both units at first. And how to do this, is what I want to show you today, based on a few […]

How to improve WordPress load speed by Lazy Load plugin

Lazy Load Image Today I want to give the WordPress bloggers among you a little tip. It’s about the free WordPress plugin Lazy Load, that serves to reduce the loading time of your WordPress blog. But how does it work?
Lazy Load jQuery makes advantage of the Sonar Expansion and loads images only when they come into the viewport. In plain text, images are only loaded when they are in the visible area of ​​your web browser. The more images you have in an article/or on your main page, the more time you can save accordingly with the Lazy Load plugin.
Instead, the visitor must wait until all images are loaded so that he/she can scroll without lags, jerking or other restrictions on your site, visitors can now get going on much faster. Only when he scrolls into an area in which […]

Simple XML serialization in C#

C# XML SerialisierungToday I want to show you how to perform a XML serialization in C#. Serialization itself, means that you convert an object to another, transportable form.
Using XML serialization, it is possible, for example, to store an object of a class in the form of an XML file and restore it later.
This can make sense if you if you want to transfer an object, for example, via HTTP or  restore an object to its state after closing and reopening an application.
For our example, I created the following class “Blog”:

public class Blog
{
public string User { get; set; }
public string Pass { get; set; }
public string Subdomain { get; set; }
public string BaseUrl { get; set; }
}

The method used to serialize is as follows:

public void […]

How to create articles on Blogspot with C#

Blogger C# API LogoToday I want to show you how to create a blog article on Blogger.com/Blogspot.com with C#. For this you need first of all the Google.GData.Client.dll, which you can find inside the Google .Net API package.
You can download the API package here from Google. (The file is called Google_Data_API_Setup_2.2.0.msi (Please note that the version number – 2.2.0 – over time may change of course.)
If the download is complete, install the package, open a new project in Visual Studio and add a reference to the Google.GData.Client.dll.
The .dll file can be found in the installation directory of the API package. (Click on the link “add a reference” above, if you need help embedding .dlls into a Visual Studio project.)
If you have included the DLL, you can start already. Blog posts (aka articles) can be created as follows:

private static int […]

How to install Ubuntu on Samsung Galaxy S2

Android Ubuntu ScreenshotToday there is again an article on Android. More specifically, it’s about how you can run Android and Ubuntu (Linux) in parallel on your smartphone or tablet. Although I had already blogged about it before, but today I want to explain the whole setup process, step-by-step (using a slightly different method).
The title of this article is actually not quite correct, because we will not install Ubuntu, but setup some kind of a live system – so we get down to business.
I used my Galaxy S2 for the project. If it works with other smartphones, I could not test, but would be happy about comments on your part, if you tried it.
 
For our purposes we need the following things / conditions:

Android based device with root rights
Android Terminal Emulator (freely available on Google Playstore)
android-vnc-viewer (freely available on […]