« first day (951 days earlier)      last day (3198 days later) » 
00:00 - 18:0018:00 - 22:00

12:15 AM
@BradleyDotNET still around?
 
@BradleyDotNET I wanna use some location features and came across this
however, the section which normally mentions for example .net 4.5 or so, is saying BING instead
 
I'm guessing its in an SDK
 
I simply don't know how to use this help as non of the commands are recognized
Oh...
 
12:17 AM
I was thinking it might be some sort of Nuget packet or something
 
When the title changes like that, its a good indication you need an extra DLL or SDK
for example, the IIS DLL has to be copied from System32
I'll be searching for something similar for windows store soon :)
hopefully there something like that
 
I came across this couple of times in the past and couldn't understand. Say it was saying Web and other stuff... and now Bing... so that's the story
 
I also found this recommendation
 
Depends on if you want to stay in the MS ecosystem I guess
I would imagine the bing support will be better
 
12:20 AM
does this mean, in the same way I have to have Google services or something installed, or only the related dll which comes with Nuget package will suffice
I would prefer to stay with Microsoft but the problem is my app is a tiny little one and I don't want to make it more complicated by asking the user to install another package
Wish it came with a DLL that I could include in the installation folder
However, I am not sure that Google approach is like that though either
@BradleyDotNET Yeah. I would be surprised if Windows Store didn't have that feature... Portable devices feed on these features
 
Either way its just an extra DLL
you don't distribute the SDK
there could be some redistributable package you have to install, but I doubt it
 
Oh... So I wouldn't need to ask the user to download and install it?
 
I very much doubt that you would
 
emmm... interesting...
let's give it a shot... it sounds interesting
it really isn't required in my application but I wanna put it there and make it more capable than asking the user about lat and long
I'll offer Fools gold if I can, rather than dry toast :P
 
12:27 AM
thanks Brad
 
no problem
you always give me the easy ones :P
 
@BradleyDotNET Well, in Persian we say, riddle becomes easy after it got solved. :)
 
Well, yours was as simple as:
1. Click one of the methods on the linked documentation to see what assembly it was in
2. When that name wasn't familiar, see if there is a related SDK on google
3. Pause for dramatic effect
4. Post link :)
^^ good technique in general for finding what reference you need, FWIW
very useful when tracking down extension methods
 
@BradleyDotNET I tried to use the assembly, but VS didn't recognize it. and it didn't look normal so I thought something must be going on. But that Google recommendation made me think I should be looking for it in Nuget however, it didn't look like that from the Article... I should've spent a bit more time before bugging you :)
@BradleyDotNET I will definitely follow these steps from now on
 
No problem at all
just trying to help your google-fu in the future :)
Searching the assembly name first was a good choice
 
12:35 AM
I really appreciate it. when you came up with the answer, I had in mind to ask you which part of the article you read to get to that conclusion
 
because a lot of them are on nuget
 
Now it becomes more like how Japanese mentions it as "you are teaching me to fish, instead"
 
that's the idea!
 
 
13 hours later…
1:09 PM
Why doesn't my string format?
<telerik:RadMenuGroupItem.Header>
<Binding Path="NavigatorLocation" StringFormat="Create in: {0}"/>
</telerik:RadMenuGroupItem.Header>
It just shows the value within {0}
 
1:53 PM
@Asheh remove the quotation marks
 
2:22 PM
no
hes using it as element not as inline text
(though.. why use it as that <Binding> element rather than normal syntax?)
 
ahh didn't even realize that lol. I concur with your question
 
 
2 hours later…
4:53 PM
Hey all, I'm trying to adapt some Java code to my C# project, and I ran across this Thread.UncaughtExceptionHandler subclass... is there any equivalent to this in C#? My web searching has not borne fruit.
I see examples for the exceptions themselves, like TempIsZeroException: ApplicationException, but not for a handler per se
 
@KyleHumfeld are you expecting an event equivilant?
are you using TPL? (Tasks)
 
I'm trying to set up a generalized exception handler that'll do stuff like send me an email when my app crashes
 
AppDomain.UnhandledException i think is what you're looking for then
 
There are places in the app where I'm using Tasks, for sure, but I'm not sure if that's applicable to this
But isn't that the exception itself rather than the thing that handles the exception?
 
The above is a catch all (for most part -- some system exceptions can't be caught) - it's the last step so you wont be able to recover your application state - but it can be used to dump contents to logs or email
 
5:04 PM
So I'd subclass AppDomain.UnhandledException? How would that cause handling to occur?
 
no
please read the link
 
Okay, will do thanks!
 
and if you're still not clear, there's google :)
np
of course feel free to come back with a more specific question about implementation once you know how the above will work out for you
 
What's an 'Application Domain'?
(And Google's the first place I started, but none of my searches were coming back with anything)
 
for your current purposes, its the process memory you're running in
and google will help when you ask it the right question - that's what i gave you :) the correct keyword to start from
(.net supports multiple AppDomains per processes - but i doubt you'll be running into that anytime soon)
 
5:07 PM
right on
A point of clarification, the docs say " this event is not raised for exceptions that corrupt the state of the process, such as stack overflows or access violations, unless the event handler is security-critical and has the HandleProcessCorruptedStateExceptionsAttribute attribute."
 
like i said, it'll catch most exceptions but not all :)
 
But I've never seen a handler with any attributes, just a catch(Exception e){ /*handler code */}
So what is it even talking about?
 
its an advanced concept - you'd see that sort of thing in P/Invoke scenario
 
P/Invoke?
 
but basically as long as you're exceptions are application exception and not corrupting the runtime itself, you don't have to worry about it
hehe see the more i talk, the more questions you'll have :P
 
5:09 PM
Yes, as the nouns and verbs are not in my vocabulary at this point
 
again, its the kinda advanced concept that you'll know about when you actually need it ;)
its used to interface with C/C++ libraries
so you can call native code from .net
 
The MS docs are really bad for someone that doesn't already know what they're 'trying' to convey - every second word is a specific term
 
P/Invoke is short for Platform Invoke
well we've kinda agreed that MSDN is a Reference Library
its not a Documentation Library
 
Okay, so that sounds ignorable for my purposes
That descriptor sounds correct. Any idea where I could find a documentation library?
 
meaning, it's pretty useless if you don't know what you're looking for - and even when you do know what you're looking for, there's a 50% chance it's still useless with its hello world examples
 
5:10 PM
Silly to look for that under the 'Documentation' tab on msdn...
 
i know
 
If you get any examples at all
 
but Reference Library has historic roots
 
Apple docs really spoiled me on this
(If 'I can find relevant information on the topic I want to look up' is counted as spoiling)
 
MSDN really used to be this huge dump of basic class information that you'd use to figure out what to plug where - but you already knew what you wanted somewhat
it still is taht way, it just looks friendlier
 
5:12 PM
Very useful when you are at that state :)
 
agreed
 
If I already knew everything, I'm sure I'd find it useful
 
But yeah, very little is useful if you don't know all the terms yet
 
Example: I just gave you the exact thing you needed from MSDN
 
Yes, and I understood maybe 10% of it
 
5:12 PM
that's normal xD
when i'm trying to learn something -- i explicitly ignore MSDN links
 
Brings to mind an analogy of a person in a hot air balloon asking a mathematician where he is...
 
:D
that does sound about right :D
it gives you all the correct information but totally useless in your own context
anyways, the example in link i gave you will work for your case
so its a good starting point
 
Okay, so back to handling exceptions. I have a desire to handle [most or all] errors with some text that I set up in my catch() blocks that will then populate logs with useful information for debugging and troubleshooting
 
your next stop should be stack overflow with that term - you'll find plenty of examples
(this is my learning process)
 
I clearly don't want to write that in every handler
 
5:14 PM
(most of examples are actually in questions themselves)
 
So I want a class/object/whatever that will do this work for me
I'll take a look on SO to see if (now that I have a term I can search for) anyone has done something similar that I can learn from
Thanks for the tips!
 
i'm not sure i follow your desire
you'll have to do quite a bit of boilerplate code
 
Another question: I sometimes see code that looks like this:
public class Example
{
[SecurityPermission(SecurityAction.Demand, Flags=SecurityPermissionFlag.ControlAppDomain)]
public static void Main()
 
yea thats an MSDN thing
 
I understand the lines that start with 'public' and '{', but not the other one
What's the deal with that?
 
5:16 PM
[..] bit are Attributes
 
Is that a comment, or does it drive functionality?
 
They are Method attributes
 
they had Aspect (or behaviour) to whatever they're being applied to
in this particular example you quoted, it's asking runtime for a very specific permission
 
Huh, weird
 
thus, a user without permission cannot run the code
 
5:17 PM
It's asking for permission, or telling about permission?
 
asking
and how it is asking is declared by SecurityAction.Demand -- (there are other ways to ask in there too)
 
Hmmm, I think that's far enough beyond me at this point that it won't be fruitful to pursue understanding that part right now
 
still, in my years of .net coding, i still dont know how to do securitypermission attribute and i haven't found a proper guide that tells me how to do this bit
 
Back to my desire...
 
its just meta data about a method..... they can be used for anything from permissions like the example above, to instrumentation
 
5:19 PM
as long as you're running as Full Trust application (which you probably are 95% of the times)
you dont need to care about security permissions
 
I've got a [big?] app. It's got tons of files and tons of code, and tons of ways to mess up
When it does mess up, I have try/catch blocks sometimes
 
sounds like normal software project to me :D
 
^^^
lol
 
In those catch blocks, I set up diagnostic strings that I want to log and/or email to me as the developer
 
5:19 PM
More common attributes would be [ImportMany] (for MEF) or [DataContract] (in WCF)
 
So I'd like a global exception handler that'll do that for me
 
Shh bradley - you'll confuse our Java friend here
 
You don't actually want that
 
But I need to pass the constructed string off to my handler
 
and yes hes right - thus I said, quite a bit of boilerplate code
you know what you want
SeriLog !
 
5:20 PM
Which is repeating that code in every handler, or... something else?
 
and use that with Email Sink
 
You're saying words I don't know
 
@Maverik are you making fun of my question about capturing all thrown exceptions?
 
@MarkW eh what? i dont even know about your question
but its a bad idea in any case
 
@BradleyDotNET cool, that's totally possible. Can you tell me 1) why, and 2) what I do want?
 
5:21 PM
lol coincidence
agreed
 
@KyleHumfeld yes both of us meant handle with repeating code
 
(And maybe all exceptions is an overstatement, I'm mainly trying to handle ones that I'm capturing in a catch block, which can happen any one of dozens of places)
 
SeriLog is logging library that reduces the load
 
4
Q: Capture all thrown exceptions in java?

Mark WI doubt such a thing is possible, but without attaching a debugger to a java application, is it possible to have some collection populated with information about every exception that is generated in a java application, regardless of if it is caught or not? I know that in .NET, messages get gener...

 
Uhhh... that has to be the wrong answer
 
5:23 PM
well I guess i'll learn a better way today :)
 
It violates the first principle of software design, which is DRY (Don't Repeat Yourself)
public class ZOMG implements Thread.UncaughtExceptionHandler {
is the class in the Java project I'm 'translating'
 
PS: This pattern is so common that in WCF you actually have to be upfront wiht exceptions you're going to throw on server side just like you declare with throws in java
(by this pattern i mean catch exception - handle exception - repeat in other code parts)
i wish world as ideal..
 
I can see repeating a call to a central class/method/whatever that takes the logging/emailing action, but not implementing that logging/email action in every place I'd want to do it
 
we can come close to dry with helpers, but there's no catch all scenario that is actually useful
see the thing is, you're thinking of this in a different way
Try/Catch is meant to be used as a graceful recovery from a problem allowing application to continue
 
That's certainly one of its functions
 
5:26 PM
if you're going to do everything in one big class that is your swiss knife - you're not going to be able to do that graceful recovery
 
No, that's not at all what I'm trying to do
 
and if you dont need graceful recovery - then just go with what i gave you
log in that handler, and you're done
 
I'm trying to do the handling in my catch block, and to log what I did in the centralized code
Maybe I can just make a class that doesn't care about exceptions at all, and use it to do the log/email
 
of course thats just my humble opinion from very limited experience and I'll let more knowledgeable people offer better advice and learn in the process
 
Well, you're more knowledgeable than me by a long shot, so I'm not trying to be argumentative, just to get to a solution that makes sense and that seems reasonably implementable
 
5:28 PM
You don't want a "catch all" that is supposed to handle everything for several reasons. (1) you can't gracefully recover, as has been noted. (2) figuring out where that exception came from sucks
 
Agreed
 
Having that catch all as a final safety net is totally reasonable
but it sounds like you are missing a lot try/catch blocks you should have and are relying too much on the safety net
 
That's more along the lines of what I want, but even that's probably an oversolution for my purposes at the moment
 
Yes, exception handling/logging is a bunch of boilerplate code and it sucks
But realistically, you need it that way
 
There are certain points where things are 'expected' to go wrong, and others where I feel safe in not try/catch wrapping
 
5:30 PM
Most of the time though, your application coreing is not an expected response to an error
at least not it my line of work :)
 
Certainly not
The places where that seems possible, I use try/catch and all is well
 
verb: core <-- now thats a first!
I hope i can remember to use it in future!
 
i use an unhandled exception handler in my app.cs
i wrap stuff i expect to fail soemtimes in try/catch
and try not to use try/catch anywhere else
 
... but gaining insight into when that happens and why is very important, and thus I want to get information produced by my catch blocks
 
First rule of programming: users are stupid
 
5:32 PM
@Julien that's generally my approach as well, with the exception of the app.cs bit
 
they will find an unexpected place to break your software
 
How do you do that, is there anything special, or is it just wrapping the [something] in a try/catch in the app.cs?
 
@Julien That still basically crashes your program
 
and sometimes its downright genius the way they do it
 
@BradleyDotNET yeah, that is a design decision i am ok with
 
5:33 PM
(if you've ever worked on a game engine, you'll know what i mean)
 
@BradleyDotNET certainly so, which is why gaining insight into what happened is key
 
@KyleHumfeld Its the handler maverik pointed you at earlier
 
Ah, okay, that's good.
 
@Julien Lucky you. My code has to run 24/7 :(
 
the other option is to wrap all your stuff in try/catch which i hate codewise
well, i think my approach is more centered around not having any fatal exceptions
 
5:34 PM
So it looks like I need two things: Mav's handler, and a separate class that does the logging/emailing of strings that my catch blocks send to it
 
and if one should occur, it should be fixed pronto
 
And in order to fix it, you need information about it
 
like i wish i could know these particular users who had so much free time on their hands and intellect needed to cobble together some random actions to cause an actual failure in game engine
 
Yeah, no doubt
 
(totally intentional for their personal in-game gains)
 
5:34 PM
let them crash it, collect the logs and fix it
@BradleyDotNET what do you do when an error occurs, you catch it, but your app stops functioning properly?
 
he answers the support phone :P
 
@Julien in my latest project incarnation, the appdomain crashes and gets restarted by my host process and hope for the best!
 
right so a fatal error triggers an app restart
 
(of course i'll get the log, but its not a fatal error or i'd know about it during development)
no..
 
coding your app to continue working after breaking just seems like so much work for the wrong reasons
 
5:37 PM
not an app restart - only a plugin restart
i used the word AppDomain not app :)
 
Okay, so it appears that Windows Store apps don't have AppDomains
 
they dont need it i'd say
you have persistent state in store apps
 
@Julien consider exceptions like disconnects on socket connections, or while reading input values from some external data source... you need to be able to recover and keep going from that 'class' of errors.... but there will always be errors for which you cannot be prepared, nor can you recover from
 
you can just resume.. something that we can't do in native apps without effort
 
That's possible, but it also means that I'm not sure how to use the UnhandledException thing, as that seems to rely upon AppDomains
 
5:39 PM
yeah all those things you list are things that should be wrapped in try/catch, because its reasonable to assume that they will fail at some point
 
mm there i can't help, i haven't done store apps unfortunately
 
Aha, found a post about it
 
yeah... but like if the disk space is out, or youre OOM, then nothing you can do... no matter how much try catch trickery you wanna throw in there
 
and yea Mark is right - thats the sort of exception i deal with a lot in REST clients
http times out - or connect aborts.. you just have to deal with it
and pretend to the user that everything is gravy (i blame this use of gravy on sean!)
Aka - Transient errors - you're expected to deal with them and keep going like nothing happened
 
Ive heard talk about the performance impact of try catch statements.... and that keeping them to a minimum is a good.... but I don't actually know any of the technical reasons why that would be the case
 
5:42 PM
@KyleHumfeld look what i just found: msdn.microsoft.com/en-us/library/windows/apps/…
 
but generally follow that idiom as best I can
 
I just searched for Windows Store UnhandledException and that was the first result :)
 
More complete but less useful (almost like it's on msdn....)
 
probably an experience thing, i find the answer complete and useful :)
 
5:44 PM
It's not a complete answer without a code example
 
it is, if it answers the question asked
and in the linked question, it does - with reference links to relevant documentation
i realise its frustrating to have to cobble together pieces of information like this - but this is how we have it right now unfortunately
 
My core question is "how can I make it work?". Having to guess at what syntax will bring about that happy conclusion is not something I can consider 'complete' in terms of answers
 
but you do kinda develop the instinct to know what to pick from where and how to cobble it together
you're asking something that you wont get on SO at least
"gief code" "we haz no code"
 
Yeah, I'm okay with it - we're all in the same boat, right?
 
well yea i understand what you're asking for
but you're unlikely to get it
 
5:47 PM
Sure, I'm generally not looking for a handout in terms of complete working code, just guessing a what combination of caps/lowercases and what objects with their methods will be the magic that will compile (and work) is not really that fun
 
this is where you as software developer have to create the solution
 
Yep, totally with you there
 
you dont have to guess the case normally
it's Initial capital pretty much all the time as far as framework code goes
 
unless its java... then the naming conventions are quite different than .NETS
 
also, if you're working on c# -- invest in a Resharper C# License
its well worth the money especially if you're learning
(may be you can get your company to buy it for you)
and I'm specifically talking in .net's case
all publicly exposed stuff will adhere to initial capital scheme generally
 
5:50 PM
Yeah, I've heard that before and I'm close to pulling the trigger on that
 
unless you've run into some lame ass developer who chose to translate to c# using some translator program
 
Or pull it over from Java.... I'm trying to not be that guy
 
I also recommend Linqpad as your scratch pad programming tool
 
I'm using Notepad++ atm
 
it started its life as a querying tool but its a mini ide now
again premium license is well worth having (its for lifetime updates)
 
5:52 PM
Aha, I see that's WAY different than NP++
 
i spend most of my rapid prototyping code stage in linqpad
NP is just a text editor
linqpad is ... its just amazing code editor
 
do you use UML by chance maverick?
 
@Julien Eventually there are unrecoverable conditions. But you would be surprised at how small that set is
 
the best part is its most basic thing .Dump() extension method
Mark: no
i know what it is - was part of my uni course.. but i haven't needed it in my jobs
 
I seem to be the only guy that likes to UML stuff out before I write it....
:(
 
5:54 PM
you're a VERY lucky person to have the luxury of time to do that
 
@MarkW I use it to the extent that I draw boxes :)
 
not that I get a chance most times.... but If I have the time I like those diagrams
 
but full UML is pretty much worthless to me
 
lol that's about mine too
a few fields, the right type of line for the relationship
beyond that I don't 'fill them in'
 
Yeah, I don't bother with the fields
 
5:54 PM
as my boss puts it: If we could clone you into two or three more devs, we'd still be running behind schedule
 
But if I'm writing something new I'll sketch a class diagram
Have one on my white board right now :)
 
:D I knew I liked you Bradley
 
:)
you guys like each other and i'll read the juicy gossip tomorrow :P
for now I shall leave you in good hands and company and head home :)
have a nice evening all!
 
pc
 
Mav out
*poof!
 
5:56 PM
cya
 
@Maverik, sounds like you're not getting paid enough then =)
 
We never are :)
 
lol idk, im happy with what I get paid... its not a lot, but it lets me drink, fish, and drive a motorcycle around
what more could I want?
 
00:00 - 18:0018:00 - 22:00

« first day (951 days earlier)      last day (3198 days later) »