« first day (501 days earlier)      last day (1831 days later) » 

12:01 AM
RELOAD!
 
Must be caching:
1336
Code Reviewcodereview.stackexchange.com

Beta Q&A site for feedback on projects you're working on, by sharing your code with fellow programmers and getting extensive feedback/review of best practices, design pattern usage, application UI, security, etc.

Currently in public beta.

 
It has started, but is still caching :)
And I have posted my 300th answer!
Damn Mug, you aiming for Socratic?
 
yes!
 
So am I... I thought....
 
0
Q: checking if a value falls between values that contain letters and numbers

fromageballI pasted the question under my solution. I am wondering how I should have programmed this, specifically the part of the question that says "Note that the range for R1-1 - R10H encompasses R1-1 to R9-9 and R1A to R10H." - I am not sure of how to check that a code falls in the range of R1-1 to R9-9...

 
12:05 AM
There I am, memorialized with FizzBuzz vs. FortRan.
 
On the image, yes...
 
quick! ask another question!
 
Huh, if you hover over the '4 years ago:
It lists the time as 12:55:35Z
 
Zulu time right
 
Boo!
 
12:09 AM
I guess we have 12 hours 48minutes to go till 1337
 
Happy 1337 eve @all
3
 
leet3v3?
 
Something along those lines
Well I'm gonna smoke an underscore and then, smoke the documentation to find out where the boo boo is in my function.
 
just don't smoke the function!
 
12:37 AM
I think I'm going to test out the iPad app for SE shortly too.
Main concern is, we frequently use back ticks in posts and I don't think that character is very easy to access on iPad
 
12:50 AM
[tag:android-ftw]
 
^^^ that
been distracted today, but it fells like it's been quiet on CR.
 
it was quiet on CR.
Java zombie down:
0
A: Trading Card Game Prototype GUI with JavaFX

Simon André ForsbergYour JavaFXGame class can use javadoc /** * This class just loads the FXML document which initializes its DocumentController */ public class JavaFXGame extends Application { The start method can be shortened and cleaned up: @Override public void start(Stage stage) throws Exception { ...

Already pushed the changes to github as I'm working on the same project ;)
And I thought "gimme-the-codez" style reviews was frowned upon...
 
Nice @SimonAndréForsberg
 
gimme-the-codez 2.0 == push the changes to github for the OP
5
 
Up late Simon?
 
1:00 AM
yeah... (what else is new?) going to bed shortly
Also, I have learned a lot more about how git works today. I managed to do a big and complicated git rebase
and I understand much better how to use git reset, git diff HEAD~1, gitt checkout HEAD~1, git checkout 9dbf2b272ca (which was what I used to checkout @bazola's code), and a whole lot more...
I think I said it before, but it is worth repeating: Git is awesome!
OK, I haven't pushed all the changes that I suggested in my answer, but some...
 
> add push ALL the things!
 
yup ^^
everything except for the things in .gitignore!
NOW!
TTGTB
 
I DID IT. Guess what I was missing? An underscore......... @Mat'sMug
Bye Simon :)
 
'night @sim!
 
Total query runtime: 257 ms.
1 row retrieved.
At least last, I was happy to see that.
 
1:21 AM
 
Yay! CS department party at my school on Friday. :D
 
@Mat'sMug someone had a lot of time on their hand to make that... still: hilarious :D
 
indeed!
 
1:44 AM
@CaptainObvious incoming!!
Taking long enough... here:
1
Q: Step 2: Creating functions the business tool will use

PhrancisI've been working on this project and here is my first function for step 2. I feel this is the most important one, as I will carry over recommendations from this review into multiple other functions that affect more table & data. Design the DB schema and table relationships, and insert data fo...

 
1
Q: Step 2: Creating functions the business tool will use

PhrancisI've been working on this project and here is my first function for step 2. I feel this is the most important one, as I will carry over recommendations from this review into multiple other functions that affect more table & data. Design the DB schema and table relationships, and insert data fo...

 
About time
 
that's ~15K new users since February or so.
 
Seems like in everything but Answer Ratio, CR is doing well above "Excellent"...
 
it doesn't matter at all
 
1:58 AM
It doesn't?
 
nope
CR is off the charts
 
So... what does?
(I guess perhaps that's what everyone has been wondering about all this time)
(I'm a newcomer so I don't know that much about it)
 
Well, I can drop a hint that Code Review is due for an update from the Community managers soon.
 
like, mid-November soon
that'll be a year
 
Probably also due to get an update from Mat's Mug on the 1337 days since beta.
Also, incoming Java question,... ;-)
 
2:04 AM
Slim Shady!
 
Standing up!
 
so, what about 1337?
 
(song stuck in head now...)
 
I repeat...
 
>_<
 
wow, time flies!
 
I guess it was just over a month ago, not too bad....
no need for an update.
Must be the new job and all.
 
my insurances are about to kick in!
 
Time to go to the dentist?
 
next month :)
 
2:09 AM
OK, so, here's an interesting one.....
 
Laws changed in Canada since I was last there? I don't recall about any kind of "kicking in" I thought you just went when needed and just sent the bill to Mr. Harper?
 
thanks, would you please provide me with a better algorithm, I need to compare that with mine to learn more. — Jack 4 hours ago
2
Q: Shady Characters

rolflAs part of my familiarization with the features of Java 8, and inspired by this question, I thought I would take the 'Shady Character' problem to 'the next level'. Find sum of number of times that each character of source occurs in the target The basic problem is that you have a 'source' ...

Should I tell him about the update ... ? ;-)
of course, but should I explain it?
 
get you'll need a room ;)
 
3
Q: Shady Characters

rolflAs part of my familiarization with the features of Java 8, and inspired by this question, I thought I would take the 'Shady Character' problem to 'the next level'. Find sum of number of times that each character of source occurs in the target The basic problem is that you have a 'source' ...

1
Q: How can I simplify this Scala networking code?

cm22I have a small TCP service running on port 4444, which given a word, will look up synonyms in a dictionary. Below is my Scala code for connecting to the socket, sending the lookup command and parsing the response. If the word exists, then the last line of the response from the service will contai...

 
I supposed you could let him now that his code is ...rags?
 
2:13 AM
I did:
Posted a follow-on question: Shady Charactersrolfl ♦ 3 mins ago
 
good monkey!
2
@rolfl is there a SEDE query showing total site users across time (like a rolling total of the "New Users in week" series of the vote+activity graph?)
 
Not yet..... want one?
 
just curious
 
@rolfl as long as you use modern JOINs ;-)
 
the activity graph is showing a number of peaks on that series, I wonder what it correlates with
 
2:21 AM
Wow, people don't know how to use SEDE: data.stackexchange.com/codereview/query/18206/…
 
wtf
 
    GROUP BY Year, Month, Count
I think that's where the issue is...right?
 
people don't know how to use SEDE SQL
TBH I didn't even bother search SEDE... I was going to fork the activity graph, but then I wondered whether you had already BTDT @rolfl
 
WITH c AS
[...]
d AS
[...]
e AS
[...]
f AS
-- ORLY??
 
@Phrancis - look ma, no old-style joins!
2
 
2:34 AM
That, and about 50 fewer lines of code! Your WeekCount seems ... odd?
 
wow it's pretty... linear
 
Not disputing it's not accurate or anything, just looks odd
 
looking more carefully though, there's an increase in velocity since end of 2013 / beginning of 2014
So 27K users in September 2013
46K users in September 2014
19K new users in the elapsed year
70.4% increase
@rolfl you call it "week", but it's really "month"...
 
You're right, I used dd instead of dw... let me fix that.
 
> The streams are surely able to compute the sum themselves in a thread-safe way.
I think he's teasing you here:
> you could reduce the memory consumption by a factor of 8 without much effort (but I don't tell you how :D:D:D)
 
2:53 AM
Wow, even MSDN uses Hungarian notation...
USE AdventureWorks2012;
GO
SELECT ROW_NUMBER() OVER(PARTITION BY PostalCode ORDER BY SalesYTD DESC) AS "Row Number",
    p.LastName, s.SalesYTD, a.PostalCode
FROM Sales.SalesPerson AS s
    INNER JOIN Person.Person AS p
        ON s.BusinessEntityID = p.BusinessEntityID
    INNER JOIN Person.Address AS a
        ON a.AddressID = p.BusinessEntityID
WHERE TerritoryID IS NOT NULL
    AND SalesYTD <> 0
ORDER BY PostalCode;
GO
p.LastName, s.SalesYTD, a.PostalCode
-- ORLY?
 
[p]erson; [s]ales; [a]ddress....
 
[s]hit;
 
TTGTB
 
[b]ye;
:)
 
@Mat'sMug I considered using a bitset..... but figured it would be slower.
It is good advice regardless.
 
3:06 AM
I thought beta for SE iPad app was open. Oh well. Submitted request to participate.
 
3:25 AM
@CraigRinger I am trying to explicitly avoid "Double Quotes" since it is a PITA to always use those. But if you do think it is best practices, feel welcome to answer the question as such. — Phrancis 1 min ago
 
3:47 AM
Is it common/standard to type an underscore in front of input parameters, like _my_parameter instead of my_parameter? Speaking SQL in snake_case
Parameter to a function/procedure, that is
 
4:05 AM
Hmm.
> To summarize: it is a well-known fact that those people who must want to rule people are, ipso facto, those least suited to do it. To summarize the summary: anyone who is capable of getting themselves made President should on no account be allowed to do the job. To summarize the summary of the summary: people are a problem.
 
0
Q: Building a simple tree structure

tangobeeI'm trying to build this simple tree: Multiverse | |--- Universe | |--- Supercluster | |--- Galaxy | |--- Andromeda | |--- Milky way I came up with this simple method which recursively walk a tree: /** * recur...

 
@CaptainObvious why do you dare interrupt a Douglas Adams quote?
 
4:40 AM
0
Q: Follow-up: Find sum of number of times that each character of source occurs in the target

JackThis question is a follow-up of this question. In the new code, I've renamed the char array and added the functionality to prevent the following "if a character is duplicated in the source, you will double-count it in the result." It was a great coding challenge as I learned a lot and would l...

 
@SimonAndréForsberg HEAD^ is equivalent to (and shorter than) HEAD~1, and in case insensitive filesystems (windows, mac) head^ works too ;-)
 
5:03 AM
@Phrancis Vogon poetry?
 
0
Q: Follow-up:Find number of times that difference of array values are equals to the number?

JackThis question is follow-up to this question. The question is to find number of times that difference of array values are equals to a number. Sample Calculation 10-21=-11 10-34=-24 10-45=-35 10-56=-46 21-10=11 < 21-34=-13 21-45=-24 21-56=-35 34-10=24 34-21=13 34-45=-11 34-56=-22 45-10=35 45-...

 
5:32 AM
morning @all
how hard can it be to subscribe yourself to a school for getting a bachelor
pretty hard, as I experianced yesterday ^^
 
6:09 AM
0
Q: NoSQL schema for weather data

Chintan PathakI am using NodeJS and MongoDB for a weather app that takes the weather info from a logger, saves it to a database, and relays the data to the browser in real-time. It is hosted here with code here which has project details and explanation. I am saving the weather data to the mongolab cloud-db l...

 
6:34 AM
'morning. I have read the help, but I am still not sure. I wrote a function and it (generally) works. My problem is that sometimes (not randomly, you can predict when, probably I made a mistake in implementing the mathematical concepts) it fails and I do not understand why. Is it a best fit here or on programmers?
 
That would be for Stack Overflow.
 
0
Q: How to refactor the repeating html tags?

pocHow to refactor the repeating html tags ? Extract with render partial ? But I think it may make it too complex ? .row.center %div.col-xs-12 .row .col-xs-6.col-sm-3.pricing-box .widget-box .widget-header.header-color-dark %h5.bigger.lighter MVaaS API ...

 
I see, thanks
 
6:50 AM
0
Q: Dragable infinite loop carousel, performance issues on dragging large number (25+) of slides

NickI have two instances of this carousel to test with, one with 7 slides and the other with 25. They run the exact same code. The 7 slide instance drags smoothly forever as intended, but the 25 slide instances is choppy when dragging. Something in the dragMove event is slowing down execution when t...

 
7:35 AM
0
Q: Optimized code for class derived from List

Tony MI need a best optimized code for the below class to increase the performance of searching data. public class TableRowInfo : IEquatable<GridRowInfo> { #region Ctor public TableRowInfo(int rowIndex, object rowData, NodeEntry nodeEntry, bool isNewRow = false) { this.RowData = r...

0
Q: Vertical-align in Nested Column

Cass03Requirements : There is Two Column, The left column is fixed width The height of two Column should be the same. Left column contain a title (can be multi-line), and an Image (limit max width,but any height) Right column contain rich text content. If the height of left column is higher than rig...

 
7:56 AM
good morning
 
0
Q: Naming of methods that perform some actions under some condition

Leonid SemyonovSorry for my English I often write such methods to avoid duplication in code. And I give them name such as: doSomethingIfSomeCondition(). For example: public class TaskDownloadFile { private boolean started; public TaskDownloadFile () { started = false; } public boole...

0
Q: LINQ query using StartsWith and Contains to limit the results for an autocomplete field

Ivo CoumansAs a source for a jquery-ui autocomplete field, I've written this action: public ActionResult Autocomplete(string term) { List<Relation> relations = db.Relation .Where(l => l.AdministrationId == Helpers.Session.AdministrationId && l.IsSupplier == t...

 
8:16 AM
sooo question
Am I allowed to do this?
0
A: Convert a doubly linked list into balanced binary search tree in-place

Pimgd(Duplicated answer from here: http://codereview.stackexchange.com/a/63125/49350) Bug: IndexOutOfBoundsException on empty list in BinaryTree.create(List<T> items). You don't have a comment stating you need to input a list containing at least something. Consider returning IllegalArgumentException...

0
A: Extract Leaves of a Binary Tree in a Doubly Linked List

PimgdBug: IndexOutOfBoundsException on empty list in BinaryTrees.create(List<T> items). You don't have a comment stating you need to input a list containing at least something. Consider returning IllegalArgumentException and adding a comment. You also have a space between a function call and its a...

 
Is the addressed code exactly the same? You can try to tailor the answer to each question if possible.
 
It's not exactly the same. His class name is BinaryTree in one and BinaryTrees in the other.
 
That's... a little weird.
 
Nah, It's JavaDeveloper.
 
True
 
8:23 AM
He copy-pastes his code for every different question regarding data structures that someone could come up with
then adds a minor tweak.
I'd love to see someone build one bit of code that pulls like 50 of his questions together, like a massive DRY
 
It may make a good Meta question, considering I don't recall seeing such an occurrence on CR before (hardly anyone else here churns out code on an assembly line, either). I have to go to bed soon.
 
monking @Jamal and @Pimgd
 
Hello
 
Hey
 
wasn't JavaDeveloper saying he was going to answer some questions to?
 
8:33 AM
Eventually, one day...
 
when he has 40k rep of questions ^^
 
Metaaaa
0
Q: Duplicated answers for duplicate subroutines

PimgdQuestion 1 - Answer 1 Question 2 - Answer 2 If a question duplicates the code... class BinaryTrees<T> { private TreesNode<T> root; public BinaryTrees(List<T> items) { create(items); } private void create (List<T> items) { root = new TreesNode<T>(items....

 
@Pimgd what's wrong with you? I can't see your picture
aah show picture solved it
 
eh?
> What's wrong with you?
That's a nice way to talk to someone.
 
mhh that's indeed a little rude
let me rephrase it
 
8:41 AM
Without even clicking on the links, I recognized that as JavaDeveloper's code.
 
@Pimgd I can't see your avatar, do you have some connection problems or am I having troubles?
 
I'm kind of tempted to close them all as duplicates.
 
@200_success we should add a new reason to close : max 10 questions without answering a question and after 10 questions you need at least 10% answers on your questions ratio :)
 
@chillworld That's not really nice.
 
@Pimgd the rephrase also not good?
 
8:44 AM
That idea isn't.
 
A more serious question might be, what to do if iterative reviews show negligible improvement?
 
@chillworld do you see no avatar at all?
 
@200_success Already dealt with, but I can't bother searching. The gist is "You'll have to explain WHY you didn't include the suggested improvements".
 
@Pimgd I know but we are CR => we help people with reviewing and we like everybody to help it.
even just saying something about nameng, constants,... is already good
@Christoph no it was only @Pimgd avatar
 
Avatar display has been unreliable for me too, from time to time.
 
8:46 AM
but already resolved
 
1
Q: Duplicated answers for duplicate subroutines

PimgdQuestion 1 - Answer 1 Question 2 - Answer 2 If a question duplicates the code... class BinaryTrees<T> { private TreesNode<T> root; public BinaryTrees(List<T> items) { create(items); } private void create (List<T> items) { root = new TreesNode<T>(items....

 
Since most of his questions are attributed to some (geeks for geeks) website... I wonder. Does he post the solutions from others? Or does he write them himself and has CR review them before submitting?
 
The style is too consistent to be the work of more than one person.
 
True
 
Given an infinite amount of time, JD will eventually solve the same problem twice in the same way.
 
8:54 AM
Ehh, he might die before that. Humans don't live forever. (Ominous foreshadowing)
 
Umm… just checking… I hope that's not a threat, because that's not cool here.
 
That's not a threat
 
That's the idea that humans can't live forever
 
That guy is a machine though.
 
8:59 AM
They say "1000 monkeys with typewriters will eventually produce Shakespeare if given enough time"
I dunno, but if the monkeys don't reproduce, eventually you don't have any monkeys anymore. (Also if you don't supply enough paper, not enough ink... the typewriters break down... etc etc etc)
I wonder why they're all named differently (BinaryTrees vs BinaryTree)
 
The infinite monkey theorem states that a monkey hitting keys at random on a typewriter keyboard for an infinite amount of time will almost surely type a given text, such as the complete works of William Shakespeare. In this context, "almost surely" is a mathematical term with a precise meaning, and the "monkey" is not an actual monkey, but a metaphor for an abstract device that produces an endless random sequence of letters and symbols. One of the earliest instances of the use of the "monkey metaphor" is that of French mathematician Émile Borel in 1913, but the earliest instance may be even earlier...
Disproven myth.
> Not only did the monkeys produce nothing but five total pages[11] largely consisting of the letter S, but the lead male began by bashing the keyboard with a stone, and the monkeys continued by urinating and defecating on it.
 
Well yeah, I'd do that too if you gave me a typewriter instead of a computer with a keyboard.
Beware, uncivilized developers ahead.
 
0
A: Duplicated answers for duplicate subroutines

chillworldFor me an answer is related to a question. An answer about formatting and naming the vars correct is also a very common answer. Do we have to redirect them to other answer of other question for that? That said, I'm even more to close the second one as duplicate or broken code. Why? Asked by th...

@Pimgd mine own unsalted opinion ;)
 
I don't like it cause you say that he didn't learn
but there was nothing to learn
yesterday both questions had 0 answers
 
0
Q: Javascript / jQuery stopwatch

user2921557just as a learning exercise I set out making a stop watch without looking up how to do it etc. I know it will have been done many times before, just looking for some feedback on what I should do to make the code more efficient / cleaner / in keeping with standards etc. Always looking to improve...

0
Q: JavaScript and callback: apply an action on each element of a callback input

nkintI'm quite new to js. I even don't know how to call this problem: apply an action on each element of a callback input, but the elements are actually an output.. I crash a lot on this situation: I have a nested callback where first I load a json array and then I perform an action on each element o...

0
Q: jQuery animations with only one callback

George02I'm aware of doing that 'magic' inside $.when(). How should I achieve same effect writing code more readable ? I read about something about $.Defferer() that I think should help but I don't know how to use it. <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title

 
9:11 AM
@Pimgd you answered it both at same time?
 
Yep
 
oke one sec, I'll edit mine post
 
I went through the unanswered java list
And saw copy pasta
So I did copy pasta
 
edited answer
 
Editted the question too, I now have 2 duplicates
oh crap
I'mmma edit it with a huge list of cases where it will apply again and again and again
 
9:17 AM
lol, you will be busy ;)
 
@StackExchange I should have guessed that it was related to JDQ's...
 
Well, if I have a list of 20 questions all the same elements in them, can I just post my answer over and over on them?
Now it becomes an interesting meta question =D
It's free rep!
 
meta rep :p
 
WOW
1
Q: Remove all nodes which don't lie in any path with sum >= k

JavaDeveloper Given a binary tree, a complete path is defined as a path from root to a leaf. The sum of all nodes on that path is defined as the sum of that path. Given a number K, you have to remove (prune the tree) all nodes which don't lie in any path with sum >= k. Note: A node can be part of multi...

This one actually fixes it!
 
Even a JDQ can learn!
 
9:27 AM
0
Q: Check if two nodes are cousins in a Binary Tree

JavaDeveloperGiven the binary Tree and the two nodes say ‘a’ and ‘b’, determine whether the two nodes are cousins of each other or not. Two nodes are cousins of each other if they are at same level and have different parents. Looking for code review, optimizations and best practices. public final class C...

Also properly applied here
updated =D
3
Q: Duplicated answers for duplicate subroutines

PimgdQuestion 1 - Answer 1 Question 2 - Answer 2 Question 3 - Answer 3 More duplicates of this pattern from the same user: Iterator for binary tree - pre, in, and post order iterators Isomorphic trees verification Return the next right node Print all nodes that are at distance k from a leaf node Cre...

25 questions, all containing the same bit of code.
What's stopping me from adding my answer to all of them?
Other than the repcap of course =D
 
Monking
 
@skiwi Hello
 
Does anyone have a clue why a 3-year old laptop (With a mobile i7, 4 GB RAM and unfortunately a regular HDD), would perform slowly?
Like... I-want-to-kick-you-in-the-screen slow
 
does it have vista
 
Nope, W7
 
9:36 AM
I have a 3~4 year old laptop that is slow as hell. Single core though.
 
or 2 webservers, 1 application server and 3 database servers
 
Oh, just got a call that I need to go
 
Windows 7 too.
 
Not even anything runs on it
 
=D I had a laptop with various webservers and database servers and application servers on it... studying IT... you just hit next in every server setup thing. Then they all launch on startup. The pain.
 
9:44 AM
hey @skiwi
 
posted my own answer
0
A: Duplicated answers for duplicate patterns/subroutines

PimgdThis started off with a two-way duplicate; That is, two questions contained the same code-pattern. In that light, I would have said "each question is separate". If a question happens to contain the same code(pattern) as another, it's perfectly valid to post answers on both questions listing the ...

It's silly, but that doesn't make it invalid or bad.
 
0
Q: Splitting values in string into array and also returning them as comma separated string

SkarvenI am iterating through a set of values that are in the following string format: 69;#Statements;#44;#Clarifications;#45;#Suggestions; (fields with multiple values returned from SharePoint.) I've created a function that both adds these values to a list and returns them as a comma separated stri...

 
10:04 AM
A different question...
Can you still add answers to a question that has a follow-up?
 
You better answer the follow-up.
 
Yeah, so why can you still add answers to the original?
 
I don't know, there may be some cases when the follow-up is better but there is something that is wrong in the original, has not been said, and does not exist in the follow-up. And since you don't know whether the author knew that it was wrong before changing it, you want to talk about it.
 
I like that answer.
 
giv mee teh rep
 
10:11 AM
kk
 
thx sans tana
 
10:33 AM
And back
 
11:01 AM
0
Q: fancy statement

niraliIt is an interesting problem to count the number of unordered partitions of a number N. This is generally done by putting N non-negative numbers in non-increasing order along a 1xN board, which sum to N. In this problem however, you are given a 2xN board. You need to fill in non-negative numbers...

 
@CaptainObvious
 
0
Q: Simple recursive program

LegatoTwo concepts I realized I needed to understand and use more are recursion and Exceptions. Thus, I combined both in the following program. Although it began with a focus on using recursion it became more about Exceptions. I think the recursive part is bare-bones and straight-forward but I would no...

 
Huh... there's a 60-second delay on posting answers.
Is there a daily cap on the amount of answers you can post?
 
11:21 AM
One thing's for certain about this site. If there's an Objective-C question (or even Swift) that I could answer that will go hot and the best answer will receive more upvotes then any Objective-C answer before it, it's sure to happen in a small window of time when I'm not around.
Despite my library of answers, several of which I think are at least as high quality as some of these answers, my highest upvoted answer is, at best, the 3rd highest upvoted Objective-C answer.
 
I just wish there were more Objective-C questions :)
 
@Pimgd yes, there's a cap.
 
Maybe what bothers me the most is that due to the nature of the sight, there's literally no value in your answers after about a week of them being posted.
 
109
Q: The Complete Rate-Limiting Guide

Lance RobertsI noticed that I can only perform certain actions such as commenting a finite number of times in a given period of time. Obviously, rate limiting is in place to prevent accidental misuse or intentional abuse of certain features. Where else is rate limiting applied on Stack Exchange sites, and wh...

 
Aaand I'm done answering
@rolfl I looked for it but I only see a captcha hit for me every minute. Other users with different reputation levels have to wait longer or shorter.
 
11:37 AM
Beta sites have different thresholds.... you would fall in the >10K bracket for these purposes, I believe.
or not, I don't exactly know.
 
Well, it wasn't that bad... only 12 new answers
 
I've seen some opvotes on those answers related to that .... thanks ... Panta!
 
0
A: Given a BST, transform it into greater sum tree

PimgdA minor bug: You get an IndexOutOfBoundsException for an empty list in GreaterSumTree.create(List<Integer> items). You don't have a comment stating you need to input a list containing at least something. Consider returning IllegalArgumentException and adding a comment. /** * Computes the grea...

And one had other feedback
lol the homepage is filled with "answered by Pimgd"
 
0
Q: Is there a better way to add a class to an element in a plugin?

MonicaI have the following code, and I just added a Class to the element that uses the plugin. I works perfectly, but I am wondering if there is a better way to do it. (function ($) { /** * jQuery Plugin Extension */ $.fn.extend({ /** * build editable * * @param {string} saveUrl...

 
Screen-grab it.... it is about the only time it won't be full of:
> edited by Jamal.
 
11:46 AM
@janos combo breaker =/
 
@Pimgd all your answers pretty much say exactly the same thing? and on top of that, do JavaDeveloper's questions really need to spam the front page? :)
 
@bazola Please direct feedback here
5
Q: Duplicated answers for duplicate patterns/subroutines

PimgdQuestion 1 - Answer 1 Question 2 - Answer 2 Question 3 - Answer 3 More duplicates of this pattern from the same user: Iterator for binary tree - pre, in, and post order iterators Isomorphic trees verification Return the next right node Print all nodes that are at distance k from a leaf node Cre...

 
@bazola - this is being discussed on meta: ... never mind... that ^^^
 
the same question came up on stack overflow and the mods deleted all the duplicate answers (at least for the guy who posted the meta question there)
 
That's because duplicates work differently on CR
damn I realize why now
JavaDeveloper's questions on CR are the SO equivalent of ... except it's
2
 
11:51 AM
Here we call them JDQs, you must be new here...
 
No... I suddenly realize what the Q is for
I know the abbreviation but I failed to understand the Q part (question)
 
Jul 7 at 21:11, by rolfl
@SimonAndréForsberg Meh, I am taking a JDQ holiday ;-)
10
A: What's a Zombie? And what are the many other memes of Code Review?

Simon André ForsbergMeme: JDQ Originator: rolfl Cultural Height: The 2nd Monitor Background: JavaDeveloper is the user who has posted the most questions on Code Review. A JDQ is of course, a JavaDeveloper Question. JavaDeveloper is the first one, and currently the only one, who have received the newly invented So...

 
Fuck floating points. vec.norm() == vec.norm() yields false. I thought that it was at least deterministic.
 
@Pimgd - you may be interested in this SEDE query..... : data.stackexchange.com/codereview/query/206619/…
@Morwenn NaN is not equal toanything, including NaN
 
@rolfl What does it do
 
12:03 PM
It scores people on various contributions to the site....
 
@rolfl The result isn't even NaN. But 3.441 or something.
The difference between vec.norm() and vec.norm() is -1.12323e-016.
And I don't use multiple threads, nor do I change the rounding mode.
And norm() does not change the vector.
 
... I suggest trying (vec.norm() - vec.norm()) - (vec.norm() - vec.norm()), maybe that will fix it
 
@Pimgd I sort things by the feedback ratio.... which is an indication of how much people vote relative to their participation in the site.
Big is good.
1.0 is 'par'
 
@Morwenn so vec.norm() actually have two different values at the same time? Are you using a quantum computer over there?
 
@SimonAndréForsberg Nope, I have a good old single core laptop.
 
12:08 PM
The 'Generated' is a basic score of how much value is added to the site based on a person's participation.
 
@Pimgd (vec.norm() - vec.norm()) - (vec.norm() - vec.norm()) actually yields 0. Now I want to die.
 
JD has a generated score of 1369 , which loosely translates to adding about 14K of rep to the site.
 
@Morwenn That, my friend, is why I don't use C/C++
 
@Morwenn hahaha
 
@SimonAndréForsberg Nope, that's why you don't use == on floating points.
 
12:10 PM
That's also a point ^^
so what do you use? A compare method to check the delta?
 
Considering that the JVM is implemented in C++, there is no reason for it to be more exact with regard to floating point.
 
abs(diff) < threshold.
 
Or is that why you use (vec.norm() - vec.norm()) - (vec.norm() - vec.norm())
@rolfl that's what I thought
 
@Morwenn No, you're wrong... on the conclusion, not the initial asseertion.
 
@rolfl Unless there is yet another layer to slow down the floating point computing, I expect that a JVM compiled with the same compiler will have the same floating point errors.
@rolfl abs(a-b) <= epsilon * max(abs(a), abs(b)) is somehow better.
 
12:16 PM
Your threshold is simply more .... adaptive.
a relative-to-the-magnitude difference, which has its own set of problems.
 
The problem is that there isn't a "best" threshold :/
 
Agreed. And, look at Java's FP mechanism, you can declare a subset of your program to be consistently computed on all platforms, deterministically: docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.4
 
Ok, I didn't know about strictfp at all.
Bottom line: if you precision, use decimal64, not double.
 
In Java, if you want precision, you use BigDecimal .... which is unlimited in both precision and scale
But, you can also use StrictMath (which is what is behind most of Math): docs.oracle.com/javase/8/docs/api/java/lang/StrictMath.html
 
But is BigDecimal helpful for 1.0/3.0? :p
 
12:27 PM
As helpful as you ask it to be.
@Morwenn - ideone.com/eKeX7E
 
The way you have to write the division is quite horrible, but the error message is pretty helpful.
 
Making math an OO concept is not convenient, but there are benefits.
You can also adjust your context to suit whatever rules you want, precision, scale, rounding, exception handling, etc.
 
That's one of the cases where overloading operators makes things clearer.
 
Agreed, Java is not perfect ;-)
of course, you lose out on using the native hardware for a lot of the performance.
but, your results are consistent.... which appears to be a problem at times ;0
 
No language is perfect anyway.
 
12:42 PM
I spent 10 years working on a financial risk analytics application. In essense, the calculations were crazy complicated modelling, simulation, and other speculative algorithms.
These things would all boil down to risk metrics that were expressed as numbers of some sort, to rank decisions, items, etc.
We would simulate situations and end up with things like 'probability of loss' with values like 0.2345223 representing about 23.5%
 
Don't become crazy while working of this kind of things all day long?
 
These numbers were validated, and tested on multiple platforms (windows, linux, aix, solaris, etc.).
and of course, there would be differences, like 0.0000001 differences.
and I am like... who cares? It's a probability of loss, it's a guess.... it's not real...!
But, we went through and fixed these things, and still managed to keep much of the performance by optimizing other things at the same time.
 
I read that Facebook wrote a shared_ptr with a small optimization. As a result, they gained 0.4% performance overall and probably spared million dollars. I still have trouble thinking like that.
 
moar stupid recruiters rargh
even if you tell them "I already have a job and the position you're offering me doesn't seem to offer me any significant improvements over my current position, so I'm not interested"
they still go on
I eventually just said "Listen, ... you make me an offer, and I refuse that offer"
I'm starting to wonder whether I should just hang up, but that might burn bridges I need later (when I AM looking for a new job)
 
They are not only making you an offer, they are documenting everything you say, what technologies you use, who you work with. They build up a picture of what your environment looks like, so they can recommend people to your company too.
in fact, often, they only call you and interest you in a job specifically to get the surrounding information.
he probably has a candidate he wants to get in to your company, and wants to know the sorts of things to make sure are on that candidate's resume.
 
12:59 PM
This time I included "You can find everything you need at URL. I don't know the border between public information and confidential information, so for questions like this, please consult the website."
 

« first day (501 days earlier)      last day (1831 days later) »