« first day (562 days earlier)      last day (3457 days later) » 

7:00 PM
RSA
 
@Mat'sMug I almost post a comment like: WELCOME TO CODE REVIEW PLEASE DON'T POST IN ALL CAPS But decided it would just be "raging" more than helping...
 
@Malachi I'll show it to a CM.
 
@Jamal thanks
@Jamal I flagged it to.
 
@rolfl Off by one R bug?
String input = "abcdefghijklmnopquestuvwxyz";
 
Does C# not have diamond inference at all?
 
7:09 PM
0
Q: Easier way to handle a Console Theme System

Brandon PalmerI'm just curious is there an easier way to handle console colors rather than just doing something like the code below. The problem is the code bloat I'm experiencing when writing a theming system for my console application. It contains almost 200 lines of code, just to handle the chat theme syst...

 
user image
8
 
lol
 
@Phrancis What am I missing?
 
@skiwi what is?
@rolfl the R
 
So I am .... ;-)
 
7:12 PM
@skiwi It depends.
 
@rolfl didn't know if you mistyped E instead of R or purposefully did that
 
actually "quest"
 
But now it's nice round 25's s, 25, 50, 100, 200, 400, 800, 1600, 3200.
Nope, that's typos al thw way though. (intentional typos hee too)
 
@skiwi Woohoo!
 
Why you be like this, CSS?!
 
7:14 PM
Intetional typoes FTW @monkye
2
^^ @sad face
 
@Jamal, there's +50 available here for you: codereview.stackexchange.com/questions/68443/… if you want the about-to-expire bounty....
 
@skiwi What are you trying to accomplish with Generics?
 
@rolfl I'm in Java class now being lazy, and I may not come up with something better. That answer is still eligible for +25.
 
@Jamal Don't believe so. The auto-award of the bounty only happens on answers posted after the bounty was posted.
 
Oh yeah
 
7:19 PM
@xDaevax Nothing in particular, was just wondering
 
Well, I still have 16 hours.
 
As example:
			foreach (InteractiveCloth interactiveCloth in GameObject.FindObjectsOfType<InteractiveCloth>()) {
				interactiveCloth.AttachToCollider(newSphere.collider, true, true);
			}
LOL, where is this??
 
In a few minutes, I think that I will leave you all to shower in the dark. One of the best things I have in a boring day.
 
@Morwenn Are there any "mystery guests" around in your house?
 
@skiwi What.
 
7:27 PM
That awkward moment when you leave multiple main page tabs open and think that someone has posted duplicate questions.
2
 
@Jamal You're supposed to close your tabs!
 
I only have four open now. D:
 
Do you want to end up like me?!
 
@skiwi look who's talking!
 
I've only got 194 open now. D:
 
7:29 PM
My laptop would probably die before I even reach 25 open tabs.
 
Browser only crashes at 2000+ tabs anyway.
 
@skiwi In that sense, no C# doesn't support the diamond operator (inference) because C# generates new code to handle the generic list when it is compiled. In Java (about which my understanding is far from masterful), the compiler erases the generic type and wraps those calls with a cast so that it is compatible with older versions of the JVM that did not know about Generics (An ArrayList<String> becomes ArrayList with cast operators from object -> String).
In .NET you essentially get a new class (ArrayStringList) which is not backwards compatible with .NET 1.
 
I don't recall having more than 20/30 tabs open at once. It's generally between 2~3 and 15.
 
@xDaevax Would adding diamond inference then break things in C#?
 
Can you provide an example of what you would want to do with it, just to make sure we're on the same page?
 
7:33 PM
0
Q: concatenating 2 array variable names to create a new variable name PHP

Yash MorarI'm developing a room booking system using PHP for a school project. I'm trying to create a variable name by concatenating values from two arrays together. here are the two arrays: $day = array('Mon', 'Tue', 'Wed', 'Thu', 'Fri'); $B = array('P1B', 'P2B', 'P3B', 'P4B', 'P5B', 'P6B'); and then...

 
@xDaevax foreach (InteractiveCloth interactiveCloth in GameObject.FindObjectsOfType<>()) { as example
 
@skiwi I see. No, the compiler will not infer from the type in the loop that the generic you are looking for is of type InteractiveCloth. You could write something like this however:
 
Off to take a shower, see you later :)
 
GameObject.FindObjectsOfType<InteractiveCloth>().ForEach((x) => {...stuff to do on each one...});
and it will infer the type of x based on the Generic type argument given
 
@xDaevax Okay, I decided to not yet burn my hands on lambdas being unfamiliar with # so far, but they seem pretty straight forward in C#
 
7:37 PM
If you prefer, you can write it out longhand without the aid of the lambda like so:
void ItemOperation(InteractiveCloth item) {
    ... method body...
};

GameObject.FindObjectsOfType<InteractiveCloth>().ForEach(ItemOperation);
 
Yea, that would work as well yep
 
hEY @Phrancis do you know off the top of your head..... will LIKE '%SOMETHING' return records where the first word is SOMETHING along with records where it's the last word?
 
It would be other way around, LIKE 'SOMETHING%'
 
@RubberDuck I'm not a GURU in T-SQL (assuming) but I'm pretty sure that will do just the last word since there is no wildcard after the SOMETHING.
 
For records that begin with SOMETHING
 
7:44 PM
hmmm let me rephrase.
How do I query for something that could be either
 
but, not in the middle I assume
 
SOMETHING

or

A SPECIFIC SOMETHING
 
You may be looking for '%SOMETHING%' then. Beware, it's not fast.
 
And it will match something at any point in the search field (including: "Hey, you wanna know something funny?")
 
Yeah. I know that. I've been trying to get the dev to let me normalize the table.
I don't need to search both sides though. Just the beginning. It's either the only word, or the last word.
 
7:46 PM
@RubberDuck LIKE %SOMETHING will only return it at the end, if you want at the beginning or end, you'd have to use two LIKE's and an OR.
 
I was afraid of that.
So,
 
@RubberDuck might work with a substring then, although I suspect that LIKE will be faster, but that depends a bit on the RDBMS you're using.
 
  FIELD = SOMETHING OR FIELD LIKE '%SOMETHING`
right?
 
not FIELD = SOMETHING ELSE ?
if it's the only word, then it's included in 'LIKE %SOMETHING'
 
@SimonAndréForsberg Bingo. Okay. I thought so. My problem must be somewhere else.
 
7:49 PM
might be that you're having some whitespace after it that fucks it up?
 
Possible maybe.....
 
@Phrancis this smells like a new meme just for me ;)
 
Like I said, I've been trying to talk them into letting me normalize it.
 
TRIM(field) LIKE '%SOMETHING' ?
 
Worth a shot. Thanks @all.
 
7:50 PM
@RubberDuck good luck with that
 
Right?
 
lol LAS
 
8:10 PM
0
Q: Copy a directory from source to destination

Marius MGI wrote a program that copies a directory, from a source to a destination. For doing this, I used this essential functions: open(), write(), mkdir(), readdir(). This is the source code (ignore the main() function, this is not the final form): #include <dirent.h> #include <errno.h> #include <...

 
@Marc-Andre Re: deletion, no worries, it was a weird question.
Also, I did not delete my answer, I still dont get how that question got deleted.. Oh well
 
8:26 PM
Isn't there something if the question has -3 of score the question can be deleted if there is no answer with a positive score ?
 
@konijn if it's the question I'm thinking about, it was self-deleted
 
Self-deleted by the OP or did the question delete itself?
 
yes it was self-deleted..
 
0
Q: Add values to two arrays at the same time

aslumSay I have a multidimensional array with associative values... I want to add some information to multiple arrays at the same time. What kind of unexpected behavior might I expect from this kind of code? Al should have 3 entries in it, while Bob and Chris will each have two... right? It seems to w...

 
8:45 PM
0
Q: REST API Design Patterns

Steve S.I'm looking for a design review of this simple REST API: https://github.com/singularsyntax/CPAN-Net-BGP-REST#rest-api General feedback is appreciated, as well as on these specifics: Use of this format for a multi-component "primary key": thisId=<IP Address>;thisAs=<integer AS number>;peerId=<...

0
Q: Comments and suggestion about 'mean filter' code in C#

sigaraI am just trying to apply 'mean filter' with using C#. The code below gets window size (3,5,7,9,...) from 'textBoxWinSize' and applys the mean filter. The code works right I am new and I want to your comments and suggestions about my code so I can improve myself. Can I make it more faster? How?...

 
@CaptainObvious VTC no code included..
also probably design
 
0
Q: Sum of Digits in a^b

Prakhar AwasthiI'm trying to calculate a problem which requires sum of digits in a^b, where a<=9 & b<=4000. I have seen various other posts similar to this, but I haven't acquired best way. I have created this: b=b-1 ; digits[0]=a ; long long int len=1,carry=0,i ; while(b--) { carry=0 ;...

 
9:04 PM
Welcome to Code Review! Please include the code you want peer reviewed, inside your question (don't just link to it). Per our help center, questions not including code can (and will) be closed as off-topic. Cheers! — Mat's Mug 9 secs ago
 
9:18 PM
0
Q: Add values to two arrays at the same time

aslumSay I have a multidimensional array with associative values... I want to add some information to multiple arrays at the same time. What kind of unexpected behavior might I expect from this kind of code? Al should have 3 entries in it, while Bob and Chris will each have two... right? It seems to w...

huh, how broken is that? ^
 
@skiwi Well, it is $PHP = 'broken'; to begin with...
2
 
9:33 PM
Are REST API designs out-of-scope for review? There is no code per-se, just URL structures like the two posted in the question. — Steve S. 1 min ago
I don't know what to say other than "well, this is Code Review..."
 
@Mat'sMug say it
 
Well, this is Code Review... — Mat's Mug 7 secs ago
oh come on
That distinction seems a bit arbitrary, and limits the utility of this site, but if that's policy, I'll go elsewhere. Thanks. — Steve S. 22 secs ago
 
I think that question would probably be on-topic for Programmers.SE... right?
 
with 32 questions per day, perhaps "limits the utility of this site" is a good thing.
@Phrancis @Nobody knows what's on-topic for Programmers.
Where's @Nobody btw?
 
in The Whiteboard, 31 secs ago, by MichaelT
@Phrancis it lacks sufficient information in the post to be a good question here in its current state.
 
9:49 PM
what's that supposed to mean?
in The Whiteboard, 1 min ago, by World Engineer
@Phrancis These is good yes? questions tend to fair poorly here
 
With a whole lot more of information, it could be a good question for Programmers, but right now I don't think there's much elsewhere you can go. At least not on Stack Exchange. — Simon André Forsberg 8 secs ago
@Mat'sMug it means that just like us, they want sufficient context.
 
ah
 
I updated my post. I am new to Code Review. It is good to see that you guys care so much about completeness. — Amberlamps 32 secs ago
 
+1'd
 
@Jamal thanks for the 3 flags :)
 
9:56 PM
D'oh!
 
Remove comments first, post in chat later ;)
 
@SimonAndréForsberg mod in training? ;)
 
I'm tired today anyway. At least I remembered to remove the post notice as well.
Here's my second and last pimping for the day, 3 from Necromancer. Also, be sure to check out One Vote Short whenever you have some extra votes before the end of the day.
 
@Mat'sMug [badge:Marshal] in development.
I'm just happy to get helpful flags :)
 
And you're actually beating me in flags. >.<
 
10:02 PM
Still not sure if I will run for moderator on election bun-fighting day or not
 
Not that I would flag comments before deleting them. That's just cheap.
 
@Jamal can you even flag stuff?
 
I certainly can, and mine are unlimited. They are put in the queue as "moderator review" flags.
I now mostly use flags to 1-hit KO spam and offensive posts.
 
This is a really nicely asked question! Kudos on the images and thorough explanation, and the bounty is the cherry on the cake! — Phrancis 9 secs ago
 
@Marc-Andre you can delete anything that is negative I though, even if it has upvoted answers.
 
10:18 PM
Well this helps a little bit:
in The Whiteboard, 25 mins ago, by MichaelT
If the entire site is designed around "doing reviews" and that is the expected quality and context, it can do it (and it has... congrats on the graduation over there). But we'd really rather not get answers of "I like XYZ and think ABC would be frustrating to use"
@SimonAndréForsberg ^^
 
@Phrancis then what do they want over at programmers?
 
@SharePointer, Let me know what you think of my revised answer, maybe post a follow up question let's see if we can counter those Down Votes. We all love reviewing code and would love to help you out if you give us a chance. — Malachi Jul 16 at 15:36
 
in The Whiteboard, 30 mins ago, by MichaelT
And so, an arbitrary "design review" post that doesn't focus on a specific problem area... those get messy and don't encourage answers of the quality that we'd like to see on all the other posts.
^^ that says more about what Programmers is
 
Who knows. I think beer reviews are on-topic on Programmers ;)
 
If there is a specific problem area about the beer, then probably yes.
 
10:27 PM
lol
has to be applicable to all programmers. Including any that doesn't drink beer.
3
 
user image
4
Congrats Jamal!
 
:D
And I never would've thought I would make it this far.
 
Sure, you're trusted in a grad site now ;-)
 
A trusted moderator? Phew.
Congrats, @Jamal
 
Thanks!
Okay, my professor has just said that I can use BoxLayout or GridBagLayout to get the desired results in Swing.
 
10:34 PM
I've never used GridBag
that doesn't make it a bad option though.
 
Didn't I send you that a few days ago?
23 hours ago, by Simon André Forsberg
I can recommend reading https://docs.oracle.com/javase/tutorial/uiswing/layout/visual.html
 
D'oh! Well, I probably would've heard from him anyway, in case there was something he recommended. They weren't even covered in lecture.
 
0
Q: Reading string separated by spaces into vector in C++

Coder43Heres what my test.txt looks like: 18 19 20 21 22 23 22 23 24 23 24 25 24 25 26 25 26 27 28 29 30 29 30 31 I want to read in the integers in test.txt as strings then create a vector of 3 ints. If that makes sense, so the output is a vector looking like: 18 19 20, 21 22 23, 22 23 24, 23 24 25,...

 
I think if someone else is going to take a look at it, that will probably be me... but it will take some time... gotta make my Brainfuck Sudoku Solver first! — Simon André Forsberg 14 mins ago
@SimonAndréForsberg's crazy
 
10:44 PM
@RubberDuck Rest assured, I still haven't started my Brainfuck Sudoku Solver.
 
@CaptainObvious Broken...
 
Welcome to Code Review! Unfortunately, it appears that your code produces an error and therefore it is not ready for review. Once you get it working as intended, we will be happy to review it and help you make it even better! — Phrancis 4 mins ago
I get happy every time I read such a comment ^^
Welcoming, yet informative about why it's not on-topic, and includes an invite to come back.
Well commented, @Phrancis.
 
Thank you :D
 
btw, I've VTC'd this but it seems like I'm the only one:
0
Q: Add values to two arrays at the same time

aslumSay I have a multidimensional array with associative values... I want to add some information to multiple arrays at the same time. What kind of unexpected behavior might I expect from this kind of code? Al should have 3 entries in it, while Bob and Chris will each have two... right? It seems to w...

 
> It seems to work, but I'm worried I'm overlooking something.
 
10:55 PM
I VTC'd for example code though. Could also have VTC'd as unclear.
 
Ah I just saw that sorry
 
All I could write in a review would be: "Why on earth are you doing it this way?" which is more of a question than an answer, indicating that the question lacks context.
Without the context, I can't suggest a better way of doing it.
 
Good point. I VTC.
 
@rolfl NICE!
 
I am trying to write fold functions that return the identity element of a group when no argument is passed.
Folding no integers with an addition should return 0 while folding no integers with a multiplication should return 1.
 
11:34 PM
Hey! Just got an enlightened badge for that terrible answer!
4
 

« first day (562 days earlier)      last day (3457 days later) »