« first day (303 days earlier)      last day (2463 days later) » 

12:00 AM
RELOAD!
2
 
@Jamal - raised a flag... is that the sort of thing obsolete is about?
 
Yes, that sort of thing.
 
(I figure if I just flag your comments I will be fine ;-)
 
It's fine. Since CR is quite low-traffic, I can take the time to decide if more comments should be removed.
Oh boy
0
Q: Reversing the digits of an integer

Simon KuangFor CS class, I had to reverse the digits of an integer from the input. This is my solution: System.out.println(new StringBuilder(new Integer(new Scanner(System.in).nextInt()).toString()).reverse().toString()); My main question is this: is this too golfed? Obviously I could simply add whitespa...

 
Editing this question codereview.stackexchange.com/questions/43257/… is : Simple application to experience encapsulation ... a good title ?
 
12:08 AM
0
Q: Reversing the digits of an integer

Simon KuangFor CS class, I had to reverse the digits of an integer from the input. This is my solution: System.out.println(new StringBuilder(new Integer(new Scanner(System.in).nextInt()).toString()).reverse().toString()); My main question is this: is this too golfed? Obviously I could simply add whitespa...

0
Q: First Chess Project (ver 1.1)

darkryderI'd already asked for my code to be reviewed earlier here: question full code link: Chess Code Considering the suggestions put forth for that question, I spent a day and refactored my whole code. For those who have seen my previous question/code could you you point out anything which I have as...

 
damn, DVLR
 
Thanks Santa!
 
@Marc-Andre :)
is this "welcoming and positive"?
Hi, I have downvoted your question. Please see our help center to see what we're all about. You could edit the question to include working code that you want peer reviewed; a golfed one-liner isn't going to get you much of a useful code review ;) — Mat's Mug 44 secs ago
 
Sweet. I have surpassed 1000 helpful flags on SO.
@Mat'sMug: Looks okay to me.
 
was my last vote!
 
12:21 AM
Already?!?
 
@Mat'sMug - you can unvote the down-vote, and apply it to the cool answer.
Good answer, @200 ;-)
 
question needs an edit, vote is frozen
 
Well, for those who still have votes left, consider napalming this (which also includes an answer from Jerry Coffin).
4
Q: Bezier curves of grade n

NaClI made a function which creates Bezier curves of grade n. What do you think? float interpolate(float n1, float n2, float prec) { return n1 + ((n2-n1) * prec); } std::vector<Vector2f> make_bezier(const std::vector<Vector2f>& anchors, double accuracy=10000.0) { if(anchors.size()<=2) ...

 
a golfed one-liner isn't going to get you much of a useful code review ...unless our monkey-reviewer tackles it of course. I can retract my downvote if this post is edited :) — Mat's Mug 38 secs ago
 
@Mat'sMug - your wish ... -0
 
12:24 AM
@rolfl here, have it
 
Hm... ungolfing some code. Interesting. As long as it's not the other way around, it could be okay.
Reminds me when my computer security professor had the class un-obfuscate some C code. That was pretty fun.
 
Well sometimes golfing is a good! With JavaScript you always want to have the simplest mignified and optimized script! But the source should be readable and blabla.
 
12:45 AM
0
Q: Is it a classical MVC (Xerox Parc) implementation?

Thom Thom ThomI've been trying to understand the original MVC implementation (the Xerox Parc's one: http://heim.ifi.uio.no/~trygver/2003/javazone-jaoo/MVC_pattern.pdf). I'm sure it has flaws, but it's a simple code to practice/learn the original MVC. Working example: http://jsfiddle.net/2D4ST/ View (index.ht...

 
1:08 AM
@Marc-Andre nice answer
 
Thanks !
I've tried to come up with something different than rolfl
 
Hey, @Pat!
 
Pat
Hello
 
Hi!
 
1:26 AM
I've edited my answer, I was wrong, there were no bug in his code, but this was one lesson for don't inline everything!
 
Is that for your entire answer, or parts of it? If you think it needs more work, you can always delete it and work on it secretly.
 
No I was talknig about the code of the OP, by inlining everything, I've misread it and though there was a bug.
My answer is fine now
 
> This site is currently in read-only mode; we’ll return with full functionality soon.
scary shit
If anyone has votes, this user is getting close to 1K:
4
A: Improved indices trick

MorwennYou can get rid of the <type_traits> header but replacing your std::enable_if by a bool template specialization: template <::std::size_t, ::std::size_t, bool> struct expand_indices_impl; template <::std::size_t A, ::std::size_t B> struct expand_indices: expand_indices_impl<A, B, A==B> {}; ...

:)
3
A: Implementation of binary heap in C++

MorwennSince you try to mimic the style of STL containers (at least, that's what your comments say), there are several things you could improve: STL containers subtypes Most of the STL containers have subtypes. I am pretty sure that some parts of the library uses these subtypes. So, if you want your c...

this one too:
9
A: 99 Haskell problems, problem 9: Code Review and simplification of pack function

Petr PudlákLet's improve the function step by step, focusin on readability as well as on the algorithm itself. I believe the type of the function is not what it should be. We get a list of characters, and we should produce a list of lists: pack1 :: [Char] -> [[Char]] pack1 xs = foldl (\acc x -> if not(nu...

^^ [badge:nice-answer] waiting to be awarded
 
1:49 AM
New 1K user!
 
Woot-woot!
4th one today I think
 
:D
 
2:13 AM
I'm trying real hard on the zombie I've put a bounty on. It would have helped if the OP had included the involved interfaces..
 
0
Q: Collision detection not working. Android

user3183590I am making a small side scrolling android game for fun. I am having a problem with my collision detection. I can't seem to find the problem with this code. Can you look it over and try and help me! thank you! public boolean boolResult(){ valuesSq = new Rect[numberSq]; valuesSq2 = new Re...

 
Anonymous
Emacs is a cool OS but I find its text editor to be a little lacking
 
Like Notepad is?
 
2:31 AM
It already looks pretty short...
0
Q: Can i make this tiny bit any shorter?

Kristian RaftesethI was just writing code, and wanted to make a piece that removes everything after the character "?" if its found within the url. My code: if (strstr($url, "?")) { $url = strstr($url, "?", true); } Can I make this any shorter? It doesnt feel right to type the "same thing" twice with strstr.

 
@Jamal indeed.
This question appears to be off-topic because it is about golfing code. Please see our help center for more details. — Mat's Mug 10 secs ago
 
1
Q: Can i make this tiny bit any shorter?

Kristian RaftesethI was just writing code, and wanted to make a piece that removes everything after the character "?" if its found within the url. My code: if (strstr($url, "?")) { $url = strstr($url, "?", true); } Can I make this any shorter? It doesnt feel right to type the "same thing" twice with strstr.

 
Too late, SE...
 
almost written an answer for that :/
 
Yeah, Jamal, I think the trigger finger is sometimes a little twitchy.
Despite the short code, there is actually a real, and meaningful question in there...
> How do I avoid calling strstr(....) twice
 
2:44 AM
I've written it as a comment
 
You could always vote to reopen.
 
I did
(although I was not first)
 
How is that a code review?
 
I have this code, it works, it does not do things as well as I think it could.
What's the problem?
I think you all understood the question wrong.
He's not looking to remove code after the '?', but the content of the URL after the '?'
 
The query string
 
2:47 AM
Yes
 
I still don't think it's a good Code Review question.
 
He wants to make 3 lines of code shorter... He don't want a review....
 
@Marc-Andre no...
 
Technically it's a one-liner...
 
We wants to avoid having to parse a string twice.
 
2:49 AM
The OP ask : Can I make this any shorter?
 
yes, and that's all there is to it. There's one possible answer to this question, and it holds in a comment.
 
No, there are many answers.
 
I don't like these one-liner questions. IMHO if CR starts getting a bunch of those, overall Q&A quality on the site will take a dip.
2
 
We also can't expect every answerer to put in a review. This could attract single-line code-only answers.
 
^^ that's the best reason to avoid these questions
 
2:55 AM
And I doubt putting a post notice at the top will solve this problem.
Now, if the OP has more code to post, rather than one conditional, then it could be worth something.
 
I want a "too narrow" close reason.
 
OK, it is not a great question, but it is even more not about 'code golfing'.... I feel the first comment is misleading.
Also, not great questions are dealt with by down-voting, not by closing.
It is more than on-topic.
@Marc-Andre Change the word 'shorter' to 'shorter runtime'... and give the guy with the non-english sounding name a little slack.
 
But this not about the Op really. If this would become the main typoe of question here on Code Review, we will have difficulty having "expert" or quality here.
 
Would this be best-suited for Meta? It might help set a standard for these types of questions.
 
@Jamal I agree, we need to sort this out ASAP. We can't afford fuzzy rules, not at this point.
 
3:03 AM
@Marc-Andre point out to me the item in the help center for on-topic questions where this one is wrong? codereview.stackexchange.com/help/on-topic
 
@rolfl I agree that "golfing" was a little far-fetched.
 
Well there is nothing actually in there I agree, but there should be. But at this point it's probably my opinion and we should ask a meta question about it.
 
Reviewers may comment on any part of the code. would be applicable if it's too narrowed down on a specific issue.
 
meh, trying to apply that logic is a losing proposition... everything has grey areas... just so long as every user submits their code with an affadavit that it is their code. ....
 
@rolfl ok you win. I've voted for reopening. But I'm writing a meta post about one-liner reviews.
 
3:08 AM
We want, in fact, we ask users to submit the code they are worried about....:
> If you want a code review, you must post the relevant snippets of code in your question.
He has concerns about a small amount of code, and he posted the relevant snippets.
I know, I drive a hard argument ;-)
@Jamal - Same user editing as asking? codereview.stackexchange.com/review/suggested-edits/17866
 
Yes, it'd be nice to get a Meta post on this. Since the question isn't being swamped with policy disputes, I probably don't need to lock it. But if it gets reopened, I'm applying a post notice and watching for code-only answers.
@rolfl: I'll check.
 
0
Q: One-liners and other narrowed-down reviews

Mat's MugEvery once in a blue moon, a question gets posted (often as a new user's first post) where the OP is asking a quite specific question about very minimalistic code, for example: if (strstr($url, "?")) { $url = strstr($url, "?", true); } There is something to say about this code, of course....

 
@rolfl: They don't appear to be the same user.
 
I approved that one. It answers the OP's "off-topic" question and rewords the question to be on-topic.
 
fair... due diligence done... approved as well.
 
3:22 AM
That question now has four reopen votes. If it gets a final vote, I'll see what happens. If needed, the Meta post can be commented on the main question.
 
3
Q: One-liners and other narrowed-down reviews

Mat's MugEvery once in a blue moon, a question gets posted (often as a new user's first post) where the OP is asking a quite specific question about very minimalistic code, for example: if (strstr($url, "?")) { $url = strstr($url, "?", true); } There is something to say about this code, of course....

 
@rolfl ^^ no rush ;)
 
0
Q: Pattern for multiple datasources

VijayI already read Design pattern for implementing multiple data sources. I was hoping for general advice. I'm writing a service which will go to numerous datasources, each source requires getting copious amounts of data and changing it to a single format. I'd know what the best pattern is for s...

 
^^ off-topic. no debate.
This question appears to be off-topic because questions must include the code you want reviewed. You might be able to get high-level design guidance on Programmers.StackExchange. Just make sure you come back here with your actual working code to get it reviewed after ;) — Mat's Mug 9 secs ago
 
Anonymous
 
Anonymous
3:33 AM
"xbox, drown"
 
1 more vote
1
Q: Removing everything after a certain character

Kristian RaftesethI was just writing code, and wanted to make a piece that removes everything after the character ? if it's found within the URL. if (strstr($url, "?")) { $url = strstr($url, "?", true); } Can I make this any shorter? It doesn't feel right to type the "same thing" twice with strstr.

 
4 more votes
-2
Q: Use If/else/elif conditionals to write a basic rock paper scissors game

user3335834I have the following code for the rock, paper, scissor game. The code works fine in python 2.7. Are there other more concise, more readable, or more pythonic ways of solving this problem in python? player1 = raw_input ("?") player2 = raw_input ("?") if (player1 == 'rock' and player2 == 'scisso...

 
Updated:
0
A: One-liners and other narrowed-down reviews

rolflAs a counterpoint, here are a list of highly ranked, small-code questions that have high quality answers, and are generally successful: Each element is the sum of itself with the next element of a List: now do this point-free in Haskell Is this an acceptable method name? Implementing a Singleto...

 
Anonymous
 
Anonymous
oh god not the bees!
 
3:41 AM
Well good night!
 
Anonymous
@rolfl upvoted, am i doing my cawodoody properly?
 
@PatoSáinz do you understand the issue and its affect on CodeReview?
 
Anonymous
@rolfl don't upboats mean "i agree" in meta?
 
3 votes closed the question, then we have 4 reopen votes
and it's closed
 
one close-vote was binding...
requires 5 votes normally to both close, and reopen
 
Anonymous
3:46 AM
@rolfl lol good pun
 
lol
3
 
4:14 AM
 
edited
1
A: One-liners and other narrowed-down reviews

Mat's MugI think these questions invite low-quality, short, code-only answers and decrease the overall quality of questions on the site. They are too narrowed down on a specific issue and leave very few possible answers, and can be answered with a mere comment. I think the ought to be closed, ideally wi...

@rolfl is this on-topic?
12
Q: if return, else return

HanneshI know this is rather trivial, but it gets at me every time. The following code snippets are functionally the same, but I'm wondering which is cleaner. if(condition) { ... return A; } else { ... return B; } Or if(condition) { ... return A; } ... return B; Of course, retur...

 
@palacsint you only found that zombie because I was working on it ;-)
My answer points out the bugs in the code :0
 
:)
I haven't dig so deep
 
This is a legitimate question about the site's scope and what's on-topic and what's not. I'd really like to know why it was downvoted. — Mat's Mug 13 secs ago
So there's a consensus apparently, that anything goes and we can have one-liners reviewed here?
 
4:36 AM
@Mat'sMug I think the concensus is more: if 1 line is enough to express a problem that otherwise fits the terms of being on-topic, then it goes.
Hell, I just had a fair amount of success with this question:
4
Q: Reversing the digits of an integer

Simon KuangFor CS class, I had to reverse the digits of an integer from the input. This is my solution: System.out.println(new StringBuilder(new Integer(new Scanner(System.in).nextInt()).toString()).reverse().toString()); My main question is this: is this too golfed? Obviously I could simply add whitesp...

 
Fine, you get the meta-checkmark, and I'll skip close-voting these ones.
 
It has to meet all the other conditions... like working, etc.
It is my (opinion apparently shared by others), that short questions can still be on topic. That's the only consensus.
We recently had the same debate about answers.....
 
I'll stick to closing questions that are idiot-proof off-topic. My point wasn't about question length, it's about the scope of the review. Perhaps I haven't made it clear enough.
I even got a meta-downvote on that question.
 
Not from me ;-)
 
Maybe it was too short.
2
Don't think I agree with keeping these narrow-scoped questions open. I'm just going with what the meta-votes say. And the query should exclude locked posts, too.
Some of the posts you're pointing as reference have this notice: "This question exists because it has historical significance, but it is not considered a good, on-topic question for this site, so please do not use it as evidence that you can ask similar questions here."
 
4:45 AM
Tis one is a good example: (of what, I am not sure...)
0
Q: Counting the WORDS in a textarea

annnI've two working ways to do so, but which one should I use? function updateStatusBar() { var text = textarea.value; statusBar.value = "Words: " + (text ? text.match(/\b\S+\b/g).length : "0") + " Characters: " + text.replace(/\s/g, "").length + " / " + text.replace(/\n/g, "")...

 
See? I'd be slamming a close vote on that one. I'll hold it back and keep my close votes for the close queue, when I'm the 4th or 5th to vote.
 
@Mat'sMug - you may be right, there may need to be a policy change, but I cannot think of a way to express it that makes it fair, and enforceable.
 
^^^^ Questions like this one are poison for this site, in my own humble useless opinion.
 
That question reveals a subtle difference in the best way to use regular expressions, whether to split, or to match. In some contexts (and I am not sure whether CR is the right context), that question is brilliant.
I am happy to answer questions like that from enquiring minds who have done their homework.
 
If we keep those coming, we'll turn into a Programmers.SE.
 
4:50 AM
0
Q: Counting the words in a textarea

annnI've two working ways to do so, but which one should I use? Common part: var textarea = document.getElementById("textarea"); function updateStatusBar() { var text = textarea.value; statusBar.value = "Words: " + (text ? text.match(/\b\S+\b/g).length : "0") + " Characters: " + text...

 
That may be true.... so, does that help you refine the Meta question?
At the moment, I view that question as 'working, has code, has question, looks good'.
A good review for either part of that question would consider the other alternative (as well as any other alternatives there may be).
 
I'm going to sleep on it I think.
actually that regex one, is really a better fit for Programmers.SE because:
1. It's comparing A vs B
2. It's narrowed-down code for a very, very specific problem
3. Invites short answers being either A, B, or C (should be reworded to also ask *why*).
4. The best answer will probably inform the OP about the inner workings of the regex engine being used, and explain how A|B is more efficient than B|A because of XYZ. This is very informative, but it's not a code review.
 
That's a valid thought... but, anything with code in it is good for review. I think you are right that the question would have value on Programmers, but, it also has value here.
 
Perhaps it would more on-topic if the separate review request was retained, while removing the part about choosing which to use.
 
5:06 AM
Essentially, I have these two functions, they do the same thing, please review both; pretend your code is able to use both - which one would you use and why, and what could be improved on that one?
 
@Mat'sMug - sort of like this... huh?
3
Q: A more readable InStr: StringContains

Mat's MugConsider the following: If myString = "abc" Or myString = "def" [...] Or myString = "xyz" Then In C# when myString == "abc" the rest of the conditions aren't evaluated. But because of how VB works, the entire expression needs to be evaluated, even if a match is found with the first comparison....

 
They're small functions, ..what do you mean?
 
Meh, just bugging you in your sleep.
get some rest.
 
The question has received its 5th reopen vote.
 
Yup... see that
 
5:14 AM
So be it.
So let it be written. So let it be done.
 
Does this mean that this can be re-opened?
15
Q: Using a for-loop instead of sleeping?

nathanIn C, using sleep() would make the program wait for a short interval of time: sleep(2000); //or whatever the number (in milliseconds) But I really don't want to include unistd.h just to use sleep, so I'm doing it this way: for(int i=0; i<=100000000000; i++); // <----- note that the loop doesn...

 
And here it goes!
:D
Oh well, sweet dreams, America!
 
Good night!
 
@syb0rg Can it be? Undoubtedly. Should it be? Seems a lot more doubtful to me.
 
@JerryCoffin Even though it isn't a lot of code to review, it is a line of code, where the user specifically explains its purpose. Then he asks for a review of it. The grey areas of CR :/
 
5:24 AM
@syb0rg Question is whether reopening it would accomplish anything useful. IOW, is there really anything to be added that hasn't already been said? Granted, it's not for me to say that's necessarily the case, but I'm not convinced there's enough to be added to justify a reopen vote either.
 
@JerryCoffin You are right. Everything that the question could have garnered in responses has been said. Meh, I already threw a re-open vote at it, we'll soon see what happens I guess.
 
0
Q: Java : HashMap and LinkedHashMap

CataclysmI would like to know some tips between LinkedHashMap and HashMap. what are the similarities between them ? what are the differences between them ? if I don't want to use sorting , is HashMap more preferable to choose ? when I focus on performance , what will you suggest to use ? How these two ...

 
Off-topic: nothing to review ^^^
Alright, time for me to power down... good night!
 
Goodnight!
 
5:42 AM
@palacsint +1 thanks
 
heck, I just "answered" my own bounty question.
that code is impossible to review IMO. Too many pieces missing.
 
I thought you were asleep?
 
I had to finish that answer!
anyway I'm gone for real now - see y@all!
 
@JerryCoffin: I've just realized something. For my answer here, would auto be okay to use instead of std::size_type? I assume auto will use that same type, but I also don't think I've seen the keyword used for loop counters, only iterators.
 
5:59 AM
0
Q: Python code not offering correct results (beginner)

user3373605By the end of it, I am supposed to have a .txt file with a temperature value for every day of 2009. The problem is, the file this code creates is only giving my 12 values (one for each month) and have of them are from dates that aren't real (i.e. April 31). I'm not fluent in Python, but I've rev...

 
for (auto i = 1; ... is equivalent to for (int i = 1; ... since the type of the 1 literal would be int
you could use some form of wide unsigned literal like 1ull, but that's still of course not guaranteed to be the same as vector::size_type
 
Off like a prom dress ....
 
@Jamal You could get auto to do the job, but it's not a very natural fit. For example, if you iterated through the container backwards, you could use auto pos = container.size();.
 
Ah, okay.
@Corbin: Understood. I somehow thought that auto would take up the type of the sentinel (from size()), not from the starting value. Jerry's explanation clarifies that as well.
 
@rolfl For what? :)
 
6:12 AM
@palacsint quickly running out of Java zombies?
 
I've just killed the second one today
1
A: Calculate min, max, average, and variance on a large dataset

palacsintI'm not familiar with Hadoop, take my advice with care. Are you sure that the following is precise enough? double count = 0d; // should be an int, but anyway... Consider the following: final double original = 123456789123456789.0; double d = original; d++; System.out.println(d == original);...

 
I noticed
 
19 left
 
I noticed that too ;-)
 
:-)
 
6:14 AM
I also noticed that I keep having to upvote your answers, and that is not helping me get on to the top row.
 
The monkey vs. the letter "P": who will win?
 
I have resigned myself to reaching the top row at about 18.3K
And I will likely hhave to pass Loki to be #3
@palacsint I'm sure you've seen my TopX SEDE query... but, have you seen it with the full history?
 
@rolfl I also noticed that I keep having to upvote your answers, and that is not helping me keep on to the top row.
 
lol
 
We may could merge with @200_success
 
6:24 AM
epic is my solace ;-)
Damnit, I upvoted 200 to a 'good answer' today as well
 
@palacsint: Huh? I thought you were 200_success. ;-)
 
:)
 
Alright, I'm off. For real. Jamal, I have a SEDE Q for the Obsolete ;-)
Marshal imminent
 
 
Maah, I'l trickle them through
 
6:30 AM
I just wanted an excuse to post another meme image. :-)
 
When I am finished flagging your comments, I'll move on ;-)
 
If I recall, Undo has made an effort to seek out comments to flag, so you're not alone.
On SO, that is.
Hide yo kids, hide yo wife, and hide yo comments 'cause they be flaggin' errybody out here.Jamal Nov 19 '13 at 3:01
 
7:03 AM
@palacsint I've been practicing in preparation for merging our accounts. Have you seen?
3
A: Is this code an efficient implementation of Reservoir Sampling?

200_successA few random notes: FileNotFoundException is a subclass of IOException. Declaring both FileNotFoundException and IOException is redundant. The Sampler() constructor can be omitted, since it is just the default constructor that would have been implicitly defined anyway. Your sampler() method is ...

 
0
Q: Longest repeated substring, CodeEval

Zack GaoHere is the problem statement: http://www.codeeval.com/open_challenges/53 CHALLENGE DESCRIPTION: You are to find the longest repeated substring in a given text. Repeated substrings may not overlap. If more than one substring is repeated with the same length, print the first one you find.(starti...

 
@200_success: I would've assumed that was palacsint's answer without first looking at the name. ;-)
 
8:01 AM
hey @Jamal isn't that new python question OT?
 
Yes, I think so. I just wasn't entirely sure, if it required some Python people to verify. You're still welcome to vote to close.
 
@Jamal missing the rep yet...
but I'm on it ;)
 
Ah, right. :-) The flag it.
 
8:33 AM
@200_success +1 :)))
 
8:44 AM
ciao all
 
@geomo ciao.
 
ciao @Vogel612 :)
 
9:14 AM
1
Q: How do I solve the database lock issue on execution the query

haseebhi friends can anyone tell me what is the issue with my query. when i execute, it lock the Database for 5 to 10 minutes, please help me to optimize this query . SELECT u.username, u.email, u.created_at, p.firstname, p.lastname, p.address, p.address_2, p.ci...

 
9:26 AM
0
Q: Empty Interface usage - is this a code smell?

RondlesI've recently made a set of interfaces/classes to work with converting a spreadsheet into an object but I utilise an empty interface in my design: So first off I have my interface which defines what a spreadsheet object should have: public interface IParsedSpreadsheet<TEntity> where TEntity: IP...

 
9:38 AM
0
Q: Importing data from an external EXCEL-Sheet - Readability and Maintainability given?

Vogel612Well then, here's my first question on this site. I was assigned the task of copying some subsums from a given EXCEL-Sheet into the executing EXCEL-Sheet. This had to be done with an EXCEL-Macro, so non-programmers can easily use it. There was the need to compare the final sum of copied values ...

feedback on my first code-review question appreciated ;)
 
1
Q: Importing data from an external EXCEL-Sheet - Readability and Maintainability given?

Vogel612Well then, here's my first question on this site. I was assigned the task of copying some subsums from a given EXCEL-Sheet into the executing EXCEL-Sheet. This had to be done with an EXCEL-Macro, so non-programmers can easily use it. There was the need to compare the final sum of copied values ...

 
slow bot is slow.
 
Haha, you don't say :D
 
 
1 hour later…
10:51 AM
0
Q: Web Service proxy that switches endpoint urls in the event of a TimeoutException

Sam LeachI am creating a service (FaultTolerantCommunication) that wraps a call to a (web) service. Its responsibility is to switch the endpoint url in the event of a TimeoutException. Currently the web service is a soap web service but I am attempting to make it reusable for other remote services such a...

 
11:03 AM
0
Q: Ruby html href parser working slow

Sarp KayaI wrote this simple HTML parser in Ruby. Basically I have a folder that has files. Every file has crawled web pages. The only addition within these files is before the HTML content there is a page metadata, #URL is one of them. What I am aiming is to have two files: 1)Will contain: currentURL,...

 
hey
 
11:34 AM
2
Q: How do I solve the database lock issue on execution the query?

haseebCan anyone tell me what the issue is with my query? When I execute, it locks the database for 5 to 10 minutes. Please help me optimize this query. SELECT u.username, u.email, u.created_at, p.firstname, p.lastname, p.address, p.address_2, p.city, p.c...

^ I'm not sure this should be closed for being "non-working code": perhaps it's working, but very slow.
 
12:12 PM
Thank you Santa's ;) A very nice surprise at the end of my vacation ;)
 
@konijn now you have work to do... still zombies!
Actually, @konijn ... in your absence I thought I would tackle a JavaScript question... which I may have gotten completely wrong ... your review-of-the-review would be appreciated.... codereview.stackexchange.com/questions/43274/…
 
naaaah...
proposal closed: scope not definable
 
now it's slowly getting ridiculous ;)
 
maybe slightly
 
: allow arbitrary nesting of third-level-domains
 
12:47 PM
0
Q: Cache<Long, BlockingDeque<Peer>> combined with Striped<ReadWriteLock>: is it thread-safe

Volodymyr BakhmatiukI've implemented PeersContainer class with all operations that I need. I need something like multimap in concurrent environment, moreover I need remove entities automatically on timeout. So, I decide to use Cache<Long, BlockingDeque<Peer>> combined with Striped<ReadWriteLock>. Also I use two ca...

 
12:59 PM
0
Q: Unable to Call Class Method on Module

Jeff NymanI have a module (in file dialect.rb) defined as such: require 'dialect/generators/elements' module Dialect def self.included(caller) caller.extend Dialect::Generator::Element end def self.version "Dialect v#{Dialect::VERSION}" end end Then I have the file dialect/generators/e...

 
hmm what is easier
or nevermind
 
@skiwi no2 is... flag as OT ;)
 
What do you mean exactly? :p
The love of Java 8:
public boolean isVisible(final Matrix4f viewMatrix, final Matrix4f projectionMatrix) {
    Matrix4f mvpMatrix = new Matrix4f().identity()
            .multiply(modelMatrix)
            .multiply(viewMatrix)
            .multiply(projectionMatrix);
    return maximalAABB.getBoundingVectors().stream()
            .map(vector -> new Vector3f(vector).multiplyWith(mvpMatrix))
            .anyMatch(Vector3f::isInScreenSpace);
}
 
wow... even though I have no clue how it does what it does I understand how it does what it does....
2
OT --> OffTopic. well maybe no more after he edits..
 
0
Q: What datatype should I use to complete this task

CodeSlingerI want to be able to allow a user to not put the leading ZERO on any decimal number in a textbox in C# ( like .1 ). I then want to convert this to a decimal or float or any datatype that will represent the decimal number correctly in an SQL table. Why does the test below not show 0.1 as the resul...

 
1:12 PM
and that was just the most confusing statement you ever said, which I was still able to perfectly understand
 
see, that's exactly what I mean..
also... it's not.
 
I'm just sooo done with those complex for-loops, etc. That's so Java7
 
<-- is coding with JEE 6, primefaces & hibernate.
 
6 hurts
Have never actually coded in it... though we gotta make some android app for uni and I'm stuck with 6 then actually
 
It's not like I have to do overly complicated stuff.. provide some lists and CRUD operations for Database stuff... Some PF-Views. and that's about it.
not even calculating anything really.
 
1:15 PM
yeah pretty much the same with android, I know the feel
 
1:34 PM
Note to self: Remove methods that you have never bothered to give a working implementation of
2
 
1:59 PM
@Vogel612 Some of the code I work with at work is old Java 5 code, a lot of it doesn't even use generics!
 
@Simon You got generics?? I envy you...
I had proposed a refactoring of ~10 classes to implement a generic interface, and it got turned down: "We got enough work to do for now."
 
dump all old code out of the window!
oh wait, then stuff doesn't work anymore
 
oh well it's not that hard to see that the duplication of CRUD-Operations for Entities should be made into a generic infused interface....
but making that happen with ~10 classes
 
2:13 PM
@Vogel612 Yes, and I also got some special principles here: ask don't tell, multi responsible principle, and a whole lot of other not so nice code :)
 
Oh well it's better than the legacy asp-classic application I had to work with before this here...
Imagine you have Trainees write a webapplication
and change the teamroster every year
write in asp-classic, without the slightest sign of coding-standards.
and then examine the result........
 
Do you have a webapplication after that?
2
 
well there was a working calendar...
for 200 employees
every day had a separate record in 3 different databases...
for 3 years ahead
 
probably 255 because at 256 there was an overflow
 
and since the setup of the application..
 
2:21 PM
brb, tea!
 
My head... it hurts
 
why??
 
All I ask this little nice drawable object is: Are you visible on the screen?
With my eyes I clearly see it is, the object still dares to reply NO...
 
maybe you have some overlay shadowing the object?
and.. it's worse when it's the other way round..
you don't see it and it still replies YES
 
I'm doing a simple vector * matrix multiplication in both shader and CPU
shader is all easy and trivial
getting the same result on cpu is not
hmmm
hmmmm
ultrarage I had the MVP calculations the wrong way around
 
2:41 PM
@SimonAndréForsberg - re-reading this, it is not as clear as it should be:
huge difference... That would return all users who have answered more than 1 answer on any questions, and the ID of the first question the user answered — rolfl 3 hours ago
With the min, and no post.Id group by, the query would select all users who have posted at least two answers, and the returned question would be for the question they answered with the smallest ID.
In other words, if User A answers one answer each to questions x, y, and z... it will return A, x, 3
 
1
Q: what is replace code for while fetch?

MinAis this good way i use <div><?php echo $obj->text; ?></div> in while loop? are there best and optimize way replace this code? <?php $akhbarkotah1 = $conn->prepare("SELECT text,time FROM small WHERE active='0' ORDER BY time DESC LIMIT 10"); $akhbarkotah1->execute(); while($obj = $akhbarkotah1->f...

 
0
Q: Calling a Java Program from Cobol

gcotisI'm trying to communicate Java and Cobol. I need to call a Java program (with paramaters) from Cobol. I read some documentation from Microfocus: http://supportline.microfocus.com/documentation/books/nx40/dijafc.htm http://supportline.microfocus.com/documentation/books/nx40/dijaco.htm But I didn...

what...
 
dang it, my chat room was frozen, the one for my sites
 
"because I need to call a whole program and not a class"
 
@skiwi - What's wrong with COBOL... you know it is an OOP... right?
 
2:52 PM
<-- hrngh... AGADJASASFDAG
 
COBOL is one of the oldest programming languages, primarily designed by Grace Hopper from 1959 onwards. Its name is an acronym for COmmon Business-Oriented Language, defining its primary domain in business, finance, and administrative systems for companies and governments. The COBOL 2002 standard includes support for object-oriented programming and other modern language features. History and specification COBOL (original) The COBOL specification was created by a committee of researchers from private industry, universities, and government during the second half of 1959. The specificatio...
 
Hi!
 
Hi @Mat'sMug !
 
hey ho
 
Hey @Mat'sMug ... the pillow-time did not help settle things?
 
2:57 PM
@rolfl I think this answer perfectly represents my concerns with the site's scope being damaged - the massive votes are sending the wrong message (i.e. it's okay to skip the review part of your answer); I don't think the voting on "short questions" means anything, especially on the old ones.
44
A: Why is my C# program slower than my Python program?

valsIf you want performance, don't create objects in the inner loop: static string generate(int len) { Random rnd = new Random(); // creating a new object string alpha = "abcdefghijklmnopqrstuvwxyz"; int letterInt; StringBuilder sb = new Str...

perhaps all "please review my code" questions should be on topic here - that's the point: the question I'm referring to, is not asking for a review, rather how to further simplify/golf a one-liner. Some of the "cherry-picked" questions (and more, returned by the same query) are asking to compare A versus B comfort the OP in saying why A is better than B or vice-versa. That's not how I see a good "code review" question. Again it's not about the length of the question, it's about the scope of the review. I strongly disagree that this is the direction we need to be taking. — Mat's Mug 14 mins ago
 
Fair point, what about this question?
3
Q: Building <div>text</div> inside a while loop

MinAI use the following code <div><?php echo $obj->text; ?></div> in while loop. Is this the best way? Is there a better way, either to optimize or replace this code? <?php $akhbarkotah1 = $conn->prepare("SELECT text,time FROM small WHERE active='0' ORDER BY time DESC LIMIT 10"); $akhbarko...

(just probing, trying to find the line in your mind between what is OK, and what is not...)
 
fine by me; the code is reviewable, in an open-ended way.
 
@rolfl But I mean using MIN(answer.postedbyuserId) and still using GROUP BY question.id, but avoiding group by answer.postedbyuserId
 

« first day (303 days earlier)      last day (2463 days later) »