Sunday 31 August 2014

Xbox One versus Xbox 360 - 853 > 500

The Xbox 360 has a 500Mhz ATI graphics card (custom built) with 10MB embedded DRAM.

The Xbox one pushes the clock speed of the GPU up to 853Mhz built by AMD (the GPU was launched in November 2013, named Durango).

Note that ATI was acquired by AMD in 2006.

GPU clock speed refers to the speed of the cores of the GPU. Faster the GPU cores, the faster the rendering.

The X in Xbox

This refers to the DirectX API. The latest incarnation is DirectX 12 which boasts "console level efficiency". 3DMark ("The Gamer's Benchmark) is a benchmark used to justify the claim.

Building Apps for Windows Store and Windows Phone

All you need is here. A recommended configuration is Windows 8.1 with Microsoft Visual Studio Express 2013.

Programming at the API Boundary in Windows 8: C++ Component Extensions

The WinRT - What CX is All About

C++/CX (Component Extensions) borrows from C++/CLI but targets the Windows Runtime (WinRT) and native code instead of the CLR and managed code.

It is not Managed C++, though it looks a bit like it.  Neither is it perfectly obedient, standard C++. It is C++ with a bit of "Microsoft spice" added to the fray.

Can thou givest an example of "Microsoft Spice" added to the fray?

Among the so-called "component extensions" is support for partial classes, mainly for auto-merging generated code with developer code. Partial classes are not part of the C++ standard (at least, not as part of C++11).

The entry point - notion of the "ref class"

To use "component extensions" you must declare your class as a "ref class" e.g. public ref class SuperClass. To make it partial, you can whack a partial on the front: partial ref class SuperClass.

C++/CX also supports runtime generics (versus compile-time generics in the STL). However, support for compile time generics remains in place.

Microsoft's Typed Superset of Javascript

TypeScript is Microsoft's open source superset of Javascript. It adds ".NET thinking" into the development of Javascript programs, introducing types but then compiles (more accurately "transcompiles") the program into plain Javascript.

The TypeScript Language Specification is available on github and presented as an md file (written in the Markdown language). It is made available under an OWF agreement.

Thursday 28 August 2014

Math in C#

If you want to do math in C#, and specifically linear algebra math, you have a number of options.

Use the in-built multidimensional array construct, create your own linear algebra library or use an existing one.

Math.Net.Numerics (currently on version 3.2.0) is a good option. It has full documentation here. The guys at Microsoft Research (at least some of them) use it too. You may also want to read Christoph Ruegg's (aka cdr) blog where he covers Math.Net releases.

If you thought you could ignore nuget

Think again. Do you know what the PM prompt is?

The History of ClickOnce

ClickOnce is Microsoft's answer to Java WebStart and was introduced in .NET version 2.0, supporting both Win Forms and WPF applications. It was initially supported only in Internet Explorer, and later a Firefox addin was developed.

Thursday 14 August 2014

WLAN Connection Issues

Facing WLAN connection issues? Can't see any wireless networks? WLAN Autoconfig service can be shut down. Then go to Network and Sharing Center. Then start WLAN Autoconfig again. Wait and see results.

Tuesday 12 August 2014

Grammars for C# Hackers; It All Starts with NTPS (Understand it, Don't Memorise It)

This post is part of a series labelled "compsci" which seeks to expound complex computer science topics in an easy way for implementers interested in the theoretical foundations of computing. These will include grammars, essential for understanding compilers, discrete math and other topics.

This post focuses on the Chomskian hierarchy of grammars and how they apply to computer science. Chomsky is a genius who spent most of his career at MIT (which suited his "idiosyncratic interests") and has written over one hundred books. He has contributed considerably to the study of generative grammars.

The most basic is known as Type 0, or phrase structure grammars (PSGs). These grammars can be encapsulated by the quadruple NTPS i.e. the set of terminals and non-terminals, start symbol (which is one of the non terminals) and productions.

There are specific derivation rules to expand nonterminals for PSGs, however these are quite general. When restrictions are put on the production rules, you get type 1, type 2 and type 3 grammars.

Type 1 grammars are also known as context sensitive grammars and they generate context sensitive languages (CSLs).

Type 2 grammars (which generate Type 2 languages) are known as context-sensitive grammars.

Chomsky has mentioned in talks the study of "universal grammar", the study of specifying general properties of languages that can be learned in the normal way by humans. UG can be thought of as a part of cognitive science.

LINQ - An Attempt at Tackling Impedance Mismatch

Origins of the Term Impedance Mismatch

Impedance mismatch is a term borrowed from the process of impedance matching in electronics. Electrical impedance measures the opposition that a circuit presents to a current when a voltage is applied.

Object-Relational Impedance Mismatch

The object-relational impedance mismatch describes the style differences required to code queries to relational database systems from OO languages.

For starters, SQL queries violate the rule of encapsulation.

LINQ tackles this by making relational queries part of the C# language. As a bonus, it also allows you to do similar queries on .NET objects.

LINQ is regarded as a Fundamental Part of C# (One of the default namespaces of System.Dll)

Proof of this is given by the "using System.Linq;" module import message that is inserted by default, by Visual Studio, at the start of your C# program (other default includes include System, System.Text and System.Collections.Generic).