Tutorials, tips&tricks, snippets..



Web Application

Create a class from XSD file (and avoid signature error)

It happens to have a XSD file, for example to communicate with an exisisting web service.
I have to create a class (in this case, C# language) starting from a XSD file provived from server side. How to do it?

Continue reading “Create a class from XSD file (and avoid signature error)”


Parsing a JSON string in C# without creating a dedicated class

JSON is a very useful format, able to stringify all your data. It is based on the key:value pattern and it a JSON value can contains a JSON structure itself.

How can we parse a JSON string and use it like an object in C#, without having a destination class? With the following code, we are able to navigate a JSON string without defining a class for it.

Continue reading “Parsing a JSON string in C# without creating a dedicated class”

Distance in metres between two GPS points

I’m using Javascript for a cross platform app (using Devextreme as developing tool, it is based on PhoneGap) and I need to read the GPS position and compare it with another fixed point. Here how to do it.

Continue reading “Distance in metres between two GPS points”

Create a WCF Service for ASMX Client

Sometimes, you need to bind some new tech with old stuff. In this case, we create a WCF service called by an ASMX client (true story, bro).

Continue reading “Create a WCF Service for ASMX Client”

Use jQuery from Google Chrome console

Sometimes is useful exploit the power of jQuery from the browser console. If you are in page/site/web application including jQuery itself, no problem: just open the console and do your stuff. And otherwise?
Continue reading “Use jQuery from Google Chrome console”

Centering an image within HTML5

How to center an image in a web page?

Below there is the css code to centering an image using css, which is an HTML5 valid method.

margin: 0px auto;display:block

If you apply the above css elements to an image, it will look like the below given code:

<img style="margin:0px auto;display:block" src="Image URL Here"/>;

BadImageFormatException using IISExpress

I had written this post about the BadImageFormatException, when I had found again this error. Why? The solution in my linked post is simply and clear, it works! What’s difference? That was my first time I found this error while developing a WCF.. but does it matter? Or the error is somewhere else? After some struggling hours, here is my solution to this problem when working with WCF.

Continue reading “BadImageFormatException using IISExpress”

Sending XML to a WCF RESTful service

Using WCF RESTful, you can find out a problem that will make you loss a lot of time. The syntax of the XML, the structure and.. the order of your fields!!! How to solve it?

Continue reading “Sending XML to a WCF RESTful service”

Triple DES with PCSK7 and ECB between PHP and .NET

The past while at work I’ve been working through some annoyingly overcomplicated encryption issues. The problem is not that Triple DES is all that complicated or annoying, it’s just that when you have 2 different technologies (one doing the encrypting and one doing the decrypting) at work; it can be frustrating to get anything accomplished.

Continue reading “Triple DES with PCSK7 and ECB between PHP and .NET”

Powered by

Up ↑