Is my code compiled on Mono (or Microsoft .NET)?

If you want to distinguish between your .NET program compiled on Mono and your program compiled on Microsoft Windows you can use the “__MonoCS_” pre-processor flag!

using System;
using System.IO;

public class AmIMono
{

    public static void Main()
    {
#if __MonoCS__
        Console.WriteLine("Hello Mono! :) ");        
#else
        Console.WriteLine("No Mono! :( ");
#endif
    }

}
 

mcs test.cs
./test.exe

via btk

December 22nd, 2009 by ahzf | No Comments »

Definition of C#

C#.NET: A hybrid of C and Java that attempted to lure defectors from the Java camp to the .NET platform. It also provides an easy transition for C++ refugees who are sick of the annoyances of manual memory management and having 9 incompatible ways to implement a simple string. (via Software++)

October 17th, 2009 by ahzf | No Comments »

Google Wave – A Revolution done wrong!

What might E-Mail look like if it were invented by… Linus Torvalds… the OSS-Community… the XMPP-Guys… or any company without central servers within their buisness plan? To me Google Wave is not much more than an IMAP-Server with integrated CSV-Log and a nice GUI. If you remember Linux Torvalds talk on the GIT at Google Talk (or better its rant against Google sourcecode management) you will be sure, that E-Mail invented by Linux would at least be as decentralized like the GIT or XMPP. Therefore Google Wave might be a very big hype but neither a technological break-through nor a great vision on the future of communicatiuon and collaboration.

October 8th, 2009 by ahzf | No Comments »

C# and implicit conversions

Sometime you decide to create a small datastructure – let’s call it Trinary ;) – which will mostly behave like some standard datastructure – let’s think of Boolean – but with some different behavior from time to time. TO avoid a lot of noisy changes to your codebase it might be better to define an implicit conversation from your new datastructure to the standard datastructure (and vice versa). Fortunately this is very easy within C# as all you have to do is to implement appropriate “public static implicit operator $DestType($SourceType myParam)” methods for the conversion:

public static implicit operator Trinary(Boolean myBoolean)
{
  if (myBoolean) return Trinary.TRUE;
  return Trinary.FALSE;
}

public static implicit operator Boolean(Trinary myTrinary)
{
  if (myTrinary == Trinary.FALSE) return false;
  if (myTrinary == Trinary.DELETED) return false;
  return true;
}
 

The complete class might look like the following:

public sealed class Trinary
{

#region Data

public readonly String Name;
public readonly Byte Value;

#endregion

#region Init default values

public static readonly Trinary FALSE   = new Trinary(0, "FALSE");
public static readonly Trinary TRUE    = new Trinary(1, "TRUE");
public static readonly Trinary DELETED = new Trinary(2, "DELETED");

#endregion

#region (private) Constructor

private Trinary(Byte myValue, String myName)
{
this.Name   = myName;
this.Value  = myValue;
}

#endregion

#region Implicit conversion to/from Boolean

public static implicit operator Trinary(Boolean myBoolean)
{

if (myBoolean)
return Trinary.TRUE;

return Trinary.FALSE;

}

public static implicit operator Boolean(Trinary myTrinary)
{

if (myTrinary == Trinary.FALSE)
return false;

if (myTrinary == Trinary.DELETED)
return false;

//if (myTrinary == Trinary.TRUE)
return true;

}

#endregion

public int CompareTo(Boolean myBoolean)
{

if (Value == 0 && myBoolean == false)
return 0;

if (Value == 2 && myBoolean == false)
return 0;

if (Value == 1 && myBoolean == true)
return 0;

return 1;

}

public int CompareTo(Trinary myTrinary)
{

if (this.Equals(myTrinary))
return 0;

return 1;

}

#region Operator overloading

#region Equals(myObject)

public override Boolean Equals(Object myObject)
{

// Check if myObject is null
if (myObject == null)
return false;

// If parameter cannot be cast to Point return false.
Trinary _Trinary = myObject as Trinary;
if ((Object)_Trinary == null)
return false;

return Equals(_Trinary);

}

#endregion

#region Equals(myRevisionID)

public Boolean Equals(Trinary myTrinary)
{

// If parameter is null return false:
if ((Object)myTrinary == null)
return false;

// Check if the inner fields have the same values
if (Value != myTrinary.Value)
return false;

if (Name != myTrinary.Name)
return false;

return true;

}

#endregion

#region Operator == (myTrinary1, myTrinary2)

public static Boolean operator == (Trinary myTrinary1, Trinary myTrinary2)
{

// If both are null, or both are same instance, return true.
if (System.Object.ReferenceEquals(myTrinary1, myTrinary2))
return true;

// If one is null, but not both, return false.
if (((Object)myTrinary1 == null) || ((Object)myTrinary2 == null))
return false;

return myTrinary1.Equals(myTrinary2);

}

#endregion

#region Operator != (myTrinary1, myTrinary2)

public static Boolean operator !=(Trinary myTrinary1, Trinary myTrinary2)
{
return !(myTrinary1 == myTrinary2);
}

#endregion

#region GetHashCode()

public override int GetHashCode()
{
return Value.GetHashCode() ^ Name.GetHashCode();
}

#endregion

#endregion

#region ToString

public override String ToString()
{
return Name;
}

#endregion

}
 

Additionally it might be usefull to define an extension method to compare the standard Boolean to your new datastructure:

public static class TrinaryExtensionMethods
{

public static int CompareTo(this Boolean myBoolean, Trinary myTrinary)
{

if (myTrinary == Trinary.FALSE    && myBoolean == false)
return 0;

if (myTrinary == Trinary.DELETED  && myBoolean == false)
return 0;

if (myTrinary == Trinary.TRUE     && myBoolean == true)
return 0;

return 1;

}

}
 

October 4th, 2009 by ahzf | 2 Comments »

Mein Cluster hat vier Räder ;)

September 21st, 2009 by ahzf | 2 Comments »

OpenVPN and Windows7

Soon after our sones Windows7 install day I realized, that our OpenVPN based VPN isn’t working properly! Fortunately there is an easy workaround:

First: “Rightclick” onto the installer and set the compatibility mode to “Vista” and run the installer as “Administrator”

Second: “Rightclick” onto the OpenVPN GUI and run it as “Administrator”

Third: If you prefer to have the OpenVPN config files within an truecrypt containter, just move the config files there and add an “Symbolic directory link”

Last: It will work again ;) !

August 17th, 2009 by ahzf | No Comments »

M$ SharePoint and Symlinks…

It seems to me that M$ sharepoint does not support real symlinks… what a fail!

But a it’s just a website there might be a crude hack to work around ;) )):
<html>
<meta http-equiv="refresh" content="0; URL=http://sharepoint.sones/sites/development/Project%20Management/PandoraFS_2009-08.docx">
You will be redirected ;) !
</html>

August 3rd, 2009 by ahzf | 1 Comment »

Die sones GmbH sucht weitere engagierte Softwareentwickler

Die sones GmbH ist ein junges IT-Unternehmen mit Standort in Erfurt. Wir forschen in den Bereichen neuartiger Datenbank- und Speichertechnologien und entwickeln auf dieser Basis neue und innovative Produkte und Lösungen.

Am Standort Erfurt suchen wir ab sofort eine(n)

Software-Entwickler JAVA / .NET (m/w)

Sie wollen in einem jungen Team innovative Software entwickeln die im Datenbank-Segment ganz neue Wege aufzeigt? Als Software-Entwickler bei der sones GmbH haben Sie hierzu die Gelegenheit!

In einem hoch motiviertem Entwicklerteam arbeiten Sie am Kern unseres Datenbanksystems mit. Sie entwickeln Features und verbessern die Qualität der Codebasis im Hinblick auf Stabilität, Performance und Skalierbarkeit. Dabei kommen modernste Entwicklungswerkzeuge zum Einsatz.

Wenn Sie unsere hohen Ansprüche an fachliches Wissen, Eigeninitiative und Kommunikation als Herausforderung sehen – dann sind Sie bei uns herzlich willkommen!

Ihre Aufgaben:

  • Projektplanung und Projektsteuerung in Koordination mit anderen Entwicklungsbereichen
  • Analyse, Design, Implementierung neuer Produktfeatures
  • Verbesserung der Qualität existierenden Codes im Hinblick auf Stabilität, Performance und Skalierbarkeit
  • Softwaretests und Dokumentationen
  • Evaluierung neuer Technologien und Prototyping

Voraussetzungen:

  • Studium im Bereich der Informatik oder vergleichbare Ausbildung mit überzeugenden Referenzen (Projekte, Beschäftigungen)
  • Mehrjährige Erfahrung in der Objektorientierten Softwareentwicklung
  • Von Vorteil:
    • Programmierkenntnisse JAVA und/oder .NET
    • Erfahrungen mit Testdriven Development
    • Gute Englischkenntnisse
    • Erfahrungen mit Datenbankarchitekturen und Netzwerkprogrammierung

Ihre Soft Skills:

  • Kommunikationsstärke und Bereitschaft zum dynamischen Wissens- und Informationsaustausch
  • Zuverlässigkeit und eigenständige kreative Denk- und Arbeitsweise
  • Ziel- bzw. Lösungsorientiertes Vorgehen

Wir bieten:

  • Hoch motiviertes und qualifiziertes Team
  • Ausgesprochen interessante und innovative Arbeitsgebiete
  • Viel Platz für Eigeninitiative und Kreativität
  • Die ständige Möglichkeit sich weiterzubilden und weiterzuentwickeln
  • Herausforderndes Umfeld eines High-Tech Start-Ups

Sie sind interessiert? Dann freuen wir uns über ihre aussagekräftige Bewerbung mit Angabe ihrer Gehaltsvorstellung an jobs@sones.de


Der Vollständigkeit halber das Stellenangebot nochmal als PDF

July 20th, 2009 by ahzf | No Comments »

Detexify2 – Latex symbol classifier

Mal ein wirklich tolles Tool für jeden der noch immer|mal wieder|immer gern mal LaTeX benutzen will|muss:

http://detexify.kirelabs.org/classify.html

Detexify2

July 12th, 2009 by ahzf | No Comments »

Piratenspot “Klarmachen zum Ändern” 2009

Piratenspot “Klarmachen zum Ändern” 2009 from Christopher Grabinski on Vimeo.

July 12th, 2009 by ahzf | No Comments »