« first day (875 days earlier)      last day (3143 days later) » 
00:00 - 21:0021:00 - 00:00

9:00 PM
0
A: Improve code of BDDs in phpunit

PaulYour switch statements will run through until they find a break statement. Having the braces {} only defines a block of code and has no effect on breaking out of the case. switch (1) { case 1: { echo 'One'; } case 2: { echo 'Two'; } default: { echo 'Also default'; } } The one a...

 
9:14 PM
0
Q: How can I factor the strings, especially with the digits?

Terry WeissI'm working on an exercise that counts the number of even digits, odd digits, or zeros in a user-input integer (I made it a long so the user could put in more numbers). However I have a bunch of repetitive code when I'm building my output, especially about the pluralization of "[s]". Really, the ...

 
Anyone C#-ey around?
 
I am, but I don't know if I can help.
What's up?
 
I have two classes named Player, in separate namespaces.
One derives from the other.
How can I convert the base Player to the derived Player?
Explicit casts just don't do it.
 
I have no idea. I wonder if you can.
Why don't you work with the non-base player?
 
We can call them PlayerB is the base, PlayerD : PlayerB is the derived.
Well, the base player is what is sent over the network.
Omg I think I just figured it out.
 
9:16 PM
Yes, I know how to derive. Does the base player have all the information the derived player needs?
 
@Hosch250 Yes, it only adds one property and a few utility methods (drawing, etc.).
 
Could you use as?
 
No, because you can't technically cast a base class to a derived type.
But, I can create the derived type from the network data, now that I think about it.
 
Either that, or you'll have to do something like PlayerD p = new PlayerB()?
 
@Hosch250 Tried that. :(
 
9:18 PM
Huh.
 
But, what I can do, is change how it deserializes the network data.
And have it deserialize directly to PlayerD, instead of PlayerB.
That's a rather large rewrite though.
That should work because the PlayerD class inherits all the netcode from PlayerB.
 
9:32 PM
So much smell. Definitely going on CR later.
 
@EBrown you can. it's just not right.
 
@Mat'sMug Well I made a FromBase(PlayerB) and a private constructor that both do exactly what you think.
I cheated and made it smell.
 
base class should have no knowledge of its derived types. I smell a fishy design
 
@Mat'sMug Well the problem is that the netcode exists in LibA, with PlayerB. Whereas the PlayerD is in LibC.
And they have to remain separate, as LibC is XNA specific.
As is PlayerD.
Wut.
Now it's borked somewhere else.
 
looks like PlayerB has functionality that PlayerD doesn't have. Are you missing an interface?
 
9:39 PM
@Mat'sMug Probably.
Now I'm getting an exception when I instantiate the camera.
Woah. This is funky.
Well, this is another smell.
YES
While it might have some smells, it works.
 
I know the feeling.
My current project smells like rotten fish, but it works.
It's an abomination.
 
I would almost be willing to part with $100USD to get someone to go through this and fix my bad paradigms.
But alas, I cannot afford it.
 
@EBrown If licensing isn't a problem, just put it on CR.
 
@Mast Licensing is a huge problem for it.
I need 24 rep to get the next privilege, this feels like a cruel joke.
 
Monking
 
9:50 PM
Ask a colleague to take a look?
 
possible answer invalidation by Jamal on question by Ilya Peterov: codereview.stackexchange.com/posts/105758/revisions
2
 
@Mast Lol I have none.
I am the only programmer on this project.
And I can't share it with anyone from work.
> Don't omit braces. Ever. It's such a bad idea (I learned this the hard way).
First line of an answer I'm about to post.
@Mat'sMug That one is for you. ;)
Thanks, Santa!
 
You're welcome ;-)
 
@Mast in a couple of years, when CR becomes mainstream, open-source software will start being known for being better engineered than closed-source paid-for software.
 
How has everything been going in the world of Code Review?
 
9:52 PM
I've fixed more bugs in Rubberduck in 24 hours than in the past 3 months
 
Oh wow, someone upvoted a couple of my SO answers.
 
That was unexpected.
 
@Mat'sMug I've heard people uttering that dream for years now. It's slowly getting better.
 
@Mast correlate with CR's growth ;-)
 
9:53 PM
@Mat'sMug There was a time when CR didn't exist and still talked about it ^^
 
Thanks again, Santa!
 
Just about 2 months left for the semester! Just about 1.33 finished.
-1
Q: Too much nesting

Curtis CreweI'm putting together a little application and it requires about 6 if statements to verify actions, here's the code I'm using: if($player[0]['value'] == $server->clean_attr($row['attr1'])) { if($player[1]['value'] == $server->clean_attr($row['attr2'])) { if($player[2]['value'] == $ser...

I almost threw up on my screen over that ^
 
I no longer omit braces, by the way.
Bad things happened earlier because of it.
 
@Hosch250 lol
 
@Hosch250 I wondered why it was still open. Luckily my edit put it back on the front page. Close votes did the rest.
 
9:59 PM
Man, new SO privilege and new CR privilege. Must be day-after-Christmas in September.
2
 
in VBA Rubberducking, 7 secs ago, by Duga
such a simple fix, for such an annoying bug!
 
Been jamming and programming all day, pretty successful I'd say.
 
last 24 hour pulse:
> Excluding merges, 1 author has pushed 10 commits to next and 10 commits to all branches. On next, 107 files have changed and there have been 11,672 additions and 9,577 deletions.
13 closed issues
 
I should write some code for RD.
 
10:02 PM
124 open, 440 closed
 
I'm sick of fighting Roslyn, I'm pretty sure some of the issues are because I'm on an 8.1 upgrade instead of a clean 10.
 
@Mat'sMug You should see mine.
The IRC bot has been going crazy today.
 
@Mat'sMug Wow. All in one day?
 
So, I have all the 8.1 SDK's and stuff.
 
@Mast yes!
 
10:03 PM
You have won the internet the Duga list.
I bet I'm going to run out of stars soon.
 
@Hosch250 would you happen to still have the .xlam add-in from #725? the link 404's now :(
 
And I successfully installed Spotify, Firefox and Skype on my Debian laptop.
 
That is something I haven't done since shortly after WinterBash.
 
Fixed a huge style bug on my main website.
 
10:05 PM
yeah
 
No.
 
speaking of rubberduck, the website is on the first page of results when one searches "rubberduck" on google
 
Wait, I just might in a backup.
 
My milk expired the 23rd, guess I'm taking the risk.
 
@Hosch250 ah, the repo still exists
 
10:08 PM
@EthanBierlein Google shows different search results for different people, remember that.
 
right
but that still makes me happy
 
@EBrown Ha! Mine expired the 19th. (I poured it out...)
 
@SimonForsberg I still drank it.
Seems fine to me.
 
I tasted mine. Did not taste that good.
 
@Hosch250 got it.
 
10:10 PM
That is just an estimate.
@Mat'sMug That's good, cause I don't have it.
 
I think that Walmart just wants me to stop living life.
 
and it's crashing with an NRE
 
If you refrigerate it, you can extend the shelf life.
BTW, @Mat'sMug, you never responded to my email.
 
Almost took a picture of my desk with CR chat up.
 
Did it get buried in your flood of GitHub emails?
 
10:12 PM
hold on
 
@EBrown Why?
 
@Hosch250 I periodically send them to a friend of mine when I do something cool. (Like getting this laptop pimped out.)
I'll gladly share it if anyone wishes to see.
 
Is incomplete code off-topic on Code Review?
 
Depends on how incomplete, I would suggest.
 
As in, the project is not finished yet?
 
10:15 PM
Depends as always.
 
I wouldn't think so, as long as the code itself does what it should, then I'd think not.
 
Hmmm.
 
Just because you haven't finished the entire project doesn't mean that you can't post part of its code for review.
 
True.
 
I have posted snippits from classes even, that don't include the entire class for review. (Just because there's no need to review the rest of it.)
 
10:16 PM
Is @RubberDuck finished? (Will @RubberDuck ever be finished?)
 
A programming project is like painting. it's art. and it's never quite done.
2
 
Spotify is irritating me.
 
So when is and when isn't posting incomplete projects appropriate?
Or is it always?
As long as it runs, of-course.
 
when it works as intended, it's ready to be reviewed
 
Great.
Now I have to add ALL these songs to "My music" so I can remove them.
Pita.
NO SPOTIFY LUKE BRYAN DOES NOT GO IN "MY MUSIC."
2
That is reserved for music that actually sounds good.
 
10:22 PM
who's Luke Bryan?
 
@Mat'sMug Some country singer.
 
He has like two songs I actually listen to, so Spotify adds like 25 other ones to "My Music."
 
blech
 
Not usually a problem, except I save everything in "My Music" to my phone.
 
10:23 PM
Not really my music, but I guess Spotify thinks it's popular
 
So who's friggin decision was it to put anything in my "Starred" into "My Music" as well?
THEY ARE SEPARATE FOR A REASON.
I wonder if they know the separation of responsibility principle.
Now I have to go back and put Frank Sinatra back in. But he was in there before this issue.
 
@EBrown Ironically they got that quite well.
 
hi
 
hi
 
@Mast Well they obviously don't know that it also applies to my music.
 
10:24 PM
@Caridorc hello
 
@EthanBierlein hi
 
Like, why the hell do I need to re-add Kelly Clarkson to it?
 
That's separation of data.
 
@Mast No, each section has a responsibility. The "Starred" list I use for general BS.
 
well that's a dumb exception.
> 'Rubberduck.Parsing.Grammar.VBAParser.ICS_S_VariableOrProcedureCallContext' does not contain a definition for 'argsCall'
 
10:26 PM
"My Music" is for stuff I'll probably listen to regularly. (Dean Martin, Blue Swede, Frank Sinatra, Kelly Clarkson, etc.)
Traffic, you know. The classics.
 
Mildly golfed ruby is 4x smaller than ungolfed Java, I was curious about implementing http://codereview.stackexchange.com/questions/105779/checking-digits-in-a-number/105783?noredirect=1#comment193734_105783 in mildly golfed ruby
But ruby does not check input like java does, kinda unfair
 
@Mat'sMug I hope you don't have to invoke it like that. Long.
 
that's the fully-qualified type lol
 
And Spotify always glitches when I maximize it.
 
It's hard enough not to violate the max 80-characters rule in Python, but with types like that you wouldn't even bother in C#
 
10:29 PM
I think it does that because they're overcompensating.
 
Geez. I turn away for one minute, and come back to find my soda overflowing onto the carpet.
 
@EBrown So don't.
 
@Mast Easier said than done. I maximize everything.
 
10:30 PM
@Mast just use var for type inference
 
well the type is VBAParser.ICS_S_VariableOrProcedureCallContext... better than VBAParser.InCallStatement_Statement_VariableOrProcedureCallContext, no?
 
@Mat'sMug Not enough underscores.
 
@Mat'sMug Both make me dizzy.
 
Anyway, back to programming!
Catch you all later.
 
10:32 PM
@EBrown bye, see you soon
Good night everyone
 
Night.
 
10:57 PM
#NamingIsHard.. especially when it's meta naming. They're not mine though, but somehow I got used to these names.
They're directly derived from ANTLR grammar rules that define RD's VBA parser
 
bbl dinner
 
11:38 PM
Huh, it seems to be quiet around here.
 
This is a better question for codereview.stackexchange — Paul92 46 secs ago
this should be migrated to codereview.stackexchange.com - stackoverflow is more about fixing issues. — Mousey 12 secs ago
 
00:00 - 21:0021:00 - 00:00

« first day (875 days earlier)      last day (3143 days later) »