PHP SimpleXml is Broken: Part 2
In a nuthsell, SimpleXMl has two things broken: 1. Elements that represent “emtpy” tags evaluate to false. This is weird design. 2. Other elements sometimes evaluate to false due to […]
In a nuthsell, SimpleXMl has two things broken: 1. Elements that represent “emtpy” tags evaluate to false. This is weird design. 2. Other elements sometimes evaluate to false due to […]
The following code does not work as expected: $xml = simplexml_load_string(“<root><a/><b>text</b></root>”); $node = $xml->xpath(“/root/a”)[0]; if ($node) process($node); // process($node) may not be called for some valid nodes Unlike most other […]
I have discovered a bug in PHP 5.4.4: a simple XPATH does not work. $xml = simplexml_load_string(“<root><a/><b>text</b></root>”); $node = $xml->xpath(“/root/b”)[0]; // $node is null $node evaluates to FALSE This is […]
Suppose I want to return a list of users in JSON or CSV format depending on a query parameter. MyService.svc/users?format=json returns JSON MyService.svc/users?format=csv returns CSV The question is: how do […]
TL;DR: XML signatures are trouble, because they are ridiculously hard to implement right. XML signatures in PHP are double trouble, because of lack of decent libraries. .NET security libraries are […]
I did a clean install of Windows 10 on a brand new SSD. Good things: It was relatively straightforward and quick. It also rebooted seamlessly without requiring me to remove […]
I run into the same story time and time again. Someone stumbles upon a bug that they cannot explain. All plausible reasons are eliminated, but it still does not work. […]
4:18PM: Went to Google Maps and entered “Tirana” in the search box. This was a random act of curiosity: we recently had a conversation about Albania at work, and I […]
This blog entry is mostly for documentation purposes, so I don’t forget what happened. TL;DR: WCF’s DataContractJsonSerializer cannot deal with JToken or JObject. If you attempt to include those in […]
It sounds unbelievable, but modern HTML applications seem to lack proper support for dock panels. So, I created one for Angular.js. See the code in Plunker My solution is based […]