« first day (869 days earlier)      last day (3140 days later) » 
00:00 - 19:0019:00 - 00:00

7:00 PM
yeah, you are probably right
Advice: Read the GoF book, everybody does it, then continue with your life as before reading it.
 
@RubberDuck You could always post an answer
 
Luckily the cram design patterns in everywhere is usually a brief phase.
 
@JohanLarsson GoF book?
 
I have a laptop here that looks like something straight out of 2001...
 
7:02 PM
@SirPython ^ GoF Gang of Four
 
TBH, I don't really get the decorator pattern myself.
 
Couldn't even get Windows XP to run on it.
And Debian is as fast as molasses.
 
@EBrown LOL, XP came out in 2001.
Are you sure it isn't from 1001?
 
@Hosch250 Sticker says it came stock with XP.
But the thing wouldn't install it when I tried.
And now the debian install won't even boot...lol
 
Reminds me of this message from Mat'sMug:
 
7:06 PM
@Hosch250 Adding functionality to a type by creating a wrapper.
 
in VBA Rubberducking, Jul 5 at 3:54, by Mat's Mug
my laptop needs a dive out the fucking window if you ask me
 
Ever heard the song Maggie Lauder? It is my favorite song right now.
 
This is not a good question for Stack Overflow. SO is for debug, head over to programmers.stackexchange.com or codereview.stackexchange.comTom Toms 5 secs ago
 
@Hosch250 sounds like this
2
 
7:10 PM
LOL.
LOL, that must take absolute ages!
 
you have just helped me discover my new favorite song @Hosch250
 
Nice.
 
@Hosch250 folk dance is a pretty slow language.
 
@EthanBierlein Check out The Tortoise too.
@JohanLarsson It is.
 
The decorator pattern can be handy, but often it's better to compose the object with a better design. In this case, inject an IEngine, IBrakes, etc.
 
7:12 PM
So I replaced the IDE cable in my PC and all-of-a-sudden my VHD drive was back.
 
Feel free to steal that for an answer ^^.
 
Is this a valid answer?
0
A: Decorator for cars

Harshdeep MehtaInterface will give more flexibility. And, decorator pattern is all about adding functionality to object without letting object know about it.

 
@RubberDuck You shouldn't steal things.
 
@ambigram_maker no
 
@Mods requesting CW:
18
Q: Welcome to The 2nd Monitor!

PhrancisSo, you have found your way to the CodeReview.SE main chat room, The 2nd Monitor, perhaps for one of these reasons: You were invited or "pinged" by a site moderator or other user to discuss a post on the main CodeReview.SE site; You visited CodeReview.SE for the 1st or Nth time, and noticed the...

Monking
 
7:22 PM
@Mat'sMug Can I bother you to help with a (very) complicated issue?
 
maybe
 
@Vogel612 Clarify your request?
 
that post is not marked CW and I think it should be
also I'd love to get this into a faq state
and MSE requires FAQ posts to be CW
 
@Vogel612 CW?
 
7:25 PM
Community Wiki
 
MSE has rep on the posts, though.
 
Ah.
 
I'm going on a walk, see you later.
 
@Hosch250 MSE?
 
@Hosch250 CW lowers the edit requirements though
@ambigram_maker Meta Stack Exchange
 
7:26 PM
@ambigram_maker Meta Stack Exchange.
(I know that one.)
 
gr.. it's been too long since I used that magic link. sorry for the pings..
 
What is the magic link for that one? Meta Stack Exchange
 
could a non-RO check whether this link is accessible?
 
Found it, never mind. Lol
 
Is "non-RO" == non-Room-Owner?
 
7:28 PM
yep
 
@Vogel612 Works for me.
 
okies, thanks
it looks a little different for me, since I can make changes.
 
Well, I suppose this weekend was actually somewhat productive.
 
since you can see the whole list, I'll just shorten the list of feeds in the answer and refer to the feeds page instead.
 
7:31 PM
Python question coming soon in the feeds
 
While we're at it. What do you guys think of a canonical faq for editing guidelines?
 
Also, @Mat'sMug if you are still here the C# book by Skeet has a bit of info about that one feature I was considering writing a Rosly Feature Request for (method overloads with optional parameters allowing inference and omission of parameters before another parameter).
 
While I get your point (and frustration), we really should write down our editing guidelines anyway. Otherwise, we'll someday end up with 2k users who don't know any better. — RubberDuck Sep 10 at 16:43
 
@EBrown the way I see it, overloading and optional parameters are like a green and a yellow screwdriver; I like my screwdriver yellow, others like the green one better - at the end of the day, we all get screwed.
that didn't come out well
 
@Mat'sMug Well he doesn't say that it's a bad idea, just that it's not in the language atm.
Do you have the book? I can tell you what page it's on.
 
7:42 PM
I do
 
It's on page 374.
 
ah, I'm at p.161. I need to finish that book.
 
0
Q: Cactus Reborn - A game engine for text-based adventure games

Ethan BierleinI'm currently working on reincarnation of the Cactus project, Cactus Reborn, and I've gotten the basic implementation so far. At this point, you can create simple, playable games. There are currently three usable classes/functions: Location - This class describes data about a location in a Gam...

0
Q: Key Value Store for Android on top of Sqlite3

divyenduzI wrote this simple key-value interface on top of Sqlite3 to use in my Android app. I am using this to persist Java objects as strings converted using Gson. The public API has 3 methods. get(Context context, String key, String defaultValue) set(Context context, String key, String value, Integ...

 
You know what's really weird about me finding that too?
I set the book on my desk, stood it on it's bindings (I do this with every book I own), and it opened to that exact page.
I'm not far into it right now, haven't had the time to really sit-down and read it.
 
A few things that bother me about this question: Ad 1) You are aware that the code you post here will be licensed under CC-BY-SA and accordingly no more belong only to your company? Do you have clearance from your boss to do this? Ad 2) You mention 3 "Crashes" found by Crashlytics. Please clarify whether these are actual hindrances in what your code seeks to accomplish. If your code is not ready for use without these 3 issues fixed, then I'd be inclined to consider the question off-topic. Ad 3) Be aware that answers may comment on any or all aspects of the code! You may not get what you want. — Vogel612 19 secs ago
 
7:46 PM
> and I am planning to make this module open source soon
 
@Vogel612 for the future, flagging tends to be more efficient than chat for CW requests.
 
@SimonForsberg except meta-flags can go unnoticed for a while
 
maybe next time I'd ping a specific mod :)
 
Looks like I have to make a world-state object for this programme...ugh, that'll be fun.
 
@Mat'sMug Ssssh :)
Don't tell them about our horrible meta flag stats.
@Vogel612 yes, that is more effective.
 
7:50 PM
5 flags. average handling time 1h 10 minutes
 
@SimonForsberg hey it's still below 24h
 
oh dear, is it really that bad??
 
All time: 287 flags, average handling time 0 days 22 hours 29 minutes
Month: 33 flags, average handling time 0 days 0 hours 56 minutes
 
2 mins ago, by Simon Forsberg
Don't tell them about our horrible meta flag stats.
...
2
 
hey, then my 1h 10 min wasn't that bad
 
7:52 PM
@Mat'sMug they forced me to tell
unfortunately, meta flags don't show when you're on the main site, you have to switch to meta in order to see the meta flags. (I wonder if @janos has noticed this yet?)
 
@SimonForsberg I guess that's judging by the number of meta flags I handled ;-)
 
@SimonForsberg isn't that kind of broken?
 
@Vogel612 well, it's not broken, but it's not ideal... (I wonder if there's a feature-request about this on MSE already...)
 
go make one :)
 
We don't get many flags on meta, today: 0 flags, average handling time N/A compared to main site: 12 flags.
26
Q: Combine flag and edit queues from main and meta on SE 2.0 sites

Kevin VermeerAbstract There's no need to have two flag queues (one for meta, and one for main) for moderators to check. There's also no need to have two edit queues, if suggested edits were allowed on meta sites. We should have one flag queue and one edit queue for both main and meta SE 2.0 sites. Backgro...

 
8:00 PM
WOAH I never knew that Visual Studio had auto-complete for override.
 
really?!
 
Yeah, I did not know it did that.
Typed public override in the IDE and it popped up with them all. Best part is it kept the return type.
 
works with just override, too
 
Does it really? It doesn't make it private?
 
override cannot change access modifier iirc
 
8:04 PM
^
 
it can only broaden access modifier
 
@SimonForsberg in Java maybe
 
broaden meaning?
 
protected can become public
 
in C# if you override a protected, it's protected
public won't compile
 
8:04 PM
In Java, yes. But I'd assume the same applies for C#
 
You got two working solutions that are responsive too. Asking for code review and opinions about which is 'best' is off topic for Stack Overflow. — GolezTrol 41 secs ago
 
@Mat'sMug And Java scores again ;)
2
 
Interfaces > All
I don't know why I've never used interfaces up until now.
2
But I am quite pleased with them. :)
Also, I don't know if you read the other chat or not @Mat'sMug, but I am changing that entire system.
I'm having Process return an IList<NetOutgoingMessage> to be sent by the server.
And I'm passing in a ServerState to it.
 
isn't it awkward that a message knows whether it's incoming or outgoing?
 
Yeah, but I didn't write that API.
That's from library I use.
 
8:10 PM
if I send you a message, it's outgoing for me, but incoming for you
 
With the given input, your program outputs 025, which isn't half bad. Adding newlines between the numbers is a no-brainer. And if the leading zero bothers you, then please take notice that your scanf call consumes the number but not the end-of-line character following it. Once you've got it debugged (that's part of the job), please apply for a code review, as I see a lot of bad practices in your code. You'll do fine; good luck! — Ruud just now
 
Yes, so when you read a message from another destination, it's Incoming. When you are writing a message to send, it's Outgoing.
 
and they don't share an interface or something?
 
The Incoming messages have extra stuff for retrieval on them.
@Mat'sMug Let me look at the source quick.
 
@SimonForsberg you can do public new Foo()
smelly
 
8:12 PM
@JohanLarsson You can do that in C# too.
Or is that what you were saying?
 
aka member shadowing
 
only very rarely is new right ime
 
@Mat'sMug They share a NetBuffer class.
No interfaces though.
 
@EBrown because you didn't know about interfaces until now?
 
8:14 PM
And that class has all the Read/Write methods.
@SimonForsberg I knew about them, just not how super useful they are.
I never needed them up until now.
 
@SimonForsberg at least in C# it's explicit. I don't see it as a Java win, I see it as hidden member shadowing, and utterly confusing and totally wrong.
 
Also, is it best practice to implement interfaces explicitly?
 
@Mat'sMug +1
 
@EBrown no
 
@Mat'sMug I might start doing that explicitly then.
I think it looks better, tbh.
 
8:15 PM
@EBrown yes no depends
 
don't implement interfaces explicitly unless you have to
 
@JohanLarsson Well I have to do it for a couple because the member I have isn't the same type as the member the interface wants.
 
@Mat'sMug I'm not quite sure what hidden member shadowing is, but what Java does doesn't really sound like it.
 
I like the way explicit interface implementations look, though. :(
 
8:17 PM
@EBrown 'till the day you stick an access modifier there and wonder why it won't compile ;-)
@SimonForsberg nah you're right, it's not shadowing
 
@Mat'sMug I'm pretty sure I'll never put an access modifier on ILogger IDataMessage.Logger.
 
28
A: What is Shadowing?

Jim MischelShadowing hides a method in a base class. Using the example in the question you linked: class A { public int Foo(){ return 5;} public virtual int Bar(){return 5;} } class B : A { public new int Foo() { return 1;} public override int Bar() {return 1;} } Class B overrides the virtu...

when the shadowing is "hidden", you get a compiler warning telling you to verify whether that was intentional or not.
the new keyword can then be used to tell the compiler "it's okay, I know what I'm doing, leave me alone"
 
As GolezTrol advises, you'd be better off on something like codereview.stackexchange.com. — DominatorX 43 secs ago
 
and AFAIK Java has that too
 
yes.
 
8:25 PM
does Java have a keyword to tell the compiler to knock it off?
 
Oh wow.
Someone forked VSDiagnostics earlier, and already PR'ed a new analyzer.
 
nice!
 
@SuppressWarnings
 
@Vogel612 works. but isn't that a bit wider than needed?
 
which isn't exactly a keyword, but it helps with more things than the shadowing warning
 
8:27 PM
It needs more tests, though.
 
the shadowing thing is also resolved with new IIRC
 
cool
 
YES
All good things!
Today is a good day.
Now I just need to rewrite all these interfaces.
 
Question @all - I'm very confused about what it is that makes this question not hypothetical example code:
1
Q: Decorator for cars

noob1992Is this a good use of decorator pattern ? If not, why not? Is this a good idea to , for example, use when we have objects communicating with MVC through php or via asp. To send data through the model to a decorator class that extends so ; and also using this data to extend to other classes. for ...

 
Oh crud...
I am still missing parts.
I know! Another interface!
 
8:30 PM
...
 
No but seriously, I think that's the only way to fix this issue.
 
careful, you might be over-compensating ;-)
4
 
Right now the prototype is public override IList<IOutgoingMessage> Process(HashSet<IPlayingClient> clients), but it should be public override IList<IActionable> Process(HashSet<IPlayingClient> clients).
Then, IActionable will be subsets of classes that do different things.
I.e. a class SendMessages with IList<NetOutgoingMessage> as a parameter, a class ProcessLogin which will contain code to mash the login with the player.
But that doesn't make sense...
I think this would make a good Programmers question.
Good news is most of my methods are down to 20 lines or fewer.
 
Boston chicks dig European hotties
I've been here for 20 hours and I've had 25 matches on Tinder, lol
 
12 mins ago, by Mat's Mug
careful, you might be over-compensating ;-)
 
8:43 PM
I love travelling
 
@JeroenVannevel No, you just love the chicks
 
@skiwi sue me!
Boston is wonderful though
 
Not that I can blame you though!
 
in VSDiagnostics, 3 mins ago, by Jeroen Vannevel
I love it. The city is sparkling with life, the weather is amazing, everything is really clean, the people are friendly, lots of very talented street performers, etc
Last night I saw a kid (maybe 10y old) play "Piano Man" in the street, including playing his piano, mouth harmonica and singing with it
 
@JeroenVannevel They just want your money.
 
8:46 PM
@Hosch250 Joke's on them, all money goes towards my hotel
 
Monk*
 
*ing
You know, some people will do anything to marry European nobility...
 
@JeroenVannevel You must see Patriots stuff everywhere this time of year I bet
 
in VBA Rubberducking, Jun 4 at 22:52, by Jeroen Vannevel
I'm part of the Belgian royal family
 
possible answer invalidation by JonB on question by JonB: codereview.stackexchange.com/posts/105185/revisions
 
8:50 PM
@Phrancis I thought Boston is all about the Red Sox?
 
or Bruins
 
Handegg season is starting, and the Pats are quite popular.
 
@JeroenVannevel Depends on the time of year
Red Sox [sic] (summer) -> Patriots (fall) -> Bruins (winter) -> Celtics (spring)
 
Aye, and inbetween there's the "Bowery Boys", the "Dead Rabbits" and the "Forty Thieves"
 
Are those the three gangs that have been rioting all summer?
 
8:56 PM
If by "all summer" you mean "late 19th century": yes
5
 
lol^
 
I heard that three Boston gangs made peace and joined ranks during the riots this summer.
 
@Hosch250 Some kind of bromance?
 
And whatever you do, don't dress like a cop - there is a movement promoting whole-sale hunting of cops across the nation.
 
wat
 
8:59 PM
I'm voting to close this question as off-topic because it's off-topic for SO. It may be on-topic for codereview.stackexchange.com, but check their faq. — T.J. Crowder 23 secs ago
 
class SqueakyBrakesDecorator : ICar
{
    private readonly ICar _car;

    public SqueakyBrakesDecorator(ICar car) {
        _car = car;
    }

    public void Drive()
    {
        _car.Drive();
    }

    public void Stop()
    {
        Console.WriteLine("Squeeeeeeak!");
        _car.Stop();
    }

    public void Park()
    {
        _car.Park();
    }
}
 
0
A: Controller to list users

tim Should I moved the foreach loops in the model? Yes, definitely. Currently, you have SQL in the model and the controller, which isn't a good idea. It makes it hard to make out what the actual query will be, and splitting up one functionality (database lookup in this case) in multiple classe...

 
This would not be on-topic for Code Review, as it looks like example code. — Phrancis 42 secs ago
 
I didn't see this first hand, but we know a family whose sons are police officers, and they are afraid because this group said that if you see a cop alone, to shoot him (or her).
 
@Mat'sMug Sounds like you need to get new brakes, not write code about it ;)
4
 
9:01 PM
0
Q: Optimizing Project Euler Solution #12

mburke05Just to reiterate my prev. post, as I think it helps structure my weaknesses. Coding methodology: Is the algorithm I used feasible or mostly correct, if not how do I correct it and why won't it work or scale? I realize in some cases there are always going to be optimal solutions that will be o...

 
@Phrancis just teaching a newbie that a decorator can make a Lamborghini sqweaky without it even knowing
 
So, is a decorator like the external two-factor auth than some people from MS Research set up for a bunch of banks?
 
...
 
They were studying the feasibility of two-factor auth and existing systems.
 
var tester = new Foobar(new SqueakyBrakesDecorator(new LamborghiniCar()));
tester.TestDrive();
I only meant that ^
 
9:03 PM
So, they designed a system and implemented it where it was completely separate from the bank system.
But you could go through it to have two-factor auth instead of single-factor auth.
 
I think worst part about moving is unpacking... gotta find a new place for every single little thing :|
 
Broken code in first post queue.
 
-1
Q: Hailstone sequence using nested while loops

Russell SherrillI'm writing a program that allows the user to input a range of numbers, and then the program will preform a hailstone sequence of each number in the range and will then print the number with the largest cycle length. I cant see why my code isn't working though. We are required to use while loops ...

 
9:20 PM
@gnat If you had bothered to read the comment you would have seen it only mentions codereview anymore. — Tom Toms 54 secs ago
 
0
Q: How to structure a bash plugin?

marvindanigI'm writing a _bash_plugin_ to help people create books in a specific way. It's an ordinary shell script to setup the project and create its subresources. I'm using a loop to create barebones assets and then seek to checks-in the project into a repository as well. The plugin will eventually pro...

 
9:49 PM
@Mat'sMug Which file(s) should I port to C# for the auto-indenter?
I'm doing that right now.
That is, if you tell me.
 
ohh coool. Dark Chat seems to come with syntax highlight now
 
10:04 PM
Ugh, this looks like VB, not VB.NET.
I mean, Basic, not VB.
Oh, .bas is basic. VB uses .vb
 
0
Q: How would I optimize this unique value finder [Java]

Mannywas told to post this here; so for our first assignment in our algorithm class we are suppose to solve several different questions using information from a 2D array. We are also suppose to optimize our code to get more marks on our assignment. We also are only allowed to use 1D and 2D arrays as t...

 
Wow, this is as ugly as Roslyn.
Function (or rather, Sub) scope variables named "i" (long), and "oCM" (object)...
 
Moinking
 
*ing
Wow. He Dim's a bunch of variables in a single line, then goes and ReDim's them.
Umm, what does ReDim asCode(0 To iEndline - iStartLine) do?
Does that create an array, or something?
 
@Hosch250 it's VB6
 
10:17 PM
Good lord, my little stepsister just walked in and said a large variety of colorful words
 
Yeah, I saw the doc comment shortly after I posted that :P
 
ReDim resizes a dynamically-sized array
 
So that is an array?
So, would that be the same as var asCode = new string[iEndLine - iStartLine];?
 
yes
 
Given that this is directly after the assignment, that is?
OK, thanks.
 
10:19 PM
watch out for Option Base 1
 
I saw that. That is evil.
 
'tis
 
At least, I'm used to it from VBA...
Is a Collection essentially a List?
 
yes
 
OK.
Clearly, I don't know VB6 at all.
 
10:21 PM
and I gotta say it scares me a little
 
Me too. I just realized I don't know what type it is.
 
let's go to VBA Rubberducking
 
OK.
 
Ooh, there's a storm outside.
 
@EthanBierlein I see it coming up.
 
10:24 PM
Yeah. I was just biking in it.
 
It won't be here for a while, though.
 
It was raining a little along the river valley.
 
10:55 PM
I think the site analytics graph is a little confused:
 
11:08 PM
-2
A: CSS3 - Make div dissapear after delay

AmorrisjQuery would help you a lot there

390
A: The Many Memes of Meta

TheTXIMeme: jQuery Originator: Unknown (possibly Ólafur Waage) Cultural Height: TBD Background: A Stack Overflow-centric meme, jQuery began its career early on as the answer to beat for any question that even remotely referenced JavaScript. Its popularity became so great that eventually jQuery becam...

 
@Jamal Asking for DV's there?
 
@Jamal Whoever commented on that is a blasphemer. JQuery can be used to solve everything!
 
Nah, I just wanted to post it. :P
 
@EthanBierlein Your storm is raining here.
Last I saw, I was at 1002 first posts. Now I just accidentally hit Done instead of Skip, and I saw I'm at 1005.
I've been skipping so other people can get the badge.
(Inspired by rolfl.)
 
11:27 PM
Yeah, but I am going to still hammer at closed-vote queue.
 
@Jamal MOAR JQUERY
 
And congrats, @Hosch250 - on the badge. People who work the review-queues, the meta, etc. .. those are the high-value contributions too.
 
Thanks.
I'm working the queues, but I've only been posting answers sporadically.
But, I did open a discussion on trashing the generator for those classes in the Roslyn chat.
If they accept, I'm going to hard-type that out and post it for review here.
3
 
I consider the queues and meta to be improving site quality. Good work there is worth a lot more than just answering/asking.
 
I've been skipping a lot in the close queue.
I only close if it I know the language and it is obviously broken, or they explicitly state it is broken.
TTGMS. (Time To Go Munch Supper.)
See you.
 
11:33 PM
@Jamal in need of some more jQuery?
 
What should you do to a post in the First Posts queue if the post looks fine?
 
@RubberDuck Always!
 
@SirPython fine as in "ok, but not worth an upvote"?
Oh... =) btw
 
@RubberDuck Right, forgot about votes.
 
You can always skip it, or leave a nice welcome wagon comment too.
 
11:36 PM
^
 
Like, "Welcome to Code Review! I hope you get helpful answers."?
 
BTW.Welcome
3
 
Yeah. Just some indication that the question has been seen by somebody.
 
I'm voting to close this question as off-topic because it belongs to codereview — tinlyx 30 secs ago
 
@SirPython Yeah, just like that! I do that all the time! (and for the record, I don't even use canned copy/paste welcome messages)
 
11:37 PM
@rolfl isn't there a meta somewhere about that?
 
There is. I wrote it ;-)
20
Q: First Post Review Queue — what is it? Why is it a bad idea to click "No Action Needed"?

rolflWhen you pass 350 reputation you gain access to the Review Queues. One of them is the "First Post" queue. What is this queue, what purpose does it serve, and how should I process items in that queue?

 
I thought so. thanks. =)
 
Zak
11:51 PM
morning
 
Oops. Thanks @Mat'sMug. Typed this one up on my phone over the course of a few hours... — RubberDuck 8 mins ago
@RubberDuck you're just as nutz as me!
 
00:00 - 19:0019:00 - 00:00

« first day (869 days earlier)      last day (3140 days later) »