« first day (249 days earlier)      last day (4692 days later) » 

6:00 AM
@rushonerok hi
 
 
2 hours later…
7:34 AM
good morning
 
Good morning
 
How I hate getting downvoted without any explanation
 
@yas4891 It's a pain
 
@Patrick it sure is. I've got a faint idea why, but it's ridiculous to say the least
 
@yas4891 What's the question/answer?
 
user asked how to do a thing in LINQ. Best answer would be to not use LINQ at all, but (as demanded by the question) I provided a LINQ answer
that's right
@MartinhoFernandes good morning!
 
@yas4891: That was a somewhat uncalled for downvote.. weird
 
yeah. i think so
 
AMH
8:05 AM
@MartinhoFernandes are u there
 
AMH
8:23 AM
@MartinhoFernandes hi
 
@AMH think it may still be a bit early for martinho :P
 
AMH
@Madcowe Ok could u help me in some issue
 
@AMH uh I can certainly try, but the odds of being of any assistance are minimum...
 
@AMH: It's a public chat, I think anyone here can help if you write your question
 
AMH
I need to get the intesection line between two planes
 
8:31 AM
@AMH oh math
 
AMH
but I have stoped at certain point I got the vector but how to get point on it
I use the following code
could any one help me
@Patrick could u
 
Uhm, I'm not that up to date with my linear algebra.. What do you mean with "how to get point on it"?
 
AMH
I need two points that represent the line
I got its direction
 
@AMH You mean the endpoints, as in start and end?
 
AMH
@Patrick something like that
@MartinhoFernandes hi
 
8:42 AM
@AMH "something", I don't get it, what points are you interested in, you got the angle between the two points, and it's "size", right?
 
AMH
@Patrick no I am not interested in the angel
 
@AMH But you told me you have its direction, doesn't that imply the angle?
 
AMH
no it's x,y,z vector
 
@AMH But a vector (to my knowledge) has a angle and a length
What it doesn't have is a specific point of "origin", as in it can be wherever in a room...
 
AMH
there's alot of representation type
 
8:47 AM
Okay
 
AMH
Any help
 
@AMH I'm sorry, I don't think I am able to help you..
 
@Patrick now that is one simple image
 
AMH
@Patrick thanks for interest
any body else
 
@AMH I think I've worked out something. Lemme post it.
 
AMH
8:57 AM
@MartinhoFernandes when
did u see my code
 
It's based on my answer, but without divisions by zero :)
 
AMH
what do u mean by division by zero
 
The code I had posted in my answer would divide by zero sometimes, and of course, give out wrong answers.
This new one doesn't.
 
AMH
may I ask can I get another point
instead of direction
 
Now that's easy. Just sum the origin point with the direction.
 
AMH
9:06 AM
you mean dir + p
 
AMH
and the result will be a new point great thanks a lot , may I ask final question
can I get the begin and the end points of the line
 
The line is infinite.
Because planes are infinite as well.
You'll have to be more clear on what you mean by the begin and end points.
 
AMH
the code is hard to be understood but I try my best
the hardest part is
if(dir.x != 0) {
p = new Vector3 { x = 0, y = b, z = c };
} else if(dir.y != 0) {
p = new Vector3 { x = b, y = 0, z = c };
} else {
p = new Vector3 { x = c, y = b, z = 0 };
}
why u do this check please
 
> In general, this system is underdetermined, but a particular solution can be found by setting z0 to 0 (assuming the z-component of a is not 0; or another analogous condition otherwise) and solving.
 
9:16 AM
Vector3 { x = 0,... and so on is just another way of typing
Vector3 vector = new Vector3(); vector.x = 0;
 
That part is just picking which coordinate will be 0.
 
AMH
why we check
 
The line has many points. I pick one that has one of the coordinates equal to zero.
But I can only set one coordinate to zero if that coordinate in the direction is not zero.
 
AMH
Ah I got it
 
Hence the if(dir.x != 0) .... p = ... x = 0 ...
 
AMH
9:19 AM
forgive me I am new to linear algebra programming
 
AMH
9:34 AM
@MartinhoFernandes You still there
 
AMH
this part
if(dir.x != 0) {
b1 = p1.Normal.y; b2 = p2.Normal.y;
c1 = p1.Normal.z; c2 = p2.Normal.z;
} else if(dir.y != 0) {
b1 = p1.Normal.x; b2 = p2.Normal.x;
c1 = p1.Normal.z; c2 = p2.Normal.z;
} else {
b1 = p1.Normal.y; b2 = p2.Normal.y;
c1 = p1.Normal.x; c2 = p2.Normal.x;
}
 
It's a check similar to the one you mentioned above.
It picks the variables to use later when solving the system.
For example, in the first one, we know x will be 0, so we pick only the ys and zs.
 
AMH
I missunderstand I got it thanks a lot I will test it and tell u
 
10:09 AM
Hey people, what's the usual convention for encoding data to binary format?
Do I count the 4 bytes that say how long the data is as part of the data length?
 
@HerpDerpington what kind of data?
 
my own format
 
Well, do as you please.
As an example, BitTorrent packets are length-prefixed, and that prefix is not accounted for.
 
@HerpDerpington do you want to convert to a string, store in a file, database, transmit over the web ?
 
over the web
Right thanks for the advice
 
10:16 AM
@HerpDerpington Usually (I think) it is prefixed with a length when a binary protocol is used. Remember to check the length before you allocate a byte buffer for the data so you don't allocate "negative" lengths or gigabytes of arrays
@HerpDerpington Although, if you are writing a client that talks to other services, you need to consult the documentation there, but I guess you would know that :)
 
 
2 hours later…
12:13 PM
hi di ho
 
1:10 PM
what's up @yas4891
been a while?
 
hey Barlow
yeah. I was taught the ultimate solution to all of my WCF problems yesterday
how are you doing?
 
@yas4891 I'm well, thank - hope you are too. =) What was this ultimate awesomeness you mention?
 
when using a callback with a custom class
you need to actually use that custom class as parameter in the callback contract
you can't use object
not so obvious mistake IMHO
hmm
@CBarlow what are you up to ?
 
@yas4891 I think i understand that. =) Never done much with WCF at all.
 
@CBarlow so what are you doing? Just hanging around?
 
1:22 PM
I am working on a Outlook-style notification bubble that I designed some time ago. =) Trying to expand its functionality.
@yas4891 It's not very exciting lol.
 
@CBarlow oh ok. What does it look like ?
 
@yas4891 It's modeled after Outlooks alerts, so it looks a lot like this:
 
ah ok. So this shows up in the lower right corner of the screen whenever a new mail arrives ?
 
yep! Though in my case, the triggers are different. All kinds of custom business scenarios that might trigger one of these guys.
 
1:42 PM
yeah ok. Just wanted to make sure, that I understand it correctly
seems nice. could be helpful in some situations
 
@CBarlow I hope they're not annoying.
(Which is, of course, a subjective matter.)
 
@MartinhoFernandes Haha, indeed. I have an entire smorgasbord of options allowing you to set which triggers cause them to appear. So if they're annoying, it's the user's fault. =)
 
@CBarlow Do you have the " You just inactivated all desktop Alerts "-alert? ;)
 
@Patrick No - I don't think the particular purpose of these alerts merits warning somebody if they turned them all off.
oh you were kidding
I'll try to be less socially awkward. =)
 
@CBarlow I was
:)
I once took a class stating that all popups should be eliminated, since if you want a dialog you can probably redesign the user flow anyway.
 
1:52 PM
interesting...
 
Sure is..The idea was probably to make us think twice before using them instead of eradicating the use entirely, but still
 
yeah. About a month ago I read sth similiar on the web
stating that MessageBox is rather out of date
 
Just noting that a desktop alert/notification is not the same thing though
 
The problem with MessageBox is that it's modal.
It blocks the entire thing until you click the damn button.
 
@MartinhoFernandes But it's not just MessageBox, even Wizards are subject to the matter
 
1:55 PM
that's true
na... I wouldn't want to miss all those dialogs
I find them handy
focussed
 
2:15 PM
Yeah, i made mine so that they are actual forms that show up without taking activation.
(and are, therefore, not modal)
 
i didn't mean "focused" as in "grabing focus"
 
they appear and then fade (by default) a few seconds later. Just like Outlook really.
 
i mean that they are (in most cases) there for a focused subset of actions / settings to take / change
 
oh i know - i was just noting because of the modal discussion. =)
 
ah ok
yeah well. my English is not that good, so I thought I might not have made myself clear
 
2:19 PM
@yas4891 They're not that useful when the only message that pops up is "You just clicked the button", as in "remove an item" or something
 
^^
 
I have used applications that state information like that with a MessageBox
 
that's OK. :)
always keep your users informed ^^
 
lol, right
And always use exclamation marks as well
"You removed the item!!" making the user scared to do it again. *You should train your user to use the application the way you designed it, even if you enable features that should not be used* :P
 
I'm using a System.Threading.Tasks.Task in a DispatcherObject and ContinueWith
System.Threading.Tasks.TaskScheduler.FromCurrentSynchronizationContext() is not
executing on the Dispatcher thread. Any suggestions for me?
 
2:27 PM
@Patrick Except "multiple exclamation marks are the sure sign of the diseased mind."
:P
 
@MartinhoFernandes lol, or a fourteen year old ;)
 
@MartinhoFernandes Nice :P
 
What's funnier is that Pratchett's characters sometimes refer to how other characters used multiple exclamation marks in their speech.
 
hmm. Anyone with experience in WCF + callbacks ?
 
2:33 PM
@MartinhoFernandes They live on a giant turtle, what's not possible? ;)
Haven't read all of his books though, perhaps not in Maskerade (which I have not read)
 
2:54 PM
grr my WCF host gets stuck when doing callbacks to a non existing client
 
Starting to learn c# .. java ( J2EE and J2SE) prgrammer .. any suggestions ?
 
@HackToHell Write code. Lots of code.
 
hackto: this tutorial softsteel.co.uk/tutorials/csharp/index.php and a couple of good advanced books. Effective C# (2nd Ed) and More Effective C# are great.
 
@christianstuder there is nothing matching experience yet want some great startup book or something
@jrwren thanks book marked
 
@HackToHell take your time... about 10-15 years if you're doing it for fun only
 
3:02 PM
@yas4891 10 - 15 years !! I have to admit that mastering Java took 7 years but 10 -15 !
 
Ron
System.OperatingSystem OSInfo = System.Environment.OSVersion;
Console.WriteLine("Service Pack = {0}", OSInfo.ServicePack);

return "Service Pack 1", what the result will be if I have no sp?
 
@Ron From the docs: The service pack version, if service packs are supported and at least one is installed; otherwise, an empty string ("").
 
Ron
ty
 
@Ron yep tried it out .. returns empty string pastebin.com/KMBU6xrm
 
3:17 PM
@HackToHell depends on whether you're doing it for fun or for work
 
@yas4891 kinda fun .. wanna impress friends
 
@HackToHell is that you in the avatar? If so: Come naked, that'll impress them
 
@yas4891 nope idiot ! that's ellen page
 
wait a sec
 
3:28 PM
@yas4891 yes what ?
 
@HackToHell ahh.. yeah. I knew I remembered that face from somewhere
 
@yas4891 inception movie
 
Juno ^^
yeah well... so that option is obv out
@HackToHell but pls tell me: why would one want to impress friends with such nerdy things as mastery of a programming language?
It seems to me that there are two options:
1. your friends are relatively normal ppl and will just think you're the average geek and will henceforth call you in the middle of the night to troubleshoot there PC problems
2. your friends are nerds as well and will be rather unimpressed by C# and demand you learn *[insert favorite esoteric programming language here]*
 
Yeah, you should be learning BrainFuck.
 
@yas4891 hmm not just limited to that ... (impressing friends) but it is also my personal interest . and I will go with Option 1
 
3:36 PM
@MartinhoFernandes my point, exactly my point
@HackToHell then don't do it.... I'd prefer sleep to impressing random guys
 
@yas4891 personal interest .. super seeds everything .. though can't help showing off
 
except maybe Eric Gamma, Eric Lippert, Kent Beck, the like
 
They're not random guys, they're his/her friends.
 
@MartinhoFernandes ah yeah.. sry my bad.
 
@yas4891 personal question are you a psychologist turned coder ?
 
3:39 PM
@HackToHell nope. just that average annoying guy you meet from time to time on the internet ;-)
 
@yas4891 :)
 
nevertheless: C# is an awesome language to learn IMHO
BTW: I hate it, when I copy code from a book and it doesn't work
Gives me the feeling that I'm the most stupid person alive
which might be true...
@HackToHell On topic: Jon Skeet's "C# in depth" is a fine read
plus you might want to read this thread here: stackoverflow.com/questions/477748/…
 
@yas4891 Everyone is a human and I tend to do that a little too often and nice thread stackoverflow.com/questions/477748/…
 
I'd like to one day ask a witty 326-upvotes-question on SO
 
One that isn't community wiki?
I find that hard.
 
3:48 PM
bye .
 
@HackToHell bye
@MartinhoFernandes that's true
or give an answer with 191 upvotes... like this one: stackoverflow.com/questions/215255/string-vs-string-in-c/…
 
That's mostly because it's a common question and that ends up with lots of views.
Of course, Jon gave a very thorough answer.
That helps, too.
 
:-)
and as one commentator put it: "OMG! Jon Skeet answer... MUST ... CLICK ... UP ARROW!!!"
Honestly I do like Eric Lippert's answers. they teach you a lot, if you are new to C#
 
Even if you're not new.
 
4:02 PM
WTF?
 
I didn't actually read about the event before I did an hour's worth of work, because I assumed it worked like every other mouse event ever. =(
 
i just wanted to make sure the control had the event, so i checked and it was listed.
@MartinhoFernandes lol
 
It's a tri state, that actually has five states, but only two of those are supported.
Amazing.
 
4:07 PM
@MartinhoFernandes OMFG
 
haha, not to mention the simple semantics of calling something a "Tri-State Boolean"
 
how did you find this gem?
 
"MSDN is a post-it Jon Skeet wrote when he was four." ^^
 
 
3 hours later…
6:52 PM
hi guys.. got a quick question about C#
 
@shambulator first class answer
@BlackBear fire away
@shambulator I still have another question, if you don't mind
 
@yas4891 thanks yas
fire away
 
is it possible to check if a character is available in console but without blocking the execution of the program?
 
@shambulator setup is still the same. I want to send the message to many clients
 
7:02 PM
so I used that code I found in "WCF - Step by Step". pastebin.com/3VT9C4wr
where listClients is a List<ClientInterface> containing the callback channels.
it works fine - as long as the clients are all connected
but when I close one client without unsubscribing it, this method just freezes
@BlackBear Console.KeyAvailable
 
@shambulator thank you. I quickly tried this thing:
        while (true) {
            if (Console.KeyAvailable)
                Console.Write(Console.ReadKey().KeyChar);
        }
the problem is the character gets printed 2 times
 
@BlackBear Or you might just as well Console.KeyAvailable as suggested by @shambulator :-)
 
@yas4891 he suggested right that ;)
 
@BlackBear that's because you type it once and then you print it on screen again using Console.Write
@BlackBear i know ^^
 
@yas4891 ups, right :) thanks guys! :)
 
7:05 PM
@yas4891 Console.ReadKey prints the value of the key you read. There's an overload which takes a bool to let you suppress it
sorry @BlackBear, replied to wrong person :P
 
@shambulator no harm done :)
 
@yas4891 weird how I've been doing wcf stuff this similar to you. I haven't done much with callbacks yet, but I was trying out some broadcast-type stuff like this recently
I don't know how much control you have over configuring timeouts, etc. on callback interfaces, but I think you should treat them as much as possible like client proxies
e.g. be prepared for them to time out and fault the channel, call them asynchronously if you need to stay responsive, etc.
 
@shambulator that is what I intended to do with this call. However: The method freezes completely
no returning from it, no timeout nothing
 
and only when a client disconnects without unsubscribing? hmm
 
yeah. I generally do not unsubscribe ATM and so it happens as soon as I close the client
 
7:16 PM
If you set a breakpoint in the else (callback is not open) does it get there? And if so, are you making sure you Invoke or BeginInvoke all UI operations in Form1.AddText?
(side note: I'm not sure that checking Open is a reliable way to check if a client is still connected. You might only find out when you try to call it, which makes me think you should restructure to catch CommunicationExceptions and Timeouts, then remove the client if any errors happen)
(another side note: it looks that way already, but you probably want to enumerate over a copy of your list of callbacks, so you're not removing them from a list that's being enumerated)
(and yet another side note: you might need to lock your collection when you remove clients, as it's potentially being accessed by multiple threads :) )
 
that's what I was wondering about, too.
AsParallel() is a LINQ extension method. I take it, that they always return a new collection
 
ah, ok
not used PLINQ yet
 
will do the locking, once I'm in production code :)
same goes for the exceptions
I do call Invokes ^^
internal static void AddText(string p)
{

cInstance.Invoke(new Action(() => cInstance.addTextInstance(p)));
}
ahh... another question concerning WCF: I don't get any exceptions when something goes wrong
I mean: They don't get shown in VS and the application does not crash, when an exception occurs
HOWEVER: I am able to try{}catch(){} them
 
and if you don't try/catch, and the app doesn't crash, what does happen? that's exceptionally odd
 
@shambulator only true for CommunicationExceptionn
 
7:26 PM
check the menu Debug -> Exceptions, I think there's a reset button there. All user-unhandled CLR exceptions should be checked
 
it is
 
it would definitely explain why you're not seeing any exceptions for this; would expect CommunicationException and nothing else if the client just vanished :P
so does any communicationexception hang the app?
have you tried sticking a try/catch (communicationexception) around your callback yet? I know you plan to, but not sure if you have yet or if it makes a difference in this odd situation
 
I have one big try / catch (Exception) around the whole call to listClients.AsParallel()...
and I don't get an exception
 
the fact that the actual callbacks happen on different threads could be muddying the water there though
stick a try/catch around the actual callback call and see what happens
 
no it didn't
i debugged through it
step by step. Checking whether the connection ist Open seems to work
with two clients subscribed (one closed) i get both code paths of the if/else invoked
 
7:37 PM
so it seems to be hanging when calling back on the client which is still running and subscribed?
 
nope
the other one
it invokes the Form1.addText(........... wait a sec
and there it stops...
 
which line hangs it?
 
cInstance.Invoke(new Action(() => cInstance.addTextInstance(p)));
 
ah, barking up the wrong tree :P
 
@shambulator that is so fucking embarassing
 
7:43 PM
I'm guessing the whole AsParallel() bit is kicked off in response to an event, which itself is kicked off in response to a Windows message
 
well... so I need to find out why - for crying out loud - this happens
I've surrounded it with if(InvokeRequired)
 
was skimming through the AsParallel/ForAll docs just now, and it doesn't guarantee that new threads are used, so:
 
and it takes that path...
 
UI thread kicks off parallel loop, which uses the UI thread to call Invoke, which sends a message to the UI thread, and waits for the UI thread to return from processing it :)
you need to use BeginInvoke, not Invoke
that will send a message to the UI thread without waiting for it to process it
 
check
works now...
 
7:46 PM
great! :)
note to self: deadlock throws no exceptions :)
 
@shambulator that's true, but I don't exceptions - even without deadlocks
 
what does happen when you should get a communicationexception then? no exception, no crash... everything just carries on running?
 
exactly. A bit like ON ERROR RESUME in VB ^^
 
what a terrifying prospect
 
hi alll......................
 
7:53 PM
@shambulator that's true
 
@Pramodh hey Pramodh
 
@shambulator hi friend
 
do you have a simple program that can reproduce the problem? this sounds utterly bizarre
as simple as possible, anyway, when by definition both client and server are involved :P
 
hello DrTJ
 
@shambulator How shall I send it ?
 
7:58 PM
@yas4891 small enough to pastebin? will have to reboot into windows in a sec
 
too big
 
@Pramodh Hello friend, how are you?!! :)
 
I'll just send you my two projects (server + client). They are simple enough - as they are just test projects to fool around with
 
How is it going?
 
@yas4891 whackarat-samplecode@yahoo.com
http://stackoverflow.com/questions/5935613/wpf-an-application-does-not-crash-if-an-exeption-occurs-in-loaded-event

http://stackoverflow.com/questions/4807122/wpf-showdialog-swallowing-exceptions-during-window-load

both WPF-related, but possibly relevant
 
8:06 PM
grats on 1,000 rep!
 
@yas4891 thanks :)
 
interesting enough: I recompiled it for "Any CPU", it now crashes
previously it was "x86" (as I have to use this in production code)
it misbehaves in both x86 and x64
running on a x64 machine
that is some strange behaviour
 
do you have all windows and VS service packs?
sounds like this, or something like it, has been around for a while
 
@DrTJ , fine............. how are you...???
 
@yas4891 (got code, thanks)
 
8:12 PM
I have to thank you
 
@Pramodh good! :D
 
@yas4891 as a matter of interest, switch back to either architecture and enable first-chance CLR exceptions from that same exception dialogue; see if you get anything
 
@Pramodh What happened with the parser you were writing?
 
linkfest on x64 dev machines swallowing exceptions:
http://social.msdn.microsoft.com/Forums/en-US/vsdebug/thread/69a0b831-7782-4bd9-b910-25c85f18bceb/
https://connect.microsoft.com/VisualStudio/feedback/details/357311/silent-exceptions-on-x64-development-machines#details
http://www.depopo.net/2011/03/re-enabling-user-mode-exception-on-64-bit-development-machines/
http://blog.paulbetts.org/index.php/2010/07/20/the-case-of-the-disappearing-onload-exception-user-mode-callback-exceptions-in-x64/
 
that's fucking crazy
I just found all those links, too...
oh BTW: using first-chance works ^^
 
8:19 PM
good to know
 
the really weird thing is, that I seem to be the only one to have this issue with WCF calls
 
doesn't seem to be consistent from those links: some people get it only when compiling for AnyCPU, you get it only when you're not, and only for WCF. very odd. do you have all relevant updates?
 
the last link you provided seems to have a lot of insight
System is up to date Win7 SP 1
with a restriction on some security patch for .NET 3.51 where it could not install the patch
 
very odd. time to try some experiments at work :) though we're using x86 version of VS on x64 systems, it sounds like it's an OS thing rather than tools
 
yeah... and a lot of OS architecture behind the scenes
sometimes it pays off to know that basics.
 
8:26 PM
be good to hear how your wcf project is going from time to time; I'm a bit bogged down trying to diagnose performance problems in a service written by my predecessor. interesting to tackle new stuff after hours :)
cheers for now
 
yeah... I'm leaving too
thanks a lot, mate. You've been a great help!
 
no worries :) it's been fun!
 
gosh...
yeah... somewhat
 
 
1 hour later…
9:57 PM
Rawr.
 
10:08 PM
Can anyone help me with a little problem?
I'm trying to implement the code posted here: stackoverflow.com/questions/4058664/…
But the code don't show some implementation details and my code is not compiling
public class ImageHandler : IRouteHandler{
...}
When I build the application
'IONWebSite.ImageHandler' does not implement interface member 'System.Web.Routing.IRouteHandler.GetHttpHandler(System.Web.Routing.RequestConte‌​xt)'
 

« first day (249 days earlier)      last day (4692 days later) »