« first day (219 days earlier)      last day (3781 days later) » 

12:02 AM
If I would get exactly 7 more reputation, the four digits of my reputation score would be the four first prime numbers.
 
12:33 AM
As someone sitting at 3404 rep, I'm now jealous of you 3500-club members :-(.
Wow, rolfl, your rep graph makes me sad inside. You've been busy!
 
@Corbin: Tell me about it...
But at least now I have enough rep to cast close/reopen votes for post-graduation.
 
12:53 AM
@Corbin - Funny, i have been using CR as a diversion... I have a ton of real work to do, and I'm putting far too much time in to it... but it is interesting, and challenging... I am using CR as a distractin 'to take my mind off things'.
Until the past few days I have not really been trying too hard... just getting lucky.
 
quite a lot of distraction then! or youre an extraordinarily fast review writer :).
 
I figure I can do 3, maybe 4 a day. at about a half-hour each... and I have to work at least an hour before I do another one.
Given that I am doing at least 10 hrs of ork a day at the moment, this is OK.
I also toy with some things during boring meetings ... ;-)
The ones that took real time are ones where I have learned something like:
2
A: Find elements occurring even number of times in an integer array

rolflWiki Answer - discussion of scalability. After some investigation I thought it would be interesting to publish some of the performance results I have seen.... there are some interesting observations. I have taken two algorithms, both on this page, the 200_Success one, and the rolfl one. I have ...

 
Well, as I've already mentioned, I'm spending more time here than I am studying. When the decision is between programming and stats, there's no contest.
 
And that was worth spending the time on to get somrething more than a distraction out of.
At some point I am going to trace and profile that code, and fogure out why there is the dip in the one curve, and why there is inverse scalability on the 'medium' density duplicates.
I can take that data to the lead Java developers @work and probably affect future product performance.
 
1:14 AM
i usually use CR as a distraction too. 1.5-2 hours a day though? nice
 
Only because I'm putting in far more actual work ... ;-) Anyway, my review of @SimonAndréForsberg code is taking far too long... it's more than I have time for .... time for a half-arsed job.
 
It must be great being an SE employee. They actually have an excuse to spend all day on SE sites and get paid for it.
2
 
1:37 AM
@rolfl you realize you are (by far) the #1 user on this site for 3 weeks in a row (4th on its way)?
 
0
Q: Better way - How to get this form

IgaoI have the following form in my jsFiddle, I wonder if this is the best way to achieve this result ... because in my view I am using many divs. Being that he must have width 100% full window FIDDLE I thank the dedicated time HTML <div id="hexagon"></div> **x25** CSS #hexagon { width: 3...

 
@retailcoder - I am just pleased that has dropped off my 'users
Much happier with java, optimization and algorithm
 
@rolfl: I now have on mine! :D
 
2:43 AM
0
Q: Is having a master instance that all instances revolve around bad practice?

LemonyQuestion: Is having a master class bad practice? I am making a simple pong game, but I'm writing the code as if I were making for something that might be for something more complicated I want to create in the future. Also, am I not doing it in a good manner? What I am doing: I have a class, in ...

 
3:20 AM
1
Q: nodejs passport wrapper

Loki AstariHave started some experiments with nodejs. Any comment on style (especially the callbacks) and best practice appreciated: PassportControl.js /* * Export single function that creates the passportControl object * * The passport control object is supposed to be a wrapper for * nodejs...

 
3:48 AM
@retailcoder awww shucks!
 
0
Q: Local user registration

Loki AstariMore javascript (nodejs) to go with the passport wrapper I just posted: UserBook.js /* * A wrapper for user Registration for a web site. * This is an MYSQL version of the client to provide persistent state. * * Exports a single function that returns the object (UserBook) that does the wor...

 
4:14 AM
0
Q: Java PrintWriter not printing data to file

mbnewThis program is compiling just fine, and the variables and such seem to be passing through. However, when I open the text file there is no data. Can anyone point me in the right direction or nudge my brain into the right process thought? package dvdlogger; import java.util.*; import java.io.*...

 
5:02 AM
0
Q: Grocery inventory program

eclass2790so I am writing a inventory list program and I am done with it completely but I seem to have stumble on some errors: this is the errors im getting: g++ -c items_function.cpp items_function.cpp: In function ‘int loadInventory(std::vector&)’: items_function.cpp:180:77: error: invalid conversion fr...

 
5:18 AM
Oohhh @Jamal and codesparkle on at the same time.
 
You rang?
 
meh, just being biugsome.
You finished studying for your finals?
 
Eh, I still have tomorrow. I'm too tired now.
 
GO TO BED!
 
5:33 AM
It's not that late now. :-P
By the way, why did you add the Clearing out a baklog of unanswered questions bit to your latest answer?
 
Because otherwise .... well, I don't know.
 
(-1 for spilling our secrets :P)
 
What, where... what secrets?
 
I can't tell you! They're secret!
 
The're gone, wiped, ....
out of interest, do you see the edit?
 
5:36 AM
Yes, your edit was applied.
 
But, there's no visible evidence an edit was made?
 
Oh, and congrats on the new privilege!
 
(did I beat the 5minute grace period).
 
No there isn't since it was done within the grace period.
 
What... the protect privilege...
has it ever been used on CR?
 
5:37 AM
Yes. Here's once instance:
7
Q: Does this question need protection?

JamalThis question is starting to attract new users who contribute nothing more than "use a switch statement" as an answer. One of these answers is also a copy cat of previous answers. There really is no need for these additional answers, especially because this is already mentioned and demonstrated...

 
Ahh... OK.
 
And this:
35
Q: File Browser GUI

Andrew ThompsonFileBro is a basic GUI based File Browser. FileBro Functionality Directory tree - shows the file system roots at start-up, but is otherwise built lazily as the user browses around the file system. FileBro displays a progress bar as it is loading new entries. The file list (a table) display...

 
Right, it does happen.... I just haven't been around long enough to see it ... ;-)
 
Other than that, I'm not sure. There's not a way to search for them.
The last privilege is trusted user, which you should find more useful. I suppose it won't take you long to get there. :-)
 
3 days?
 
5:40 AM
Pretty sure about that?
 
You think we will graduate first?
 
I'm pretty sure. Your rep will be stuck at 3999 until the site graduates.
 
hehe.... I sense a consiracy ... ;-)
 
I put a feature-request on MSO titled: "Keep rolfl's rep at 3999 maximum until Code Review graduates." 100 upvotes already!
2
 
What's the link, I'll make it a target, and people will have to up-vote my answer ... /;)
 
Meh, that post is from 2010... at the time it was bleeding-edge stuff.
Android and geo-location in 2012, I wonder what Jul is doing now... running a multi-billion company/
 
Even then, I find that an amusing use of a tag. Reminds me of this tag:
8
Q: Burn the books of [learning]?

JamalI've come across learning, which is only tagged with 15 questions right now. It seems unneeded because it doesn't add anything important to the question. We already have beginner, which sort of already implies that the OP is currently learning. If the OP were indeed posting some code for learn...

 
 
1 hour later…
7:19 AM
@rolfl: Relevant to your interests:
Grace Murray Hopper (December 9, 1906January 1, 1992) was an American computer scientist and United States Navy Rear Admiral. A pioneer in the field, she was one of the first programmers of the Harvard Mark I computer, and developed the first compiler for a computer programming language. She conceptualized the idea of machine-independent programming languages, which led to the development of COBOL, one of the first modern programming languages. She is credited with popularizing the term "debugging" for fixing computer glitches (inspired by an actual moth removed from the computer). Owin...
 
7:56 AM
0
Q: Time limit exceed in Heap

PorfiriyI wrote a Heap, but judge system gives time limit exceed in some tests. I use a sift_down to build, so I don't know why. May be I can improve a build? Or have I a bad sift_down? Input: n commands. Than commands: 0 xxx, where xxx is a number to add to heap. 1 - extract maximum from heap. #include <

 
 
1 hour later…
9:01 AM
0
Q: A more efficient approach to existing JavaScript coding

anthonytwpI am now working on a Node.js project, and on my ejs view page, I'm retrieving this array of objects, like: [{ name: 'Andy', age: 20, username: 'andygoodluck'}, {name: 'Terry', age: 21, username: 'terrygoodnight'}] My objective is to make use of this data to dynamically create an...

 
 
2 hours later…
10:36 AM
0
Q: Class: Reverse date in PHP

ForebaI've just created a small class to reverse date in PHP. I'd like to show to someone to see if it's good or not. If I can improve it or not. So, here is the code. <?php /** * Reverse date and hour */ class ReverseDate { var $date; var $hour; var $error; /** * Checks if th...

 
11:26 AM
0
Q: CSS align header label and span

mfinkelstine I want to create page that will show me server info. I tried as shown bellow to add header then label then span, but when Im trying to align the info every time it's become a mass. HTML CODE <div class="data"> <h2>Client Information</h2> <label>Date Creation</label><span>2013-08-18 ...

 
12:16 PM
0
Q: Implementing R-Tree (rectangles)

mr5I am making my own UI, just a hobby project, and I want to implement an R-Tree algorithm to detect a point hovering in a rectangle and even over overlapping rectangles. I have this two functions that checks all of its child component whether its hovering or not. The first implementation works ...

0
Q: Socket.io listener with many categorized events

Lame-up-duckGood day to all of you. I'm here to ask an hint from you. I wrote a web application in a RHOK event but I want to know if the way I done, is the best one. My question is about server side and here's the point. Each client that connects, causes this: client = new RestClient(socket, function(clie...

 
 
2 hours later…
2:35 PM
0
Q: Registration service refactoring

regedarekclass RegisterService < BaseService REGISTRATION = 1 DEREGISTRATION = 2 attr_accessor :registration_type, :user_id def initialize(type, user_id) self.registration_type = parse_type type self.user_id = user_id end def registration parsed_response self.class.post "/regist...

 
3:03 PM
@Jamal where is this post, I don't believe that I have voted on it yet
 
.... feeling sad ... no-one likes me ....
 
@rolfl wth?
 
no-one wants me to pass 3999
And, whan I do get 4K, I'l come and lock all your questions so no-one upvotes you!
kidding.... just kidding ...;-)
I do think I have sent simon in to a sulk ... haven't heard from him at all.
 
3:20 PM
lol. You're there by Friday!
 
@rolfl DING! (Once again, when you least expect it)
I think I will add some comments on your answer to explain some of the things you didn't understand about my code. But I do admit, you have many good points in there.
 
I have reread my comments, and your code, and some things fell in to place as well.
 
If I am brutally honest, part of the problem was just too much code. If it is in eclipse where I am familiar with jumping through method calls, hitting f4 for hierarchy, f3 to open methods, etc. it would have been easier to work through.
Anyway, the 'flat' layout for CR does not help much when it comes to 'feeling' the inheritance, etc.
 
Yeah, I agree. It's much harder to get a good overview of code on CR. I should have included a link to a .zip to make the code easier to download, since there is no copy code button
 
3:36 PM
0
Q: Compose in Javascript - Go ahead with this example?

Luiz FernandoI'm trying to use the good parts of Javascript and dont follow the classical inheritance. I studied and created this example of compose in Javascript, https://gist.github.com/fernandoperigolo/7789866. My question is. You think this example have a good implementations of composition? Can i go ahe...

0
Q: Enum or Constant

Robert SnyderI'm writing a SDK for a NFC device in .NET so I don't have to import the SDK from C++. Right now I'm working on the ISO14443-3 part which is just simple Halt, Request, and Anticollision commands. The communication part between the device and computer is simple enough so I'm not going to post any ...

0
Q: Design advice for class creation based on user selection

georgeslI'm currently working a little software which send/receive data according to some format. It's still fairly simple, but it can elvove into somthing more complex, so I need to be clever in my design process. The current architecture The design was proposed b...

 
F4 for hierarchy, how could I have missed that key shortcut??
 
Easily, the f4 key is shy, and normally only comes out for Alt... or Ctrl. Otherwise it tries to hide behind the f5 ....
 
0
Q: I need help with integer division in PHP

TheRealWitblitzI had a bit of code in BASIC I needed to convert, but specifically this following line has me stumped atm: NRSLATHOR=INT(LSLATVER/PITCHVER-.8) In PHP I'm attempting to do an integer division but I get different results from similiar input values. For example one: $length = 1590; $pitch = 50;...

 
@rolfl You couldn't resist providing an answer to that off-topic PHP zombie, could you? :)
 
No.... and I think my answer is wrong ... ;-)
 
3:53 PM
I just hope the question will be closed and deleted ASAP.
 
put my close vote in :)
 
Where's @Jamal and his vacuum cleaner?
 
0
Q: Finding ship by using coordinates

kazanI need to make a ship battle game to find the ship by using coordinates.I am not a programmer but i came till here. Just i don't know how can i find the ship by using coordinates.I guess this is not so clear. but i didn't know where can start. thanks.Boot boot = new Boot(); Console.WriteLin...

 
4:24 PM
@rolfl Added some comments to your answer to explain some thing about my code.
 
4:55 PM
Ah, now I know how to structure an important thing of the Soduku solver! So if/when we are going to have that challenge, I am prepared!
 
@SimonAndréForsberg & @rolfl do you think that this is sufficiently better than what the answerer had before? it still has a negative score
-1
A: Onset detection using FFT

William MorrisThe link in the post to your fft file is broken, so I can't see the function prototype. This is a pity, because it is otherwise difficult to know what to make of your arrays: double (*vocalData)[2] = malloc(2 * 512 * sizeof(double)); This says vocalData is a pointer to an array of two double...

@SimonAndréForsberg what zombie?
 
@Malachi At first I thought "Why are you asking me? It's a C question! Both I and @rolfl are Java guys"
I'd say that's a significant improvement to the answer indeed. Upvote from me
 
@SimonAndréForsberg thinking about that. couldn't we create a 2 dimensional array and see if it adds up to 45 in each row, and then check that there isn't a duplicate digit in a row or column? all at the same time? I forgot about the 3x3 blocks too....
 
@Malachi Just because it adds up to 45 doesn't mean that they're all unique. 9+9+9+9+1+1+1+1+5 is also 45.
Or even easier example: Fill the entire row/column/box of 5s, 9*5 = 45.
Oh, you mentioned duplicate digit also... gotta learn to read first and write later.
But if we check for non-duplicate digits, the 45 check is redundant. Assuming we also check for non-empty and enforces the digits to be within the 1-9 range.
 
anyone know Ruby?
0
Q: Registration service refactoring

regedarekclass RegisterService < BaseService REGISTRATION = 1 DEREGISTRATION = 2 attr_accessor :registration_type, :user_id def initialize(type, user_id) self.registration_type = parse_type type self.user_id = user_id end def registration parsed_response self.class.post "/regist...

someone wanted to close this one. but I don't think it is bad enough to be closed
@SimonAndréForsberg the other thing that I remembered about Sudoku is that you have 3x3 blocks that cannot contain duplicates as well as the entire row or column cannot contain duplicates. there's the rub.
@SimonAndréForsberg do you have a downvote on that question? you can remove it if you do.
 
5:14 PM
@Malachi I'm downvoting it because it's both unclear what he's asking and he doesn't provide any background information. I won't vote to close for the moment though. See my meta question.
@Malachi There are ways to organize that information for Sudoku for the rows, columns and boxes
 
@SimonAndréForsberg I think I might look into this one. that way I can check my own Answers....lol or cheat and make myself look really smart. turn it into an app for a smartphone maybe
 
@Malachi Turn what into an app for smartphone? Look into what? Vote to close your message as "Unclear what you are talking about"
2
 
@SimonAndréForsberg I think we were getting lines crossed. I was talking about upvoting an answer and not closing a question
@SimonAndréForsberg Sudoku solver
 
0
Q: Libraray Management system Analyse written with Java SE

SajjadI complete my application that is a Libraray Management system. Please run my application and tell me my program defects. http://www.speedyshare.com/xE8mq/My-Project-v.02.rar Password in administrator mode: 200 Password in user mode: 24 or 18 or 16 or... Thanks.

 
5:20 PM
The answer for the C question got an up vote, the Ruby question got a down-vote but not a close vote, the Sudoku solver got interesting
Damn there's plenty of off-topic zombies arriving today...
 
@SimonAndréForsberg that's a good sign. means more new users are coming our way :)
 
@retailcoder Or it's a bad sign, could mean that Code Review will just be filled with garbage.
 
@SimonAndréForsberg not gonna happen. We won't let that happen.
 
@All, so getting back to the FFT answer... it came up in the review queue, I responded 'appropriately' (flagged it as a low-quality answer, IIRC), and then downvoted....
but, I get o notification that a revision was made.
Is there a way to 'follow' an answer so that you can monitor when something you downvoted gets revised?
 
@rolfl bookmark it?
 
5:27 PM
It should not take @Malachi 'politely' requesting we re-review it....!
Bookmark as in using my browser?
 
you see another way?
 
If I did I would not be asking.....
 
MSO Suggestion: RSS feeds on specific questions & answers...
 
@rolfl Unfortunately there are currently no ways to being notified by edits to such posts. I recall there has been MSO suggestions about this but I believe they have been declined.
The currently best way is to notify those who have commented on an answer manually.
 
5:48 PM
@rolfl if you favorite it, and then use activity tab in your favorites, then it will show you the questions that have been active recently and when they were active and I think who was active on it. that is how I found that question
@SimonAndréForsberg that is wrong, if you favorite it, then go to..... I will make a meta post....
 
Thanks all... I typiclly don't want to 'reward' bad questions with a favourite star ....
 
0
Q: Using Favorites to follow a question

Malachito Follow a Post you want to click the cool Star Button or Favorite button on the left just underneath the voting buttons this shows a question that I have Favorited I want to know if there is any activity on this post. this shows me that 7 things have happened on my Favorite Questions. I ...

@rolfl I don't think that the Favorite stars give anything, maybe a badge, but I usually remove a favorite after so long because I don't want to clutter my favorites.
 
0
Q: Using Favorites to follow a question

Malachito Follow a Post you want to click the cool Star Button or Favorite button on the left just underneath the voting buttons this shows a question that I have Favorited I want to know if there is any activity on this post. this shows me that 7 things have happened on my Favorite Questions. I ...

 
that was quick
 
StackExchange bot has its moments.
 
6:02 PM
@Malachi you have just made your account email address CC-Wiki...
..and you did break your presence streak! :(
 
6:13 PM
1
Q: Is `if( hidden ) return;` an antipattern?

boboboboSometimes, when you're doing something like displaying a bunch of elements, you can avoid running a function entirely if an object is hidden. So you can either write the check from the loop: for( Displayable * d : displayables ) if( d->isShowing() ) d->draw() ; Or you can put an "...

 
@retailcoder that was on meta-CR and not on DR
 
What's DR?
 
it won't let me edit it now
 
Dr.Review?
 
@retailcoder thanks for telling me about that. that is an old E-mail that I use mostly for junkmail and if I need a Microsoft account.
@retailcoder the new screenshot shows my CR profile. it's at 36 days now
 
6:22 PM
oooh, drop shadows :)
 
@Malachi - you id things backwards!!!!!
You should have created a question that says "If a user wants to track a queston or answer because they want to see if bad questions or answers are improved, what should that user do?", and then you should have self-answered with your comprehensive answer.
2
Right now your question is actually an answerd... so, I have to down-vote and close-recommend as being off-topic ... ;-) (just kidding).
@Malachi also, why are you favouriting a C# RPSLS implementation... get some real taste!
 
@rolfl it was the first question that I came to on my user page. and meta doesn't always follow the Q&A format either
 
7:00 PM
@Malachi don't take my meta-posts as examples :)
 
@retailcoder that is how we come up with FAQ's isn't it?
 
If it can be worded as a Q&A, it should be.
 
@SimonAndréForsberg: I got rid of that question that you've edited. Good work.
 
@Jamal Thanks
 
@retailcoder ok I changed the Question and added an answer
2
Q: how to follow Questions and be alerted to changes/answers

MalachiI would like to be alerted when there are changes made to a post or answers on a Question, what is a good way to do this?

 
7:07 PM
@SimonAndréForsberg: What did you mean about that comment in the close proposal? Do you want one of us to give a answer specifying what I've said in the comment?
 
@Jamal Yes. Since your comment seems to be an answer. Sometimes I would like to flag things as "Not a comment, it's an answer"
 
I still need to follow-up on this too codereview.stackexchange.com/q/36482/18427
 
@Malachi do you mind if I edit your question to indicate that you want to follow the question/answer because you DownVoted, and if the answer changes/improves you may want to upvote?
(really, I should have asked this myself on meta.... now it is a pain).
 
0
Q: Take an array and return "n" elements, as evenly spaced as possible

MagnakaiI get the following correct results from this code, but it seems incredibly clunky to me. Is there anything I could be doing more elegantly? The results can be imprecise - as long as it's the right number of returned elements, and the selection is mostly right. $_5elements = array(1,2,3,4,5); $_...

 
@SimonAndréForsberg: The main reason I made it a comment is because the close reason was only brought up in your answer, not the question.
 
7:19 PM
0
Q: apt alternative for proxy environment with bash shell

KyllopardiunAs I am new to bash scripting, and wanted to use apt-get in my university and I know that many people does suffer when trying to do so. I tried to make this which my focus is simplicity and ease of use but still need to be somewhat robust. #!/bin/bash string="install" errormsg="\n\tInvalid inp...

 
@rolfl go ahead. that is really what sparked the Question/Answer and it should reflect what you (and I) want it to
 
@Jamal If you think it should be handled differently then please add an answer for that. Or if you don't think it's a problem at all, then that could also be an answer :P
Just created my first ever "meme"
 
@200_success : I see that there are some tagging disputes on this question. A flag was raised on it as well, deeming it off-topic. Would the work here?
8
Q: Is it bad practice to increment more than one variable in a for loop declaration?

afuzzyllamaWhile coding today, I came across the following loop in C#: for(int x = 0; x < max_x_index; x++){ for(int y = 0; y < max_y_index; y++, count++){ { some2DarrayRepresentedBy1D[count] = ...; } } Would this be consider bad practice? Would the following be a better way to achi...

@Malachi: Your original revision here seemed okay. It was instead moved into an answer, deeming it a non-answer.
2
Q: how to follow Questions and be alerted to changes/answers

MalachiI would like to be alerted when there are changes made to a post or answers on a Question, what is a good way to do this?

 
7:41 PM
@Jamal on the meta question?
 
@Malachi: Yes.
 
so I should Rollback then. bends under the peer pressure then bends back under authority pressure
@Jamal, in the very first revision I posted a picture that had personal information in it, is there a way to make that go away completely?
 
Which information specifically?
 
@Jamal Actually, I think that might be a bad idea for the Code Review site in general, for the same reason that we have a no-pseudocode rule. Here, we like to critique code that solves a particular problem. For generic best-practices questions, there's Programmers.SE.
2
Just the presence of ellipses in codereview.stackexchange.com/q/36904 was enough to cause speculation about what other flow-control measures might be lurking in that loop.
 
@200_success: I was starting to think that as well. Should we still keep it, or burninate it (after reviewing the tagged questions).
 
7:55 PM
@Jamal E-mail and Real Name
 
-2
Q: refresh a page without reload in php?

EugeneI am have a page with many entries right now i am taking 2 like this page url http://localhost/DS/abc.php?id=1 1-280-12/09/2013-er-0-delete 2-280-12/09/2013-edr-0-delete ..... So when i delete it goes to page with blank id and ofcourse that id is deleted.I want that it should reload or stay on...

 
In codereview.stackexchange.com/q/36978, I noted that the answer might not be as language-agnostic as you might think.
 
@Malachi: I'll ask someone to get that hard-deleted (or you can just delete the question and start over).
@200_success: Probably shows my confusion over the tag, then. What should we do with these questions, if anything?
 
0
Q: How to follow Questions and be alerted to changes/answers

Malachito Follow a Post you want to click the cool Star Button or Favorite button on the left just underneath the voting buttons this shows a question that I have Favorited I want to know if there is any activity on this post. This will have a small Circle with a number in it next to the favorite...

that is a new one. but the old one
 
0
Q: How to follow Questions and be alerted to changes/answers

Malachito Follow a Post you want to click the cool Star Button or Favorite button on the left just underneath the voting buttons this shows a question that I have Favorited I want to know if there is any activity on this post. This will have a small Circle with a number in it next to the favorite...

 
8:04 PM
@Malachi: I have sent in a request to get that hard-deleted.
 
@Jamal I think that the poster of the question should tag the question for all languages he/she would like the code to be reviewed as. If the discussion for a C# question also happens to be relevant to C++, but wasn't tagged as C++, so be it. Better to have accurate tags than spammy tags.
Example: codereview.stackexchange.com/q/36514 could also be relevant to C++, if not for the private keyword.
 
0
Q: Improve code performace

Peter PenzovI have this code that lists daemons from Linux. I use /proc filesystem to get the data that I want to read: This is the file structure: /proc/24/status /proc/344/status /proc/456/status ....... This is the structure that I want to search for data for example: I made this very quick code: pu...

0
Q: Users unhappy with voting to close/move

tomdemuytPlease see this question : refresh a page without reload in php? I invited the 2 users to comment on this thread. From my perspective, Code Review is there to Review working code, that code is not working.

 
@200_success: We can clean them together, then.
 
does this answer strike anyone else as odd: codereview.stackexchange.com/a/36980/7308 In particular, it feels like he is suggesting a modification of a service locator, which is well known antipattern. And the m_ or m prefix seems to be useless in a modern IDE. Not to mention, if there's so many variables involved that local/class mixups are happening, it's a huge code smell in my opinion that the class is holding too much state and thus likely doing way too much. Any thoughts, anyone?
I'm just worried that I'm missing something, since it got 4 upvotes in an hour >.<
 
You could mention that all in a comment.
 
8:15 PM
yeah, i considered it... but just wanted to double check my understanding before. it's very possible that i've misunderstood something about the entity manager that he's suggesting
 
Where's Loki when you need him? ;-)
 
really :(
lol
this is actually a trend ive been meaning to write about on meta for a while but havent gotten around to. on this answer it's not really a big deal, but on quite a few PHP answers there is some less than great advice, but the answers have been upvoted...
i think it's an underlying problem of the site: if anyone can vote, then people who aren't always qualified to vote can vote...
it's a very, very minor problem over all, but just something i've come across a few times
although on this C++ answer, I suspect I've just misunderstood what the poster meant
 
True. That cannot quite be stopped, though, as votes are anonymous.
 
@StackExchange Yeah, I was under the impression that was like Rule Number 1, so their unhappiness is unfortunate but irrelevant.
 
@Donald.McLean: Agreed. Guilt shouldn't get in the way of this, especially if the OP has other options. I also think it received those downvotes because it was hard to understand the question.
 
8:25 PM
i think it received the downvotes because not only was it off topic, it was a bad question.
it would get downvoted and closed on SO too which is where it (arguably) belongs
 
@Corbin: Hence why I didn't migrate it.
 
:)
whoa i just realized that meta is hidden in the help menu of the new top-bar. that's interesting
 
Gotta remember that golden rule. And... although SO occasionally sends us off-topic questions, it doesn't mean we need to fight back.
 
I wasn't saying that you should migrate it. I was just saying that it could, in theory, with a lot of improvement belong on SO :)
 
True, but that may be up to the OP to improve it. Perhaps it'll get posted there anyway.
 
8:31 PM
0
Q: Optimize this path location script?

Clark T.Example Script is located in /home/insp/public_html/deploy/ I want to return the /home/insp/ section $path = realpath(__DIR__); $parts = explode('/', $path); $newPath = array( $parts[0], $parts[1], $parts[2], ); $realPath = ...

 
@Jamal So we want to abolish , currently with 15 questions. A lot of those questions are old. Would pushing them to Programmers.SE be considered "migrating crap"? How about just closing/locking them?
 
right. i wasn't implying any of us should improve it. just that's it's a rubbish question and it doesn't belong anywhere.
 
@200_success: They are all too old to migrate. I'm cleaning them up now. Some, particular ones without code, have been deleted. I've noticed one that has specifically mentioned pseudocode. I may delete that one, or lock it. As for the rest, the tag can be removed. Again, watch out for pseudocode.
 
@Corbin FWIW, I upvoted that answer.... It appeared in my 'First Post' review queue, It looked like the answer tackled a specific problem in the question, and then gave general, and reasonable advice to the asker... I upvoted when the guy had rep=1. In general, on CR, I have the impression that we should be generous with upvoting (and down voting)
 
@rolfl Hmm. The m and m_ prefix thing is definitely valid advice, especially since he presented it in the context of personal coding style. Even the EntityManager is understandable if the 3 objects will never be in a situation where all 3 are not needed.
My fear though is that the EntityManager will quickly devolve into a "Oh the PaddleDrawer needs the enemyPaddle? I better pass it the entire EntityManager and just have it draw both at the same time" situation. Perhaps I'm just being overly picky though, especially for a first answer.
In the right context, the EM can be valid advice. I just think in 99.9% of cases, it's dubious advice at best, and the answerer didn't explain that. EntityManagers have a bad habit of permeating through an entire code base once one is introduced.
 
8:51 PM
@Corbin you may well be right, and I think this is the danger of getting all first posts in the review queue ... I simply do not know C++ well enough. I simply went on a 'triage' system: If the post has spam/whatever I downvote and close. If it looks loosely on topic, I say 'looks good'. If the answer looks well thought out, on topic and like it adds value, I upvote and Done... This answer ranked upvote. If the topic is one I am more familiar with (Jva, SQL, whatever, I pay more attention).
 
Fair enough. I tend to use a relatively similar approach when I'm in the first post review queue. I actually hadn't considered the first post aspect of it.
 
@200_success: I've edited a few myself, but I'm not sure of their languages. Some don't seem they should be deleted, though.
 
9:08 PM
@Jamal I don't think codereview.stackexchange.com/q/1586 should have been closed, since the code can be improved, and reasonable justifications can be given. It should also be tagged with .
 
@200_success: Okay, I can make some improvements and reopen it.
 
heh... apparently I have fuse:
1
A: Improve code performace

rolflYour code does not work... submitting here just because it compiles is wasting our (my) time. In your code you have: dataReader = new BufferedReader(new InputStreamReader(new FileInputStream("subDirs/status"))) This is a broken line, and it will obviously not do what you think it should. So,...

 
9:23 PM
I am really getting tired of seeing bad titles...
Lesson to be learned here: don't waste the monkey's time.
 
you may need a spanking!
 
Better not mean me! I deliver the spankings here. ;-)
 
you spank the monkey?
4
 
is about to be burninated. :-)
That's... quite a personal question to ask someone. :-P
 
9:38 PM
>.<
 
lol
 
it's made all the more disturbing since his profile picture is a monkey....
 
Well, every site needs a coding monkey, and we have ours.
 
though i just realized that im incredibly slow, and that was the joke to begin with
 
It's especially meaningful considering he dared to answer CR's first question.
 
9:43 PM
0
Q: Text conversion - Javascript before saving to db, or php when retrieving?

Charlie74Long story short, I have a social networking site I wrote a while back as a "proof of concept" to myself that I had the skills to do it. I decided to revisit it, and "improve" a lot of the bad coding practices I had when I first wrote the thing (3 years ago). My current situation Users can cr...

 
@Jamal My reason for asking that question to be reopened: codereview.stackexchange.com/a/36998/9357
 
CR got a cobol question? wow!
 
@Jamal Monkey answered a COBOL question asked by an Ape.
2
 
0
Q: Big Data in MongoDB Database Design

amcdnlI'm developing an application for storing form content. There could be potentially millions of records for each form. My backend is .NET / MongoDB. I've currently implemented the following design but am not sure that its the most effective solution for this quantity of content. [{ form...

 
@Corbin: I eventually found it after going through some digging. :-)
@200_success: I've just noticed the OP's username. Brix = shat.
 
9:51 PM
interesting. i guess not very surprising since there is still a surprisingly high amount of cobol out there, but still... interesting
 
There are still many questions on SO, but unfortunately they're only on-topic for that site. I would've loved to see rolfl earn the bronze tag badge.
 
yeah
somehow i imagine there's a pretty small interest in having COBOL reviewed since most code bases using it are 10+ years old
 
Speaking of tag badges, I'm surprised you haven't earned yours yet for C++.
 
it would be a very uphill battle to try to refactor a cobol code base now. especially since if you're going to go through the effort of refactoring it, you might as well rewrite it in a modern language.
27 points from C++ bronze it looks like
 
Yeah. Clearly tag score isn't everything, as I'm pretty sure I'm not the 2nd-best C++ reviewer on this site (based on skill, not activity).
 
9:59 PM
eh i think youre pretty good
Loki just sets a really high bar :)
there's a actually a lot of good C++ reviewers. I've learned a ton from reading random C++ reviews. Every time i write one, there's this nagging voice in the back fo my head that's like "there's at least one thing wrong in this, and someone will find it" lol
 
Really high. :-) Winston Ewert is great as well, but his modding had to come first (and he now does Python). There's still lots for me to learn, and I'm so glad I've discovered SE. It has probably changed my life.
 
yeah
i cant imagine where my C++ would be if not for CR...
C++ is possibly one of the top languages in terms of widely misused
 
Yeah, there are random ones, but it's good to know what the "established" ones are. That, it seems, is based on tag score.
 
whenever i see classmates' C++, i typically cringe
raw pointers, loops instead of standard library stuff... undefined behavior... all kinds of "ohhh god!"
yeah, im sure tag score correlates pretty closely with skill
 
Back when I took my first data structures class, I sucked. Made an F, despite great honest effort.
 
10:02 PM
it's obviously influenced by output, but... definitely corresponds with skill
i loved data structures. advanced data structures is the class that made me actually learn C++. pretty hard to implement RB trees, AVL trees, hash tables, vectors, etc without learning some of the C++ gotcha's and tricks
not to mention that was the first time i ever looked at the standard library and actually thought about why they made the decisions they did rather than just how to us eit.
use it*
 
Well, back then, I was still bad with C++ classes. I remember once telling another professor that this seemed like something I could never understand. And yet here I am...
Oh, and have you seen this?
0
A: Review of three constructors for a String class

JamalWhen dealing with length, prefer std::size_t. This is an unsigned integer type that is also the return type of the sizeof operator. It is not good to use int because you cannot guarantee that any length will fit. Your code will break if the user constructs an object that is too large. There's...

 
i actually saw that in the going native videos
it's been at the back of my mind for a while
i still tend to use std::size_t probably more than i should
it's just so temptign to have everything mesh well with the standard library :(
im glad you posted that. i need to go back through and edit all of my answers
that was always one of the things i would pick on
 
Agreed. I still admire the STL, even in spite of this. Not sure why it took them so long to discover this, though. Might be a good reason.
 
eh, they had good and understandable intentions
"a size should never be negative" seems like a good enoguh reason
it's just through C++ funness that void f(unsigned int x) {} f(-5); is valid code
and thus invalidates that reason
idk. in C++11 it's much less of a concern, but in C++03, i'm always tempted to use std::size_t for loops since gcc/clang both get pissy about for (int i = 0; i < v.size(); ++i) {}
 
Yeah, that code is just asking for bugs.
 
10:12 PM
though lately ive begun doing: for (int i = 0, s = v.size(); i < s; ++i) {} which does not give warnings
 
Even in that code, std::size_t is not preferred as you cannot assume the container uses that size type. It is, however, preferred for C-style arrays.
 
0
Q: Help me optimize this scrollTo javascript

user1087110I'm no pro in Javascript. Please help me review this code. I would appreciate any suggestions! Javascript: var y_offset, /*current position of window*/ distance_from_current_position, /*different between current position and target*/ body_height, /*hight of body*/ window_height, /*h...

 
well, yeah. if i were going to be very pedantic, i would use vector<...>::size_type
but that presents a problem of hard coding that v is a vector
which should typically be avoided
all the loop needs ot know is that a size() exists and that an operator[] exists. having vector::size_type in it presents a new coupling
 
What about a typedef?
 
though it's obviously very, very minor
well, if i go the ::size_type route, that's what i usually do. it still presents a problem of having the type of v unnecessarily involved in the loop through
though*
idk... just another reason to prefer iterators :)
(well, and im crazy)
 
10:16 PM
True. :-) I suppose in the case of keeping a number count, a separate counter could be used.
Speaking of iterators, I still haven't been able to fully access C++11 on my machine. I do want to start using range-based for-loops.
 
if the numeric index were involved, i would probably just go ahead and use for (int i = 0, s = v.size(); i < s; ++i) {}
why isn't it available?
C++11 is magical. it feels like a different language. it's great.
 
It says my gcc version is 4.7.1, but also my IDE (Visual C++ 2010 Express) cannot utilize all of C++11.
 
you're using VC++ with gcc? that's interesting. you could use netbeans to get access to C++11 with 4.7, but... meh.
you could also go the dreamspark route to get VC 2013 for free
 
Frankly, I'm not too picky with compilers. I just haven't found an ideal one.
 
ive begun using clang lately. it supports all, literally all, of C++11, and it tends to have better warnings than gcc
it's mac/linux only though unless you're willing to get your hands very, very dirty trying to get it to work on windows
 
10:23 PM
I can consider Visual Studio, but it'll probably take some time to install it.
 
i remember mingw having some oddities with gcc 4.7, and C++11 but... maybe that's fixed now
idk. you could also try netbeans. i tend to use it for C++ when im on windows
 
I can give it a try. I'm also having to get my make utility working so that I can run x86 assembly programs again.
 
ah
 
I wanted to write a FizzBuzz program in assembly. :-)
 
that could be interesting
which instruction set?
 
10:42 PM
8086, I believe.
This is the type I was taught in my assembly class. I've also covered MIPS in another class, but it wasn't an assembly class.
 
11:01 PM
It seems busy in here today!
 
lol
 
0
Q: Alternate initializer pattern in Python

Alex BuchananUsually it's recommended that classmethod is used for alternate constructors in Python: class Foo(object): def __init__(self, x): self.x = x @classmethod def from_other(cls, other): # Pretend that getting "x" from "other" is non-trivial # and it's code you wo...

 
11:12 PM
ah interesting
i had to do a ton of MIPS for a class. i quite liked it. and then i tried to pick up x86 once.... my god. x86 fucks with my head.
 
0
Q: Making .NET delegates and C++ std::function play nice

goneskiingSo I have a question about how best to get interop working between delegates and unmanaged std::function. Obviously I am talking C++CLI for the implementation on the managed side here. Most examples I have seen online talk about interop for stand alone unmanaged functions and also often with no...

 
I didn't do a Degree where they taught people enough to be programmers. I never learnt to write assembly (among other things) I didn't get my job because of my awesome education. Must have been my good looks.
 
my degree has been 99% theoretical, but i was originally computer engineering before computer science
and we had a class that was processor design and assembly
 
I live in Australia where (IMHO) that we don't have much in the way of good education for software development. I did learn a lot of other things like how to write an essay and business report. How to set up an old-school router/network ports. And how to write copious amounts of documentation so that no-one will read it.
Thankfully I enjoyed programming and was learning before I got into my tertiary education.
 
hrmm in america, CS degrees don't focus on software development at all. it definitely comes up in passing, and most schools have at least 1 or 2 required courses on it, but... meh. 98% of the people about to graduate with me i wouldn't want within a hundred yards of a code base i had to work on.
typically software engineering is seen as a separate degree here
or it's not offered at all...
was your degree IS or CS, out of curiosity, James?
 
11:22 PM
Ok ... so I don't feel so left out then.
 
because it sounds like an american IS degree
 
It was a Bachelor of Information Technology. The coourse was retired after my year and they now focus more on Non-Programming units.
It covered a little bit of everything and not enough of anything to be helpful.
 
ah
IS degrees in America tend to go into more of hte business side than the actual technical side
for example, the IS degree at my uni is actually though the business college, not the engineering college like hte CS/CE degrees are
not sure if it's like that there though
 
I've given up hope for any real software developers to come out of uni with some solid grouding. I think its more important to look for a learning attitude and teach them on the job.
I think CodeReview and SO are better teachers.
 
does this code work now?
2
Q: Two functions with different names but the same implementation

ROHIT NANDANBelow are two functions with different names but the same implementation. I'm getting different answers. Can someone review them? #include <iostream> using namespace std; int s[100],p[10]={1,5,8,9,10,17,17,20,24,30}; int max(int a,int b) { if(a>b) return a; else return b; } i...

 
11:31 PM
well, the problem is that most degrees don't try to teach software engineering. not to mention that most faculty have 0 software development skill. i don't expect CS graduates to have software engineering experience. it's not what a CS degree is. I'm not quite sure about IS, but i don't think IS degrees focus very much on SE here either. CS just focuses on theory.
i do wish it had dealt with SE a bit more though :(
 
@Malachi I can't see any code changes ?
 
@Malachi I voted leave closed
That is Jamal keeping house tidy
(He hates bad titles)
 
I had a couple of Lecturers that could program. One in the physics area (not corporate or industry) for things like a spectrometer monitoring software and other research tools. Another who was actually in the industry for many years (good old COBOL and c++) and what they taught us off the curriculum helped more than what we actually studied.
 
One professor I had was actually really good with C. There are a few other professors at my school who can actually code, but I've just seen their code; I didn't take any of their classes since they were both new this year. Most of my professors not only are bad at software engineering, but actually promote bad practices. It's very frustrating.
For example, one of my professors told the class that vectors in C++ are slow and that they should use raw arrays. Not only is that entirely error prone, but it's wrong. As long as the vector doesn't shrink or grow and the compiler is even vaguely recent, the performance will be identical.
 
@rolfl does it automatically get added to the reopen queue when someone makes an edit on closed questions? @Jamal
 
11:42 PM
I believe so.
 
check these out
6
Q: Is `if( hidden ) return;` an antipattern?

boboboboSometimes, when you're doing something like displaying a bunch of elements, you can avoid running a function entirely if an object is hidden. So you can either write the check from the loop: for( Displayable * d : displayables ) if( d->isShowing() ) d->draw() ; Or you can put an "...

94
Q: Is it better practice to return if false or execute an if statement if true?

Jake KingOften, while writing code, I find myself presented with two options. Either I can do this: public void aThing(boolean cond) { if (cond) { // Some code } } Or this: public void aThing(boolean cond) { if (!cond) return; // Some code } Is either one preferable over the ...

and they say I am a rep whore......
 

« first day (219 days earlier)      last day (3781 days later) »