« first day (484 days earlier)      last day (3519 days later) » 

10:07 AM
@CaptainObvious JAVA!
 
10:42 AM
0
Q: How specific should my unit test be?

Caster TroyI have made the pragmatic decision to have my repository serve as both a repository and a a severely thin service layer. One method of the class that I want to test is the Add method. It looks like this: public void Add(Post post) { post.Slug = SlugConverter.Convert(post.Title); conte...

 
11:08 AM
Monking
 
Monking @skiwi
Brand new user, very off-topic question:
This question appears to be off-topic because the code may not compile, the code is not included in the question, and the code is placeholders for the real classes. — Simon André Forsberg 3 mins ago
 
11:41 AM
0
Q: Propel ORM on-the-fly Schema Builder

hardkingI loved Propel since I'Ve found it, but one thing i didnt like about it, was that it needs an schema xml file. I didnt'nt want to build one, but just start on-the-fly like you can with redbean php. So i got the idea to build an on-the-fly schema builder that automatically writes the schema file w...

 
11:57 AM
Monking guys. In case you missed it last night, I think you'll like this. stilldrinking.org/programming-sucks
 
12:10 PM
Top: pseudocode handed by teacher; Bottom: pseudocode from Wikipedia
Do I look like a mathematician?!
Long live Wikipedia
 
0
Q: Lwjgl Library / Engine

T_01I am writing an Opengl "Engine", based on Lwjgl. (Java) Its not finished yet, but i think its time to post it to let other people have a look on it ^^ I uploaded the eclipse project with the library and a test package: http://www.file-upload.net/download-9444411/AGL.zip.html

 
12:33 PM
@CaptainObvious ^^ Off topic
 
Crap, it's Morwenn
 
@rolfl I love you too.
 
translate fr: Everyone, speak french
Tout le monde, parler français
 
Comment je peux dire?
 
12:48 PM
@rolfl where did you find that profile picture ? Search by Image on Google only shows your profiles
 
@SimonAndréForsberg Dit quoi?
 
Je sais pas
@JaDogg Je pense que il took it himself
 
@JaDogg I took it.
 
@SimonAndréForsberg Je pense qu'il y a prenne soi-même
;)
I think
 
:D
 
12:50 PM
I don't know whether I passed french this year or not
 
@JeroenVannevel C'est exaclamente que je dit, non?
I passed french 10 years ago, probably wouldn't today
 
I passed German 5 years ago (and a bit of Chinese), and I would probably be unable to write a correct sentence.
 
@SimonAndréForsberg Bien sûr, mais c'est "exactement"!
My german consisted of making up words that sounded germany-y but had a Dutch twist
2
 
user image
2
 
When I am in France, the french comes back to me a bit. When I am home, it disappears again
 
12:53 PM
Just a note: there is an undividable space before an exclamation or an interrogation mark in French.
 
I didn't quite pass my German exams
@Morwenn That's not a total rule though. I've always learned it without those spaces (although it might be because of the Belgian French vs French French difference)
 
@JeroenVannevel Or because almost nobody really knows about this rule.
 
@JeroenVannevel God, those pseudo codes are worst ever
I'm going to create a Java -> Latex/Pseudocode translator I think for in a few months, because I cannot stand typing those pseudocodes
 
Wikipedia is good enough though
 
We need to hand it in in Latex :(
 
12:56 PM
That's one serious looking monkey
 
It might be one of the major reasons why I failed Algorithms last year
I cannot stand people that attempt to make something easy easier by making it more complicated, and then force it onto everyone else.
4
 
@skiwi I think that's what some call programming, muwahaha
 
1:34 PM
@skiwi tex.stackexchange.com is friendly
 
1:51 PM
0
Q: Monte Carlo estimation of the Hypergeometric Function

clintvalI am trying to implement the algorithm described in the paper Statistical Test for the Comparison of Samples from Mutational Spectra (Adams & Skopek, 1986) DOI: 10.1016/0022-2836(87)90669-3. The math is easy to follow in this script although very large numbers are generated and I am not sure h...

 
@CaptainObvious ?
 
0
Q: AngularJS expression redundancy in templates

pilauI sometimes find myself using multiple expressions checking on a single flag to control the state of some template, in this example, a Facebook log in button. On a second look, however, I noticed this pattern might bear a significant performance drawback for making Angular have to update the DOM...

 
2:18 PM
0
Q: PHP Class isn't being picked up

EkAI created 2 php class files and stored it in my class folder in a directory called Shoes. The code for the 2 class files are as follows houses.php enter code hereenter code hereclass house{ enter code herevar $name; enter code herepublic function set_name($new_name) enter code here{ enter code ...

 
0
Q: Error Handler in PHP

Hassan AlthafI am currently developing a Content Management System, and I have just completed the Error Handling system, which handles error's according to the user's settings. What do I want to know during the review? Every single thing I could improve to make it more flexible, robust, light weight and fast ...

 
0
Q: Error Handler in PHP

Hassan AlthafI am currently developing a Content Management System, and I have just completed the Error Handling system, which handles error's according to the user's settings. What do I want to know during the review? Every single thing I could improve to make it more flexible, robust, light weight and fast ...

 
3:09 PM
monking!
there seems to be something that looks like a comma at the right here:
is it significant in any way?
^^ MathJax looks right, but I'm just not sure about that comma-like thing
 
I've never seen such a comma before
 
1
Q: Is there ways to optimize this method that produce the intersection of several sequences?

tigrouBased on this SO answer I have created a method that produce the set intersection of several sequences : private static IEnumerable<TSource> Intersect<TSource>(this IEnumerable<IEnumerable<TSource>> source) { using (IEnumerator<IEnumerable<TSource>> sourceIterator = source.GetEnumerator()...

 
@SimonAndréForsberg I presume it's a cropping artifact
 
@Mat'sMug No. In Maths texts it is common to include formulas in the normal flow of the text, and not treat them as special figures. In the book where the image was copied from, there was probably a sentence like “If we look at <formula>, then we can see properties foo and bar” – except that the comma is not put at the start of the next text line, but at the end of the formula.
 
ah, makes sense
 
3:14 PM
There's always someone lurking in this chat room...
15
 
Orly?
 
Expect a new question from me within a couple of days btw:
 
Someone needs to review my on-disk merge sort too ;-)
otherwise it will become a zombie.
 
@rolfl YA RLY
 
4 stars and only 2 other people currently chatting.. told you there's lurkers.
 
3:19 PM
Orly?
 
(enters lurking mode)
 
0
Q: Unit testing Backbone Model

SBelI would like to hear other people's opinion on how I unit tested a functionality in a Backbone Model. As you see below, the code under test, upon being called to toggle, toggles its completed state and saves the new state: // js/models/todo.js var app = app || {}; // Todo Model // ------...

 
3:37 PM
> With 7 users above 20000 points, 17 users above 10000 points, and 62 users above 3000 points as of August 2014, I would say that this is no longer a concern. In fact, allowing users to create tags at 150 points instead of 300 is becoming problematic.
18
A: What are the advantages of graduation?

200_successDisadvantage: Existing users are probably going to experience a demotion in privilege levels, since graduated sites have higher standard thresholds: 20000: Trusted user 15000: Protect questions 10000: Access to moderator tools 5000: Approve tag wiki edits 3000: Cast close and reopen votes … I...

^^ when being a beta site is starting to be problematic... it's a sign :)
13
 
@Pops - some reading for when you have a moment ;-) Beta status is now in some ways more of a pain than a benefit (OK, not in all ways, but, still)....
 
200_success' answer about privilege levels has been updated recently. I believe it changes the overall picture. — Mat's Mug 9 secs ago
 
0
Q: My clock code stops working at Ten O' Clock

nmelssxMy clock code works at every other hour except ten o' clock. At every other hour, it increments minutes by 1 every time seconds is 60, but at ten o' clock, for some reason, it increments minutes by 1 every time seconds is 10. I don't know what I did wrong. Please help! package misk; public cla...

oh god
 
3:48 PM
I feel like commenting something along the lines of..
> Please, please, please get this to work and then head straight to Code Review with your working version. This needs a major tune-up.
 
Please no.... a person who cannot find Ctrl-a Ctrl-f ... before a code review ..... no. please.
 
haven't / won't
side note, we're now at 45,499 users
and today is beta day #1319. #1337 might actually happen :)
 
4:14 PM
> There are so many things wrong with this code that it's almost impossible to know where to begin.
 
4:30 PM
0
Q: Object key-value map reversal

Peeyush KushwahaI have implemented functions that will let me reverse a one-to-many value 'Map', that is a plain javascript object. For example, var map = {'foo': 'bar', 'baz': 'bar', 'moo': 'zoo'}; becomes var reversedMap = {'zoo': ['moo'], 'bar': ['foo', 'baz']} and also a function to bring back rever...

 
4:45 PM
0
Q: Minimal entity component system, take 2

DaggHere's a followup to Minimal entity component system. Please see that question for background. -- ecs.lua local unpack = table.unpack or _G.unpack local function addComponent(entity, component, instance) entity[component] = setmetatable(instance or {}, { __index = component }) return entit...

 
@rolfl are you around?
 
@DaggNabbit Instead of posting a new question when your previous is still unanswered, why not simply edit the old one with the improvements?
 
Hi Simon
 
1
Q: Pong game built on a minimal entity component system

DaggThis simple game is built on the ECS described here: Minimal entity component system, take 2 local ecs = require 'ecs' local ui = require 'ui' local entities = {} local velocitySystem = ecs.createSystem( { 'position', 'velocity' }, function (entity, pos, vel) pos.x = pos.x + vel.vx ...

 
5:05 PM
@SimonAndréForsberg because it's a big change
the first one will be easier to digest/review
second one adds a bunch of stuff that's harder to understand
hard enough to get Lua shit reviewed, better to leave the simple stuff alone
 
Refactoring the compiler sources is turning out being highly educative. I'm tempted to start writing an IDE when I'm done...
 
@Mat'sMug With built-in Resharper?
 
Autocomplete at least.. heck, why not.
 
lolcode IDE?
 
5:13 PM
Yeah, in C#/WPF :)
 
sounds like an awesome project
 
yeah, .. but I want to make the parser/compiler code maintainable first. Token is a class that acts as both a Token and a LinkedList<Token>... working on breaking it down into a struct Token and a LinkedList<Token> for now.
> 45,500 users
 
5:30 PM
hello
 
@Mat'sMug The comma is there because the equation is part of a sentence
 
hi @janos!
@200_success ah!
like @amon said then :)
editing MathJax into questions/answer is so much fun, I'm grateful we've got that feature enabled!
6
 
hi @Webby
 
hey
have some time for quick code review
stuck on it for a while
 
it's better to ping me here than in a comment on a question/answer
the one you linked to?
 
5:37 PM
sure
yeah the one I linked
I am trying to understand for full atomicity, do we need synchronization blocks everywhere?
 
0
Q: Having full atomicity against all the threads without impacting performance or throughputs

WebbyI am working on a project in which I construct a URL with a valid hostname (but not a blocked hostname) and then execute that URL using RestTemplate from my main application thread. I also have a single background thread in my application which parses the data from the url and extracts the block ...

 
For the full flow of understanding, I have copied most of my code on pastebin. If you want I can provide those as well
yes
 
I think there's enough info in the question
the way you worded it is very difficult to understand, but I think I got what you
it's not easy to answer (for me) so I haven't yet
 
sure :(
I see
If this makes something easy for you
I have copied all the necessary classes which is needed for the undersatanding purpose on the pastebin

This is my factory class -
pastebin.com/w3LX9NKQ

This is my client class -
pastebin.com/WWxGKbtt

This is my task class -
pastebin.com/sj9fYUwB

This is my mappings class -
pastebin.com/7RQm6bcA

And this is my scheduler -
pastebin.com/8LJ8JPEb

so the actual flow is, people will get the instance of DataClient from the factory and call getUserDataSync method by passing DataKey.
While getting the instance of DataClient from the factory, it will start the background thread which is in Data
 
please don't pollute this chat
 
5:42 PM
ohkk sure. Sorry about that
 
my biggest problem was with your explanation, not so much the code
 
I see
Is anything unclear?
 
0
Q: Initial value of variable to reduce nesting

BerloMy colleague and I were debating over the following problem. Our code currently looks like this: int actualVal; if (someCondition) { //Several lines of code. To abbreviate: actualVal = longComputation(inputVal); } else { actualVal = someCollection[inputVal]; } I proposed to rewrite...

 
@Webby I think you could rewrite the explanation to make it simpler, but it's difficult to say how exactly
 
ohhkk
 
5:46 PM
it's not an easy question for me, I'm not sure if I can answer well, but I'll try. It might not be today.
 
sure that's fine. In the mean time, I will work on simplifying it
Thanks janos
 
questions that are clear and easy to understand attract more answers
 
0
Q: Custom angular directive for data-binding on Telerik's Kendo UI

CielThis is one of my first times using code review, so please forgive me if this question is inappropriate, or not something I should post here. I'll delete it if that is the case, and I am a little nervous about even posting it, but my javascript is so bad that I really want to get some input here....

 
My correct answer here still has no upvotes stackoverflow.com/a/25587030/2792531 while the incorrect(ish) answer has an upvote: stackoverflow.com/a/25586923/2792531
 
ugh.. does this come off rude?
No, it's not ok, and yes I've seen what column A contains. You'll have 9 columns with 9 almost-identical formulas that only differ by what ranges in column A are being accounted for. What I'm saying is that if you had another column to hold the "priority groups" for each row, you could get what you need without having to subtract the "not in range" values - in fact there wouldn't be a need for a "range" at all. Just have a column that contains "High" for all such rows, and "Low" for all low-priority tasks, and so on: you're making this much harder than it needs to be. — Mat's Mug 2 mins ago
(I removed the ", and your math is wrong" part I would have put at the end)
 
5:56 PM
Travis CI integration: done
 
@nhgrif let's fix that ;)
 
;)
 
does the asker really deserve to be punished like that? (I don't know objective-C)
 
It's very strange. When I posted my answer, the incorrect answer had no votes. Then I downvoted the other answer (so it was at -1 and hopefully that encourages the wrong answer to just delete itself)
and instead, someone upvoted the wrong answer, despite my correct answer and my comment explaining why the other answer is wrong
 
I mean the question has 2 downvotes, but it doesn't seem so bad to me
 
6:00 PM
It's as rudimentary a question as possible. And it's sort of in that unfortunate area where... the problem has probably been solved, but there's not quite a clear enough duplicate.
"This question does not show any research effort."
"It is not useful"
Janos, do you know Java?
 
I know some, yeah
 
What languages do you know?
You see how his setters are backwards, right?
 
I haven't read his code
 
Of whom/what?
 
-2
Q: How To Call Methods In Objective-C

redpearI'm having an issue calling methods in a fairly simple script. For some reason, when I run the program, all I get in the console is return 0. What can I do to fix it? Here's my script: #import <Foundation/Foundation.h> @interface person:NSObject { int weight; int height; int age; ...

 
6:07 PM
it looks well formatted, and not very long
 
The formatting is from my edit.
 
I've seen so many worse questions
 
The setters are indeed totally backwards.
 
It wouldn't be too terrible if it were so absolutely rudimentary. And as I said, the only reason it can't quite be closed as a duplicate is because there are two issues going on.
His setters are backwards (that alone, could maybe find a duplicate for).
 
But getters and setters are so 20th century.
 
6:09 PM
He's not instantiating his object at all (that alone, could maybe find a duplicate for)
 
in Java with final variables for immutability it wouldn't even compile luckily ;)
I almost VTC'd that question because it didn't follow the CR rules
 
But I can't really mark it as a duplicate of one or the other because he'd still have the other problem.
And whoever just upvoted the other answer on that question (not mine) needs to reverse it. It's wrong and doesn't solve the stated problem.
 
@skiwi I guess that someone that manages to write backward setters wouldn't have bothered marking a parameter final.
 
@nhgrif I don't need to do anything
 
I'm not disputing about the answers
 
6:11 PM
I mean... it's not wrong. What it states does need to be fixed, but the backwards setters doesn't even remotely address the question asked.
 
holding back so hard...
That seems like unneeded complexity... your solution seems to be "add another 2 columns that represent already-present information so that you can use use more formulas to come up with the same result". — Supuhstar 1 min ago
 
But you are correct though that I need to revise the votes... I was voting thinking it was a CR question
 
Even with backwards setters, something besides just 0 would print to the console, as I explained in my answer and the comment to the incorrect answer.
 
it's weird who's upvoting the other wnaswer...
 
In which partial answers deserve an upvote, but realized it was SO after that
 
6:12 PM
The other answer needs downvotes.
I kind of wish this were a CR question though... so I could comment on several other non-broken issues with his code.
 
not solving all problems doesn't call for downvotes
 
It doesn't solve the problem asked about.
Meh, whatever. We can all vote how we want.
 
yup
 
But to me, on StackOverflow, if you're not addressing the primary concern, you're not even answering the question. Addressing other issues you notice is fine and optional and definitely makes a good answer better, but in my book, you're not even qualified as a good answer unless you're solving the actual issue.
 
There are some cases where questions are really hard and there isn't a best naswer. In these cases, elements of answer are already welcome.
 
6:18 PM
I would downvote the other answer if it had the same score as yours, for fear that it might accidentally get upvoted ahead of you. And once your answer is comfortably in the lead, I would remove my downvote
 
@Morwenn I could maybe agree with that... but this definitely isn't one of those cases.
 
@nhgrif This definitely isn't one of those cases. Indeed.
By the way, I still have unanswered questions on SO.
 
@Morwenn who doesn't....
 
@janos Actually, I have only one. And the answer is probably "compiler bug".
 
O RLY
it's hard to get attention on SO
not like here
 
6:26 PM
Also, nobody could help me find an algorithm to add two gray codes without converting them back to 2-complement integers :(
 
viewed 31 times.... seems pretty hopeless
 
I'm going to say "Thanks Santa" :p
 
Link?
 
3
Q: Constructor inheritance failure with boost::multiprecision::mpz_int

MorwennI tried to create a class deriving from boost::multiprecision::mpz_int and to have it inherit the base class constructors: #include <boost/multiprecision/gmp.hpp> using namespace boost::multiprecision; struct Integer: mpz_int { using mpz_int::mpz_int; }; g++ 4.9.0 gives me the follow...

@nhgrif Well, actually I'm confused. Which link did you want?
 
I'd like to know that answer
on SO a +50 bounty might not mean much though, we'll see
 
6:30 PM
both, probably
The one that saves Zelda.
 
And I don't really care that much since the workaround works and only takes 3 additional lines.
 
@nhgrif lol
 
I'd still like to know
 
I fixed your question up slightly.
 
@nhgrif Thanks :)
How come I got like 3 upvotes in less than 5 seconds?
 
6:34 PM
Ho ho ho
 
Of course someone still answered this. It's not good for any other site anyway.
 
@Morwenn I think your question might actually have potential to go viral
 
@janos I think that the feature of inheriting constructors is not as well-known/widely used as is needs for the question to go viral :p
 
Could this be a gcc bug? -- Constructor inheritance failure with boost::multiprecision::mpz_int http://stackoverflow.com/q/24912280/641955?stw=2
 
Look, the last C++ question that went viral was "What is operator>>>= ?" xD
 
6:39 PM
@Morwenn I hate those questions
 
But if it does, I will have to thank you again :p
 
Together with "[JavaScript] Why does construct X ======= construct Y return 'JS is stupid'"
Those are the two that I downvote immediately
 
@JeroenVannevel I sometimes wonder how many points were awarded on SO thanks to digraphs and trigraphs.
 
Hmm... based on comments to this question:
0
Q: Private variables in Objective-C

Perplexing PiesThe cocoa Dev tutorial states that all instance variables are private when declared Accessors All instance variables are private in Objective-C by default, so you should use accessors to get and set values in most cases. There are two syntaxes. This is the traditional 1.x syntax: [p...

Are there OOP languages for which instance variables are public by default?
 
C++ when you use struct instead of class?
 
6:43 PM
Yea, I see his comment now.
Structs are not classes though. :/ Eh.
 
@nhgrif Scala (but they are usually readonly). Python. Perl. JavaScript.
 
@nhgrif In what aspect are they not classes?
 
@Morwenn What's the definition of a class?
 
They're called structs. Meanwhile, classes are called classes.
 
A class translates to a reference type, a struct to a value type
 
6:46 PM
Unless there's a class called Struct, and it's the Struct class.
 
they're inheritently different
 
@nhgrif You can write struct Foo; class Foo { /* ... */ }; and it still compiles fine. You sometimes get a warning.
 
How do you sometimes get a warning?
 
Are we still talking about C++?
 
Whatever language for which the IDE only sometimes warning you about something.
 
6:50 PM
By "sometimes", I meant "it depends on the compiler and the level of pedantry".
 
-2
Q: Lwjgl Library / Engine

T_01I am writing an Opengl "Engine", based on Lwjgl. (Java) Its not finished yet, but i think its time to post it to let other people have a look on it ^^ I uploaded the eclipse project with the library and a test package: http://www.file-upload.net/download-9444411/AGL.zip.html

^^ add some comments will you, Looks like the OP didn't get me
 
18
Q: Can I put my code on a third party site and link to the site in my question?

Simon André ForsbergIs it OK if I write a question and instead of putting the code here on Code Review, I include a link to GitHub/Pastebin/other similar site?

^^ useful link in such situations ;)
 
What kind of computer is that cat using?
Look at the keyboard...
Rather, the part above the keyboard.
 
@Mat'sMug I can't believe that specific question wasn't asked on meta before I did it...
 
Well
It's in the help center.
The only reason it should really need to be asked is if someone caused a stink and disagreed with the rule, at which point a discussion could be had.
However, it's very useful to have a link to the meta that discusses the specific issue.
 
7:02 PM
And right now I was thinking: "Hey, why haven't I upvoted the answer on that meta?"
 
@nhgrif is that ...a red "OMG" button?!
 
-1
Q: Is that bad design?

T_01I'm programming opengl applications for 2 years now. But often i do not know, if my code design is good or not. for example: Game.java: private RenderPool pool; void addObject(RenderObject object){ pool.addObject(object); } GameMap.java class GameMap implements Buildable... private Re...

^^ this is where it all began
 
@rolfl's flowchart for the Stack Exchange sites would really be handy
Stack Exchange should add that whenever anyone is about to ask a question
So that they can direct you to the correct site
 
@T_01 You need to post the code you want reviewed. You can include a link to the rest of the library for context if you feel it necessary (see this example), but keep in mind, the smaller chunk of code you post for review, the more in-depth of a review you are likely to get. Don't overwhelm potential reviewers. Also... I don't know about others, but I'm never going to download someone's .zip file. I suggest posting the code to Github so it can be viewed. — nhgrif 8 secs ago
 
And once you have >= 200 reputation or something, you don't have to see those flowchart questions any longer
@nhgrif I just downloaded the zipfile. I trust my anti-virus though :)
 
7:10 PM
It's not even about anti-virus that much.
That's a small factor sure...
But, if it's on Github, it's so much easier for me to just click through the files and look at whatever I want to look at.
And if it's on Github, if I really want to download it and run it, I can do that extremely easily.
 
Use a virtual machine to disarm zip files from strangers :D
 
But the main point is, I don't want the hassle of downloading and unzipping files and importing them into an IDE just to review someone's code for free.
 
I guess we ed a guy again,muwahaha
TS (theoretical star) "rolfl's flowchart for the Stack Exchange sites would really be handy"
 
0
Q: Dining Philosophers Algorithm

ShreePlease visit the http://en.wikipedia.org/wiki/Dining_philosophers_problem for algorithm discussion. I have written below java program to solve this problem by Arbitrator solution algorithm mentioned in wiki to solve this. I need this code to be reviewed by you all.Any suggestions regarding cod...

 
@nhgrif I rarely do it, but this time I just downloaded and looked at how many files there was, also pressed F3 to view some of them.
 
7:44 PM
@JaDogg RSA
 
@Yuushi I have to say that the pinned link of yours was very entertaining :)
 
8:09 PM
@nhgrif Are you free to chat?
 
@SimonAndréForsberg I just read that link too. It was hilarious.
But come on, the only problem with the errors due to C++ template is that they do not always fit the max line length of the dedicated space in Code::Blocks. Otherwise, they are pretty readable.
 
1
Q: Synchronous events library

d3lI have implemented a small library that handles synchronous events with posix compliant threads. I oriented me on the already existing posix thread API. Here are the files I created: ptevent.h /*! * @file ptevent.h * @copyright < Pro Fusion , 2014 > * @date 31.0...

 

« first day (484 days earlier)      last day (3519 days later) »