« first day (870 days earlier)      last day (3130 days later) » 

12:00 AM
RELOAD!
There are 1514 unanswered questions (94.4100% answered)
 
@EthanBierlein Cactus Reborn is in the HNQ!
 
12:12 AM
LOL, @EthanBierlein, you have a dictionary of socks?
 
Lol. Maybe @Mat'sMug. Maybe...
Free obsolete & noisy flags up there btw
 
@RubberDuck these comments are long gone ;-)
@RubberDuck btw, it seems there's something we both failed to convey:
As I do not understand the decorator pattern yet... — noob1992 9 mins ago
 
Heck, @Mat'sMug, you explained it in your answer.
 
IKR
 
I understand what it is now.
 
Zak
12:22 AM
It's weird. In the last 72 hours since getting into a drinking contest with my boss, I feel better and better yet look progressively worse.
@Mat'sMug Wait, so he's asking if his code follows a standard which he himself doesn't understand?
 
@Zak you know about design patterns do you?
 
Zak
@Mat'sMug Haven't got a clue what they are.
 
there are quite a bunch. there are creational patterns, like "abstract factory" and "builder" patterns
 
Zak
(Quick google search later) okay, cool.
 
lol
the "decorator" pattern is a design pattern
 
12:25 AM
It is pretty cool.
You make a decorator and DI the actual item.
 
thing is, OP got the wrong concept of "Dependency Injection" from the start
 
Then, you just use the decorator for things.
 
@Mat'sMug woot!
 
I almost hammer-closed that one for being hypothetical code
but then, OP desperately needs guidance
 
@Mat'sMug perhaps I should make it more clear that il what I showed was not a decorator.
 
12:29 AM
right. it annoyed me that his example didn't actually need a decorator at all... but it often happens when you try to learn design patterns: you try to solve the wrong problem with them... @RubberDuck your answer is fine, it's mine that somehow failed to "click"
 
Hey, FYI, I did a rollback here because I wasn't sure what the OP was trying to do with the edit
Any suggestions are welcome
 
possible answer invalidation by noob1992 on question by noob1992: codereview.stackexchange.com/posts/105184/revisions
 
@Duga damn
@noob1992 if it's going to make the answers moot, an edit of the question is likely to get rolled back (see meta). If you make substantial improvements based on feedback you got here, feel free to ask a new question. — Mat's Mug ♦ 21 mins ago
This Q+A (the canonical "cake" decorator example) might help. Removing the no-op decorator class from the OP will invalidate answers, and get rolled back; I warmly recommend making a new post. — Mat's Mug ♦ 11 mins ago
....and then he edits. WTF dude!
> Changing the code that one of the developers has pointed out to. really interested on receiving the feed back right now
 
Well, I rolled back, so everything is in order. For now...
 
canonical #PeopleDontRead I guess
 
12:32 AM
FYI, I've rolled back your edit as it invalidates advice given in existing answer. — Ethan Bierlein 14 secs ago
 
I think there's a language barrier.
 
Is the above statements correct ??????? — noob1992 1 min ago
 
I've no idea what that means...
 
sigh
flagged
 
@RubberDuck I figured out that problem, methinks.
 
12:36 AM
Good @EBrown!
 
I'm using events.
 
Would this get closed if asked today?
7
Q: Usage of Decorator pattern in baking program

TheTruthIsInCodeIs this a good usage of Decorator pattern? I'm trying to use Interfaces instead of Abstract classes. (Component) Interface public interface IBake { string Name { get; } double Price { get; } } (Concrete Component) public class BakeBase : IBake { private s...

 
It looks fine to me.
 
agree
 
> I'm getting the following, which is not the right total:
 
12:38 AM
@Mat'sMug no. It's a sufficiently complex learning exercise.
Oh. Missed that.
Anyway. Gtg.
 
Oh, yes.
I just skimmed the code.
 
Gone.
 
ahaah
I see what you did there
 
12:49 AM
in Discussion between noob1992 and Mat's Mug, 1 min ago, by Mat's Mug
could be a Tesla, a Lamborghini, ...or a Ford Fiesta
 
This is such a pita.
 
Zak
Eh, you should see my chat with "ten-dimensional-array-sorting guy". Didn't understand that arguments are defined just as solidly as if you'd typed "dim var"
 
@Zak In that they are not defined solidly. ;)
 
Zak
@EBrown well, yes :) but he thought that because a variable was an argument and not actually defined anywhere, he couldn't use "Option Explicit"
 
@Zak You should always use Option Explicit.
Anytime I get a VB.NET project, I add that right away.
 
Zak
12:57 AM
@EBrown I know that
 
Ah, right. :)
 
@EBrown wait, there's a possibility to write code without Option Explicit in ?????
 
@Mat'sMug There is.
 
OMG
 
Once again, virtual and override cost me some time.
 
1:08 AM
?
 
@Mat'sMug Lord of the Ducks!
3
 
Thanks, Santa! One vote short.
 
If you can see deleted answers: codereview.stackexchange.com/a/35459/34073
> I would like see the face of the teacher if he were to present this :)
 
> notes: "Login and Chat messages go back and forth now. ".
That's very nice.
 
1:47 AM
@Hosch250 huh
interesting
@Hosch250 Lord of the Mugs?
 
Heck, wrong message.
1 hour ago, by Zak
https://www.facebook.com/TheOriginalBestOfTumblr/videos/885549121596286/
@EthanBierlein Check the Horrific Injuries.
 
Hello everyone
 
Hi, @june1992.
 
BTW.Hello
 
Hello
 
1:51 AM
hi!
 
We need a general all-purpose "The 2nd Monitor Enum"
Or maybe even a Code Review enum.
 
Zak
@june1992 *waves
 
Hello guys so this decorator pattern is really something to learn i don't know how you guys do it
 
We make a habit of learning at least one thing new every day.
 
yes I agree
 
@EBrown We got your mutable struct analyzer implemented! New contributor forked this morning and PR soon after.
 
Those are concrete classes
 
Yep.
Most people don't program right, and that is why CR exists.
6
Dishes time, BBL.
 
see ya
@Mat'sMug Did you edit an old message?
 
@EthanBierlein nope
 
2:13 AM
Huh
I wonder why your avatar whited-out
 
I'm a ghost zombie
2
 
2:31 AM
0
Q: Simple implementation of a generic stack

BrianI'm fairly new to C++ programming. To help I've been writing my own data structures for practice. I'd liked this to be judged as if it was written by a professional, and receive honest feedback. I already have a few concerns. Am I managing memory correctly? I don't believe I have any leaks. A l...

 
2:46 AM
night
 
'night
 
Zak
3:04 AM
Advantages of being alone in the office: I can cheer out loud when I finally get my XPath queries working
4
 
LOL.
 
3:17 AM
I'm bored.
I didn't do a single thing all day, and I feel guilty too.
 
Zak
I have days like that sometimes. Occasionally whole weeks. Pitfalls of being left to come up with your own solutions.
 
The thing is, I have 4 papers to get finished, including one just under 2 pages in 8 days.
I can do it, and I will, but I feel guilty for delaying it at all.
 
3:34 AM
I'm voting to close this question as off-topic because it is about improving existing, working code. Questions on how to improve working code should be asked on the CodeReview.StackExchange site. — TylerH 13 secs ago
 
Split-brain is a lay term to describe the result when the corpus callosum connecting the two hemispheres of the brain is severed to some degree. It is an association of symptoms produced by disruption of or interference with the connection between the hemispheres of the brain. The surgical operation to produce this condition results from transection of the corpus callosum, and is usually a last resort to treat refractory epilepsy. Initially, partial callosotomies are performed; if this operation does not succeed, a complete callosotomy is performed to mitigate the risk of accidental physical injury...
 
3:50 AM
0
Q: Retrieving a link

AlvynI'm trying to retrieve the link before extracting out the data from there. For now, I just need help on getting the link out first, probably using AJAX/jQuery, before extracting the data out into a table. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1...

0
Q: Holes in a word

azam iftikharfirst of all i want to say i am new in c programing language ( or i can say new in programing ). today i tried to solve my first codecief problem BUT IT ALWAYS shows WRONG ANSWER. here is problem we have to enter a word which is less then 100 alphabits with no space and have to calculate total n...

 
4:03 AM
public abstract class Car
{
    public virtual void Drive()
    {
        Console.WriteLine("♪On the road again♪");
    }

    public virtual void Stop()
    {
        Console.WriteLine("BRAAAAAAAAAKE!");
    }

    public virtual void Park()
    {
        Console.WriteLine("Your destination is on the right.")
    }
}
#SensibleDefaults
 
Laurence Kim Peek (November 11, 1951 – December 19, 2009) was an American savant. Known as a "megasavant", he had an exceptional memory, but he also experienced social difficulties, possibly resulting from a developmental disability related to congenital brain abnormalities. He was the inspiration for the character of Raymond Babbitt, in the movie Rain Man. Unlike Babbitt, who had autism, Peek had FG syndrome. == Early lifeEdit == Peek was born in Salt Lake City, Utah with macrocephaly, damage to the cerebellum, and agenesis of the corpus callosum, a condition in which the bundle of nerves that...
 
0
Q: Increment number in jquery

PekkaI have this number return from ajax request 015-0011-00001 i want to increment the last part of the number (00001) on load of document. What i did is get the last number and increment it then combine again the numbers. Is there a cleaner way to increment this number without slicing the number int...

 
Why are you linking rain man?
 
Not Rain Man, the inspiration behind Rain Man.
Never heard of him, he was amazing.
Related to Split Brain.
 
He is the real rain man, but semantics, and yeah I figured that when I read up and started reading the split-brain thing, related to your impending papers I surmise?
 
4:11 AM
No.
I took Psychology a few semesters ago.
We read about split brain a bit.
 
Random readings?
ic
A lot of amazing people have what most consider disabilities. It's fascinating.
 
I would be considered mildly autistic.
Or maybe severely autistic, I don't know.
 
Dyslexia seems pretty prevalent.
 
Yeah.
 
Let me talk out of my ass for a sec,
 
4:14 AM
I've never had a seizure, but I am also mildly epileptic, where I can't stand flashing lights very long.
 
Autism, ADD, ADHD and the like

It seems of those soidissant diagnosis are handed out like candy.
 
My brother is worse than I am - he'll go to bed with a headache for hours after watchinga football game on the computer, or something.
 
Hm.
 
@Legato Yeah, we know that. One school district had every kid on drugs except the superintendent's.
It is the drug companies making big bucks, really.
 
Light sensitivity, maybe?
 
4:17 AM
Something.
 
Yeah, I wouldn't be surprised if there's some incentives for some people to give those "prescriptions," I see it as a cop-out. Child has a problem, "learning disorder," doesn't pay attention in your class "add" etc
How does he describe the pain/its root? It could just be lack of sleep/over-exertion, but If it's a migraine headache or the result of a chronic inflammation may be worth checking out, who knows.
Night @Hosch250 Kick all those hw assignment's butts.
 
Night.
No, it is the flashing lights. It has happened several times.
 
night!
 
I'm going to bed after I finish a couple articles too.
 
@Hosch250 did you see my edited decorator answer?
 
4:22 AM
@Mat'sMug No.
 
aw
 
Reading now.
Nice.
Now, what if I have a decorator for a decorator?
Like, what if I have a decorator for squeeky brakes.
 
you don't.
you have another decorator for ICar
you just happen to be giving it a SqueakyBrakesDecorator instance, but it treats it as any other ICar
 
Then, I have another one for failing, squeeky brakes?
But, what if the brakes have to squeek to fail?
So, a failing brakes cannot exist without squeeking brakes.
How would I document that?
 
that's what I hate about the ICar example.
 
4:29 AM
Oh wait, did I just get myself into the wizards and warriors situation?
LOL, I think I did.
 
what's the wizards and warriors situation?
 
I'm going to bed, see you later (or would it be earlier?).
Night.
 
night
 
Mod awake?
8
Q: Generic domain independent Monte Carlo Tree Search methods library

nejc92I've written this small generic library for the purpose of my Bachelor’s thesis. It's fully functional and unit tested and I want to get as many opinions as possible regarding overall code quality (readability, naming, structure, coupling, cohesion, etc.). Suggestions on how I could improve the l...

 
yup
 
4:34 AM
That question ... an interesting case involving a boounty.
 
misclicked "reward existing answer" I guess?
 
I have recommended huge changes for the way the generics are on in his interfaces, and classes....... but he's not happy....
Hmmm..... perhaps.
 
so... who do I nuke?
 
I would prefer if someone other than me were to ask, and suggest a follow-ion instead...?
(instead of "more attention").
 
> This question has not received enough attention. - really? If you have implemented the advice already given and would like additional feedback, feel free to mark this one as accepted and ask a new question with the updated code.
@rolfl ^?
 
4:42 AM
That will start the process... yes. Remember, though, that only a mod can refund the bounty, and if a follow-on happens, that would probably be the right thing
(to refund the bounty).
Thanks.... I need to hit the hay. hard
 
...but if he started that bounty in order to receive more answers, he knows his bounty rep is paid and gone. I'm not sure I'd refund a bounty for a user that didn't get more answers than the already-quite-comprehensive answer they got: if it's not to reward the existing answer, it's worth losing the rep IMO.
it's part of the game
 
Well, that's true. Hey, it's no skin off my back.... the bounty he posted has earned me a couple of +1's on my answer
 
I'll leave it on :)
 
Just seems like an odd thing to do.... but also thought I am not the right person to ask him.
I was not suggesting a unilateral "refund the bounty", just a "Are you sure this is the option you want to take, these are the other things you could do, and a mod could possibly refund the bounty".
Night... for real.
 
'night
 
5:09 AM
Monking
 
monking!
 
0
Q: Can this approach for getting user's property be improved?

Sirwan AfifiCan below extension method be improved? public static string GetAvatar(this System.Security.Principal.IIdentity user) { var service = SmObjectFactory.Container.GetInstance<IApplicationUserManager>(); return service.FindByIdAsync(int.Parse(user.GetUserId())).Result.Avatar...

 
 
1 hour later…
6:40 AM
monking @all
 
hey @chillworld
 
6:56 AM
Monking
 
@Mat'sMug In Java, either you override a method, or you don't. I don't think that would be possible in Java.
 
you don't use @Override, but expose the same signature...
I think that's only a warning.
 
7:13 AM
that's not even a warning, that is an overriding. Using @Override is optional
 
7:32 AM
This is a blatant copy of an answer at CodeReview, without attribution. — Patrick Hofman 45 secs ago
 
wat..
SO people start copy-pasting CR things???
I guess we're famous now :D
hi @JacobRaihle welcome to the 2nd monitor
 
vogel, can you give link of deleted answer?
 
yea, what's the parent post?
@chillworld when / where was it deleted?
I cannot search for deleted posts, that's a mod only thing
 
Zak
@Duga I'm not sure what's more impressive, that we're famous enough for people to be stealing our answers, or that somebody managed to recognise it.
 
there was another answer on the same post, that actually attributed
I'd guess Hofman just saw both of those, since he has his own answer in there...
and since he's a poweruser ...
 
7:43 AM
0
Q: Please have a look at my bugfix

Programmer 400I was asked to change code that I maintain (but didn't write) for a learning management system that previously listed an examed course both under examed courses and other courses and now my task was to exclude the examed course from other courses. The following is the bugfix that I would like you...

 
I can't see the comment anymore
the one @duga spits out
 
@Vogel612 Hi, thanks!
 
8:24 AM
Monking :-)
Welcome to 2nd, @JacobRaihle
Kiss goodbye to all productivity you had ;-)
(But say hello to the nicest people you'll ever meet on the interwebs)
 
Hi all :)
 
what brings you here? :)
@Duga deleted :(
 
Nothing in particular, I followed a link here on thursday or friday and got stuck
 
That's how most of us end up here
 
@ARedHerring hey, fancy a 50 rep bounty??
it has only 2 days left, and I don't want to bounty the current answer, because it's not addressing my questions..
or are you good with javascript @Jacob?
 
8:34 AM
@Vogel612 link?
(Is this the question you asked a while ago?)
 
8
Q: Early Access: Dynamically expanding input element table

Vogel612This code is in a really early state in the lifecycle. I'm still in the process of implementing some core features, but nevertheless the code up to here works and accomplishes its task. I have no idea as to how well, though. This code is intended to give a dead-simple way of creating growable a...

yes.
 
I've been meaning to review it, but I keep getting distracted by work and responsibilities
 
oh those. I don't have those right now
 
I'll see if I can do something at lunch today, sorry for not reviewing it sooner :(
 
no worries :)
 
8:35 AM
I'm semi-AFK though, I have to get shit done today
 
even Flambino already called a review on it, but didn't get to it yet.
 
And yeah, I can see what you mean about your other review, it is rather lacking
 
I actually tried to get it into my codebase. and the only really usable point is the handling of defaults with a short-circuiting ||
 
and even then you could just use _.defaults() from any decent helper library
 
it's vanilla, you know?
 
8:42 AM
Yeah, I know :P
Although as a project grows you will almost certainly want to use some features from lodash
 
I don't think I'll make this become something big
 
okay, sure :P
fair enough
the main thing I see with your code is mixing dom/logic together
but thats pretty common
 
0
Q: Defining application flow in ASP.NET MVC5

Dion V.Currently I am assigned to a project which has a standard view-flow, yet this flow is determined by whether settings are set to either true or false. So, for example, let the standard flow be View1 > View2 > View3. When the customer has no need for View2, the application should be adjusting thi...

 
8:57 AM
You tell us what's wrong and what's the problem - then we maybe can help. However in this form it's off-topic it's not a code review site. You find one here: codereview.stackexchange.complanetmaker 5 secs ago
"What is wrong" is a very strong indicator this code is not working as expected. Just because OP seems to not be able to write a coherent question stating the actual problem, that doesn't mean this is a Code Review question. In it's current form the question will be close-nuked on Code Review.SE. What you should have said instead is the following: "What is the error you see happening?" @planetmaker — Vogel612 30 secs ago
 
0
Q: Android/Java - better Toast function

Yousha AleayoubI made this method for a better TOAST. But i feel bad... Because this TOAST forced me to make 2x methods, and get 2x contexts from arg. Now i would like to improve it, shortening my code, choosing a better approach and more professional (overall structure, splitting onto logical units, accordan...

0
Q: Maze solver for 2d matrix in Ruby

RobDelI got rejected for a junior Ruby job entry where I had to solve a 2d matrix as a maze with walls. This is the main class: solver.rb ## # 2d matrix maze solver # # The story: # The program parses the maze as a string when the object is initialized and # saves it in an array. The nodes are saved ...

 
9:13 AM
@Vogel612 @JacobRaihle perhaps you should leave a link to the help center about what is on / off topic on CR?
I understand it has been done to death but I don't think OP will get the point without reading the help center (even though he should know to have done that before recommending the migration)
javascript can be truly beautiful sometimes
 
@ARedHerring Fair enough, I'll keep that in mind
 
then again, from his profile:
> mercurial enthusiast
 
Can you fix your formatting, please? And code reviews might be better placed over at codereviewdhke 26 secs ago
 
he clearly likes beating himself up, so shrug :^)
4
A: Why isn't everything assignable in JavaScript?

Dan Pantryx.field is a boolean value; boolean values are primitives and are read-only. When you attempt to assign a value to x.field.netType, you are attempting to modify the value of x.field. Pointy's answer mostly explains this. When in 'normal' JavaScript mode, this results in the value simply being un...

Could someone upvote this so I can actually comment on SO?
Can you fix your formatting, please? And code reviews might be better placed over at codereviewdhke 4 mins ago
OP does not appear to be asking for a code review
 
At first I wanted to downvote and suggest moving it to codereview, but after rereading and noticing the actual question, his seems valid and well-asked question to me. — quetzalcoatl 43 secs ago
 
9:30 AM
Monking
 
monking
 
9:56 AM
1
Q: Proper way to insert a record and assign the id to the Entity object

Adrian ArseneScenario: I need to insert a record in a database and use the id resulting from that operation for every other operation needed. So I've created a class that contains all details of the object that needs to be persisted in the database and added an Id field to store the record id returned by th...

 
10:09 AM
I'd recommend commenting the code and specifying exactly what it should do, then underline the actual problems and how you solved it. Finally I'd move everything here. — Mena 1 min ago
 
10:19 AM
@Mena Given that you can replace all the code with a single line, I'm not sure how appropriate it would be for Code Review. Is it appropriate for Stack Overflow? Probably not in its current state, although it may be editable to be so. — Dukeling 18 secs ago
@Dukeling well, Code Review allows questions asking to improve current code. Which is OP's essential question: "have I improved it well enough?". The problems I see with the current question is that it's all introduction and code, but no functional description on scope. Definitely not a great SO question but could be salvaged in Code Review, in my opinion. — Mena just now
 
10:39 AM
@ARedHerring Any reason why you are running 2 accounts on SO?
 
0
Q: Object destruction in Qt

newtoQt_sI am new to Qt and am trying to understand object destruction and where I need to explicitly destroy objects using delete. The following is the code. class MainDialog: public QWidget { Q_OBJECT public: MainDialog(QWidget *parent=0); private: QPushButton *m_newClick; ...

 
@rolfl Facebook has been blocked in my work, which means I can't sign in using it - Unfortunately, this account is tied to Facebook so I'm pretty much out of luck there
Believe me, if I didn't have to use two I wouldn't..
 
10:59 AM
0
Q: Diagonal difference

CodeYogiGiven You are given a square matrix of size N×N. Calculate the absolute difference of the sums across the two main diagonals. Input Format The first line contains a single integer N. The next N lines contain N integers (each) describing the matrix. Constraints 1≤N≤100 −100≤...

0
Q: A few problems in my shoot 'em up game code

Soul_MI have been trying to code a shoot 'em up game and so far i noticed a few problems when i run the code. Problems i see include a few light red circles and bullets appearing at the start when it should not. After that, two light red circles should appear and move down like a sine wave smoothly.H...

 
@ARedHerring you can associate multiple openId providers with 1 account..
 
@CaptainObvious broken
 
you can request an account merger
 
@Vogel612 Yes, but the problem is that I can't get onto the account settings without logging in through Facebook.
@Vogel612 Which I intend on doing
Nearly all of the openID providers are blocked in work
The exception is G+, which I have used with the other SO account
(poor G+, even forgotten when ti comes to block lists lol)
 
0
Q: Updating multiple connection from multiple suppliers

Andrew_LvovI feel pretty stupid about this question, so asking your advice about this. Let's say you have suppliers and customers and orders from one to other. For example, s1 ==apples,tomatoes=> c1 ==apples => c2 s2 ==potatoes ==> c2 s2 ==oranges, potatoes => c3 etc. There are two version to implement...

 
11:09 AM
@CaptainObvious hypothetical, doesn't even have a language tag
 
11:31 AM
0
Q: Segmentation Fault encountered

rg666Expected Output:- b Problem Encountered:- Segmentation Fault #include<stdio.h> void main() { char *k = "ayqm"; printf("%c", ++*(k++)); }

 
Monking
 
monking @skiwi
 
@rolfl Why did you write int[] uniqueValues = new int[500]? OP says the matrix can have 1000x250 values.
Context:
5
A: Unique value finder

rolflYour algorithm goes through each cell, and for each cell, you compare the values against each possible value (200,000 of them). If you call the cells the input size (\$n\$) and the distinct values (\$m\$), then your complexity is \$O(nm)\$. You cannot avoid the scan of each cell in the matrix (t...

@toto2 You said I could do it in Scala... Could you tell me how?
Context:
2
A: Roman Numerals in Java

toto2I like that you use an immutable map. However I don't like the name map: you should give it a more descriptive name and it should be capitalized since it is a constant. You should also declare the type of map as LinkedHashMap: it is important here since you do use the ordering property. You ca...

Thanks @chillworld @Santa ;)
 
11:51 AM
damn, how did you know it was me?
 
Intuition.
 
I'm trying to be a ghost, read in chat and sometimes talk here ;)
 
I found a haunted room yesterday.
18 hours ago, by ambigram_maker
Just walked into a Haunted House Room!!!! D:
 
    if (uniqueValues.length == uniqueCounter) {
        // expand the array if needed.
        uniqueValues = Arrays.copyOf(uniqueValues, uniqueCounter * 2);
    }
@ambigram_maker ^^ it's a common memory-usage improvement to reduce the preallocated unused memory
 
@Vogel612 isn't this exactly what List<T> does?
 
11:58 AM
Oh... sorry @rolfl. nevermind.
 
for Java it's what ArrayList does, yes.
List is not bound to an ArrayBased implementation...
 

« first day (870 days earlier)      last day (3130 days later) »