Sunday, 31 August 2014

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).