« first day (300 days earlier)      last day (3718 days later) » 
00:00 - 20:0020:00 - 00:00

12:00 AM
I'm not sure why he would have deleted it. Though his answer itself could use some touching up grammar and spelling wise, I think it is fine.
 
Oh yeah, I forgot that trusted users can also edit deleted posts. :P
 
I presume you voted to undelete it.... @syb0rg (since you posted here that it can be undeleted).
If you do undelete it, it will now 'compete' with palacsint's
 
@rolfl Yeah, and I tried to fix up the post a bit.
@rolfl Competition is always good in economics ;)
 
Yeah, it will make palacsint look like an ass for duplicating an existing answer.
 
Both have some unique points in them. If there are duplicate items within the answers, it only emphasizes their importance.
 
12:06 AM
Meh, my point is that, if someone wants to delete their answer, undeleting it against their wishes should be a carefully considered process.
 
My first notable question badge.. is on superuser..
 
@rolfl Are you talking about codereview.stackexchange.com/a/28550/7076 ?
 
yes
reading it more carefully there is not much duplication with yours (if any), but still
 
which ones?
 
> not much duplication with yours (if any)
^^^ nothing.
 
12:20 AM
cool :)
I've read that answer before and voted to undelete
 
Thanks SAnta!
 
;-)
 
1:12 AM
0
Q: Review of design and style of this C++ implementation of Binary Heap

sumoddsThings I can think of things like integer overflow, if the input type is int etc. But other than that, what do you think is wrong with this code, design wise, style wise , also in terms of other edge/corner cases. binaryheap.h #ifndef INCLUDE_BINARYHEAP_H_ #define INCLUDE_BINARYHEAP_H_ #include

0
Q: A TaskScheduler that always run tasks in a specific thread

Earth EngineThe following is an TaskScheduler that always run tasks in a thread it maintains. When created, a name of the thread was specified. Once you schedule the first task, untill it is been Disposeed, a thread will be created and wait for tasks to execute. The reason of this class is that sometimes th...

 
 
1 hour later…
2:25 AM
@Marc-Andre - You answering questions with 2 answers already, but from last year?
Man, then you get the @Jamal ification process going too... and then I miss the date, and add downvotes, and comments ;-)
Sudden flurry of activity on an old post
Actually, @Jamal got there first....
and then you added an answer
 
Well I wouldnt have done it normally but Jamal edited it so
 
Edit what exactly? I've edited many today. :P
 
I feel like it was missing something
 
3
Q: Selection sort in Java

Fernando MartinezI am working on a program in which 10000 random no repeat numbers are selectively sorted into ascending order. I have written the following code: import java.util.Random; public class Sorting { public static void main (String[] args){ //Here, we initiate an array with the integers...

Not sure why you edited either, Jamal... you did not even remove Java from the title, but you capitalized it ;-)
 
"Selection sort" as a title would've been even more generic. Unfortunately, we'll naturally get a lot of the same types of programs. Eventually, we'll have titles such as "Linked list implementation #455 in C++"
 
2:30 AM
I guess...
 
Yeah, dealing with titles on this site is tough.
 
Argh! I figured out how to fix a bug and finalize my UTTT game, but then I just found out that a scholarship deadline is tomorrow... :(
 
If every Jamalized post earned an extra answer, answers per question ratio would be well above 1:2.5.
 
@rolfl But just to reassure you I'm not searching for post like that one!
 
In your most recent answer @rolfl

Intro: This is good code.
...
Conclusion: Otherwise, this is good code.
 
2:40 AM
Who cares.
(apart from you!)
It got your upvote... right?
 
Yeah ;)
Per usual.
 
Actually, despite all the criticisms, it really is good code.....
worth saying twice.
 
@rolfl "I don't like 1-liners Sam-I-Am"
lol
2
 
@syb0rg: Could you confirm what the OP and I are saying in the comments? You may also add an answer if we've missed something.
10
Q: Hexadecimal to integer conversion function

SteveI am working through Kernighan and Ritchie to brush up on my C skills, so I thought I would invite critiques of my code. Here is my Hex-to-int function: int htoi(char *str, unsigned long long *result) { int c; int i; int msnibble; int digits; const int nibbles[] = {'\x0','\x...

 
2:43 AM
301 Answers
Feel free to stalk!
 
It also appears he has added more code to the second code block, so the reviews may be hard to follow. Other than that, I don't think he edited the original code.
 
@Jamal It's hard to see when looking at the revision of edits.
Also, I asked where he found that stuff in the Linux kernel. My interest is peaked.
It looks like personal finance just graduated:
 
5 more 10Kers than we do.
 
I guess it also takes more time for the chat link to update (it still shows beta).
 
2:51 AM
They have some 50K users though
You guys have some voting to do
4
 
^^^ Pin that
 
0
Q: Array of Objects or Array of array?

WarehouseMuzikI build phone apps and I use JSON a lot in my APIs. The problem is sometimes I don´t know how how to format the JSON data. For example iOS UITableView takes NSArray as datasource. { "contact_id": [ "455", "464" ], "contact_name": [ "Administrator", "...

 
3:06 AM
@Jamal... can I ask you to intercede on this one... I don't want to be the one:
@rolfl: I just updated the question.. I miss couple of important points.. I have rewrote most of the things.. Now take a look.. It will make sense now.. I guess now you will be angry as in the question lot of things might have change as corresponding to what you have suggested :( — user2809564 52 secs ago
 
I was just about to mention it. :-)
 
(no, not angry, but afraid anything I say will be taken wrong).
 
If the update was only a clarification and had nothing to do with the suggestions in your answer, then you may have to update yours based on the changes.
In terms of invalidations, this is one of the lesser likely cases.
 
I disagree..... so I will rollback.
 
There have been lot of really good questions/answers on CR today. Has made for some good reading :)
 
3:22 AM
It must've been Grace Note's presence in the chatroom today. :-)
 
0
Q: How to extract elements from multiple sorted list efficiently?

user2809564I am following up on my previous question here Problem Statement:- I was ask this interview question recently.. I was able to come up with the below code only which runs in O(k log n)- Given k <= n sorted arrays each of size n, there exists a data structure requiring O(kn) preprocessing time ...

 
3:51 AM
2
Q: Replace multiple if statements with for loop

Randall987I'm working on extending the functionality of a photo gallery by adding a thumbnail display, I have multiple if statements set up to adjust the position of the thumbnails. Obviously this is not ideal, I'm trying to put my head around how to use a for loop to iterate the width multiplier and curSl...

 
We have a cookie monster ^^^^^
 
Yay!
 
4:02 AM
guys in the replace multiple if statements with foor loop question, the selected answer has this piece of code "Math.floor(((currSlide || 1)-1)" what does the or operator do? its not inside a condition
 
0
Q: Removeclass addclass multiple selectors optimization

RENE VILLAI've written a function that works fine, but being new to jQuery, I'd like to know if there's a more cleaner way of writing it. Anything advice would help; just trying to learn! function displayContent() { var $link1 = $('.row.nav li a.bio'); var $link2 = $('.row.nav li a.stylist'); var $l...

 
4:18 AM
Return of the cookie monster:
1
A: Removeclass addclass multiple selectors optimization

cookie monsterfunction displayContent() { // put all links together var $links = $('.row.nav li a').filter(".bio,.stylist,.contact"); var $content = $('#text-content') var $bio = $("#bio"); // put these together since they're used in the same way var $stylist_contact = $("#stylist,#contact"); ...

@Jamal Here is the file that OP was talking about: android.googlesource.com/kernel/common.git/+/android-3.0/arch/…
I'm not completely sure why they have stuff like return -ERESTARTNOHAND; in there.
 
Ah, I see. I believe my suggestion there was still correct. At first, I thought they were just typos.
 
It's correct as far as I know. I would need to conduct further research to see why that is done. To me, it doesn't make much sense though.
 
Doesn't seem like much of an issue anyway. The OP also mentions that he doesn't want to post a further review request.
 
Hey @Yuushi
@Yuushi Do you know why there are statements such as return -ERESTARTNOHAND; in this code: android.googlesource.com/kernel/common.git/+/android-3.0/arch/…
 
not without digging in a lot further, nope
 
4:57 AM
0
Q: Producer/Consumer implementation

Diljot RI am using Netty embedded within Grails to process and display incoming SNMP messages. Since Netty 4 doesn't come with a built-in ChannelExecutionHandler I had to make my own and would like some feedback on it. I have created a Gist as there is a decent amount of code and separate files to look ...

 
@user3362707 good question
57
Q: In Javascript, why is "0" equal to false, but not false by itself?

動靜能量The following shows that "0" is false in Javascript: >>> "0" == false true >>> false == "0" true So why does the following print "ha"? >>> if ("0") console.log("ha") ha

The or operator || just means that if the value is 0, it will make it 1.
and then the full expression: var n = Math.floor(((currSlide || 1)-1) / 5); will never be -1 which would happen for (0 - 1) / 5
 
@rolfl interesting, thanks for the info
 
np... your question got buried by @StackExchange - I imagine that's why you did not get someone ele to answer...
Welcome to the 2nd monitor, BTW
 
@user3362707 Why don't you change your name and avatar to something unique?
 
5:12 AM
-1 ... his name and avatar are, by definition unique ...
you mean 'personal' .. ;-)
 
@rolfl Bleah, yeah... :)
 
5:26 AM
0
Q: What is a more elegant way in Java to read line and combine duplicate entries based on one of the fields

user3259085The following Java code reads lines from an input text file and will output the entry that has the highest number in field-2 to an output file. INPUT: William J. Clinton 6 Q1124 42nd President of the United States 6 Q1124 Bill Clinton,6,Q1124 Bill Clinton,14,Q9890 Bill Clinton,5,Q9880 Will...

 
5:38 AM
Why do I have a strange urge to write a Java review?
I shall refrain, as I'm sure it would not end well. Haven't touched Java in about 3 years :/
 
I've written a few myself, including a Scala one. ;-)
Um... new as a variable name? Although this is C and not C++, it still looks bad.
0
Q: Singly linked list implementation in C

dysruptionHeader file: #include <stdio.h> #include <stdlib.h> #include <assert.h> typedef struct linked_list linked_list; typedef struct cons cons; void append(cons *cons, int value); void linked_list_append(linked_list *ll, int value); int size(linked_list *ll); void insert_after(cons *c, int value, in...

 
0
Q: Singly linked list implementation in C

dysruptionHeader file: #include <stdio.h> #include <stdlib.h> #include <assert.h> typedef struct linked_list linked_list; typedef struct cons cons; void append(cons *cons, int value); void linked_list_append(linked_list *ll, int value); int size(linked_list *ll); void insert_after(cons *c, int value, in...

 
@Jamal Wow, that's brutal. I feel sorry for the poor soul who tries to compile that on a C++ compiler.
Also... I decided to answer the Java question... Shameless plug:
0
A: Read line and combine duplicate entries based on one of the fields

CorbinI'm far from a Java expert, but a few things jumped out at me You forgot to close the reader (br). Do not close the streams inside of the try. What happens if an exception gets thrown before the close commands are reached? You need a finally block. Or, better yet, if you're using Java 7 or ...

 
Speaking of weird code... this has received five fast answers, pretty much saying the same things.
1
Q: What does double semicolon mean in c?

mvitagamesFor example: void thisIsAnExample(Hello* bye, char* name, int num, in* arr, int* sum){ GoodBye x;; x.funName = name; . . .

 
Wow. People do love to jump on easy SO questions lol
 
6:00 AM
I've mentioned a few things in the linked list question. I don't feel like doing a full sweep tonight.
0
A: Singly linked list implementation in C

JamalJust a few things that stick out to me: What is cons? Don't you mean Node? At first I thought it was just a short form of constructor, but it appears to be corresponding to a node. I'd strongly recommend using a different variable name than new. Although this is C and not C++, this could sti...

 
0
Q: Is this a good practice of password salt/hash?

QwisoOriginal: http://www.php.net/manual/en/function.crypt.php#114060 I've removed the original author's comments to give you a quick glance at the code. Visit the link for detailed explanations of each method's use. I've tested it with success and since I am brand new to the world of security and...

0
Q: My Python lesson : Use If/else/elif conditionals to write a basic rock paper scissors game. Why isn't my code working?

Niratplayer1 = raw_input ("?") player2 = raw_input ("?") if (player1 == 'rock' and player2 == 'scissors'): print "Player 1 wins." elif (player1 == 'rock' and player2 == 'rock'): print "Tie" elif (player1 == 'scissors' and player2 == 'paper'): print "Player 1 wins." elif (player2 == 'sciss...

 
6:24 AM
0
Q: Use of multiple value errors in python

Patrickcode: mode = "PARALLE" try: if mode == "PARALLEL": # some code elif mode == "SERIES": # some code else: raise ValueError("Error: Invalid mode") except ValueError, Argument: print Argument phase = "inverte" try: if phase == "inverted": # some code elif phase == "non_inverted":...

 
7:12 AM
0
Q: Return Json array through PHP

user2604422call from my index.php to function get_data($curr_date) goes from here case "events" : $curr_date = $_POST['current_date']; if ( $eid = get_data($curr_date) ) { $result = array( "success"=>true, ...

 
7:24 AM
Night @Jamal. Morning, others.
 
Morning!
 
7:48 AM
0
Q: How to dry up this code without meta programming?

naveedI have a ruby code segment which I need to DRY up. Following is the code segment. def disable_attribute statement1 @response = Client::Service.disable_attribute( param1: param1value, param2: param2value ) statement2 end def enable_attribute statement1 @response = Client::...

 
No, no morning for you!
For you, night!
 
lol
 
8:00 AM
0
Q: Increase performance of removing character from String

LiondancerI wrote this function as part of interview practice. This method removes a character from a given string. I was wondering how I could make this code more efficient when it comes to runtime/space. I think my code is O(n) and I'm not sure if I can increase the efficiency. However, perhaps using th...

 
8:12 AM
0
Q: preformance help with c++ algo

Androidyi'm a c++ newbie, this is an algorithm i'm trying to optimize. i was trying to use openMP without any success. please try to explain why do i need to change any line of code. I want to learn. also i wish to understand is using openMP is the best way for matrix based algorithms? Thanks void CAlg...

 
 
1 hour later…
9:19 AM
0
Q: Need opinion if my php code has opened vulnerabilities

wolvereneNewbie here. Please bear with me. so I did a php mailer script. It does the basic validation of fields, return errors, else submit if all is good. But it also has a honeypot field that is not required to be filled in (I'm assuming by hiding it using css a spambot will fill in the field anyway). i...

 
9:52 AM
    if (!this.Value.equals("")) {
        boolean foo = true;
    }
^^ Don't you just love random unused boolean variables with meaningless names?
 
EVERYONE loves randomly named never used variables.
they don't even have to be boolean
 
^^ Don't you just love completely useless code that has absolutely no effect at all?
that better?
 
isn't that the same??
 
10:13 AM
0
Q: High score list - adding info from two players

lira79915220import java.util.*; import java.io.*; public class Player implements Comparable<Player> { Scanner read; PrintWriter write; private String playerid; private int playerscore; int x = 0; ArrayList<String> n = new ArrayList<String>(); ArrayList<I...

 
10:49 AM
0
Q: Need help about my examinable command pattern

user37775Need help about my examinable command pattern, it just becomes too complicated to continue: What I need is a examinable comamnd, so I could examine then execute something of cleaning. here is what is done: public interface ICommand { public void execute(); } public interface IExaminable { ...

 
11:03 AM
@Vogel612 Not entirely, useless code is more than just randomly named never used variables. if (!this.Value.equals("")) is not a random unused variable. It is however, completely useless code.
 
11:21 AM
Just saying hi.
 
0
Q: Correct code does produced desired result?

Mawia HLI have the following sql code. It is working fine and the structure seems to be correct. Though it outputs something, but not correct. what could be the problem? Is it a mysql drawback? Select regd, Section, Test_date, SUM(IF(t_scored IS NULL,0,t_scored)+IF(w_scored IS NULL,0,w_scored)+IF(f_scor...

 
@Morwenn Hi
 
11:49 AM
0
Q: Python code to generate features for future ML analysis of asset returns

L1metaI have built the following code to download stock data from yahoo finance. The plan is to then use the inbuilt pandas functions to calculate metrics from this data that will then be used as features for classification. I also try to calculate whether or not the asset performed better or worse or ...

 
12:09 PM
Hi!
...I was serial-reversed :(
 
@Mat'sMug Ouch. But at least you still got repcapped yesterday
LMFTFY.
 
0
Q: How can i fix this parse error T_DOUBLE_ARROW?

geomo$filterType = array( // set up an array that will hold specific flags needed for PHP's filter_var() function. 'string' => FILTER_SANITIZE_STRING, //Strip tags, optionally strip or encode special characters 'integer' => FILTER_VALIDATE_INT, //Validate value as integer, optionally from the speci...

 
@Mat'sMug I hope a Necromancer badge can make you feel better
 
Hey, thanks Santa! :D
 
12:35 PM
Hey all
 
Hey monkey
 
@SimonAndréForsberg .... we have to talk.... how can we get more 10K users when there is this sort of BS ... huh? :
2 DAYS AGO!!!! Seriously ?
2
 
lol
2
 
Hahaha. Well, in my defense, I wanted to answer that Direction question but it already has five other answers now :)
I will have some time to look through some zombies this weekend. It's been a busy week at work. (But I've gotten a whole lot of things done!)
I think I have several answers with very few up-votes though. If they need something more to earn an upvote, just add a comment :)
 
Yeah, being @repCap already probably means I will spend more time looking at work-things while .
huh.... homework
ohhh... you have 2 votes left for today
 
12:47 PM
^^ How can we get more 10K users when there's that sort of BS?
(the BS being vote limits)
 
hmm great, in one of my programs I have a bug where true after 3 seconds becomes false
on certain methods
 
concurrency... itistsa a prpobrolemblem
4
 
however
there's no concurrent code
 
Did you use volatile?
 
nope
 
1:01 PM
Good thing.
 
SO post is almost up
0
Q: How can a default method return true for a while, and then return false? (Possible bug)

skiwiI have an issue with the following code, which I isolated to the most closed form, I am using Java 8, which is almost ready for launch, so I expect no serious issues in the implementation itself, so it may/must be my own code: public abstract class Drawable implements DrawableInterface { } ...

 
Ok, so that's weird. In the last two days, I've earned 110 rep on an answer from April 2012.
 
that's nice and weird ye
 
The question must have been posted on a heavily trafficked web site.
 
0
Q: iOS objective C is it wrong to have constants on a def enum

MaKoI define some variables needed in my app with a enum but this values are not compared in a switch, Is it a bad practice to use this variables not in an enumeration? should they just be declared as int?

 
1:09 PM
I'd be interested if someone with Java 8 could try to reproduce that problem I just posted on his own installation
 
@Donald.McLean It happened to me once when one of my answers got shared by isocpp.org.
 
Since I'm trying to deliver a working system to operations, I haven't even really looked at 8.
 
np ;)
this bug is really stumbling my minds
 
@skiwi Unfortunately I don't have Java 8 nearby but I think it's because of your class inheritance..
thinking...
 
it should have to do with the inheritance
I have had a working version of this yesterday
but that from an OOP view made barey any sense :P
barely*
 
1:23 PM
I'm thinking about which possible changes you can making without creating problem
What happens if you make your List<Drawable> drawables; a List<Box>`?
 
thanks for your answer @rolfl ! +1
i'll try @SimonAndréForsberg
and rolfl found there's a Java8 bug report related to it
 
0
Q: Ruby: Refactoring a String Calculator

Lucien LachanceI've refactored the string calculator kata as much as I could and tried to maintain single responsibility. Is there anything I could factor differently? The specs can be reviewed here: http://osherove.com/tdd-kata-1/ module StringCalculator def self.add(string) string.end_with?("\n") ? fai...

0
Q: Reducing complexity of method

Petre PătraşcI'm trying to reduce the complexity of some methods, and I'm not exactly sure what approach to take. I'm currently building a PHP wrapper for a REST API, and the main problematic class is here: https://github.com/petrepatrasc/blizzard-starcraft-api/blob/master/Service/ApiService.php In short, s...

 
Good morning all!
 
good morning
erm afternon here
 
Well good afertoon then!
 
1:37 PM
Afternoon!
 
noon
 
@skiwi - it's an odd one... well done for identifying the problem before your mind imploded....
JVM bugs are a PITA... but this is also why there are Beta releases.
Although, you would think that the test harnesses they use would cover the code post-JIT
 
hey I see you're here now
well I'd imagine
I was working on a 3D project, and suddenly my shadows were disappearing 3 seconds into the game
and I had done only some code structure formatting, no actual new code introduction
so had nothing left over but to pull the issue out and see what would happen
 
@All ... uhm..... did something just happen to the SO Close-review queue?
 
1:49 PM
That explains a lot....
Now everyone has a 'binding' close vote.
 
now time to figure how I will work around the Java8 bug..
 
I kinda hope that once the current queue is down to zero, they will reduce so that all questions with 3 or more close/flag votes are shown.
So that the backlog is processed bit by bit.
 
I hope so, need to get 3K rep on SO still
however last days it was going hard :P
 
0
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> {}; ...

Zombie from january, down.
 
I expect to see a Revival!
 
1:57 PM
jdk8.java.net/download.html is this the OpenJDK implementation?
 
Haha, we'll see :)
 
how in earth do I register on bugs.openjdk.java.net/issues/?jql=
oh I can't I think...
 
@skiwi You're the expert at Java8. ... I just know my way around google ;;))
 
finally found it, via the Oracle site:p
 
0
Q: If Else statement with two queries

Phillip De VitaI have some PHP code I'm working on which contains 2 queries and I need to set extra conditions for 2 out of 3 view options and one less query for 1 out of 3 view options. Basically I'm rendering a history list of shows with three options ALL | PRO | UPCOMMING. The ALL option should include both...

 
2:12 PM
@rolfl I did file it as new bug, because every indication to me is that it should be fixed in the version we are both running
 
2:38 PM
0
Q: Improvements to an Angular ScrollSpy module

PatrickThings that I'm not sure about: Whether this works in all use cases - alongside routing and within templates etc Am I polluting the scope with all these variables? This seems to be the easiest way to do unit tests - or should I be passing the vars into the function? Some ( documentHeight, USerS...

 
3:27 PM
0
Q: Prototype OO-style of my THREE.JS application in JavaScript

Gelo VolroFor several months I'm working with JavaScript and THREE.JS library. Firstly I dislike the prototype-based programming, because I have to work a lot of with class-oriented languages, where any class is represented as the type and there is a strict separation between declaration and behavior of pr...

 
Hello everyone.
 
Hello!
 
3:45 PM
0
Q: Is there is a better way to combine array

Emilio GortIs there a better way to do this kind of array combination like a php native function like array_combine, I'm trying to improve my skills, and in certain point I note that I using too much nested foreach for almost everything. Using PHP 5.4 $array = Array( 'GroupName' => 'Emilio', ...

 
0
Q: Design considerations for classes/methods using JDBC to ensure resources closed correctly

Sam GoldbergIn reviewing code in our application, I see a tension between what makes a convenient design for methods accessing database data versus coding to ensure that the JDBC resource objects are closed properly. An example problem: // Application.java: Singleton class for objects which want to execute...

 
Hi @Mat'sMug and hi @kleinfreund!
 
Hi. :)
 
4:09 PM
If there are other Git/GitHub savvy people around, you may help me fixing a strange issue with my repositories. :)
1
Q: Remote Repository doesn't contain recent Commits

kleinfreundI have a remote repository on GitHub with two branches for my website. A master and a dev branch. Locally, I have a dev repository and a master repository. Problem: Although using git commit -am "message" and git push origin dev (or git push origin master respectively) works for both repositorie...

 
0
Q: How to get the Split value from collection

Abu HamzahI have the following key value pair in the array and trying to extract and load in the collections the below code is working but i'm thinking if i have any room to optimized this code using linq? string _data = "Website=url:www.site1.com,isdefault:true,url:www.site2.com,isdefault:true"; List<W...

 
@kleinfreund only 2 reputation points of difference between your SO account and here!
 
But the badges! :D
 
Well badges! Who cares about badges :P
 
.... uhm .... me?
hi all.
 
4:16 PM
Hi @rolfl ! And I do too :P
<-- was trying to be funny but looks like I'm not funny :P
 
badge-bling is the currency of CR .... no-one jokes about such things.
kidding.
 
Hey monkey. ;)
Badges. Badges and bananas.
5
Hey @syb0rg
 
Hey @kleinfreund
 
1
Q: How to Modularize more Efficiently in an if/else setup

PlattStudent101I wrote a program for one of my Object Oriented Programming in Java classes(Program 2) and I got docked off because my method was too long, which I'm not complaining about, but I got the note: Modularize more, method too long SO: I was wondering what any of you more experienced programmers would ...

 
@Marc-Andre it's ok, we still like you ;)
 
4:27 PM
We do? Ok, noted.
2
Only 23 more votes on this StackOverflow answer and I get Java8-Guru: stackoverflow.com/a/22096371/1305253 ;-)
 
0
Q: Monitoring a web page changes +

Tref PI'm trying to write a code to monitor a 'starsvalue' on a webpage (localhost:9911/star?request=1) every 5 second and when the 'starsvalue' changes to go this link ( localhost:9911/star?transf=2&stars='starsvalue') with 'starsvalue'/100-1. When I go to this link 'localhost:9911/star?request=1' I s...

 
4:43 PM
@rolfl 22 votes ;)
 
hehehe Repmax on SO day today....
Thanks all ;-)
 
@rolfl 19
 
Let me try this: Only 79 more votes on this SO answer and I get [badge:great-answer]... ;-)
 
5:33 PM
Yay, it's Friday!
 
I'm more like, at last it's Friday!
 
tries not to get Rebecca Black song stuck in head
 
"It's Friday, I'm in love." is better, isn't it, huh?
 
@Jamal Why WHY!
 
lol
3
 
5:46 PM
and back again
nice amoutn of votes there @rolfl :P
I wonder if my question appeared in the hot questions or something
 
@skiwi It is actually
 
oh wow @Marc-Andre ; that most explain the amount of votes/reads then
darn one short of [badge:good-question]
ok those tags don't work then
 
@JeffVanzella ... ditto
 
6:39 PM
Oh look. A banana!
 
Where ... where ... //// ?
 
in my hand
 
swedish bananas ... like your massages and saunas?
 
you get the peel and the actual banana in two flatboxes
 
I've eaten two bananas today.
 
6:41 PM
the saunas is the Finnish!
 
0
Q: Java Fraction Calculator Example

GigalI wrote this java program for a tutorial of my 1st year java module. And I posted it as a blog post and in Github. I validate it for Non numeric inputs x/0 type fractions 0/0 and 0/y type fractions x/1 and x/x type fractions -x/-y and x/-y type fractions appreciate if someone can look in to ...

 
@rolfl beat you by about 6 seconds...
 
I'm jealous of you @kleinfreund. Considering getting another one.
 
Might as well.. :~)
 
0
Q: Wannabe coder requesting code review

Koray TugaySo this is the requirement I have ( from the book: Cracking the Coding Interview ) And this is my implementation: public interface CallAllocator { public Employee getCallHandler() throws NoEmployeeInTheHouseException; void setTL(TechnicalLead technicalLead); void setPM(ProductMana...

 
6:54 PM
oh look, another banana!
(not in a box)
 
Playing Mario Cart, huh?
 
oh look, a koopa shell!
 
@amon No one came up with something on my GitHub issue so far. :(
 
bounty?
(stupid fr-CA keyboard)
 
@kleinfreund I know. Unfortunately, git questions on SO don't have the best track record of being answered.
I'll set up a bounty as soon as the system lets me
of course, asking a question on Friday evening wasn't exactly the best strategy.
 
6:59 PM
That's true.
I'm a git newbie, so I bet this isn't a huge issue and someone can figure it out quite easy. Although it's still a strange issue.
 
0
Q: How can I improve my game loop?

GamingGuySome time ago I made my simple game loop, so here's the code: public class Game { private final int TARGET_FPS = 60; /** optimal waiting time in milliseconds */ private final long OPTIMAL_TIME = 1000 / TARGET_FPS; /** last Frame time */ private long lastFrame; private i...

 
A question wants to be reopened
0
Q: Java Fraction Calculator

GigalI wrote this java program for a tutorial of my 1st year java module. And I posted it as a blog post and in Github. I validate it for Non numeric inputs x/0 type fractions 0/0 and 0/y type fractions x/1 and x/x type fractions -x/-y and x/-y type fractions appreciate if someone can look in to ...

lacked the code earlier
 
Done
 
and back again
1 vote short of my silver badge, oh noes
@rolfl What did you use to get the System.getProperties() pritn nicely formatted?
oh monkey gone, bananas
 
7:21 PM
@skiwi System.out.println(System.getProperties() ); followed by some editing manually to add line breaks, and remove 'sensitive' information.
 
If I did more reviews, I would probably be ranting like this all day:
0
A: Are there any open vulnerabilities in this mailer script?

200_successYour mailer is vulnerable to a header-splitting attack! (Also known as a CRLF-injection attack.) Basically, if one of the fields contains a CRLF, the attacker can insert any arbitrary header into the generated message. For example, if the email parameter is victim1@example.com%0d%0aCc:%20vict...

 
ah ok, well I was too lazy to do the editing manually
I'm glad that someone came up with the -Xint option, can atleast run my real program normally now :)
and bugs.java.com is really slow
 
it will be much slower, but it will work
 
yeah well, I can live with it for now
until a fix is there
yay my first Good Question badge
 
@200_success: Based on yours and William Morris' answer on the hex-to-int question, I'm not sure if I should keep my answer, unless mine could be considered an alternative in some situations. Then again, I never really read what that C function actually does.
 
Anonymous
 
@Jamal Now that the OP has posted revised code based on your advice, your answer now has historical significance. You should leave it up because even unpopular advice has educational value. Hopefully your answer will get outvoted.
Context, for the rest of you:
7
A: Hexadecimal to integer conversion function

JamalI think you should be returning different error values for different errors. You're returning -1 for an invalid pointer, too many hex digits, no hex digits, and a non-hex character detected. Instead, choose separate error values for each of these (and any additional error types) and return the ...

 
That is true, and I am okay with out-voting. I have upvoted yours and William's already, of course. Since this was a hot question for a bit, I'm surprised some SO people didn't leave comments.
 
@amon Looks like someone has a plausible answer.
 
7:48 PM
0
Q: lazy instantiation and instance lifetimes in POM

evanmcdonnalI've been considering the pro's and con's between implementing my page objects with privately backed properties and lazily instantiating them or just returning new instances every time and am curious what other people think is the best practice. For example, I could have something like; pri...

 
Is a CR question with "non-compilable" code allowed?
I mean I am making a 3D game which has now already a quite large sourcecode, while the question is only about part of it
 
Yes, it is allowed. But it has to 'work' in the sense that it cannot have syntax errors, must do what it is supposed to do.
 
@skiwi What would your CR question for the non-compilable code be?
@rolfl My first answer in two days:
 
@skiwi Your whole program must work. However, you can provide just the relevant excerpt in the question to be reviewed, which obviously won't compile standalone.
 
0
A: Java Fraction Calculator

Simon André ForsbergThere are several things that can be improved in your code, I will point out some of them here. Polymorphism Your Addition/Subtraction/Multiplication/Division classes has a lot in common. You should use polymorphism and inheritance to use them better. You can make an abstract class for them. A...

 
7:52 PM
@SimonAndréForsberg DVLR ....
 
So bookmark it, dear monkey, dear monkey, dear monkey.
So bookmark it, dear monkey, dear monkey, dear monkey. Bookmark!
 
Hmm that is really tricky then, as I cannot just dump all sourcecode there, which also has dependencies on LWJGL for example
I could make it into a working code example though, but then it is no 3D application anymore nor does produce any graphical result
 
@skiwi - consider this:
5
Q: Increase performance of removing character from String

LiondancerI wrote this function as part of interview practice. This method removes a character from a given string. I was wondering how I could make this code more efficient when it comes to runtime/space. I think my code is O(n) and I'm not sure if I can increase the efficiency. However, perhaps using th...

That is 'working code'.
It can't compile in that state though
 
ok I can figure it out then I think giving an abstract class + interfaces + example implementation then qualifies to be working code
 
If you can 'pull' the parts of the code that you want reviewed, and it is clear that it is part of a working system.... then you are good.
 
7:56 PM
ok cool cool
 
@skiwi that sounds about right.
 
I'm still doubting if I want to make my Java/LWJGL/OpenGL4+ game fully closed down, or partly opensource... hard decisions
 
00:00 - 20:0020:00 - 00:00

« first day (300 days earlier)      last day (3718 days later) »