« first day (345 days earlier)      last day (3678 days later) » 

12:10 AM
@PatoSáinz The script runs after three more hours.
 
12:28 AM
0
Q: How to force base class functions to be used from base class?

CalprattThe answer to this question is probably "W-what!? What the !@#$-- Stop!! That's a terrible idea!",. but I would like to hear your thoughts... Lets say I have two classes and one inherits from the other. class A(object): def t1(self): self.t2() def t2(self): print "A" cl...

 
1:05 AM
0
Q: Find the sum and multiply equilibrium

JavaDeveloperFinds the equilibrium. For sum/mult an equilibrium is defined as the index i at which sum/mult of all elements at index < i is same as sum/mult of all elements of at index > j. respectively. Edge cases are documented clearly in javadocs. Note, I do understand merits of unit testing in separate ...

 
1:28 AM
You've earned the "Nice Answer" badge for Hi! What brings you here today?.

You've earned the "Notable Question" badge for Is my coding technique progressing in terms of C# loops?.
 
0
Q: Rails engine testing - use dummy app or real parent app?

niftygriftyI'm using Rails engines to break up a big app into smaller pieces. The parent app mostly handles users and authentication. In one of my engine tests I want to log in a user before each test. How should I access this user log in functionality, which exists in the parent app, from the engine? It ...

 
why doesn't the tag formatting work in comments on the Meta site?
 
Anonymous
@Malachi because
 
@PatoSáinz lol really?
 
Anonymous
dunno
 
1:42 AM
Dang it @Jamal
 
@Malachi You were about to vote to close?
 
yeah I figured I would write a comment first...lol
 
I actually knew about this some time ago, but I was just waiting a while.
@Malachi Now you can put a close vote on that question you've just edited. It appears to be example code.
 
wait which one....
 
2
Q: Forcing base class functions to be used from the base class

CalprattThe answer to this question is probably "W-what!? What the !@#$-- Stop!! That's a terrible idea!", but I would like to hear your thoughts... I have two classes and one inherits from the other. class A(object): def t1(self): self.t2() def t2(self): print "A" class B(A): ...

 
1:47 AM
there was one I was thinking about editing but it isn't example code
he says this is what I got and it works but I think there is something better out there
> This is all I could come up with, and it works, but I'm thinking there's a better solution.
he says that right before the second code block
 
You could ask him if it is example code or not. The variable names do give it away. Check this Meta post if you haven't already:
10
Q: Why is hypothetical example code off-topic for Code Review?

200_successAs stated in the Help Center, one of the criteria for a question to be on topic is: Is it actual code from a project rather than pseudo-code or example code? What is the rationale for that rule?

 
oh I see.
I didn't even read the code because I don't know enough Python to make heads or tails of a lot of stuff. but I see what you are saying
 
Is this example code? The edited out "let's say" and the variable names suggest this. If so, then this is off-topic as we only review real code. — Jamal ♦ 7 secs ago
 
@Jamal I was writing up a comment when you posted...lol
keep at it, I need to shower and shave my head while I am at it
 
Alright, have fun. :-)
 
1:55 AM
@Malachi Things you don't need to know .... # 102
 
@rolfl where is this list of things I don't need to know?
 
lol
3
 
The NSA keeps it for me
 
One more hour until possible reversal...
 
Anonymous
@Jamal yea?
 
2:02 AM
Perhaps, at that time. Maybe I'll get lucky.
 
2:25 AM
Hey, @syb0rg! I've fixed my answer here. All this time I didn't know that you can't pass by reference like you can do in C++.
 
@Jamal I was wondering what you were trying to do, lol.
Looks good.
But you already got my upvote ;)
 
I've also reinstalled an IDE for C, so I was able to test it fully. It also allowed me to discover that CTRL+D doesn't work for Windows.
Hopefully Santa will see it. One more to Necromancer. :-)
 
int valid_char(char ch)
{
    return (!isdigit(ch));
}
@Jamal You could simplify the first method to that^^^
 
Oh, that's what you meant. I kept it as is in case other tests are used (based on Loki's link).
 
Sounds good, my version may be more unreadable...
 
2:31 AM
Knowing you, it might still be more robust than mine.
 
2:44 AM
Hey, @NiallC. came! Welcome to the 2nd Monitor!
Also, we need to think about changing the room name. Technically, it should be "The 2d Monitor".
And no, that is not 2D, as in two dimensions.
Hello @Mat'sMug
 
I just played the most insane 2048 game
@syb0rg what's that about?
2<sup>nd</sup> isn't the standard thing?
 
@Mat'sMug Extreme proper English usage.
I have a reference somewhere...
I'll probably find it tomorrow :/
 
Next step, 20K .... ;-) if you can now spend some time on CR isntead of 2048 ;-)
@syb0rg Huh?
 
@rolfl you're just jealous ;)
 
@rolfl Ordinal numbers
 
2:56 AM
nice! I browse questions, and find this:
2
Q: Using model view presenter (MVP) in C# code

ChathurI'm a beginner to Model-View-Presenter pattern and I'm finding a way to use it in a sample application In my C# winforms application has a Employee Class and it has properties like EmployeeID,Name, Address, Designation etc. Also it has behaviors like viewEmployee(), AddNewEmployee(), PromoteEmpl...

this is a returning customer! :D
 
It was news to me too, but then one of my teachers pointed out that my usage was technically wrong.
@Mat'sMug Invitation to the chat room may be in order.
 
@Mat'sMug perhaps ... I never made it to 4096 ;-) my high-score is somewhere around 22K
 
@Mat'sMug: Two more minutes until... you know.
 
@syb0rg hmm.. it's actually fraying with off-topic, it's not real code, it's his "current understanding" of MVP, wants high-level design guidance => Programmers.SE
 
Hm... no reversal.
 
3:14 AM
right
 
In that case, it looks like my progress won't be delayed. 230 rep to go.
 
3:27 AM
@rob0t is back online.
 
3:39 AM
yay!
 
Darn, I could've handled that NAA flag just a tad sooner. :P Still fast.
 
the one I just flagged?
 
Yeah
 
@rob0t told me about that answer ;)
 
Good rob0t! :-) Even better for spam! In such cases, I'd also delete those posts from the chatroom.
 
3:46 AM
@Mat'sMug the more I look at that question the more I find it off-topic, but I'm reluctant to cast a close vote... I answered it.
anyway, TTGTB now - 'night!
 
Night!
 
@Mat'sMug Good night!
Dammit, I think I'm writing a malformed WAVE file.
And I have no clue why.
 
4:10 AM
@syb0rg Thanks. I finally made it here. :) I was on mobile all day yesterday and forgot about the invitation this morning.
 
4:43 AM
0
Q: How to use string frequencies list in Trie data structure?

user2809564I am working on some performance test on various data structures. In my list I have HashMap and Trie data structure. I am done with HashMap but not sure how to use Trie for below problem - I have a text file which contains 2 million english words with their frequencies in this format - hello 10...

 
5:13 AM
0
Q: A faster way to combine two SQL table

Mustafa M JalalI would like to give it a try and ask about my codes on here from now on to see if there are improvement for'em this code is supposed to combine two sql tables into one. SELECT * FROM (SELECT * FROM posts WHERE id < $lastpost AND position = submitter order by id DESC LIMIT 5) t1 JOIN (SELECT us...

 
5:53 AM
1
Q: A simple Thread Pool

Loki AstariA very simple Thread pool: Any work added to the pool will be executed. The destructor will wait for all work to be finished before letting the threads stop. We then join all threads before letting the destructor exit. #include <thread> #include <mutex> #include <condition_variable> #include <f...

 
6:36 AM
0
Q: How to handle code review interations?

JoelIs it okay to edit the question to include the improved code? I would like to do so for the following reasons: To share the improved code with others To show the answering persons that I take their feedback seriously To make sure that I understood (and implement) the feedback in the right mann...

 
6:58 AM
0
A: How to handle code review iterations?

JamalFrom a mod's perspective, I see this as a major complication on this site. Although different questions can go through different iterations (or none at all), these things are certain: The original code must not be updated based on answers; we want answers to be linked to the code that was revi...

 
0
Q: Simple Optimisation for Sprite Animation

MunkybunkyThis code animates the my main game sprite by increasing the animation frame. How can I make it more elegant and optimised in terms of speed. if (moving){ anispeed++; if (anispeed==animaxspeed){ anispeed=0; animationframe++; if (animatio...

 
7:25 AM
Monking! :)
 
Monking
 
0
Q: An integer array of size n is A[] given, find any three numbers s.t. A[i] > A[j] > A[k] and I < j < k

JavaDeveloperReturn any three descending numbers that appear sequentially in the input. Since problem description contains 'any' I could not unit test using junits. Looking for request code review, optimizations and best practices. final class DescendingTriplets { private final int high; private fi...

 
7:46 AM
0
Q: QuickSort C# Implementation

RedPolygonIt has been a while I haven't implemented a QuickSort and I wanted to write it down like I remembered. Here it is: int MyPartition(List<int> list, int left, int right) { int pivot = list[left]; while(true) { while(list[left] < pivot) l...

 
8:04 AM
0
Q: How to get exit code of a parallel process launched by xargs?

bLuEdDyI'd made a script for launching parallel rsync process: #! /bin/bash LIST=$1 DEST_DIR=$2 RSYNC_OPTS=$3 #echo "rsyncing From=$SRC_DIR To=$DEST_DIR RSYNC_OPTS=$RSYNC_OPTS" echo $LIST|xargs -n1 -d, echo|xargs -n1 -P 0 -I% rsync --rsync-path='sudo rsync' ${RSYNC_OPTS} % ${DEST_DIR} Then, I have pr...

 
8:37 AM
Morning!
 
Morning..
aren't you faster, normally?
It's almost 11AM and you just came here??^#
 
It depends, really
No university or work = Late
University or work = Early
That might explain
I might even start to write a CR anwer..
 
soo... you might?
I got one. Quota fulfilled ...
 
Well I'd need to find oneo I'm able to review
This teacher will be surprised... Got a mail asking for confirmation on a prsentation tomorrow, and replied within one minute.
Ah, you are looking at
2
Q: Find the sum and multiply equilibrium

JavaDeveloperFinds the equilibrium. For sum/mult an equilibrium is defined as the index i at which sum/mult of all elements at index < i is same as sum/mult of all elements of at index > j. respectively. Edge cases are documented clearly in javadocs. Note, I do understand merits of unit testing in separate ...

aswell
I fidn it very hard to try to answer such question... Too much non-obvious things going on, on which there is not much to review unless I'd be using Java 8 in my review :P
Brain's messed up:
32
Q: If I were you, I'd apologise to *my* (OR) *your* mum

GuestyI'm stuck with this example which I don't know how to solve A: I've said bad things to my mum. B: If I were you, I'd apologise to your mum. Is it suppose to be 'your', or 'my' instead? My feeling tells me that your is right, but my sounds more logical.

 
8:57 AM
Answer is finished.
Still not understanding why that guy used double..
 
9:07 AM
Why must both CR and the chat se the same CR icon, hard to differentiate now
 
that's the same for all chatrooms..
ask a meta question on MSE..
or isn't it up yet?
 
I actually don't know
I should start with my TCG idea now.. for the challenge
Hoping it isn't hard to connect it to github, I've done it with another project aswell earlier
 
TCG?
 
trading card game
 
aaah
the t was missing ;)
 
9:11 AM
well I don't know how to call it else :p
 
no idea..
 
I actually got an older project I made 1 year ago, but it doesn't do right to my current coding skills
 
I am starting to understand how the standard C++ classes for parallel programming work.
 
It's not too bad I guess though
Sounds cool @Morwenn
SyncObject syncObject = new SyncObject();
Network.getInstance().send("login " + username + " " + new String(password));
Network.getInstance().sync("loginusernamedenied|loginpassworddenied|loginconfirmed", syncObject);
synchronized(syncObject) {
    while (!syncObject.isProcessed()) {
        syncObject.wait();
    }
}
Is some old code I found
ouch no enums there, that hurts
 
Your parsed a string instead?
 
9:17 AM
yep
What is GUI code doing in my model there...
 
ouch,..
 
Overall I think the code is still decent
I also had a working centralized server
But the game was not playable, by far
 
9:39 AM
I think my git is alive
 
Hi @NiallC. I've seen a few excellent questions and answers from you lately. Glad to see you here.
 
Morning @200_success
 
In fact, you would rank third on this site for average score per answer — if you had enough answers to qualify for an entry on that query.
Good morning @skiwi
 
Yeah, it's up & running
 
What's the meaning of FusionCards?
also. I know your name now ..
 
9:54 AM
You can fuse cards with fusion cards
 
hi all
 
Two cards become one.
hey
4
Q: How to handle code review iterations?

JoelIs it okay to edit the question to include the improved code? I would like to do so for the following reasons: To share the improved code with others To show the answering persons that I take their feedback seriously To make sure that I understood (and implement) the feedback in the right mann...

 
Shouldnt the constructor then be:
 
So @200_success is saying that you should never append code to your original question, while @Jamal says it is okay to do so... oops
 
public FusionCard(Card first, Card second){
 // ...
}
 
9:55 AM
I don't think so, this is purely a model, this is the fusion card as is a card in your hand
Such functionality should be provided at the moment you actually will fuse cards
 
yea, but then you don't need a distinction between monsters and fusions.
 
But there is a distinction, so I don't think you should get rid of it
 
another thing, shouldn't it be derived from MonsterCard then?
 
I think you don't understand the exact meaning as of now... There are two types of cards in my game: Monster cards and Fusion cards. There is nothing more to them than that ^^
 
no more cards?
*sadface*
 
9:58 AM
My AI needs to be able to handle it
 
as soon as I get eclipse running on my home PC I think I will join the fun on TCG..
 
cool
Hmm, need to figure out how to seperate a Player from the way it interacts/thinks
 
you're missing @Override on the FusionCard#getName() btw..
 
Because there'll be a console version and an AI version
 
meh. Javadoc syntax.
 
10:00 AM
That's missing because... it doesn't implement Card, oops
It should be possible with git to only submit 2 out of 3 files I worked on, imo
Ah ye of course when committing you have those nice checkboxes
 
you work with a GUI?
 
At some point yes
 
that's pathetic. real developers use console!
 
First goal is to have a console line interface for a whole TCG
 
talking about git here..
 
10:02 AM
@Vogel612: Real developers listen to the sound patterns made by the powerconsumption of the cpu
 
Ah..
GIT with GUI yep
 
@Nobody real developers set the initial constants of the universe blah blah blah
 
Hmm, how does this whole Milestone system work on github
 
no clue. not using github.
 
Like first milestone is that the model should be complete I guess
No due dates, I don't care about deadlines.
 
10:04 AM
@skiwi and if you suddenly get the idea to add SpellCard... omg omg omg incorrect milestone..
 
Well, completing a milestone doesn't mean that you cannot add anothing anymore to a package/subpart of project
 
<-- off to grab something to eat
 
Hmm, can't I integrate with github's bug tracker? :(
 
@skiwi My post makes recommendations that depart from previous accepted practice on this site, because I've observed that appending revised code to questions tends to make a mess of things. I should have made it clear that it's a new recommendation.
Context:
6
A: How to handle code review iterations?

200_successYou have several options for follow-ups: If one of the answers gives you good advice with clear directions for improving your code, just accept the best answer and upvote any other answers you feel were helpful. The checkmark that you confer is the best way to show appreciation on this site, a...

 
@200_success no problem, it was just that I thought I spotted something that was weird
 
10:08 AM
For now, consider it an RFC rather than an edict. If there's consensus, then I may upgrade it to an .
 
ok
I think I'm in live with github already.
I commit a fix with the comment "Fixes #1." and it automatically marks bug #1 as closed
 
@skiwi People who liked issue autolinking also read: the GitHub Cheat Sheet
 
I should definately take a read at that, thanks @amon
(Very new into using git 'professionally')
Hmmm quick question if anyone knows:
 
10:27 AM
what do you understand under using it professionally?
 
public <E extends RuntimeException> void throwOnFail(final boolean result, final Supplier<E> exceptionSupplier) throws E {
    Objects.requireNonNull(exceptionSupplier);
    if (result) return;
    throw exceptionSupplier.get();
}
Is if (result) return; code-smell?
@Nobody As in submitting code in increments, tracking issues, fixing them and using milestones.
All I used it so far for is to occasionally commit code to sync between collaborators (university projects)
 
ah ok
so by professionally you mean actually correctly ^^
 
Yeah
 
or rather efficiently
 
Monking CRitters!
 
10:32 AM
monking
 
Monking @rolfl
 
Monking
 
What a beautiful Monday Morning ;-)
 
no more.
should be getting into Mocking tho.
refactoring the application for the fourth week in row is getting "boring"
 
Lunar Eclipse tomorrow night.....
 
10:39 AM
just in canada huh?
 
@Vogel612 That is work ... and why you get paid (you are getting paid).
 
the problem is... I'm doing this the fourth week in row... Alone. for a codebase coming from 7 devs running wild for 3 months.
 
In Soviet Russia, Lunar Eclipse sees you.
 
@skiwi that one's getting real old..
 
@Vogel612 - funny thing about the Lunar Eclipse, is that it shadows the entire moon, so, whomever can see the moon at about 07H00Z on Wednesday (2-am EST Wednesday) will see the eclipse. This means pretty much all of the americas.
 
10:41 AM
EST?... What's that in GMT?
 
07H00Z I believe
GMT is on Zulu time at the moment.
 
damn it's at 6 in the morning in GMT+1.
GMT is Zulu-2 currently...
 
I was guessing at the times base on our local news saying the eclipse stats at about 2am
 
I have a feeling that when coding I always create more work than there really is to do.
 
10:58 AM
@skiwi: Do you mean in the sense of YAGNI?
 
Two more upvotes for a new user, please:
 
@Nobody Not really, I am needing it ^^
 
the you don't do more than is needed or am I misunderstanding you?
 
@200_success pimpin ... ;-) !
Gone to bed yet, or woken up early?
 
@Nobody Well, it could also be done differently, take this:
    public class Hand {
        private final List<Card> list = new ArrayList<>();
        private final int capacity;

        public Hand(final int capacity) {
            this.capacity = capacity;
        }

        public boolean isFull() {
            return (list.size() == capacity);
        }

        public void add(final Card card) {
            Objects.requireNonNull(card);
            ExceptionUtils.throwOnFail(this::isFull, IllegalArgumentException::new, "hand is full");
            list.add(card);
I could also just write:
if (isFull()) {
    throw new IllegalArgumentException("hand is full");
}
But that's three lines of code versus one.
 
11:07 AM
Either you need that level of indirection or you don't (in which case it is YAGNI)
2
 
It's alrady bad enough that in add two out of three lines are for error-checking
Is there another word for switching position of two cards in your hand? Java (obviously) doesn't like a method called switch.
(In the class Hand)
 
swap.
 
Ah, how coudl I have forgotten that... thanks @Vogel612
Hmm tricky, (and weird?) in a List you cannot use the set operation on an arbitrary positive index
 
11:24 AM
why would you need to??
List != Set/Map.
List has add() and remove().
 
I guess it does make sense after all
 
what did you try?
I think the index has to exist already for the operation to complete...
 
I tried to think about it. But it makes sense to only swap elements in the list
 
btw. why would you need to swap elements in your hand.
you could just leave them unordered.
 
I'd say for visual representation you want some order
 
11:36 AM
why?
There is absolutely no need for that.
 
If I'm playing a TCG myself (years ago) I would re-order the cards in my hand
 
well. It is your decision after all ;)
 
Where's the Java CR questions at
 
12:10 PM
Would it be considered ok to purposefully submit code without javadoc and ask if it can be understood relatively easily?
 
If you also accept reviews on every aspect of the code, then I see no problem.
In fact I dislike javadoc when reviewing, but it's my personal opinion.
 
I dislike writing it and reading it myself (if not neccessary)
 
dito.
 
Though if I edit a file containing javadoc, then I must keep the javadoc up to date
 
well.. that should be a given.
 
12:18 PM
Chances this javascript code works in one try: Zero.
Dang, it worked half, that's the last I would expect
Ah, I'm stupid
 
I get that often from other people..
and even more often from my own self.
 
12:38 PM
@NiallC. The internet at my house is flakey right now, so I'm going to be on mobile a lot too.
@Vogel612 Because double is better than float?
 
Yay! My little university project works
Please do not spam requests to it as it is quota based and I need it tomorrow :D - localhost:8383/MovieComparer/index.html
Oh... You can't access my localhost
 
Not sure if people have seen this answer of mine or not: codereview.stackexchange.com/a/47019/27623
 
The input thing is probably wonky as hell, not planning to fix that
 
6 votes -> "not sure people have seen my answer"
2
 
@Morwenn Hey, I usually don't post my answers for the morning people to see ;)
 
12:42 PM
@syb0rg because floating point arithmetics sucks.
 
@syb0rg When I have 6 votes, I consider that many people have already seen my answer :p
 
@Morwenn Yeah, but you never know :)
@Vogel612 Agreed.
 
@syb0rg you got the up and running again?
 
@Vogel612 No, he can't handle my flakey internet at my house.
 
Today, I discovered std::atomic_flag: an atomic bool that is automatically set to true after its value has been read.
 
12:49 PM
maybe we could move it to some permanently running service...
 
@syb0rg: The last time I saw your answer was when I was out of ammo
well, I am off, need to fix my code at the client's site
see you later
 
Bye :)
 
Bye!
 
monking
 
1:06 PM
0
Q: Why does caching of string object performs faster?

srikanthI'm trying to implement String-Pool. I'm maintaining a HashMap to store the keys. Here is the code. public class TestStringCaching { static Map<String,String> cache = new HashMap<String,String>(); public static void main(String[] args) { int iter = 8000000 ; String[] temp = new String[it...

^^ that question seems very dubious to me
Great, after reading some exercise again (due tomorrow), I just realised I also need ot make a small report
afternoon @BenVlodgi
 
1:22 PM
0
Q: Why does caching of string objects performs faster?

srikanthI'm trying to implement String-Pool. I'm maintaining a HashMap to store the keys. Here is the code. public class TestStringCaching { static Map < String, String > cache = new HashMap < String, String > (); public static void main(String[] args) { int iter = 8000000; Strin...

 
@syb0rg morning people? they are liars. no one is a morning person. the just wake up earlier to get over the crankiness before they see anyone.
3
here is a good accepted answer that has less than 6 votes, @Morwenn
3
A: How to optimize these nested loops for better performance?

Malachiit looks like you are doing a lot with making all sorts of variables that are really confusing to look at, maybe I am simple minded and that is why I can't figure it all out. not really sure what you are doing with the t but I changed it to i XmlNodelist ClientNodes; ClientNodes = Clientes[0]...

I would vote on some of yours @Morwenn but they all look like they are in C++
 
@Malachi That's because I only know how to review C++ :p
 
lol
2
 
1:31 PM
It seems that my parallel sieve question made it to the SE hot questions yesterday.
4
 
@Morwenn nice
no Offense @Morwenn but when I see your Avatar in chat I can't help but think of Richmond from IT Crowd....
speaking of which I need to get caught up on that show
 
@Malachi Eh... I look nothing like him.
 
@Morwenn I know
 
I have curly hair and I do not look that creepy :o
3
I still have work if I want to make it to the first page, reputation-wise.
Thanks Santa ! :D
 
@Morwenn Rep is over-rated. If you can't trade it in for discounts at a good restaurant, what good is it?
 
1:38 PM
@Donald.McLean At The Workplace, the people in the first two pages of reputation could have goodies :o
 
@Morwenn That's what I'm working toward as well, lol.
Hello @palacsint
 
@Morwenn I'm in the first two pages. I'll take a cherry danish now, please.
 
hi all
 
@palacsint Hi :)
 
Hi there @palacsint
has noone seen this question, or is everyone ??
2
Q: Find the sum and multiply equilibrium

JavaDeveloperFinds the equilibrium. For sum/mult an equilibrium is defined as the index i at which sum/mult of all elements at index < i is same as sum/mult of all elements of at index > j. respectively. Edge cases are documented clearly in javadocs. Note, I do understand merits of unit testing in separate ...

 
1:56 PM
@Vogel612 Already has my vote.
Hey @JerryCoffin
 
@syb0rg mine is the other one.. I'm especially interested why noone but me voted on the answers.
 
@syb0rg Hello.
 
*meeting...*
 

« first day (345 days earlier)      last day (3678 days later) »