« first day (957 days earlier)      last day (4005 days later) » 

4:00 PM
and you're a bad person for taking time away from those with skill because your f-ing lazy
 
Glad to see the level of discussion has remained lofty in my absence.
 
it hasn't been this riduculous in a long time :/
 
Hi Billdr, long time no see
 
sorry to everyone else
 
Hey Roel! How's it going?
 
4:00 PM
lol, what is this chatroom for anyways? C# or something? sorry I asked a C# question guys
 
I'll stop
 
@Billdr Same as always. Glad I don't work with PHP at all times!
 
I never said I won't learn regex... however I rather learn it on my own time versus company time because of my situation.
 
Yea... it's a struggle. Not having a proper debugger is making my head hurt; I can't see why stuff isn't working, I have to make guesses and observe results.
Code->Magic->Output.
 
@Billdr There are PHP IDEs with debuggers you know?
 
4:03 PM
@Billdr I believe they call that evangelical programming
*press F5 and pray
 
Hmm, I'm using eclipse, but I'm not seeing a way to go line-by-line once execution begins.
@deltree That seems about right.
 
@Billdr There is a plugin called XDebug, IIRC.
 
I will investigate immediately!
 
It's free and goes into your PHP plugin folder.
Then you need to let Eclipse attach to it.
PHP will remain to be crap, at least less so with a debugger :P
 
PHP is fun :)
 
4:06 PM
!
I really need a good UML tool right now
 
The funny thing is I wrote this application in a morning in C#. Damn *nix zealots.
 
Oh wait, I can use VS2012!
 
i was going to say, doesn't vs have one? lol
 
@Billdr Let them use NodeJS :-) Runs everywhere. Fun too
@Steve Brain failure on this end :P
 
or vizio
 
4:07 PM
NO >_<
 
LOL
 
They won't spring for any more windows licenses. I guess I could host it off my laptop.
 
Generic Question; How do most MMOs sort players efficiently to send only updates about those in range?
 
can i take a random stab at it??
 
Sure :-) (I have no good idea, so it's an actual question :-P)
 
4:10 PM
keep track of every players x and y coordinate, then find the distance between the two points
 
They only have to worry about players in a given instance. That's usually under 100.
 
Loop through tens of thousands of players for each change?
 
well, you have separate maps right
 
Yeah, but how do you get those 100 in range efficiently?
 
Who cares, it's 100 times through a loop
 
4:11 PM
@Billdr hi, long time!
 
Take a MMO with one big persistent world as example.
 
so you could have separate collections of players, one for each map, each with its own x and y coordinate system
 
Yo Johan!
 
like WoW
you can download map addons which tell the players their x and y coodinates on the current map
i'm not sure if thats the same data used behind the scenes, but i don't see why not
 
Eve would be the most interesting example to look at - but I don't think they have communications any more granular than the current system.
 
4:13 PM
@deltree why so angry all the time?
 
but then the issue comes up of when the players are on the edge of the map, then you'd need to some more math and cycle through two collections, which still shouldn't be too... inefficient
 
@JohanLarsson perhaps you could be more specific?
 
@deltree ok maybe not all the time but you seemed grumpy yesterday and today :D
 
@JohanLarsson the place I'm currently working has lied to me every step of the way about my job. On top of that, the programmers are incompetent on a level I've never seen before (even working with overseas teams). Add to all of that that I keep getting in trouble for stupid things like working 9 hour days instead of 8 and that I have 4 bosses none of whom take responsibility for anything.
I'm a little frustrated with incompetence
and @N00B.NET embodied that
 
imagines sad music playing while reading that
 
4:18 PM
ok but NOOB is a great guy ime, many are in this chat to learn also. That is the whole point of SO no?
 
He didn't even attempt to learn
he simply asked for a solution to his problem
someone else even said "rtfm"
 
ok the I know the reason :D
 
?
 
Is there a collection that can be enumerated upon even when its contents change while enumerating?
 
@deltree the reason you seemed mad
 
4:20 PM
still not sure what that means
@RoelvanUden I like queues
 
he knows the reason why you seemed mad....
 
@deltree A queue can be enumerated even when modified? :\
 
@RoelvanUden .ToList()?
 
you don't enumerate queues in a standard method
 
4:20 PM
foreach(var x in stuff) { stuff.Add("Haha!"); }
 
you dequeue each entity
or enqueue more entities
 
@JohanLarsson That makes a copy and even the .ToList can break internally
 
I think I would do foreach(var x in stuff.ToList()) { stuff.Add("Haha!"); } probably wrong flame away
 
it makes a copy as roal suggested
its not he same data structure anymore in memory
 
@JohanLarsson Johan is probably right here
it is right ;)
*wrong
 
4:23 PM
Imagine multi-threaded situation, Linq's ToList just enumerates and makes a copy. However, the actual enumeration can go wrong when the collection is modified in-between the enumeration process.
 
lol
 
So, is there a collection resistant to that?
 
ah multi-threaded
there is something...
 
There is no thread safe list I think, there are a couple of thread safe collections though
 
4:24 PM
The Concurrent namespace has a bunch of thread-safe collections, but enumerating over them is not thread-safe as far as I am aware.
 
@JohanLarsson if you do that it literally throws an exception btw
so you want to thread-safe enumerate, sounds like you will need to roll your own afaik
 
this worked:
var ints = new List<int> {1, 2, 3};
foreach (var i in ints.ToList()) { ints.Add(2*i); }
 
@deltree That looks good.
 
it enumerated forever?
 
no worked as expected, produced {1, 2, 3, 2, 4, 6}, the ToList() is evaluated once creating a copy I think
 
4:29 PM
then I don't think that will fit what he's trying to do
 
Pretty sure he's suggesting it doesn't throw an exception
 
list = list.Concat(list.Select(i => i * 2)).ToList()
 
oh, then I was wrong, I've seen the exception (just the other day) with .remove, so I just assumed with .add it would, my bad
 
worked with remove also foreach (var i in ints.ToList()) { ints.Remove(i); } produced [] altough Clear() would be better
 
i figured it would lol, its iterating over the copy, removing items from the original
 
4:33 PM
@JohanLarsson whu?!?
 
I suk at threading stuff though, suk is not strong enough what is suk--?
 
you mean because you do the "tolist" inside the foreach declaration?
 
i can hack threading together, it does what i want it to, but i'm sure its full of bugs and race conditions i'm not even aware of
 
@deltree yeah
 
neat trick
 
4:35 PM
The link @deltree provided is perfect for my situation. I want to enumerate without modification, and it does exactly that.
 
good :)
nice post deltree
 
but I was still wrong
and that may help me with a project I'm working on
 
and we still love you :D
 
I created a second list of items to remove, then iterate over it separately to remove items from my original list, I gotta fix that now
 
4:38 PM
the devil woman was nice to me today
 
@Steve Miss DBA?
 
wonder why
 
@ShotgunNinja lol yeah
 
Women are always nice to me.
 
@KendallFrey It's because you have a baby face.
 
4:41 PM
kendall, when was the last time you saw a woman who wasn't related to you lmao
 
Oooh, I think I just strained my sarcasm generator
 
@KendallFrey Might want to see a doctor about that.
 
@Steve Let me think... Sunday I believe.
 
@KendallFrey :( ruined my funny
 
@KendallFrey at church?
 
4:42 PM
Actually, yes.
 
@KendallFrey aren't people supposed to be nice to one another at church?
 
the only time i went to church was while i was in the marines, in a weird sense i kind of miss it, i was never raised to be religious
 
I used to go to church with my family when I lived at home. Nowadays, I don't go, mostly because I'm often busy on Sundays, and also because I feel that church and faith have gotten separated.
 
very good point
 
This message is making me lie. So I will lie. Yes, I did implement the change in version X.
 
4:46 PM
I see too many people going to church because they feel guilty about their daily lives.
Instead of learning from the lessons religion teaches, they use it to make themselves feel better after doing something wrong.
 
-1 * 6 + 6 * 1 evens out
 
i do wrong
 
So is church worth 6 conscience points?
@Steve You missed a word. *everything
 
lol you dick
 
... everything
verbing ftw
 
4:48 PM
turns 18 again, i did your mom right last night, ooooooo
 
Oh, so you were the guy I passed on the way in?
 
lmao what. the. f.
 
heh hehe
I have a sick sense of humour.
 
i enjoy it, its entertaining
 
You have a sick sense of humour too.
 
4:50 PM
i know i do
sick is putting it mildly
 
inb4 dead babies
 
orphans
If an orphan dies, is it still an orphan?
 
dead orphans?
 
lmao
 
I believe that makes it soilent green or something
 
4:52 PM
soilent green? wtf
 
@deltree i almost watched that movie a couple of months ago, i completely forgot to
 
I know what green is, but what is soilent?
 
its a movie from like the 70s
 
Soylent Green is a 1973 American science fiction film directed by Richard Fleischer and starring Charlton Heston and, in his final film, Edward G. Robinson. The film overlays the police procedural and science fiction genres as it depicts the investigation into the murder of a wealthy businessman in a dystopian future suffering from pollution, overpopulation, depleted resources, poverty, dying oceans, and a hot climate due to the greenhouse effect. Much of the population survives on processed food rations, including "soylent green". The film, which is loosely based upon the 1966 science...
 
fk u vs2012, y u no support xna?
 
Thanks for reminding me, I forgot I had a reason not to uninstall 2010
 
seriously now i have to install 2010... this sucks.
 
same reason I had to install 2010 incidentally
 
ITS PEOPLE
oops spoiler
 
OH NO!
 
4:56 PM
@drch not people, its no-lifers here.
or noobs and nerds
 
@drch lol thought about saying that
 
Screw it, the answer in C# is to read line by line. I hate php.
 
what does reading c# line by line have got to do with php?
 
What does Soylent Green have to do with anything?
 
what does bacon have to do with anything?
 
5:01 PM
what does Kendall's mom have to do with anything?
 
what does soylent green have to do with people?
 
My data has actual new line characters, and a string that looks like a new line character. C# would distinguish between the string and the character. php does not.
Or if it does, I don't know how to do it.
 
I will have to purchase the film, sounds interesting.
 
@Steve @ShotgunNinja a lot more than you would expect
 
Hi Kendall.
 
5:02 PM
@Billdr what are you trying to do exactly?
 
@Billdr newline is CRLF in windows
\r\n
 
@Billdr Sorry, you caught me during one of those off times when I'm not high.
 
or my favourite solution - Environment.NewLine
 
I've got a big text file that I need to load into an array. From there I need to compare elements of that array to a database, and return the results.
I think a liberal application of regexps is going to make my life easier. (Said the idiot.)
 
streamreader will read line by line and it will handle \r \n or \r\n
 
5:06 PM
It sure will.
 
What must I say to get a starred comment?
4
 
that makes my amazing comments so cheap
 
Thanks :)
 
Is Kyle's leaderboard still a thing?
 
Bob
@Billdr I only recommend using regex when large amounts of HTML are involved.
 
5:08 PM
@Billdr Yes and no.
 
god I wish there were html involved. I could base my explosion on tags.
 
Yes, the code is still available, no he does not maintain the site.
 
as is, the data source is an inconsistent nightmare.
Wow, I'm the last commit on that? Jeepers.
Also, I'm #2 until the site dies. I'm fine with this.
 
Who's number 1?
;)
 
link the site
 
5:10 PM
Looks like you're on top. Must run in the family.
 
HTML is not regular, many tags have optional closing tags etc, so RegEx is NOT suitable. There is a very funny SO post answer on this.
 
.NET regex isn't regular either.
 
Anyone know that post?
 
5:11 PM
yes, pretty sure everybody knows about that post lol
 
lol lol lol
 
but who's talking about parsing html with regex?
 
1330
Q: RegEx match open tags except XHTML self-contained tags

JeffI need to match all of these opening tags: <p> <a href="foo"> But not these: <br /> <hr class="foo" /> I came up with this and wanted to make sure I've got it right. I am only capturing the a-z. <([a-z]+) *[^/]*?> I believe it says: Find a less-than, then Find (and capture) a-z one or ...

 
I parsed HTML with regular expressions. It works absolutely fine if you do it correctly.
 
Some time I'm going to write a simple XML-matching regex. Just to prove I can.
 
5:12 PM
lol
 
One regex to match an entire XML document.
 
quick, somebody link the most downvoted question on SO
or answer, idc
 
hmm that starboard should be easy to whip up
 
-34
Q: Why does i|= j|= k|= (j+= i) - - (k+++k) - - (i =+j) == 11?

Jeremy BanksI came across this code in a project I have started working on. The original developer is no longer available, and I can't make any sense of it. k = (j = (i = 0) + 2) + 1; return i|= j|= k|= (j+= i) - - (k+++k) - - (i =+j); It produces a value of 11. How does this work? What is the =+ operato...

 
5:14 PM
meh whats the fun in that
 
ok, I'm off home. Buy all.
bye.
 
Laters
 
-44
A: Rhino Mocks, TypeMock, Moq, or NMock? Which one do you use and why?

Jonathan AllenI don't. When unit testing, I prefer to test the real code and not just some imaginary scaffolding. If I really, really need to mock something out, then I use conditional compilation. Just wrap a #If around each version of the class and away you go. EDIT in response to questions: How do yo...

 
Bob
It seems like writing a question with that many negative votes takes a fair amount of skill/luck
 
Quite literally one-in-a-million
Wait. Let me find a deleted question.
 
5:19 PM
@KendallFrey thats really an interesting post
 
This is the most downvoted question:
-148
Q: How to send 100,000 emails weekly?

xRobotHow can one send an email to 100,000 users on a weekly basis in PHP? This includes mail to subscribers using the following providers: AOL G-Mail Hotmail Yahoo It is important that all e-mail actually be delivered, to the extent that it is possible. Obviously, just sending the mail conventiona...

Are. You. Kidding. Me.
 
only 148?
 
It would undoubtedly be more if it was still unlocked.
 
I got nearly 2% of that for asking a silly nubcake question.
That is way too close for comfort.
 
Yesterday?
 
5:23 PM
Sweet, I'm still #25 on the star leaderboard.
 
Yea
 
gotta love these -
839
Q: What's your favorite "programmer" cartoon?

Dan WilliamsPersonally I like this one: P.S. Do not hotlink the cartoon without the site's permission please.

 
@KendallFrey love was such an easy game to play?
 
where am i on the star leader board?
 
@ShotgunNinja ?
 
5:24 PM
Oh cool, I got more downvotes. PHP devs are so friendly.
 
Bob
Not to drag this off/on topic, but when overriding Button's onPaint in windows forms is the drawing space limited to the button's existing borders/rect? I can't seem to draw outside of it...
 
@Billdr What was the quesdtion?
 
@RoelvanUden It was essentially "Why am I not catching my error with any of the three tools that should catch errors, also why is this producing an error?"
The answer was the server has to be configured to show errors (even when requested) and global variables can only be used in functions when explicitly declared inside the function.
 
@Billdr You might want to link the question here? Just because we prefer not to use PHP, doesn't mean we're not better at it than the average run-of-the-mill PHP developer.
 
Ah, flashbacks of C.
 
5:28 PM
0
Q: Why am I not seeing an error message?

BilldrI'm feeling my way around php for the first time in years. I'm trying to perform a simple select statement. I've confirmed the statement works directly against mysql. My php does not complete. I'd like to know why my real_query isn't working, I'd also like to know how to coax an error message out...

I got it figured out, eventually.
 
@Billdr "echo "teeheehee"; //doesn't display" lmao
 
You say, more downvotes. I see, more upvotes. wtf
 
Using global and such. Also, SQL injection opportunities there Billdr.
 
where's the injection?
There's no user input
 
It's still bad practice.
 
5:29 PM
What is?!
 
if($mysqli->real_query("SELECT * FROM gem, bundles WHERE gem.nid = bundles.baseNid AND bundles.nid = " . $nid))
that
 
Not using prepared statements.
 
Parameters
 
inserting values directly into your sql query
 
5:31 PM
@KendallFrey It's from the song "Yesterday", by the Beatles.
 
Protip: You can do "bla bla $nid" instead of "bla bla " . $nid (fuck you, PHP)
 
Someone want to write that query correctly?
 
@KendallFrey I always thought that was pretty cool, until I actually had to use the dollar sign for something.
 
Does that mitigate the injection concern, Kendall?
 
@Billdr No, it makes it worse.
@ShotgunNinja So use single quotes.
 
5:32 PM
@Billdr In PHP you can use PDO.
Then you can use ? as a placeholder.
 
$db->execute("SELECT * FROM users` WHERE id = ?", $id)`
IIRC
 
if you're using mysql you should mysqli because it has a bunch of extra stuff specific to mysql that pdo doesn't
 
I am, and I am Steve.
 
had a pretty long discussion in the php room maybe six months ago about this same topic
 
5:35 PM
You can talk long or short about it, but if doesn't boil down to using prepared statements underwater, the conclusion was wrong :P
 
Bob
In case this brilliant thought ever occurs to anyone, adding this.Height = this.Height + 10; to the end of a draw event does not help the situation and ends very badly in design mode when the controls get rendered.
 
Food. bbiab.
 
@Bob lol
 
@RoelvanUden yeah, absolutely prepared statements are the way to go
 
php also has that lovely auto globala feature that turns request parameters into global variables
 
5:45 PM
i thought they turned that off so now you have to use $_POST or $_GET
 
@bob didn't they do that with the find dialog in VS2010?
 
by default... since like php4
or 3
i hate questions that don't say what the problem is right off the bad, i don't wan to read your 100 lines of shitty code guy
 
it's off by default since 4.2 but the setting still exists
 
I have a filter that I am running on a lot of divs. Perhaps something like 5000 of them, so performance at a micro op level has become important. One place that I have found where I can gain performance is in the way that the filter hides or shows an element. I made a jsperf to try to determine if I should hide/show them as I find them, or if I should mark them and then do it all at once later.
It seems that firefox can do the work as they are found without issue, but chrome will choke and lock up. Is there a better way to approach this than using if(flag)$(this).hide();else{$(this).show()} inside of the each loop?
any ideas?
 
@drch ahhh
 
5:50 PM
@TravisJ I wasn't aware that jQuery was written in C#.
 
5000 O_o
 
you can remove the branching and do a lookup but I doubt that micro of an optimisation would help
 
@Kendall - And now you know
 
link the jsperf
 
The perf is inaccurate imo though. Because if I try to do that in the actual scenario, chrome locks up
 
5:54 PM
hmm well that jsperf is obvious that it would take twice as long since your operating on the collection twice
 
But that is not the case, operating twice on the collection will not lock chrome, whereas doing it inside the each loop locks
 
just have a .hide class that has display none
 
will try
 
when you modify inline styles it has to rerun the CSS rules
but adding a class shouldn't add that overhead
 
k
testing
 

« first day (957 days earlier)      last day (4005 days later) »