Click here to Skip to main content
15,354,822 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: What kind of car does a 50-year-old web developer drive? Pin
dandy7221-Mar-22 11:52
Memberdandy7221-Mar-22 11:52 
GeneralRe: What kind of car does a 50-year-old web developer drive? Pin
OriginalGriff21-Mar-22 12:33
mveOriginalGriff21-Mar-22 12:33 
GeneralRe: What kind of car does a 50-year-old web developer drive? Pin
Andreas Mertens21-Mar-22 15:50
professionalAndreas Mertens21-Mar-22 15:50 
JokeRe: What kind of car does a 50-year-old web developer drive? Pin
Member 332128221-Mar-22 17:27
MemberMember 332128221-Mar-22 17:27 
GeneralRe: What kind of car does a 50-year-old web developer drive? Pin
Slow Eddie22-Mar-22 2:32
professionalSlow Eddie22-Mar-22 2:32 
GeneralRe: What kind of car does a 50-year-old web developer drive? Pin
jkirkerx23-Mar-22 6:24
professionaljkirkerx23-Mar-22 6:24 
General(re) Hey lookee here ... a joke icon! Pin
CalinNegru21-Mar-22 8:28
MemberCalinNegru21-Mar-22 8:28 
RantMicrosoft Rant of the Day Pin
DerekT-P21-Mar-22 7:57
professionalDerekT-P21-Mar-22 7:57 
Not whinged about MS for a while, so here goes...

I'm doing lots of work with mapping and webservices, and had (for simplicity) created a basic DTO object called LatLng, consisting of just a Latitude and Longitude property. Then I discovered that MS had an object GeoCoordinate (in System.Device.Location) that had LatLng and also a method for calculating distance to another LatLng. I already had that formula but thought I'd simplify my code by using the GeoCoordinate object and it's DistanceFrom function. Simple - pull out my LatLng class, replace with GeoCoordinate, all good. Everything worked from the start.

Until... I needed to access the LatLng data from a webservice, using JSON. The webservice ran fine, but JQuery wouldn't parse the JSON. Turns out that the GeoCoordinate object has some properties, defined as Double, that default to NaN - NOT zero! When the webservice serializes the object to JSON, it does it as {"Latitude" : NaN} which the browser can't parse as valid JSON, so the whole thing is unreadable. Those properties include Altitude, Speed, HorizontalAccuracy and VerticalAccuracy.

Now, I use the GeoCoordinate in so many places I don't want to explicitly set all these properties (which I don't even need anyway). So I subclassed GeoCoordinate, wrapping it in my own class and setting those four values to 0 in the constructor. All good, surely? Nope, still not working in the JSON serialisation. Close inspection showed that Altitude and Speed were now zero, but the accuracy properties still coming back as NaN. Checked the documentation, confirmed those properties are settable. Setting the value to 1 is all good, but setting it to 0 "works" (as in no error thrown) but the value remains as NaN.

Now, I sort-of understand why you can't have an accuracy of zero in this context... but WHY Microsoft, don't you either throw an exception or at least DOCUMENT that??? (The property even has a documented "Out of Range" exception, but they don't throw it for zero D'Oh! | :doh: )

So two oddities - failing to parse the JSON because of an unquoted text literal "NaN", and a property with an undocumented un-settable value. Wasted the best part of the afternoon... Sigh | :sigh: OMG | :OMG:

(And on the subject of rants, CodeProject seems to have lost the toolbar when making posts in a forum...)
QuestionRe: Microsoft Rant of the Day Pin
Randor 21-Mar-22 8:36
professional Randor 21-Mar-22 8:36 
AnswerRe: Microsoft Rant of the Day Pin
DerekT-P21-Mar-22 11:50
professionalDerekT-P21-Mar-22 11:50 
GeneralRe: Microsoft Rant of the Day Pin
Randor 21-Mar-22 12:01
professional Randor 21-Mar-22 12:01 
GeneralRe: Microsoft Rant of the Day Pin
obermd21-Mar-22 10:47
Memberobermd21-Mar-22 10:47 
GeneralRe: Microsoft Rant of the Day Pin
DerekT-P21-Mar-22 13:05
professionalDerekT-P21-Mar-22 13:05 
GeneralRe: Microsoft Rant of the Day Pin
obermd22-Mar-22 7:42
Memberobermd22-Mar-22 7:42 
GeneralRe: Microsoft Rant of the Day Pin
obermd21-Mar-22 10:54
Memberobermd21-Mar-22 10:54 
GeneralRe: Microsoft Rant of the Day Pin
Brisingr Aerowing21-Mar-22 14:59
professionalBrisingr Aerowing21-Mar-22 14:59 
GeneralRe: Microsoft Rant of the Day Pin
honey the codewitch22-Mar-22 1:10
mvahoney the codewitch22-Mar-22 1:10 
JokeTwo public officers ... Pin
0x01AA21-Mar-22 7:47
professional0x01AA21-Mar-22 7:47 
GeneralRe: Two public officers ... Pin
RobertSF21-Mar-22 10:04
professionalRobertSF21-Mar-22 10:04 
GeneralRe: Two public officers ... Pin
0x01AA21-Mar-22 10:19
professional0x01AA21-Mar-22 10:19 
GeneralRe: Two public officers ... Pin
RobertSF21-Mar-22 15:33
professionalRobertSF21-Mar-22 15:33 
GeneralHmmm. The new CP look ... I'm not sure I like it. Pin
OriginalGriff21-Mar-22 7:17
mveOriginalGriff21-Mar-22 7:17 
GeneralRe: Hmmm. The new CP look ... I'm not sure I like it. Pin
Slacker00721-Mar-22 7:27
professionalSlacker00721-Mar-22 7:27 
GeneralRe: Hmmm. The new CP look ... I'm not sure I like it. Pin
Marc Clifton21-Mar-22 9:20
mvaMarc Clifton21-Mar-22 9:20 
GeneralRe: Hmmm. The new CP look ... I'm not sure I like it. Pin
Richard MacCutchan21-Mar-22 7:34
mveRichard MacCutchan21-Mar-22 7:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Straw Poll

What language are you using for AI development or learning?
Whether you're at work or home, hard core coding or just trying to figure out this AI thing, which languages have you used in your adventures?
  Results   472 votes