WASD Magazin

WASD Magazin

WASD Magazin – Ausgabe 1 und 2

Das WASD Magazin ist ein Magazin über Spiele. Im Gegensatz zu vielen anderen Publikationen aus diesem Bereich gibt es hier aber keine Preview, Reviews, Wertungen, Tabellen, Statistiken etc. Es geht auch nicht direkt speziell um einzelne Spiele. Es sind ganz allgemein Texte über Spiele. Interessant für jeden der an Spiele – wie auch immer – interessiert ist. Bei den Autoren gibt es viele Leute, die man so schonmal gehört/gesehen/gelesen hat.

Auch optisch macht es einiges mehr her als normale Zeitschriften oder Magazine. Es ist als Buch gebunden und passt damit auch super in das Bücherregal. Auch das Design und Layout sind ansprechend.

Das Magazin erscheint alle 6 Monate und vor kurzem ist die zweite Ausgabe erschienen. Es kann online über die WASD Homepage gekauft werden. Ich persönlich kann es nur allen Spieleinteressierten empfehlen.

BoxCryptor: Cloud verschlüsseln

Ich bin begeisterter Nutzer von Microsofts SkyDrive. Der Vorteil ist, ich hab immer und überall Zugriff auf meine Daten, und diese sind auch immer aktuell. Vorbei die Zeiten wo man immer USB-Festplatten oder Sticks herumtragen musste und schauen, dass auch wirklich alle aktuell sind.

Der Nachteil daran ist leider, dass die Daten bei Microsoft liegen und damit auch Amerikanischen Recht unterliegen. Wobei der Datenschutz und Zugriff der Behörden auf die Daten bei uns auch bald nicht mehr besser ist. Zeit also, die Daten in der Cloud zu verschlüsseln.

Da ich eine komplette Microsoft-Umgebung hab, ist es für mich wichtig dass das eingesetzte Tool unter Windows läuft. Ich hab mich für BoxCryptor entschieden. Es erzeugt eine virtuelle Festplatte und man kann SkyDrive oder DropBox verwenden. Auch interessant ist, dass es eine Version für Windows RT gibt und ich so auch auf meinem Surface Zugriff auf diese Daten haben. Leider gibt es noch keine Version für Windows Phone, aber das ist zu verschmerzen da ich auf meinen Smartphone eher selten an die Daten ran muss.

BoxCryptor ist für den Privatgebrauch kostenlos und auch völlig ausreichend. Wenn man etwas zahlt, bekommt man einige weitere Features wie z. B. zusätzliche (virtuelle) Laufwerke oder die Genehmigung für eine kommerzielle Nutzung.

How to: Verify that Strings Are in Valid Email Format

If you are looking for a good Email Validation script in C#, Microsoft provides a very good sample at the MSDN: http://msdn.microsoft.com/en-us/library/01escwtf.aspx. The script do not only check if there exists an @ and a . (dot), also if the tld is correct and exists.

Windows 8 Media Center: No HD Sound with Intel HD Graphics

A few days ago, I updated my HTPC from Windows 7 to Windows 8. After some days, I realized, that there will not send an HD Sound Signal (DTS HD Master Audio, Dolby True HD) to my AV-Receiver. Only normal DTS was playing.

First I think it was a Problem of the Shark007 Codecs. After removing them and re-installing PowerDVD the Problem was not solved. Then I restore my HTPC from a Backup of my WHS where no other programs and codecs was installed and try it again. But also without an result.

The solution was to install the newest Intel Graphics Driver. The Problem here, it’s not easy to find them on the Intel page. Windows 8 is not listed in the Operation System list, and the Windows 7 drivers are not the newest ones. Finally I found a link to the Intel Downloadcenter where the actual versions are listed:

Intel Graphics Driver – Intel Download Center

Windows Azure: Unlock SSL Settings in WebRole

If you try to change the SSL Access Settings of an Azure WebRole in the web.config, you get an 500 Internal Server with following error text:

This configuration section cannot be used at this path. 
This happens when the section is locked at a parent level. 
Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode=”Deny” or the legacy allowOverride="false".

To unlock the section and enable changes, you need to setup an startup task and execute following command line:

%windir%\system32\inetsrv\appcmd unlock config /section:system.webServer/security/access1

This also works for any other section wich is locked and need to be changed.

DirectX ToolKit – native XNA SpriteBatch

With XNA it was pretty easy to create DirectX applications. The framework has taken a lot of work four you. Unfortunately, XNA is no longer supported for Windows 8 Apps Store, so you have to do a lot work yourself.

With the DirectX Tool Kit you get some native methods back from XNA. One of the most useful things is the SpriteBatch. With this it is possible to create 2D Applictions/Games on a easy way. Also usefull are the SpriteFonts and the TextureLoaders.

Quick Overview SpriteBatch
To use the SpriteBatch and draw sprites, you only need some few line of codes.
First, load the texture (in this case the Default App-logo delived with the template):

(CreateWICTextureFromFile(
    m_d3dDevice.Get(),
    m_d3dContext.Get(),
    L"Assets\\Logo.png",
    0,
    &m_pTextureView));

And then you can draw the sprite with another three lines:

m_pSpriteBatch->Begin();
m_pSpriteBatch->Draw(m_pTextureView.Get(), XMFLOAT2(0, 0));
m_pSpriteBatch->End();

Articles
Good Tutorial for using the SpriteBatch
DirectX ToolKit on Codeplex

Azure and socket.io: TypeError: Object [object] has no method ‘on’

I try to create an Azure WorkerRole with Node.js. This work’s without any problems. If I add socket.io, the Node.js Server don’t start if I run in the Emulator. If I start the node.exe with my application JavaScript file, it works.

First I thought, I don’t copy the socket.io modules so within the Emulator Node.js could not load the socket.io Module. But I copy all, and the error message shown is not the one, if a module is missing.

The error message on the Server console looks like this:

...\node_modules\socket.io\lib\Manager.js:104
Server.on<'error', function(err) {
TypeError: Object 12345 has no method 'on'

The code was the example code from the socket.io startpage with some changes to run in an azure Environment:

var io = require('socket.io').listen(process.env.port);
io.sockets.on('connection', function (socket) {
    socket.emit('news', { hello: 'world' });
    socket.on('my other event', function (data) {
        console.log(data);
    });
});

The answer is realy simple: the listen-method of socket.io force an integer, but the enviroment value returns an string. So I need to parse it first to an int:

var io = require('socket.io').listen(parseInt(process.env.port));

Thanks to smarx for the quick answer

Visual Studio: Set large number of files to copy always to Output Directory

In one of my projects I hat do add a large number of static files. All the files had to copy to the Output Directory. To do this within Visual Studio can be very laborious. Visual Studio do not offer a method to change the “Copty to Output Directory” propertie of an folder and all including items. Due to this, I wrote a simple console application which done the job for me.

static void Main(string[] args)
{
    string projectFile = string.Empty;
    // load project file from arguments
    if (args.Length > 0)
    {
        projectFile = args[0];
    }
    // try to find project file
    else
    {
        // get all files
        var fileList = Directory.GetFiles(Directory.GetCurrentDirectory(), "*.csproj");
        // file found, take first
        if (fileList.Length > 0)
            projectFile = fileList[0];
    }
    // no project file found
    if (String.IsNullOrEmpty(projectFile))
    {
        Console.WriteLine("No Project file found");
        Console.WriteLine("Attributes: [project file]");
        return;
    }
    // backup project file and overwrite existing backup
    File.Copy(projectFile, String.Format("{0}.bak", projectFile), true);
     
    // load xml
    var xml = new XmlDocument();
    xml.Load(projectFile);
    // Add namespaces
    var nsManager = new XmlNamespaceManager(xml.NameTable);
    nsManager.AddNamespace("pf", "http://schemas.microsoft.com/developer/msbuild/2003");
     
    // add the output setting to copy always (for BuildAction "Content" and "None")
    var contentNodes = xml.SelectNodes("//pf:Project/pf:ItemGroup/pf:Content", nsManager);
    UpdateNodes(contentNodes, xml, nsManager);
    var noneNodes = xml.SelectNodes("//pf:Project/pf:ItemGroup/pf:None", nsManager);
    UpdateNodes(noneNodes, xml, nsManager);
    // save updated file
    xml.Save(projectFile);
     
    // remove the namespace attributes
    var content = xml.InnerXml.Replace("<CopyToOutputDirectory xmlns=\"\">", "<CopyToOutputDirectory>");
    xml.LoadXml(content);
    // save file without namespaced
    xml.Save(projectFile);
}
     
/// <summary>
/// Update Nodes
/// </summary>
/// <param name="nodes">List of all nodes to update</param>
/// <param name="xml">XML Document</param>
/// <param name="nsManager">Namespaces</param>
static void UpdateNodes(IEnumerable nodes, XmlDocument xml, XmlNamespaceManager nsManager)
{
    foreach (XmlNode node in nodes)
    {
        var copyToOutputDirectoryNode = node.SelectSingleNode("pf:CopyToOutputDirectory", nsManager);
        // no output directory mode set
        if (copyToOutputDirectoryNode == null)
        {
            var n = xml.CreateNode(XmlNodeType.Element, "CopyToOutputDirectory", null);
            n.InnerText = "Always";
            node.AppendChild(n);
        }
        // update output directory mode
        else
        {
            if (String.Compare(copyToOutputDirectoryNode.InnerText, "Always", StringComparison.OrdinalIgnoreCase) != 0)
                copyToOutputDirectoryNode.InnerText = "Always";
        }
    }
}

Piwik for Microsoft Silverlight Analytics Framework: WP8 Support

Due to the official relese of the Windows Phone 8 SDK, Piwik for Microsoft Silverlight Analytics Framework now supports Windows Phone 8. The latest download can be found on Codeplex.

Documentation: http://piwik4msaf.codeplex.com/documentation

Windows Azure: Using custom fonts

In one of my Windows Azure Project I have to render images via GDI+. For this, I need some custom, not Windows standard fonts. The problem was that I could not install customs Fonts directly on the hosted service. The solution is to use a PrivatFontCollection and load directly the Font-File.

// inits font collection
var fontCollection = new PrivateFontCollection();
// load font
fontCollection.AddFontFile(fontFile);
// return font
var myFontFamily = fontCollection.Families[0];

The font files can be published via the solution or store in the blob storage and donwloaded on startup/periodicly.
Remark: This method not only works for Windows Azure. It works on all systems on which you are not able to install new fonts.