« first day (561 days earlier)      last day (3459 days later) » 

12:17 AM
0
Q: A Java class for calculating size of iterable/array v2

qedVersion 2 of A Java class for calculating size of iterable/array import java.util.Collection; /** * Created by IDEA on 16/11/14. */ public class Size { public static int size(Iterable<?> data) { if (data instanceof Collection) { return ((Collection<?>) data).size(); ...

 
1:12 AM
0
Q: Multithreading pthread program

Mike MinaevMy multithreaded version of code works slowly than singlethreaded. Can you help me to understand why? #include <iostream> #include <vector> #include <getopt.h> #include <stdlib.h> #include <cmath> #include <pthread.h> #include <unistd.h> #include <time.h> std::vector<std::vector<double> > phi, ...

 
1:22 AM
16144 starred messages already? That's about 150 starred messages in 5 days. Equals 30 messages per day. Equals one and a half @Malachi.
5
 
hey @SimonAndréForsberg :)
 
Evening, @Mat'sMug.
 
50,121 users
38,451 visitors/day
 
and a whooping 32.7 questions/day
 
50K users, approaching 40K visitors/day. We're only 1 year after Grace Note's review.
772 zombies
 
1:29 AM
Congratulations, @janos. You're top row now.
4
And I'm second again :(
@Mat'sMug isn't that technically 772 too many?
 
Sure, but %-wise, it's been pretty stable, if not decreasing. Incoming zombies don't live very long.
1 year ago it was > 1K zombies, and that was like 10% of questions.
we brough it down to some 550 in April, and then it kept going back up, ..but the %unanswered has never gone back to <90% (and hopefully never will)
 
I think we were at 96% answered not so long ago, but it seems like we're back to 95 again.
Indeed it is very stable though
 
I love what we've done with this site in the last year. I don't know if/when I'll be able to contribute as much as I used to, but I'll keep coming back to post whatever code I come up with, that's for sure.
 
You can always come back to Code Review.
 
(I could always get another shit job)
CR feels like home :)
 
1:43 AM
There's no place like home CR.
2
There's no place like home CR bed.
 
hehe.. good night!
 
1:59 AM
0
Q: A Java class for reading MaCH dosage files

qedA dosage file (used in computational genetics) is formatted like this: // ID TAG geno1 geno2 geno3 ... 1->76016 DOSE 1.871 1.832 1.897 1.995 1.884 1.856 1.405 1.853 1.998 1.885 1.390 1.971 1.890 1.699 2->76018 DOSE 1.877 1.832 1.897 1.995 1.884 1.856 1.405 1.853 1.998 1.885 1.390 1.971 1.890...

 
2:31 AM
0
Q: What design pattern to use here?

prestokeys#include <iostream> #include <string> #include <list> #include <vector> #include <set> #include <array> struct Person; struct State {virtual ~State() = default;}; struct StateA : State { std::vector<Person*> enemies; }; struct StateB : State { std::set<Person*> prospectiveEmployers; }...

 
2:56 AM
@SimonAndréForsberg Holy Carp
 
3:50 AM
My first threat-email from an SO user!
 
wut?
 
> Hi,
how are you ?
I just wanted you to know your a huge asshole ! :)
Learn to help people rather then criticize
I cant wait til I see you .
Watch your back if i ever see you criticizing people again chap.
Apologize to the poor people you attack on stack overflow , i am watching your content.
if you dont, your going to get punch in the face Monday in class
Sincerely
your secret Classmate
from an aol.com email address
8
That's probably the worst offense
 
That, and the smiley used after that sentence.
 
I submitted my report to SE too early.. A bit of google-fu and I have concrete evidence it's linked to who I thought it was
I'll let them know when they get back to me
 
You should also tell him that one usually offers punch to someone in a cup, not in the face.
4
 
3:57 AM
0
Q: Removing stray brackets from in between shortcodes

gregpressI was wondering if someone could point me in the right direction for cleaning up this code. WordPress uses shortcodes in the form [shortcode] to add extended functionality to posts and pages. What I am trying to do is to return a string with all of the 'stray' brackets, ones not being used by ...

 
I should have known I couldn't trust my classmates with drinks!
Alright, bedtime
 
In that case, don't apologize (unless of course you dislike punch). ;-)
 
5am is no hour for a gunfight
 
Goodnight!
 
'night!
 
4:13 AM
@JeroenVannevel 5 am is the perfect hour for a gunfight. I like to do my (zombie) killing before breakfast.
 
8 AM. I do my (zombie) killing after breakfast.
 
 
3 hours later…
6:57 AM
0
Q: Quadratic formula c++

Sam LincolnNeed help on making a code for users to input numbers for a, b, c to find the quadratic formula. #include <iostream> #include <cmath> #include <string> using namespace std; //////Quadratic Formula/////// int main() { int a; int b; int c; ////////////////////User Input a, b, c/...

 
7:18 AM
0
Q: What is the most efficient way to evalaute the function $f(N, R) = F(N)/(F(N-R)*F(R))$ where $F(N) = 1^1 * 2^2 *....* N^N$?

ManuIn particular goal is to find f(n,r)mod(m) for given values of n, r, m and m is a prime number. f(n,r) = F(n)/(F(n-r) * F(r)) where F(n) = 11 * 22 * 33 *... * nn Here is the python code snippet I've written n_r = n - r num = 1 den = 1 if n_r > r: for j in xrange(n...

 
8:14 AM
0
Q: What is best practice to write such a PHP code

indevelerThis code is from my Kohana project. How to make it more beautiful? Should I use try-catch instead? How not to write exit() two times? public function action_index() { $id = $this->request->query('id'); if (!empty($id)) { $ticket = ORM::factory('ticket') ->where('id',...

 
8:49 AM
Good morning, folks. :)
 
0
Q: Extended Euclidean algorithm and modular multiplicative inverse element

kleinfreundAfter my first exercise here is another. Again, this is exactly that: Exercise, which means that the output doesn't necessarily need to be beautifully formatted, etc. I probably have some variable naming issues around and also more general issues. # coding=utf-8 """Basic usage: $ python xggt.py...

0
Q: reader/writer spinlock

programmerjakeI wrote some code for a reader/writer spinlock that gives some preference to writers. Is the code correct? The code uses readerCount for the actual locking and just uses writerCount for preferring writers. This is similar to C++14's std::shared_timed_mutex but without timeouts. struct rw_lock { ...

 
 
1 hour later…
10:06 AM
monking
 
Hey @janos
 
hey @kleinfreund, how's it going?
 
Fine. Doing some Python instead of doing the work I'm supposed to do.
 
similar here: doing some CR instead of doing the work I'm supposed to do
 
How are you doing?
 
10:10 AM
actually I'm supposed to rest. I'm sick today :(
 
Well, who stays off the internet when he's sick?
 
0
Q: ArrayList for Shop implementatin

rick112358Problem statement: Design a system for the following scenario: 1.An item list contains item code, name, rate, and quantity for several items. Whenever a new item is added in the list uniqueness of item code is to be checked. Register a new product with its price. Time to time rate of the items...

 
I'm doing Python too :p
 
By doing Python I meant refining my second thing I did in Python. So currently I'm not doing real Python.
 
@janos they are giving up on perl. started python
 
10:18 AM
that is very good news for you!
was it because you suggested it?
 
No I wrote the same app in perl and python and ran it, Python was 15x faster
 
wow
 
It might be because I made some mistakes in the code, Unfortunately I cannot get those reviewed.
 
haha
@kleinfreund the initialization of parser is missing in your question
parser = argparse.ArgumentParser()
 
Oh no! I was about to remove the description inside ArgumentParser() and went two steps too far I guess. :D
 
10:25 AM
btw I got the fanatic badge
 
Good job!
Got it a couple of days ago as well.
 
yeah me too
 
oh, congrats to both of you then :)
 
:D
thanks
 
actually I didn't want to get that one, but forgot to break the streak....
 
10:29 AM
I usually have codereview as the homepage on all my browsers.
 
Thanks for reviewing @janos. Good points.
 
you're welcome!
 
@janos : system support people are not happy going to Python, single line in bash get replaced with 10 line Python code
 
why replace everything? I'd replace only when things get too complicated with bash
@kleinfreund I noticed one more thing just now, updated my answer
 
Not sure though, I have to do what I'm told.
 
10:37 AM
@janos Ah, yeah. Makes sense. This way it's easier to scan through the code and get the idea.
 
@JaDogg in any case, single line that only few people understand is not as good as 10 lines that anybody can understand
preference for write-time convenience instead of read-time convenience is a false economy: code is read far more often than written
3
 
yup
@janos I'm going to steal that line
 
I stole it too: from Steve McConnell's Code Complete cc2e.com/Default.aspx
 
0
Q: PHP or Jquery code to parse a string

Anuradhan Anandhani need to parse following string using php or jquery. {"UserId":"9c932a93-5fff-4416-b1fb-0cd7aa320df5","Details":[{"Id":2,"Name":"Commercial"},{"Id":15,"Name":"Book"},{"Id":21,"Name":"Retail"},{"Id":24,"Name":"Documentary"}],"ReturnMessage":"Success"} Result should be like: UserId = 9c932a93-...

 
so that's where I've read it before
 
10:41 AM
you're read that book?
 
yes
 
that's great! I'm not even half-way through, wishing I had read it years ago
 
10:59 AM
Monking
 
Monking
 
How is everything @janos
 
@200_success @rolfl isn't this bounty question off topic: codereview.stackexchange.com/q/69198/12390
thanks @Anirudh, not so good, caught a bad cold :(
 
Get well soon take ginger tea
 
good idea!
 
11:02 AM
Usually the body kills virus in sleep, it's good to sleep as much you can, though during cold it's kind of hard as you keep on sniffing...lol
 
11:23 AM
@janos oh, get well soon.
 
0
Q: C program to add element-wise, a parallel program which doesn't execute

Nayak Karkala H#include <stdio.h> #include "omp.h" #define NUM_THREADS 4 int main() { int a[100],b[100],c[100]; int i,n; printf("enter the no. of elements\n"); scanf("%d",&n); printf("enter the elements of A\n"); for(i=0;i<n;i++) scanf("%d",&a[i]); printf("enter the elements of B\n"); for(i=0;i<n;i++) ...

 
12:20 PM
Monking
 
0
Q: RubyWarrior beginner epic Solution

RadW2020 This is my RubyWarrior Solution Help me refine it thou kind sirs :) I think RubyWarrior is a well known of Ruby coders. https://github.com/ryanb/ruby-warrior I am starting to learn Ruby and I would appreciate some help from you to improve the organization or the mistakes that I could have. I d...

 
Heya @skiwi
 
@mbatchkarov @konijn @firda Why did you edit/approve this?
 
12:35 PM
How are ya @kleinfreund?
 
Fine, doing work for the uni. Finally.
And you?
 
Also fine.. and busy schedules
Including university
 
0
Q: A Java class for reading MaCH dosage files v2

qedVersion 2 of A Java class for reading MaCH dosage files import java.io.*; import java.util.ArrayList; import java.util.regex.Pattern; import java.util.zip.GZIPInputStream; /** * Created by vu.co.kaiyin.ReadMachDosage on 15/11/14. */ public class Dosage { final String filename; final P...

 
@janos Interesting issue! I encourage you to ask on Meta. If found to be off-topic, a refund of the bounty might be in order.
 
12:54 PM
I am scanning it now too, and it's iffy. Technically the code works, from what I can see.
@200 ... you still awake, or woke up really early?
The 'broken' shader instances are designed to be 'stub' shaders, and they are not part of his concern about the deprecated methods and setup for the new version
The real question is about the setup and launch code.
 
Oh it's OpenGL related... and LWJGL! I'll take a look
 
There are a couple of other reasons why it may be off topic though, @skiwi..... like, is it asking for code to be written?
Not quite sure
 
@rolfl @200_success That question appears to not have been presented as including working code. I don't (personally) care whether it has working code or not, he is using non-working code in his question and therefore I think it is fully off-topic.
It's using OpenGL 1.0/1.1 calls and he is using the core profile which explicitly forbids them.
Those calls are from the fixed graphics rendering pipeline and he wants us to rewrite them (or give advice on) to use the new programmable graphics rendering pipeline, present from 2.0 onward I believe (at least surely from 3.0 onward)
Frustrating, I can't even VTC it because of the bounty
 
OK... can you think whether the question woul be on-topic on SO (or a revised version of the question?)
 
morning
 
1:02 PM
I think the question is well-formed as is, it's just not for here. SO makes sense to me
> The first problem I have is that I make calls to glMatrixMode(), glLoadIdentity() and glOrtho() right off the bat. I believe all of these are deprecated and I have no idea how to replace them
 
OpenGL shaders have been introduced officially in 2.0, and his code uses OpenGL 1.x calls, which is fine... But using only the core profile forbids using OpenGL 1.x calls.
 
^^^ dunno how to replace them, this part is clearly SO for me
 
@rolfl It's hopeless on SO. You need a way more shorter question for them to even bother looking at it.
 
> I'm pretty sure there's nothing usable about these shaders. They don't even work in OpenGL 2.1
 
It could be on-topic on SO, but still wouldn't get answered
 
1:03 PM
the bounty might help, on SO
 
Except maybe some broad advice that isn't useful (for anyone) in my opinion
 
@200_success You still looking?
I'm thinking a comment, with a link to the transcript here, and a refund of the bounty may be in order.
 
it's well explained and shows effort, I agree with the refund
he has more rep on SO, he can easily afford the bounty
maybe he asked here in the hope of more attention (which he did get indeed...)
 
It's the SO paradox: You have to aska question that the masses can understand, otherwise it gets closed unclear.
 
Yep, it all looks very familiar to me
 
1:07 PM
A detailed and complicated question is very hard to ask on SO.
 
It's worth a Meta post.
 
@skiwi Is it possible that the code compiles, and runs? That the actual shading is stub shading, but that the question is not about that, but about the setup, and management?
 
I'm trying to figure out the point of his MainWindow class at all
@rolfl Here's the tricky part... All individuals parts will most likely compile and run
Except that compiling/linking the shaders may give errors, which we only see if we could/would actually run the code properly
For any code involving OpenGL and shaders there is no clear-cut answer for "will it run?"
 
That's what I am afraid of. But, following on from that, do you think a CR-like answer is possible on the code as it is?
(one that is worthy of the bounty?)
 
The question from (Then I have the Renderer class...) seems to be usable, but I cannot check if it would produce a meaningful result
@rolfl Not with the MainWindow class and text above that, in the question
 
1:12 PM
OK, Any volunteers for the meta question ... ? ;-)
 
Then in the Rendered class itself the calls to glColorPointer and glEnableClientState seem fishy... But that's only because I don't know them, they may be completely valid for core OpenGL
> I believe there are some deprecated calls in the render() method (I think glVertexPointer() and glColorPointer() are both deprecated).
There it is actually
I think he should come back once he knows how OpenGL works, he will really need to study something about it first.
 
OK, he's trying to short-circuit his learning by using CR in a way it's not designed to accomodate.
Get expert attention on code that he knows is not ready for review.
 
I agree with that ^
(Gravving a lunch now)
 
K, thanks, extra Gravy
 
1:25 PM
0
Q: Is the *Updating OpenGL version to 4.1 (LWJGL)* question on-topic?

rolflThis question: Updating OpenGL version to 4.1 (LWJGL) The question has an open bounty, but is it on-topic?

This question is being discussed on Meta. Is this question on-topic? — rolfl ♦ 15 secs ago
 
1:39 PM
3
Q: Is the *Updating OpenGL version to 4.1 (LWJGL)* question on-topic?

rolflThis question: Updating OpenGL version to 4.1 (LWJGL) The question has an open bounty, but is it on-topic?

 
0
Q: Authentication with JWT

Beyond ProgrammingPlease review my code for 'JWT' authentication Are there any security issues? Where should i store the secret's key, DB or Session? What's a good 'JWT' Lifetime, do i add Lifetime information to header or payload? Should i send the 'JWT' in Header for every request? What should be done when ...

 
2:45 PM
I miss the weekly question of "When do we graduate?"
6
 
lol
monking!
 
hey @Mat'sMug
 
I'm hoping to put my Parser up for review today.. but damn there's so many issues right now :(
 
@Mat'sMug That means the code fears a review, hence it creates some bugs to save itself.
 
that's gotta be it :)
I'm starting to wonder if using regex was a good idea at all...
 
2:55 PM
@Mat'sMug Depends in what context
 
parsing regular syntax
 
Hello @Mug
 
hey @kleinfreund
 
How're you doing?
 
could be worse.. the code builds :)
 
2:59 PM
hmm..
Hey @skiwi how about I put up that CommandBuilder from yesterday?
 
@Vogel612 You can always put it up! But I'm short on time, so not sure if I can review... I'll probably have time from February onward..
But I think there's other that can provide good insights
 
0
Q: Refactor switch statement using Strategy pattern or enum

user77318I am refactoring an existing code which has a huge switch statement with more than 20 cases. I was thinking of using the strategy pattern, however this means I need to create 1 interface with 20 plus classes implementing the interface. I was thinking of using enum approach as describe at http://...

 
3:28 PM
@200_success I wanted the formula to correspond exactly to what the code is doing, but I seem to have forgotten the minus. I'll edit again
 
3:56 PM
0
Q: Could someone explain to me how i can display the values which the user enters.

m123 jan= int(input("enter amount of rainfall for January")) feb= int(input("enter amount of rainfall for Febuary")) mar= int(input("enter amount of rainfall for March")) apr= int(input("enter amount of rainfall for April")) may= int(input("enter amount of rainfall for May")) jun= int(input("ent...

 
4:08 PM
0
Q: Remove or change [tag:c++]

nwpThe tag c++ has become ambiguous and a source of confusion. There is c++98 (not used), c++03, c++11, c++14, soonish there will be c++17 and c++22 and then there is c++0x (synonym for c++11) and c++1y (which should be a synonym for c++17). C++11 is so much different from C++03 that most answers fo...

 
4:25 PM
0
Q: Matrix: Set a row/col to zero

Tehan FragoA practice interview question. Question: Write an algorithm such that if an element in an MxN matrix is 0, its entire row and column is set to 0. void SetZeroOnMatrix(int **matrix, int M, int N) { bool *rowZeros = new bool[M]; bool *colZeros = new bool[N]; // Find the 0's for(...

 
@JeroenVannevel From a 4K rep account... unexpected
Oh, it was on his own question
 
Yeah it's his own Q+A
It's just funny to go from watever to ecerything
 
@JeroenVannevel Doesn't make much sense :)
 
5:16 PM
Hi all, a newbie question: some helpful spirits corrected my mistakes and sent me the text for approval. Where do I sign? Is there a button for accepting the proposed changes?
 
0
Q: Memorable Combinations for Sargent Mechanical Combination Locks

erturneI have a safe with a manual combination lock that I periodically change the combination to. I like to use a combination that's easy for me to remember, so I thought I'd write a quick Clojure program to make it easier to pick a new combination. Note: When I say "combination" in this write-up it m...

 
Okay, got it. The changes have already been applied. Thanks to the helpful spirits! Over and out....
 
0
Q: finding points of intersection not consistant

spyr03I have unfinished code to find the points of intersection of all lines that are perpendicular. So far I have this: import java.util.Scanner; public class CountSquares { public static void main(String args[]) { Scanner scan = new Scanner(System.in); int lines = scan.nextInt()...

 
5:53 PM
0
Q: Operator alignment: to or not to?

viclibBy operator alignment, I mean this: var script = document.createElement('script'); script.type = 'text/javascript'; script.src = "socket.io.js"; script.onload = socketio; What are the pros and cons of such style?

1
Q: Am I treating Exceptions handling right?

ahmedI'm using the function countLinkes() to fetch URLs' Likes count from the Facebook API. // Link.php class Link { private $url; public function __construct($url){ $this->url = new Url($url); } public function getUrl(){ return $this->url(); } public function countLikes() { global $...

 
are we voting to close or letting Moderators handle this one? — Malachi 2 mins ago
@rolfl I say we close it and refund the bounty. looks like a good question for SO
 
6:20 PM
@StackExchange D:
 
6:46 PM
0
Q: jsperf for js objects vs array tuples

George MauerI'm getting more and more into programming js in a functional manner which makes heavy use of multiple returns via tuples. Usually I see tuples in js implemented with arrays [a, b] though of course an object - while annoying to write would be just as valid: {a: a, b: b}. I'm curious if there's...

 
7:05 PM
I think there's a typo in the dealCards method in your answer, shouldn't it add to cards instead of usersCards?skiwi just now
Late comment is late
and wow @Jamal, that's a late edit as well ;)
 
user seen 1 hour ago. So not too late for him ;)
 
@Malachi I say we let the person who asked the question get back and throw his weight in on the situation. Seems fair.
 
-1
Q: Very basic password checker

JakePretty obvious what I'm trying to do, how do I make it loop back to the "If" statement after the second input? Started last week, sorry for my newness, cheers. count=0 cpass=str("changeme") password=input("Enter Password: ") if str(password)==str(cpass): print("Accepted!") else: count=co...

^ something written in the language, interesting...
 
code not yet written
 
-1
Q: Very basic password checker

JakePretty obvious what I'm trying to do, how do I make it loop back to the "If" statement after the second input? Started last week, sorry for my newness, cheers. count=0 cpass=str("changeme") password=input("Enter Password: ") if str(password)==str(cpass): print("Accepted!") else: count=co...

 
7:37 PM
1
Q: How could I clean up this Javascript code that uses multiple callback functions?

GregBI'm a javascript rookiee, but I wrote a javascript function as part of a Chrome extension that will activate the tab to the left of the currently active tab. The function is pretty ugly, but I couldn't figure out another way to write it. The logic is pretty simple, but I ran into problems settin...

 
7:51 PM
0
Q: Function to get NGrams fast in haskell: Is there a better way

MuzzleIs this a good way to get all sublists of a sequence/list that have a given length? An inefficient way to do it would be something like f n = (filter (\x -> (length x) > n)) . (take n) . tails this just takes the n first elements of each tail of the original list. I think it should be slow be...

 
8:12 PM
I'm not sure how many people noticed this answer, but for a new user this is an amazing answer: codereview.stackexchange.com/a/69990/27623
 
^^^ true
 
Welcome to Code Review, and thank you for making this such a wonderful review! Hopefully you can stick around to make some more! — syb0rg 10 secs ago
 
This sort of makes you wonder... how on earth did he find this site?
 
We could always try to get him in the chat room and ask him
He seems to know what he is doing with the rules and all
 
1
Q: Rename files to titlecased

janosI wrote this Python script to rename specified files to "titlecase", for example: hello.txt to Hello.txt hello there.txt to Hello There.txt path/to/file.txt to path/to/File.txt The main script: #!/usr/bin/env python import os import re import argparse re_junk = re.compile(r'[._-]') re_spac...

 
8:25 PM
Extended an invitation to the chat room, maybe he will respond
Also, I'm not sure why the OP deleted this answer: codereview.stackexchange.com/a/69745/27623
I think it should be undeleted personally, I made the edits to include the parts of the other answers to make it a "proper" answer
 
1
Q: Implementing equals(), hashCode(), toString() in the hierarchy like the Optional<?> from Guava

Leonid SemyonovI have simple hierarchy which looks [a little bit] like the Optional<?> from Guava: public abstract class Result<T> { public static <ResultType> Result<ResultType> get(ResultType result) { return new PresentResult(result); } public static Result<?> absent(Throwable exceptio...

0
Q: A Java class for reading MaCH dosage files v2.0

qedVersion 2 of A Java class for reading MaCH dosage files import java.io.*; import java.util.ArrayList; import java.util.regex.Pattern; import java.util.zip.GZIPInputStream; /** * Created by vu.co.kaiyin.ReadMachDosage on 15/11/14. */ public class Dosage { final String filename; final P...

 
8:51 PM
0
Q: Given n numbers find out the least k numbers from them. For example, if there are 8 numbers like 5,6,3,4,7,8,9,-1. For k = 3 the result will be -1,3,4

TanvirI have been solving the following problem. Given n numbers find out the least k numbers from them. For example, if there are 8 numbers like 5,6,3,4,7,8,9,-1. For k = 3 the result will be -1,3,4. I implemented it in the following way. make heap with first k numbers traverse the rest k-n numbers...

 
9:04 PM
Morning.
 
@Morwenn Good morning!
 
@Jamal Are you currently answering the latest C++ question?
@syb0rg I say "morning" out of habit, but it's already 2 hours from midnight .___.
 
@Morwenn No I'm not
 
Ok, I'm on it then :p
 
@Morwenn And you aren't going to bed? haha
 
9:09 PM
@syb0rg I'm already in bed :D
 
@Morwenn Oh, gotcha! I totally do the same thing sometimes...
 
0
Q: Do I violate solid principles and DRY?

Midori KocakI created this basic content management system to teach object oriented php to beginners. However I have concerns if I violate solid principles in App.php and Router.php App.php: <?php /** * The class that starts our application. * * Works as dependency injector. * TODO Have to check solid ...

 
For those who haven't seen yet, a pretty awesome answer: codereview.stackexchange.com/a/69990/27623
And only one more undelete vote: codereview.stackexchange.com/a/69745/27623
 
@CaptainObvious You're writing . Name one principle you don't violate.
4
 
9:32 PM
Thanks, Santa! 21 upvotes remaining
 
9:56 PM
@rolfl sounds good
 
@200_success re: change, I figured you got the formula wrong, my apologies if you were right
 
@konijn IMO such edits should be comments and not edits. Unless you have the necessary reputation to edit it and really know what you are doing.
 
Yeah, I was really doubting on this one
mea culpa
 
I rejected an edit earlier today on the same post, from an anonymous user.
 
@Morwenn: I have decided to say something else about that question, though you two have already covered most of it.
 
10:05 PM
0
Q: Creating new types that facilitate safety, flexibility, and DRY-ness (Haskell)

JosiahDisclaimer: I realize that a lot of my trouble has to do with how I'm grounded in the OO way of thinking. If you can point out exactly how I'm trying to force OO thought on Haskell, I would be very grateful to you. I've run into something in my code that is not a "Show-stopper", but is a bit an...

0
Q: Globalize config data is safe in PHP?

qreqorI have some framework in PHP/MySQL for developing web services. Finally my code works on two servers - production and developer. My idea is to create one code without differences, which will work different on both servers, depend of config. I created table [ini], with two rows of data, where I ca...

 
@Jamal Be careful, cbegin and cend require C++11 :p
 
Ah, right. I've removed the c's. :-)
 
So only ++ left then?
 
I just made it to Code Review's top 25. Thanks Santa! :D
2
 
Looks like someone wants a t-shirt...
 
10:13 PM
To be honest, I would rather have a nice mug.
 
And I'm still waiting for my mod hat.
 
@Jamal I thought Winterbash was 11 months ago?
 
I requested it some time ago, but it does take a while. I hope it was sent out.
 
0
Q: Inclusive Range c#

chaisI've written a method to obtain an IEnumerable from a start point, end point and step. Similar to Enumerable.Range() but for doubles and not fixed step. public static IEnumerable<double> InclusiveRange(double start, double end, double step = 1) { while (start <= end) { ...

 
Language in the title, but not as a tag.
 
10:21 PM
And is a good tag or not?
9 questions. Many of them also tagged with .
 
0
Q: I can't seem to get my hangman java program working

user57030'm trying to make a hangman program and I have no errors but the program will just terminate when I run it. Do you see any issues with my code? Can I add StringBuilder to strings that change in my code? I also wanted to make create a driver class but not sure what to put in it. package hangman;...

 
@CaptainObvious then you are at the wrong site
 
10:45 PM
Speaking of Java, I'm starting on my GUI assignment now. It's also my very first time dealing with GUI, so this should be interesting.
 
11:03 PM
@Jamal Are you gonna use Swing or JavaFX?
 
AWT of course.
 
of course
silly me :)
 
hey guys
 
@SimonAndréForsberg Has to be Swing
 
11:18 PM
@SimonAndréForsberg Do you have some time for quick CR?
 
0
Q: Implementing `foldTree` on an ITree

Kevin MeredithLooking at this Typeclassopedia exercise, I implemented foldTree on the following type: data ITree a = Leaf (Int -> a) | Node [ITree a] And my implementation: foldTree :: ((Int -> a) -> b) -> ([b] -> b) -> ITree a -> b foldTree f _ (Leaf x) = f x foldTree f g (Node xs) = g $ map...

0
Q: Angular JS directive + service best practice?

burzumI've started to use AngularJS to build parts of the site in a modular API based fashion so that we can re-use them in another project we're going to start soon. Since I don't have much experience with Angular I would like to know if I did everything right or if there are things that can be impro...

0
Q: How to read file and save integers in an arrayList?

Fox I have saved the whole text below in a text file in java. I want to read the textfile, get out the currency rates/numbers and save them in an arrayList. Can someone help me? //text below public void split(){ <?xml version="1.0" encoding="ISO-8859-1"?> <exchangerates typ...

 
@Webby The Simon you are trying to reach is not available at the moment.
 
lol sure :) you busy?
 
I'm coding
 
sure
I have my code, just need to be reviewed. Haven't got anything yet so thought to check with you guys. Since rolfl is busy these days
 
11:32 PM
Have you posted a question about it?
 
yeah already there
since 8 days
 
Which one?
 
6
Q: Efficiently using ZeroMQ sockets in Java

WebbyI am working on multithreading project and I am using ZeroMQ socket to send the data as a byte array. Below is my example which works fine. I'm opting for code review to see whether it can be improved by adding a wrapper class for using ZeroMQ socket as some sort of socket manager. public class ...

 
You have put a bounty on it I see. That's really all you can do.
15 mins ago, by Webby
@SimonAndréForsberg Do you have some time for quick CR?
For the record: That is not a "quick" review.
 
lol sorry yeah I thought it will be quick for you
 
11:35 PM
Oh no. Most reviewers take their time with the questions.
 
I see
 
I posted a wall of text on a forum half an hour ago and I am sad that nobody answered yet. I really should learn patience.
 
Here's my rough time estimation of your question:
- Reading question: 5-10 minutes
- Understanding question better: At least 5 minutes
- Figuring out what ZeroMQ is and reading some about it: about 5 minutes
- Writing an answer: 10 minutes
There's really nothing "quick" about that.
 
sure. now I understood, I thought you might have used ZeroMQ before will be quick for you
 
@Webby While you wait for an answer to your question, why not spend some time reviewing someone else's question and doing them a favor?
 
11:39 PM
I can try doing it for sure
 
0
Q: Generalization of phase based systems for card and board games

MLProgrammer-CiMIn an exercise of futility I'm trying to abstract and generalize a framework where to build any turn/rule based system. I've had a head start but after decompiling HearthStone I'm second-guessing that it may have higher complexity than I expected, at least for abstraction. So, I would like a peer...

0
Q: Is monkeypatching __builtin__ in tests like this an absurdly complicated practice?

Eddie Antonio SantosMy hunch: Probably. I'm testing a little magic behaviour of my script that automatically reads from ~/.ghtoken to do automagic authentication on GitHub API requests. I want to test that this works properly by checking the headers in my mock requests to GitHub's API. I'm using HTTPretty to mock H...

0
Q: Read first column of a space delimited file with Java 8 stream

qedCode: import java.nio.charset.Charset; import java.nio.file.Files; import java.nio.file.Paths; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; /** * Created by IDEA on 16/11/14. */ public class TestStream { private...

 
In Swing, how would I display my text box right below my label?
 
I want to read a manga but I also want to sleep. Life is too hard.
 
@Jamal use one of the 200 different layoutmanagers
for that one, use BoxLayout
you just need to pass some parameter to it that I don't exactly remember
using BorderLayout is also possible, but overkill for that one :) BoxLayout is better
 
11:55 PM
Haha, proramming windowed applications always mean programming with a doc.
 
@SimonAndréForsberg I wish we were provided more examples. I guess I just need to play around with this and (maybe) get nowhere.
 
@Jamal it's been a long long time since I used Swing now :)
At least it feels like a long long time... but it was probably at the beginning of this year...
 
@SimonAndréForsberg I guess you don't swing that way anymore.
 
Of all the different GUI APIs I've used, I've come to realize that Swing and Android are not as good as I thought they were.
Android is a bit better than Swing though. RelativeLayout FTW.
 
I just hate that we're pretty much thrown straight into Java. There is no beginner class before this.
 

« first day (561 days earlier)      last day (3459 days later) »