Sample code: https://gist.github.com/wolfspelz/a080601bbd3988782701
Valid tokens are stored statically in Azure-CloudConfigurationManager. This can be changed easily to check a real database of tokens.
_happy_authenticating()
![]() |
| (Symbolbild) |
Labels: Code

Any time a piece of my software receives a JSON message it must dive into the JSON and extract parameters. Sometimes the JSON is deeply nested and parameters are buried inside arrays of objects of arrays.
I want to access these parameters quickly without dissecting the JSON by looping and if-ing through the layers. In other words: I want single line expressions to dive into JSON and extract values.
You can call it XPath for JSON, but a language integrated compiled way, which his much faster, than XPath and supported by IntelliSense (autocomplete).
Example JSON:
[ "first", { "aString": "HelloWorld", "aNumber": 42 } ]Extract the value 42:
var fourtytwo = json.List[1].Dictionary["aNumber"].Int;The JsonTree library basically maps JavaScript Arrays to C# Lists and a JavaScript Objects to C# Dictionaries. It is then very easy to enumerate lists of dictionaries of lists, etc as single line expressions to extract values. Also, if looping is required, it is done on well known container classes List<...> and Dictionary<string,...>.
var data = "[ { aInt: 41, bBool: true, bLong: 42000000000, cString: "43", dFloat: 3.14159265358979323 }, { aInt: 44, bLong: 45000000000, cString: "46" }, { aList: [ { aInt: 47, bString: "48" }, { aInt: 49, bString: "50" } ], bMap: { aInt: 51, bString: "52" } } ]";Extracting the 50 as integer number. The 50 is a string value in a JS object (of key "bString") in a JS array (as second element) in a JS object (with key "aList") in a JS array (as third element).
var fifty = new JsonTree.Node(data).Array[2].Object["aList"].Array[1].Object["bString"].Int;JsonTree uses either JavaScript notation with Array and Object as keywords or C# notation with List and Dictionary as keywords. Choose whatever you like more.
var fifty = new JsonTree.Node(data).List[2].Dictionary["aList"].List[1].Dictionary["bString"].Int;Other examples:
var pi = new JsonTree.Node("{a:3.1415927}").Dictionary.First().Value.Float;You can use JsonTree as nuget package: https://www.nuget.org/packages/JsonTree/
var pi = new JsonTree.Node("{a:3.1415927}").Dictionary["a"].Float;
Labels: Realwelt, Statistisch Spenden
Labels: Realwelt, Statistisch Spenden
If your Developer Studio suddenly tells you, that your project is "out of date". If it keeps telling you, even though you rebuild all. If a simple F5 always pops the annoying "These projects are out of date" dialog box, then ...
... you probably ran into a bug that lets Visual Studio think, that a totally unrelated file on your disk is a dependency of your project(s). This file probably has been added to your disk recently and for unknown reasons Visual Studio regards it as dependency.
In my case its "C:\PROGRAMDATA\NVIDIA CORPORATION\DRS\NVDRSDB0.BIN" from a newly installed Nvidia driver. Other files have also been reported like "C:\PROGRAMDATA\SOPHOS\SOPHOS ANTI-VIRUS\CONFIG\CONFIG.BOPS".
There might be other reasons for this behavior, like missing header files. These can be resolved easily, by adding the missing file or removing it from the solution.
This article is about solving the case of "Visual Studio Project Out Of Date Because of Weird Dependency".
The standard way to solve this is to
1. find out which file claims to be newer than your project.
2. Exclude the offending file.
Step 1:
Enable Visual Studio debugging and check the log. Basically:
in
%ProgramFiles(x86)%\Microsoft Visual Studio\10.0\Common7\IDE\
after
</configSections>
insert
<system.diagnostics>
<switches>
<add name="CPS" value="4" />
</switches>
</system.diagnostics>Then use DgbView to get the log output.Labels: Code
Labels: Alltag, memcache, Realwelt, Statistisch Spenden