« first day (11 days earlier)      last day (4938 days later) » 

8:01 PM
@ReedCopsey what is 'other' in your example
 
@Shogun: You should probably write it down as an actual stackoverflow question
Starting from the basics of what data you have and what data you need to end up with
 
k
 
It's pretty hard to get a grasp at what you're doing from the chat
Also the audience is far bigger :)
 
8:38 PM
I want to validate some data (a host name, but the specifics don't matter) in a few steps, while carefully and elegantly handling any errors. Which approach should I take: 1) A monadic approach with a Validated<T> type (consider it an extended Nullable<T>), 2) exception throwing validation code + catching everything later, or 3) exception throwing validation code wrapped inside Task<T>? Option 3 is sort of intermediate between 1 and 2.
 
@Joren ~ Personal experience says go with option 3, assuming you can't force a bad data to hit a default (which might let you alleviate into #1)
 
Yeah, I want to handle every type of error differently, not just have a single 'it didn't work' result
 
@Joren yeah, if it is something that has an well defined/graceful way to re-act to "failure", go with #1, if it's truly exceptional, use #3, I say.
 
@Shogun yes/no; sometimes I do this myself, when solving a problem, sometimes you may leave code blocks for a while, it can't hurt
 
@Pete: Well, if we do go to the specifics, validating the host name involves a few simple checks for checking that there actually is something to validate, that there is a port number specified, that the DNS lookup manages to find results, and that those results include at least one IPv4 address (as opposed to say IPv6)
Basically I just want to display a message to the user for each different error
With option 1, to be clear, I meant that Validated<T> would have either an actual T value, or an enum value that specifies what went wrong
 
8:45 PM
@Joren I would just throw exceptions if you can't define a robust enum strategy instead. I think you could return an enum.
 
Like Validation.CouldNotResolve or Validation.NoPortSpecified or whatever
 
@Joren you beat me to it :\
 
I think 1) is the most elegant conceptually, but it's also harder to follow since you keep calling into all the other validation steps which then do nothing but pass the existing enum value along
Except when it was Validation.Success, then they do more validation and return something new
 
yeah but you have to carry the branching information at some point, no?
 
What do you mean?
 
8:47 PM
Pop Question: If your hand was tied, and you had to use another language, which language with it be?
 
@Darknight javascript
 
@Darknight: For something that I would usually have done in C#?
 
yes
 
I guess Java
 
@Joren I mean that you have to either branch, catch exceptions, or carry along the value while you keep working.
 
8:48 PM
@Darknight Depending on the project: C, Java, or PHP
 
Interesting that they are all C family style, I wonder if you guys would consider non c style family?
 
@Darknight depends on the context, but since I tend to do asp.net, my choices tend to be either javascript or asp.net
 
Given a List<ulong>, I want to create a string of the form 1,2,3,4,5. What's a fast way to do it with LINQ
 
@Darknight For me it's abit of laziness... I could use Scheme for example, but tat's more effort... I also like Python, but again...
 
@Darknight otherwise I would likely go with VB if it was going to be desktop app, but between VB and C# nowadays there is like zero difference, disregarding syntactic sugar
 
8:50 PM
@Michael: string.Join
 
silly question, I assumed JavaScript was only client side?
 
ahh, that makes sense
 
I thought string.join gave an array
wouldn't he then have to .ToList()?
 
string.Join looks correct, but the list is a list of ulongs, not strings (which string.Join requires)
 
8:51 PM
try explaining that to management! (ala vb and c#)
 
Then you first do Select(n => n.ToString())
 
so I need to (via LINQ) convert to IEnumerable<string> from List<ulong>
 
so try ulong.join
 
OK, cool now we're talking :)
 
string.Join(", ", array.Select(n => n.ToString()) or something like that
 
8:52 PM
idk if that works, but I can guess, since linq is all about helper functions
 
technically were chatting ;)
 
Not true by the way
If you check that link
It's Join<T>
Which takes IEnumerable<T>
 
@Darknight actually no
 
And probably just does the ToString internally
 
Joren's solution works for me
 
8:53 PM
@Darknight give me the chance ;)
 
and looks correct
 
how so? are you talking as your typing :)
ooh sorry, apologies
 
heh, I just need a ToArray at the end
 
Server-side JavaScript (SSJS) refers to JavaScript that runs on the server-side. This term was coined because the language is predominantly used on the client-side, i.e. client-side JavaScript (CSJS). The first implementation of SSJS was Netscape's LiveWire, included in their Enterprise Server 2.0 product, released in 1996. CommonJS is a project to provide common specifications for SSJS development. Specifications *[http://research.nihonsoft.org/javascript/ServerReferenceJS12/index.htm Reference for Server-Side JavaScript 1.2] *[http://research.nihonsoft.org/javascript/ServerGuideJS12/in...
@Darknight thought that might help there
 
@drachenstern The validation logic is perfectly linear, so in the Validated<T> case I was just thinking of passing error values along in every step. Task<T> would of course do basically the same automatically, but with exceptions instead of an enum. Option 2 would jump right out of the validation logic to the caller, who would catch the exception and handle it
@Michael: Oh sorry, the method overload I was talking about is new .NET 4.0
 
8:56 PM
@Joren Ok, so here's my thought, how tight is your loop on this? Is it a once off validation (say when they key something into a textbox and hit enter) or are you looping through a couple hundred thousand XML entries and testing each?
 
One off, exactly the textbox case :)
 
Server Side JavaScript! cool
 
So performance is mostly irrelevant
 
OK I believed I have simplified my possible solution to the confusing question I was asking earlier.. and pulled the data into List<T>, so hopefully someone can help me with this question
0
Q: How to remove all objects from List<object> where object.variable exists at least once in any other object.variable2?

ShogunI have having trouble figure out how to write this code. I have a list of items, the items all have an ID. There is also another value that we will call otherID. If otherID is zero or null, we will ignore it. However, if otherID contains the ID of another item in the list, I want to remove that ...

 
I'm looking for what would be most elegant/maintainable/etc
 
8:56 PM
@Darknight Yep, so next time they say what language? I like to respond with javascript but of course
 
And I think it's a pretty hard choice
 
@Joren so just go for exception based parsing, it'll be easier to implement, and they can worry about just the cases they want. It'll look sloppy, but document the reason for the choice
@Shogun build a third list?
 
hmm somebody posted an answer that looks like a one liner, I'm going to try that first
 
@Darknight and the best part? I can write either functional OR procedural code, given the bent I'm on that day ;)
@Shogun I would trust SLaks on my code anyday.
0
Q: Given a .SQL file on an internal website, what options are there for pretty formatting on the fly?

drachensternSo I want to put the files up on my local server, for reference purposes and aside from my regular DVCS because this will turn into training material later. But I want to be able to pretty format the SQL file. (Would be nice if it extended to C# code as well.) I'm not sure what libraries do this...

 
:)
 
8:58 PM
@drachenstern: Yeah, it'll probably be clearest that way. Thanks for your thoughts
 
I've heard that js was functional, but kinda feel fuzzier (is that a word) when doing it in F#
 
@Joren noproblem, I'm sure the chatroom will listen to my awful ideas many many times ;)
 
Gladly :P
@Darknight: My favorite functional programming language is ... Mathematica :)
 
@Darknight that's the beauty to me of javascript. I can write it both styles. I've not quite gotten into doing a lot of functional programming with javascript, but I've dabbled (which is all I ever claim to do anyways, when it comes to writing code ;) )
 
omg it worked... technology never ceases to amaze me that I can solve this problem with one freaking line of code after bashing my head against the keyboard all day
 
9:00 PM
So am I then only one that does backtick semicolon close paren backtick for smileys?
 
lol, programming is dabbling in essence :)
yea gotta love them one liners
but be weary of doing too much of them, maintainability wise
some poor sod has to read it one day.....
 
@Darknight agreed and how. That'll kill you in the long run @Shogun, without documentation around it. For the spontaneous oneliner, it's not so bad. But for code that's nothing but one-liners, it'll hurt more than help
 
@drachenstern I think so
 
@drachenstern what like this :}
 
@drachenstern But if you do it at the end of a parenthesized phrase like you did, that does make it less visually awkward
 
9:04 PM
:)
 
@Darknight no, not quite. format it like an inline code block
 
//;)
 
you can see the difference if you do :) :) [first is backticked, second is not]
 
yea SO chat removes some chars
 
@Darknight the backticking works the same as the markdown on SO
 
9:05 PM
oh i see
 
yeah, the basic markdown is the same, but there's differences to be sure
 
i like this one -> //:)
looks like the dude has straight hair
 
I do it on SO too, gives my smiley a bluegrayish background box
like a square smileyface
 
or he is wearing one of those hats the marines where
 
lol
 
9:06 PM
lol
 
i should have joined the marines i bet i can load bullets better than i can load bits
 
best part is you can use it in your C# and its a valid comment
 
and then i could have a real sword...
 
This conversation is getting dangerous
 
some times, programming frustrates me to the point where I wish I didn't learn to program in the first place!
or punch a cute kitten in the face
 
9:08 PM
I tried joining the marines, I told them they were crazy and to give me a bus ticket home after six weeks
 
I wonder what would happen.....
if a marine wanted to be a programmer?
 
My advice, don't join the marines, but do make friends with them
oh shucks, there's plenty of programmers in the marines
 
would the discipline help ship code on time?
 
well i bet my back wouldn't hurt all day from sitting in a chair hunched over a keyboard lol
but I'm sure every profession has it's perks and it's downsides
but i bet i could get more chicks as a marine than a computer nerd :D
 
perks: when the big cheese comes by, I just run my brute force MD5 hash app
 
9:10 PM
hahahaha
 
//:) he thinks I'm working reaally hard
 
'compiling!'
 
yeah or i check something huge out from SVN
 
Nerd is the new cool!
chicks actually digg us!
 
if i was a marine my number of girlfriends variable could be an int instead of an int?
 
9:12 PM
lol @ nullable ints
 
could be a float, but then we can never be sure precisely ;)
 
I don't see how null for number of girlfriends makes sense, are you saying that you don't know? :P
 
0
Q: Wrapping several different types in a common generic class for common access?

Cade RouxI have several web services which return various results. Some results are strings and some are arrays (automatically generated from the WSDL). When I call the web services, I want to get all the various results (including exceptions), and then operate on them through a common interface, but be...

 
wow, I have a few questions trying to close in on a kiloview
 
ah well, nothingness is a hard concept for humans
 
9:15 PM
You have 0 for no girlfriends, null for 'this value is missing/unknown'
Now if it was currentGirlfriend, that could reasonably be null
 
hahahaha
 
hahaha
fair enough
 
currentGirlfriend.Upgrade();
 
Yeah, given my previous two, I'm gonna go with currentGirlfriend = null; for now
seriously, one was a closet oxy addict with believable pain symptoms, the other just a callous bitch
 
why bother surely the GC will pick it up?
 
9:19 PM
@drachenstern: To continue on that exception stuff a bit, should I just throw an InvalidDataException or something with a custom message for each error, or have a seperate exception type for every possibility? The difference would of course mainly be in how you handle them: either a sequence of catch blocks for every type, or a single catch with a switch on the exception message in it.
 
nah, I'm gonna keep the option open for later girlfriends, but I want to make sure the position is currently empty
 
@Darknight: Are you saying you keep a WeakReference? :P
 
perhaps the real difference is in the definition itself... Nerd { int numberOfGameConsoles; int languagesKnown } vs Marine { int numberOfGuns; int numberOfGirlfriends; }
 
lol gotta dash guys
 
@Joren I would define my exceptions and possibly even toss in an extra field or two for tracking purposes, such as some set of enums for what was broken. So two derivations off Exception ...
 
9:20 PM
wifey.IsCalling :O
 
@drachenstern: Two derivations?
 
@Joren so public class DerviedException : Exception { enum mytrackingfield ... } and then public class BadHostNameException : DerivedException {...}
 
Ah, I see
 
@Joren just what I'm thinking right now, not necessarily better
 
IsCalling(bool dinnerReady) { if(!dinnerReady) return; else Answer(); }
 
9:22 PM
@Joren I think it just depends on what information you want to pass back out again, as to what you need to define there. You may just be fine tossing a single message into a wrapped Exception public class MyException : Exception
@Shogun how would you know without answering?
 
I think differentiating on type is worthwhile, then the caller has the most flexibility
 
hahaha touche
 
'cmon ssms, let's go copy them records ... hupto hupto
488.850 records transferred
 
And of course have them all derive from a common base exception so that you can catch them all without automatically catching unrelated exceptions like NullReference
Yeah, I'll just go the extra mile
 
@Joren yeah, they can either catch (DerivedException ex) or they can catch (BadHostNameException ex) natch. To me just looks like a cleaner implementation
@Joren exactly!
@Joren And the added benefit is being able to define a common set of fields that you know will always be present, without worrying about any tagalong variables that may not get set
 
9:25 PM
Yeah
 
684,390 rows transferred
oh well that explains it ... 56,698,697 total rows ... this is gonna take some time
/facepalm
 
haha
 
probably should've done a backup and restore
1.1 million ...
so it does roughly one million records in five minutes, give or take ... it should need about an hour to do the whole table ... that's not terrible
 
if you're waiting for it though
 
0
Q: ExtJS vs. jQueryUI

Stefan SavevI recently had the experience of doing the same thing (a search combo box) with jquery and extjs. I found extjs to be buggy and overly complex. On the contrary, I found jquery to work very well and be very simple. I am wondering what are other people's experiences of using extjs. Does extjs compl...

nah, not waiting on it, just need it to be done
It can run all night for all I care
only one comment allowed, timer reset ... only one comment allowed, timer reset ... can I at least get a visual indication because my internal clock is overclocked ...
 
9:59 PM
'admit it, we'd be programming even if they weren't paying us' -- Don Syme :)
 
Know what I hate? Being the first one to answer a question and doing so in either a comment or having my answer ignored only because I assumed the asker would take some initiative ... gah, it doesn't box the answers unless they're by themselves?
0
Q: For a user control with a listbox, how can I expose the selected item to a parent page?

AdamDI have a simple user control which wraps some logic around an AutoCompleteBox. This question could apply to any ItemsControl control like a dropdown or listbox though. <UserControl> <Grid Background="White"> <sdk:AutoCompleteBox Name="myACB" ItemsSource="{Binding myDat...

0
Q: javascript / jQuery / CSS - vertical text ?

AlexHi how can I make text draw vertically, like in this site: http://cure.org/help-now/ ? I see that it's done with jQuery + SlideDeck because I see them loaded, but how exactly does the plugin do this? Firefox has css -moz-transform, but other browsers don't have such properties, and the vertical...

/me whiny
 
I hate vertical text
 
yea, but I bet the customer is a paying customer, and the customer is king, we are but code monkeys :)
 
oh those aren't my questions
those are questions that I was either first on or that my answer gets buried on ... like I said "/me whiny"
 
10:05 PM
hmm i see, this SO chat is confusing, or "I'm just to old for this foo"
 
and as for vertical text, meh, parlor trick. If they need it, great. But usually I only see that for printed materials
 
with all these high paid web designers, the print world and web world is getting harder to tell apart..
 
what's worse is when you know you've seen an error before and the solution escapes you
 
highly paid
 
0
Q: ASP.NET web site can't see .cs file in App_Code folder

yeratowelSo I have an ASP.NET web site (not web application) I'm making in VS2010 with C#. It runs fine on my machine, but when I upload it to the site it's hosted on, it won't compile, giving: "CS0246: The type or namespace name 'DataAccess' could not be found (are you missing a using directive or an ass...

 
10:08 PM
Let me take a wild guess
 
yea, sigh I know the feeling
 
Maybe he's missing an assembly reference ;)
Or a using directive
 
but it says "directive or an ass" :) my ass is firmly on my chair
 
well since his code is not defined in a namespace, he shouldn't need a using directive
 
The word is cut off, I think it's supposed to say 'or an asshole ruined your build'
 
10:10 PM
lol
 
man I'd put that on a t-shirt
"an Asshole ruined your build"
funny they say that violence isn't the answer. I tell you know, if the last time my co-developer decided to hard code some sh*t, and I kicked him right in the balls, he most certainly would not do it again....
now
 
well, I've made some progress I guess .... 6403935 rows transferred
 
what r u using dial up :P
 
only 50 million more to transfer
lol, I think so
this is what happens when you let devs get lazy, we do shit like this
would've been faster for me to do an backup/restore probably
 
10:17 PM
why not do that, or is it too late?
 
except it's 8GB so I didn't want to bother ... I'll just let it run lazy like through my desktop
cos if it runs overnight I'm not really taxing anything
it's an unused table on an underutilized server, and I'm pushing stuff to production while I work on totally unrelated things
 
u say, that but i nearly burnt down my laptop once
 
so this way I can see exactly what my progress is
lol, ouch
 
mind you it was crunching stuff
 
fortunately this is a desktop and it can run all night like this
 
10:19 PM
but I also did actually burn down my desktop too, ehh I don't seem to have a good track record :)
 
I'm using about 2% of my 100Mbps connection on average according to task manager ... and at peak 8% of my CPU, averaging 0-2% of my CPU
eeps, egads man what were you doing?
tonight's not a patch teusday by any chance is it? ;) ... PC shouldn't auto-reboot
brilliant ... I love answering questions and getting shafted because I didn't go back and make them shiny ... anyone else get frustrated by that?
I know I know, go make 'em shiny ...
 
so what do you guys/gals do?
 
programming is a given...
 
10:23 PM
|.|
 
lol
I'm a scruffy nerfherder normally
 
wtf? is a nerfherder?
 
does it involve large vegetables?
 
does it autobox?
it does not autobox
 
10:24 PM
only special sites do
 
So I see
but that's a wikia site :( ;)
 
another SO user leaves in disgust... :)
 
I feel like a nerfherder sometimes
 
and I'm surely scruffier than that <-- looks
@Joren ... ya ya ya ... :p ... it oneboxes (I'll remember this eventually) wikipedia so why not wikia? ;)
 
10:27 PM
Maybe they don't think wikia is awesome enough
 
woohoo sympathy rep ... thank you to my anonymous donor
 
I'm more of your 'normal' header, I prefer herding lambda's
arg herder....
 
lol, that's what the edit button is for @Darknight
@Joren, how is it you have never asked any SO questions?
 
too lazy..
 
ok, so try the up arrow
 
10:29 PM
@drachenstern Never had anything interesting to ask
 
hmm i see
 
@Joren well I guess that counts then
 
I'm a pepping pervert? I dunno, I'm sure I;ve asked SO questions
arg, u was asking Joren...
 
I tend to figure things out for myself
Maybe now that I'm actually doing some professional development work I might eventually have some questions
 
arg man, spelling is my weakness
 
10:31 PM
perhaps
 
@Joren your ment to say, that you use SO excellent search... :)
 
That as well
 
and I love when I goto post a question, get it all framed up, then have that /facepalm aha moment
 
Yeah, I try to have that before asking a question :P
 
yea sometimes actually explaining the problem solves the issue
or makes it clearer
 
10:32 PM
Questions are Serious Business ;)
 
wise man once said:
 
But yeah, this chat is nice, since now I can at least just discuss the issues I do run into
 
"Ask a question, and you have half the answer"
 
yep
also, I used to do that with my boss when I was troubleshooting electronics. I'ld goto him and say "make sure I'm not doing something just obtuse" ... then sure enough while explaining it I would walk off mumbling to myself
 
Anything that has a completely objective answer is something I in principe want to figure out for myself, and to that end I consume massive amounts of documentation and blog posts ;)
I'm not really a pragmatist when it comes to solving technical problems like that. Maybe because for the past six years minus the last month I've only been doing hobby programming
 
10:36 PM
@Joren I agree, but only do it on your own time, in production sometimes deadlines means needing to ask
 
@Darknight very true
 
as some devs have - "bang that Sh*t out"
code of couse!
 
@Joren I try to figure them out for myself too, but then there's things I don't have the skillset for. For instance, all the finer workings of IIS (which I want to teach myself, I really do)
ok, I think it's time to ~drachenstern for today
 
ah IIS, best to get yourself a server at home to play with, that's what I've done
 
@Darknight ... a VM is what I was thinking, on my laptop, so I can spin it up and down as I work on code
 
10:38 PM
@drachenstern Hmm, actually I do think that I might ask questions about serverfault and superuser problems. Those aren't things I do for fun.
But I don't do them at all at the moment, at least nothing remotely complex
 
yea vm is cool too
 
But still, so much stuff is easy to find on google or, of course, already on stackoverflow :P
 
nothing like the smell of 42U cabinet, with racks n racks of hardware....
cables, baby...
 
night all
 
nite dude.
 
10:40 PM
bye
 
8 other users, but awfully quite :P
speak, follow programmers, I shall not pull down your pants :)
fellow
o.o
(o) L (o)
 
Rye
10:57 PM
good morning csharpers
 
morning
only barely, but okay :P
 
11:55 PM
any news on publishing date for C# in depth 2? Still says "end of october" on Manning but no date yet
 

« first day (11 days earlier)      last day (4938 days later) »