« first day (632 days earlier)      last day (4314 days later) » 

9:01 PM
@Hans You can't fall down in C# switch
 
@AmmarThebadprogrammer which is exactly why c# case statements should be braced
case 1: looks like a label to me
 
@AmmarThebadprogrammer - If you had a lot of if statements to deal with, and did not want to switch to a bunch of case statements to deal with, then you could try to have a dictionary where the index was the statement to switch on, and the value was the type to pass to a generic method which would then do all the work. However, it could become a little involved.
 
ohh .. sorry I missunderstood what you said
 
@AmmarThebadprogrammer Not true
you can fall down in c# switches
if the case is empty
 
oh really? Didn't know that
 
9:04 PM
case 1:
case 2:
case 3:
    break;
that works
 
I agree, that does work
 
if the case isn't empty, it won't work though.
so you'll need to use a goto shudder
goto case 4;
 
anyway, ima get back to my busy work. Thanks
 
But be careful of
case 1: i++;
case 2: i++;
default: break;
because switching on 1 will cause i to increment twice.
 
9:05 PM
@TravisJ nope
syntax error
 
No? It won't continue on?
 
those aren't empty cases
so it won't fall through
 
hm
So there is a required break if the case has arguments?
 
ahh
even if a default is defined?
 
9:06 PM
yes
 
been a while since I had to write a switch statement
I like generics :)
 
well .. I just found out about the HTML "Disabled"
Rage
 
What is the 'HTML "Disabled"'?
 
I'm gonna guess its where you disable HTML
 
<input type="text" disabled="disabled" />
that?
 
9:08 PM
it would disable a drop down list
ya
 
yeah, disables a form element
 
tldr I had a list on my view and I was doing things l;ike that
 
makes it "greyed out" and read only
 
@{ string returnedReviewType = "ERROR";
if (Model.propertyAppraisalEntity.ReviewType == "CAPMKT")
{
returnedReviewType = "Capital Market";
}
else if (Model.property
 
Ah, I usually would just remove the control and replace it with a label if it is locked.
 
9:09 PM
that works too
and IMO, a better user experience
unless the user can unlock the field
I.E. via a checkbox
or a selection in a drop down
 
User can always unlock it by editing the local page too
 
But if they add in an input it will most likely violate the ModelState
 
which is why server side validation is important.
 
indeed
 
9:10 PM
@TravisJ example please? not sure what you mean by control
 
seriously, don't skimp on server side validation folks.
 
@AmmarThebadprogrammer - Any <input> is technically a control. <select> is also in that family
 
@AmmarThebadprogrammer control in this regard is a texbox, or a dropdown
 
wouldn't disabled="disabled" mean the disable is disabled making it broken?
SIR, We cannot disable the Hatch.
WHy?
Because it's disabled!
What? The Disable is disabled? THE HORROR
stupid html4...
stupid ie...
 
@RyanTernier lol, you'd think.
 
9:12 PM
lol
 
@TravisJ thanks
 
Yo dawg...
 
Html makes no sense sometimes
 
I generate almost all of my html from javascript
 
that's gotta be painful
 
9:13 PM
I wrote an API that does most of the work for me. The upshot is that I get o(1) search to dom objects and the whole page can be dynamically changed at runtime.
 
double U, Tea, Eff
 
@TravisJ I want/need to see this.
 
plz wait until i am gone...
 
Can you email me your code to "Code4SaleCheap4You@google.com"?
 
lol
does anyone have any experience
 
9:15 PM
@KyleTrauberman - The elements are wrapped in a closure named Panel. I then have a PanelFactory which holds an array of them with an autoinc primary key. Each time a panel is created by the factory it returns the primary key which is held in the code that is building the page. That way there is easy reference.
 
@KyleTrauberman Nope, no one at all.
 
lol
late edit
 
Not an single person on the planet.
 
Does anyone have any experience with Kerberos? </longshot>
 
I have no experience with that either
Looks interesting though
 
9:16 PM
I'm running into the infamous Double Hop issue.
its a PITA
I'll ask on server fault
 
obligatory google search
 
This is the problem:
 
<summons Topper>
That's nothing. I create a Pearl application that generates JavaScript script based on random thoughts that I have while making Toast which resulted in HTML8.2 which was so advanced that I was bought out by a consortium of MIcrosoft, Google and Apple. I only exist now as digital 0, 1, and 2's. Yes I created 2 as well.
 
0
Q: Client Object Model gives 401 when impersonating logged in user - MVC App

Kyle TraubermanI have an ASP.NET MVC app that connects to SharePoint 2010 via the Client OM. When I run ExecuteQuery(), I get a HTTP 401 error from SharePoint. I have the MVC app set to impersonate the logged in user. The impersonate setting in web.config (of the MVC app): <configuration> <sy...

ignore the SharePoint pieces
its an IIS issue.
 
@RyanTernier - 0012 0022 0012 0001
translation: lol!
 
9:18 PM
Oh god, the double-hop issue
My boss refused to implement Delegation, so we ended up using basic authentication
 
I know, right?
 
@TravisJ
How did you know that story?
 
I outsourced our application hosting so that I wasn't liable for security :)
Oh s<IE>t, NPH!
 
Can't argue with NPH
 
i have this on my wall
 
9:24 PM
lol
That sounds like something a CFO would say
 
Is that from Head First?
looks like something from their books.
 
@KyleTrauberman Is your server set up for Delegation?
 
I'm completely lost with Kerberos, so I don't even know where to check that
One of the other guys here has been helping me
 
the service account has delegation enabled
and we checked the SPNs
@Hans that's what I thought.
I love those books.
 
9:28 PM
yep, my first 3 programming books were head first java, head first c++, and head first python
 
I think you also need to give the Server machine permission to delegate
 
Head First Design Patterns is good too
@walkingTarget do you know how?
Sorry, I'm a bit of noob when it comes to IIS and Kerberos
 
It's a setting in Active Directory
 
9:29 PM
I hear Head First Programming is a great resource for entry entry entry level programmers
 
Eh, don't worry about it
I wanted to bash my head in working on this stuff
 
yeah, its so painful
 
is there a set of icon images for winforms
 
@Hans Open Icon Library?
 
9:31 PM
nothing windows provided?
 
@Hans VS comes with a set of icons
 
@KyleTrauberman You mean the default icons for toolbars? Or something more?
 
and I've used the Silk Icon set before: famfamfam.com/lab/icons/silk
The default icons on the toolbar, but they are free for use in your apps
as long as you don't change the meaning of the icons
 
oh nice @walking
that's what I needed
 
9:37 PM
^Today's dilbert :)
 
image not found
joke not found
 
Got my first bounty today.
 
Nice, but I would have though you had a bunch by now. What did you get a bounty for?
 
It was an auto-half bounty, but still.
2
A: creating an advanced metronome in WPF (problems with code created animation and completed event)

Kendall FreyThis might not be easily implemented with WPF animations. Instead, a good method would be a game loop. A little research should turn up lots of resources about this. The first one that jumped out at me was http://www.nuclex.org/articles/3-basics/5-how-a-game-loop-works. In your game loop, you wo...

 
9:43 PM
@KendallFrey that was my first bounty too
 
I bountied jon skeet 250 once
Only because his answer saved me like 5 hours of work
I implemented soft-deleting for records in my database, and managed to get a single controller to handle the "deleting" or "restoring" for every table in the database.
 
Soft deleting, like deleted=true;?
 
Yes, but I use a temporal design.
 
Like source control?
 
Date DeletedOn
String? Reason
Bool IsActive
int DeletedByUserId
 
9:50 PM
Half way in between. That's cool.
 
why are interfaces icky with delegates?
 
I haven't got to test with a large data set yet, but I am considering partitioning it based on the IsActive field
 
@Hans How so?
 
I can't define a delegate inside an interface
 
I am not familiar enough with delegates :(
 
9:52 PM
which means I need to create a separate file that defines the delegate and then include it in my interface
 
Specifically, "interfaces cannot declare types"
 
Can I specify a delegate's method sig inside a function's parameter list anonymously?
 
Not that I know of.
 
well not method sig, but return type/parameter list
 
I do know that Func and Action made custom delegates basically unnecessary.
afk
 
9:54 PM
I use Func
we got the Func..no? nvm
 
but Func doesn't let you specify multiple inputs, no?
like Func<int, out int, out int>?
 
I use this to add arguments to a query:

var exp = new Collection<Expression<Func<SomeDBClass, object>>>();
But that is only single input
 
I guess I can Func<ICollection<object>,ICollection<object>>
but that seems icky
I don't wanna work too hard on this this is all gonna be deleted once a working prototype of the upstream stuff gets done
oh wow okay so Func<string, string, string, string, void> is a method with the signature void Delegate(string, string, string, string)
this works up to 16 times because that is how many overloaded Func's MS has.... lol
 
Don't make me go variadic on yo ass
 
@Hans Funcs have n-1 inputs
where n is the number of type parameters
the last is always the return type
 
10:02 PM
Func, according to intellisense, has exactly 17 overloads, with 0-16 inputs and 1 output
 
so let's say I need to get the average of 17 ints and I need to write 1 delegate to do it
too bad :(
No Func for you
 
so you want 17 inputs?
 
well granted it's an extreme case but I can't help but think MS could have defined this language feature in less of a clunky way
 
yeah
I wonder if you could use params in a func
probably not
 
10:05 PM
well I'm using a func as a param
in this interface I am writing, which I am tempting to name "Parliament" because we've got the Func
also it makes me sad that I can't specify constructors in interfaces
 
yeah, no params in funcs
if you need to specify constructors, use an abstract base class.
 
but multiple inheritance!
 
ahh, you're already inheriting?
then you don't need constructors
 
yes, otherwise I would have a base class for this already
 
interfaces specify the public interface for a class, something that constructors ain't.
 
10:11 PM
Multiple inheritance isn't allowed...unless you chain it! :)
 
yep, chaining is allowed
but discouraged
 
Yeah, I wouldn't suggest it.
 
unless if you have a SOLID reason to do so
 
Some people like to hack or something I guess.
 
right
a smaller inheritance chain == better
 
10:12 PM
like Polygon <- Quadrilateral <- Rectangle
 
Tell that to the WPF design team.
 
@Hans you could always create your own 17 input func.
This is all a func is:
 
Sometimes I want to ask an SO question but I google things and do lots of research to back my question up and then I solve my own question and I feel sad because I lost out on an opportunity to ask a great question
2
 
 public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, in T6, out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6);
 
WPF design team ->
 
10:14 PM
@hans answer your own question
 
its not discouraged, there is even a checkbox a the bottom where you can enter the answer before you even post the question
 
lol @Kyle I'm not saying I need a 17 in/ 1 out Func, I'm just saying that the fact that Func is implemented as 17 different functions overloading each other is silly
 
But but but...
I know :)
 
10:15 PM
like for example, if main in c looked like
 
that was probably their reason for stopping at 16
who in their right mind would need more than that?
 
lol
 
if you do, refactor
 
public int void main (char* arg1);
public int void main (char* arg1, char* arg2);
public int void main (char* arg1, char* arg2, char* arg3);
 
Nooo...
 
10:17 PM
I think their reason for stopping at 16 is because they didn't want to have to make the poor JIT compiler find the correct Func out of 64 similar looking method names
 
@Hans JIT doesn't care about type names.
 
Oh of course, Action is implemented similarly
 
@TravisJ I just realized that's Alf.
I thought it was a dog.
 
16 is an awfully suspicious base 2 number
lol @Kyle
 
is different method signature overload in the same way inheritence overload is?
 
10:20 PM
@TravisJ 2^^3, why?
@Hans You mean overriding? No.
 
what is inheritance overloading?
 
@Hans what's wrong with public int void main (char** argv)?
 
2 ^ 4? Just saying, if there are 16 total it is probably a memory assumption or something similar that was behind the reasoning
 
@TravisJ if that's the case, then why didn't they stop at 15?
so there are 16 total type params
 
@walkingTarget nothing, I'm pointing out how silly func overloading is
 
10:22 PM
@Kyle - Not sure
 
@Hans Someone needs to point out how silly you are.
 
but I was pointing out how silly Func was using a silly example
:( pout
 
Argh =/ I left something working, came back to it, and now it is only working sporadically.
 
Le awesome Mandelbug.
 
when googling Mandelbug I found this:catb.org/jargon/html/koans.html
 
10:31 PM
Hmm, I think I'd rather use a delegate instead of Function<T> when I can
 
i don't think you can use a delegate without defining it first
and I can't define in a interface
 
Can't define a delegate in a namespace either?
 
I can, but I'm not sure I want to make it namespace scoped
seems not very solid to me
 
What's the advantage of putting it inside an interface?
If you could, only derived interfaces could make use of it
 
Code review tip of the day:
Int32.Parse(GetSystemCode(oidCode).ToUpper())
Casting a string to upper case increases the chance of it being a number.
4
 
10:33 PM
So essentially, isn't an Abstract Base Class with a delegate just as good?
 
@RyanTernier lol wtf
 
@Ryan: You crack me up.
 
@walkingTarget not if you need to implement multiple of these interfaces I'm creating
 
Hey Kendall, you going to be around in a bit? I have a RegEx question to ask you if you don't mind.
 
Hmm, I'm gonna think about this, bbl
 
10:35 PM
Regex!!! I "^(\<[3])$" regex
 
@RyanTernier Yes! I love those!
 
dafuq
 
Frick if I downloaded that I'd probably get every acheivment in the book, then they'd get taken all away for the amount of AntiPatterns in our code haha
 
10:37 PM
I think I would get the achievement for F10/F11 10 times in a single debug session hourly
 
All code files consist of two parts: 1. An anti-pattern. 2. An empty string.
 
You get one for just installing the thing
 
That just makes me angry thinking about it.
 
    @KendallFrey
    Ok. I Have the following snippit of XML, and I need to regex the 10 digit # that starts with a 9. (I actually want to replace it with ***)

     <reasonCode code="xxx" codeSystem="xxx" codeSystemVersion="xxx" displayName="blah blah. (9999999999)">
    	<originalText>Error: blah blah blah. (9999999999)</originalText>
    </reasonCode>
 The # **may** or **may not** be surrounded by a special character, but it will definately be not surrounded by a letter or a number.
the regex needs to look within the <reasonCode> tags
 
10:41 PM
What if it is surrounded by a letter or number? Can that happen?
 
Hah, fixed my Mandelbug
 
can't be surrounded by a letter or number
it can be "9999999999" (9999999999) |9999999999| ~9999999999%@ but never a9999999999a or 099999999990
it could also just be spaces
 
Could there possibly be a case where there is a 10-digit number surrounded by invalid characters?
 
it was a copy paste error but it was deep in an

if()
{
}else{
 if()
 {
 }else{
   //copy paste error
 }
}
 
so <reasonCode> [could care less about this] 999999999 999999991 [blah blah] </reasonCode>
I should get both numbers out of that
 
10:43 PM
If so, should that number be ignored?
 
invalid characters like Æçë?
 
Or a, 1, 7, f, etc.
 
surrounded by anything other than numbers/letters
 
surrounded or containing?
 
Answer me straight. Can the string 9999999999a happen?
 
10:44 PM
no
 
OK, so why not match 9\d{9}
 
What if you somehow got a hex or a binary? 1FFh x1010
 
@RyanTernier could those numbers occur outside<reasonCode> elements?
 
Will that match "999999999" 0(999999999)0 ?
@kyle they could, but I don't care about them
they have to be inside <reasonCode>
 
then you'll need to include that <reasonCode> check in the regex
otherwise it will check everything
 
10:47 PM
It matches any 10-digit number beginning with 9.
 
yes, but i don't want to check outside of REgionCOde
hmm, actually that'd work..
 
Can you pass just the tag's inner xml to the regex? It would make it so much simpler.
 
can code, codeSystem, or codeSystemVersion be 10 digit numbers?
 
This isn't HTML haha
 
10:49 PM
Same idea.
 
Reading that rant was like watching an episode of South Park. In the end, Kenny was splattered everywhere, nothing made sense, and I felt the need to go through it a second time to remove the look of wtf from my face.
Seriously, how did he get the text to do that from an SO editor?
 
He didn't
 
That's some form of math #
 
Hm, that is cool
 
10:56 PM
r̼̲̯͕̠ͩ̆̊̌ͥ̑͠e̲̤͖̥̥ͤ̈́s̢̼̝̝̪̥̫͔̘ͤ̈̓͒̒͘͘e̊ͯͯ͡͏͓͎̤͍n̴̞̮̗̩͈͕ͮ̉͛͐̈́̒͘͢t̷͇͇̥͈̐̂ͮ̍̋̿ͪͨ́i‌​̣͍͖̳̙̝̟̆̍̀n̟̯̟̻̜͙̦̲̚͝͞g͈͙̙̫͔̠ͯ̌̌̅̚͢ ̷̄͗ͮ̑ͤ̒͗҉̢̘̞c̸͍̞̙̙̋̈̍̄̓̊ͣh̸̩̤͆̿̈̃̓ͨͦ̕ã̷̾̐ͪͮ̈́͏̤̯̻ő̷̷̼̖̓͌s̙̮͐͋ͪͫ̔̌.́́
 
Ryan you broke my chat! Awesome :)
 
All it is is Unicode combining diacriticals.
 
Y͕͚̯̦̾ͣ̂͂̓̒̐ō̷̙͒̍̀͒̚u̶̶̼̝̯͓ͨ͌̀̿ͭ̄̅̐́͢ ̨̝͈̩̲͔͉͔ͫ́̐͂̒ͥm̷͎̠̤͊̊͑ͬͮ̔̆̈́ͬ͜ë̡̫͈͋̍ͤ͟͝ạ̧̖̟̖͍̠͓̼̓͑ͯ̒͑ṋ͎̬̩̟͋̋̀̀͝ ̝̻̬͚̗̞͋͛ͩ̎̄̂͒̉͟l̵̷̖͈̭̳̪̪͗ͣ̀ͅî͚̦͍ͯͭ́͌̈̃ͨ͟k̛̰̖̤͚̫̥̬̻ͤͦͬͭͤͪ̇̚͠ę̸̧͇͓̼̽̾͒̇͌͑ͅ ̵̥̖̃̑ͤͣ̀t̛͖̰͎ͭ͛̚͜h͙̤̞͙͑̅̅ͥ̋͑͢i̸̛̙͈͚̦ͧͭͩ̍̽ͫ̉̏s̥̲̼̖̥̿ͧͦ͒̆̍͑̕͝?̡͉̰̥͈̼̭̫͔͂̀̊ͨ̔
haha
 
Those character does not exist boxes run way off the side of the page lol
 
doesn't workin chat
 
10:58 PM
chat doesn't let you.
 
R̸̫̞̹̾ͭͨͫͮ̍ͭ̀̕y̝̖ͨ͡͝a̧̧͉̠̻͕̥ͮͦn̴̨̯̈́ͥ́̀̇͗ ̘̺̓ͪ̋͢T̡̻̤̹̩̈ͦͤͫ̆̀͡eͩ͂ͪ̄͋͂͗҉͔͍͎̱r̨̲̖̓͒ͧ͟n̴̛͍ͮ̂́ͪ́́̎͂ǐ̴̷̦͓͎͓̥̻͚ͪ͆̂̏̌͆̀ͅe̐ͥ̄̿̎̆ͧ̃‌​̶̬r͊͐̄͛̌̏ͮ҉͈͕͇̥͓
 
this works though: <(?:"[^"]*"['"]*|'[^']*'['"]*|[^'">])+>
 
<(?:"[^"]*"['"]*|'[^']*'['"]*|[^'">])+>
 
bahh, still has char not found boxes
 
<(?:"[^"]*"['"]*|'[^']*'['"]*|[^'">])+>
 
11:00 PM
<̣̫̮̦̙̗̖͔̲͎̬̰͙̗͇ͫ͛̆͊̉̎̓͐͑͠ͅs͈̣̮̩̻̭͓͈̮̳̦̤̹̃̔͒̉̈̈́ͥͫ͌̿̿͑̄͌̀ͭ̽ͪ͘̕ͅͅc̢͎̩͖͔̪͎̖̤̭̥̳͓͔͙̲̪͖̓ͯͮ̾̒͆̈̀̄́̅̋̆̑ͭ̕͡ŗ̺̹̼̪͔̱͕͇͙̼̤̽͐͌ͪi̴͎̩̪͖̪̟̞̱͎̹̇ͤͧ̿̚͞p̸̨̨̹̱̯̳͎̠͚͖͍͙͉͒ͬ̓̇ͤͪ̐ͅt̴̶̡̡͓̟̻̘͔̹͖̖̬͚̪͛̅͊̏ͣ͂͋ͭͦ͗́>̷̡̪͙̘͚̰͓̼ͤ̓̒̓ͫ̂̀̚̕͜
̪̖̤̞͚͇͉̮͌͒̇̑ͧ̄̓̔ͫ͘͠a̛̩̯̖̘̳̼̝̫͓̲̦͙͈̮̰̲̔̓ͪ̆̉̽̎̏̅͘l̉͌̔͛̽ͪͬ̃ͯ̓ͣ́҉̴͏͚̬͔̘̳̺̟̖̤̠̤͉̤̖͍e̷̖̻̼̜͓̩̲̦̿̿̒͂̄̋̔́ͭ͂ͮ̆̒͑͢͢ͅrͨ͑ͬ̈́ͬ̌̍̅͂͒̏̎̅͡͏̞̞̹̝͕̺̝̺̯͉̤͔̱ẗ́̍͂̇̽͊́͏̶̨̞̖̬͖̻̦̮̙̜̙̟͈͙̘̤̕ͅ(̦͚̪̝̻̖̱͕͍͕͙͉̺̣͚͇̮̊͒̎́̂̀̊̏͆̀̄͑͘ͅ"ͦ͒̉ͮͦ̈́͒͒ͬ͢҉̴͕̬̣̝̭̤͕͚͚̙̤́ͅͅͅ!̢̼͙̼̹͎̹͚̣͍̼̜̙͉̣̉͗ͯͣ͊̑̏̒̊͂̐͟͞͡ͅͅ"̷̢̧̹̖̤̲̤̭̥̩ͨ̄ͥ̇)͖̯͎̟̗̺͉̳͂̆̎ͫ̃̄͗ͩ̅̓ͧ̑̆ͭ͟͡
 
I see it now. Changed my font from Verdana to Arial.
 
no dice lol
@Kendall - I tried to flag this comment:
`Is it just me, or there is a wrong assertion in here? "Jon Skeet cannot parse HTML using regular expressions." BLASPHEMY!`
As "Other: Jon Skeet **can** parse HTML with regex!". But flags were closed :(
 
You misread the comment.
And I think it is because the post is locked.
 
I did misread the comment =/ And the post was locked =/
Clearly I need more coffee
 
Caffeine.On();
My friends have recently started a fad with espresso shots. Note: Normally hyper kid + espresso = scary.
 
11:19 PM
0
Q: Change chat font from Verdana to Arial

Kyle TraubermanVerdana doesn't allow Z̨͚͎͚̲͚̳̫̀̎͐̋̐͌͊͐͟͡ḁ̜͍̠̫̪̥̐ͣ͑ͣ͑ͫ̿̑͞l̶̶͕͈͍̉̆̋̍̅͋͐ͣ̍͝g̤̻̮͎̗͐̋̑̾ͬ̽͋͟o̜̹̜̙͕͉ͬ́͊ͤ͗̊̇ ̶̠̹̗̄̅̽͛͡T̳̤̓ͥ̀ͪ̍̕͞e͛͌̊ͪ̃͏͏̜͙̥̭̙͕̜͇x̨̱̖̘̹̩̬̮ͯ̎ͨ̓͒͘͠t̳͕̘̫̰͖̩ͯͫ̆ͨ to be used, whereas Arial does. I propose changing the default chat font from Verdana to Arial.

 
I wonder if that will compile...
 
!
testing
 
one of these days I am going to alert a "!" lol :)
 
@TravisJ !
 
11:31 PM
Winning
 
no one likes my suggestion :(
 
Happens
I am trying to get negative rep on meta
 
good thing I made it in jest
I even voted to close my own question
 
11:44 PM
hahaha
 
11:57 PM
!#@%
frick leave my computer open for one second
 
What was that?
 
THat was a punishment for leaving a computer unlocked
 
lol I missed it
Can .net applications run threads in the background? Aren't those threads subject to the application pool refreshing?
 
If a Senior finds your computer unlocked you will either have:
1) An email sent out to everyone saying drinks are on you
2) you invite everyone to dinner
3) you're background gets set to "that"
4) if you keep it open with a facebook link up well then that's just asking for wall posts etc.
@TravisJ are you talking about ASP.nET?
 
yes
 
11:59 PM
then yes.
and no
Closing the application pool will stop all background worker threads
 

« first day (632 days earlier)      last day (4314 days later) »