« first day (424 days earlier)      last day (3590 days later) » 

7:10 PM
Is this a proper way to edit an answer because the answer code did not work?
 
@Phrancis personally I'd replace and maybe leave a notice
 
OK
 
@Phrancis I would recommend.... ^^ that
having both working and non-working code in the answer is not helpful, only the helpful parts of the answer are helpful.
 
definitely ;)
 
7:19 PM
0
Q: Does setting the same element in a list does something at all?

Akira YamamotoI have a code similar to this: public class PlayerRound { private final List<Strip> playerStrips = new ArrayList<>(); public boolean addStrip(final Strip aStrip) { // ... playerStrips.set(playerStrips.indexOf(aStrip), aStrip); // DOES THIS LINE CHANGE SOMETHING? ...

 
@Phrancis that is about to be seen I think..
 
lol
There are multiple ways to do the same thing, obviously.
I like the one with the variable the best though
 
6 SotW's... and 20 below 200 :)
 
@Mat'sMug what?
 
7:27 PM
Almost capped, and almost caught up with @Simon's score @Malachi :)
 
@Mat'sMug nice
 
...lost about 10lbs of hair
 
92 under 200 here
 
Gotta go pick up the kids, I'll see if I can post a before/after later ;)
 
and I have 54 until I overtake amon
later @Mat'sMug
559 until I reach @ChrisWue's score and take his spot!
44 and 549 now
 
7:31 PM
Earliest-to-answer isn't good for Stack Overflow, nor would it be good for Code Review.
3
 
Josay will be harder to pass than ChrisWue I think
@200_success are you talking about the SQL question?
 
Yes.
 
Does anyone understanding using bitmasking with enums to add enumerated options together and then use it in an if later?
That didn't even make sense to me.
2
 
in theory I think I know what you are asking
 
Use powers of 2 and the | operator
that'll get you through most of it
 
7:34 PM
Yes.
But what on earth does the | operator actually do?
Let's say I have this.
 
It's a non-shortcircuit operator
it will evaluate both options regardless of the first one's outcome
For example if you have this situation:
 
forgot we were talking bitwise....
 
enum Swaggers {
  Yolo = 1,
  Hashtag = 2
}
 
Ok. I'm with you.
 
Hold on, I'm trying to think why || isn't appropriate
 
7:39 PM
|| isn't a Bitwise Operation....
 
There you have it!
 
@Mat'sMug Already? I thought you liked smashing mugs, not Simon's!
 
So let's say I have this enum.

Public Enum ReportType
ItemActivity = 1
NewItem = 2
BItem = 4
ComsNotFed = 8
Voided = 16
End Enum

and I use it like this:

Private Sub test()
Dim var As ReportType
var = BItem + ComsNotFed

If var And BItem Then
Debug.Print "BItem"
Debug.Print var
Debug.Print BItem
End If
If var And ComsNotFed Then
Debug.Print "Coms Not Fed"
Debug.Print var
Debug.Print ComsNotFed
End If
If var And ItemActivity Then
Debug.Print "Item Activity"
Debug.Print var
Debug.Print ItemActivity
What is that "And" doing?
 
It's obvious why & can't: 1 (0001) and 3 (0011) would yield 1 (0001) while you would actually want to return true if either of the two options are set and not just the first one
 
@200_success I know lol. I just like a little friendly competition :)
 
7:40 PM
anyone help me out here? I am a little confused....
In the line sequenceType = ToUpper[sequenceType]; where is the ToUpper array defined? — Snowbody 9 mins ago
 
@Malachi I think you misunderstood Loki's comment. He's claiming that the internal implementation of std::toupper() supposedly uses an array access.
 
@jliv902 am I using the same std::toupper() or am I using something else? is my code correct?
 
sequenceType = std::toupper (sequenceType) ;
Is what you want.
 
thank you. I don't code C++ so I don't know all the fun syntax stuff lol
 
Well..
No, not true
 
7:44 PM
Or you could use std::toupper (sequenceType) as an rvalue inside the if-condition.
 
I don't like bitwise programming
 
@jliv902 what do you mean?
 
@Malachi Forget I said that, that would be kind of ugly. I basically meant you could do this: if (std::toupper (sequenceType) == 'F') { // ...
But don't do that.
Since you would have to duplicate it in multiple places.
 
@jliv902 lol, cool.
meeting coming up
 
@200_success What about that .equals List think Java question is broken?
To me, it seems on-topic. Especially now that the .equals implementation was added. I was just about to write a review on it.
 
7:50 PM
@JeroenVannevel I've got it. I just had to write all the values down in binary on paper.
Thank you.
The whole thing works because of the powers of 2.
 
well it's already TTGTB (after eating a light evening snack)
Cya tomorrow, guys.
 
Later @Vogel612
 
0
Q: JavaScript eBay Listing Generator [REVISED]

MyCompassSpinsI posted my first attempt at this HERE. It's an app that generates both a preview of an interactive eBay listing, as well as the raw code which the user can copy and paste into their listing. I got some friendly suggestions about separating all the HTML/CSS/JS markup which needs to be included ...

0
Q: solving the coin change algorithm using 10 coins

Pradyut BhattacharyaI m solving the coin change problem having target of n and upper bound as n. Also the maximum number of coins is 10. So for an example if the target is 11 then the possible outcomes are - 11 10,1 9,2 9,1,1 .... .... .... 2,1,1,1,1,1,1,1,1,1 So the last iteration having eleven 1's are not all...

0
Q: Elementary foldMap implementation

BasilTomatoI think I got the implementation right, but I'm a bit unsure if this implementation will do fine in terms of space (stack) because I'm doing a foldRight. Would I want to use foldLeft if e.g. I wanted to execute flatMap on a large list? Also, any other suggestion for improvement would be appreciat...

 
I don't understand why this is closed as off-topic. I see no indication whatsoever that the code is broken. And apparently the code has already been written (How else could it be posted here?). If anything, one could complain that it's example code, but especially now that we have the Strip.equals implementation, I think we have the context needed to review this. I'm voting to re-open — Simon André Forsberg 2 mins ago
 
8:09 PM
17K!!
 
What is the purpose of ?
 
@Phrancis "Add this tag to your question to indicate that you are new to the language of your code. This will often be taken in to consideration by reviewers when assessing your code. "
 
Ah makes sense
 
Although honestly: I'm not a big fan of the tag.
Excellent comment btw @Malachi:
Welcome to CodeReview! This is a good question, thank you for taking the time to form it so that we can help show you the proper coding styles and techniques. We all look forward to seeing more of your posts! — Malachi 5 hours ago
3
 
It's a bit meta.
But it makes it easier for guys like me to find questions to review.
I'm not as smart as most people around here.
 
8:25 PM
@ckuhn203 I think all of us are smarter than we think.
 
@SimonAndréForsberg Maybe.
 
0
Q: Dice Calculation Dialect

kealistAs a sample of dialects and teaching myself parse with block! values, I wrote the following dice dialect with the following grammar: [ word! | integer! word! ] Where the word!s are defined as integers (d10: 10) so an expression of this dialect would look like: dice: [d2 20 d100 d10...

 
This spam seems totally legit:
user image
2
 
@skiwi Totally.
 
@skiwi Who's Adriana? Tell her to follow me too!
 
8:38 PM
Wow the BBB website looks so FUBAR on this work PC...
@ckuhn203 Re: Smart. All things taken into consideration, programmers are smarter (at least computer-wise) than the average end-user. I showed some of my code to a colleague (who is not a programmer) and they were like, "I don't understand any of this"
 
@Phrancis And even the dumbest user is smarter than the computer. :)
 
@Edward At least the computer does what I tell it to do...
 
@Edward I don't know about that... lol
The CPU knows how to FETCH and EXECUTE some end-users can't even handle that :)
 
@Phrancis Having the computer do what I tell it to do isn't so much an endorsement of its intelligence as affirmation of my stupidity.
4
 
But when you think about it, learning a programming language is almost like learning a human language, plus learning to think abstractly and logically, that's got to amount for something
 
8:47 PM
lol
 
int main() { main(); }
 
@ckuhn203 What kind of computer do you have? I want one of those!
 
@SimonAndréForsberg "I'm sorry, Dave. I can't do that."
 
@Edward sudo make me a sandwich
 
I'm a little frightened. I just got this message from a coworker.
"Potentially a record for me. 2100 lines of code in 3 days"
And how good will that code be?
 
8:52 PM
@ckuhn203 I don't even count my lines. Some days I make none, some days more.
2
 
Computer science is no more about computers than astronomy is about telescopes.
2
 
@ckuhn203 It will probably be <--- that good
 
@ckuhn203 - I did 2400 lines of code for a monitoring system for DOS/Clipper 10 years ago that is still running bug free. But, it did take me 6 days.
 
@JohnP My most productive days tend to end up with negative line counts due to refactoring.
4
 
8:57 PM
@SimonAndréForsberg thank you
Hey I used up all my stars. I haven't done that in a while....lol
@Edward LOL
 
@Edward Those are the really good days. Aren't they?
 
@ckuhn203 Nah. The really good days don't much involve computers. :)
3
 
TRUTH!
 
posted on July 02, 2014 by konijn

I am writing a copy paste detector using esprima.js and Hmm. This particular function checks a number of sequences and reduces them. Due to the parsing I might have 2 sequences with the same piece of text, if so I need to merge the 2 sequences and add the start/ends ( both are source token indexes ) and occurrences ( contains location of the dupes in the original so

 
0
Q: Possible to have dynamic array in C++?

Elizabeth C.The consensus seems to be that it's possible, but not desirable to have dynamically sized arrays in C++. It's preferable to use vectors. I'm new to C++ (we haven't learned vectors yet), and am trying to do this with arrays. Here's my code: #include "stdafx.h" #include <iostream> #include <cmath>

Was this even improved from the previous code?
 
9:12 PM
@CaptainObvious why does this post look different than the others that captain obvious posts???
 
@Malachi Because @CaptainObvious is drunk. We should migrate him to Beer.SE
3
 
0
Q: Possible to have dynamic array in C++?

Elizabeth C.The consensus seems to be that it's possible, but not desirable to have dynamically sized arrays in C++. It's preferable to use vectors. I'm new to C++ (we haven't learned vectors yet), and am trying to do this with arrays. Here's my code: #include "stdafx.h" #include <iostream> #include <cmath>

 
Sober already? lol
 
@SimonAndréForsberg THere's a BEER SE?!!
 
9:19 PM
Also
 
I'm in lust.
 
@Vogel612 So, in iOS, in your main.m file, in your main function, it's a single function call, and all of your app execution happens within that function call. You could wrap this in a try-catch block... but the problem is that wrapping everything in a try-catch block like this prevents your app from ever completely crashing... so the device never generates a crash report (which the OS does automatically, and I'd be surprised if Android doesn't also do this)
 
0
Q: Sort a linkedlist with 3 elements 0, 1 and 2

JavaDeveloperGiven a linked list of 0s, 1s and 2s, sort it. Looking for code review, optimizations and best practices public final class SortZeroesOnesTwos { private Node first; private Node last; private int size; public SortZeroesOnesTwos(List<Integer> items) { for (Integer item :...

 
So, in the catch block... you could write your own code to generate a crash report, but if anything is ever wrong in the catch block here, there could be a whole slew of exceptions that you've got no idea about.
 
@CaptainObvious JDQ #151 ?
 
9:22 PM
Whereas if you use a custom unhandled exception handler, you can generate your own crash logs and still let the OS generate its own crash logs.
And this is particularly important in regards to iOS dev, because Apple reviews will automatically reject apps that crash. But when they reject an app for this reason, they will send you the crash logs. If you've wrapped everything in the main function in a try-catch that prevents the app from truly crashing and letting the OS generate a crash report, you won't get these crash logs from Apple because they won't be generated.
 
@ckuhn203 now I'm really temped to get me one of these
 
9:45 PM
Functionally speaking, what is the difference between SQL functions CAST() and CONVERT() ?
 
Convert gives you more options
I generally only use convert when going from datetime to varchar, for example, where I want a particular datetime format.
CAST takes two arguments... the variable to cast and the datatype to cast to.
CONVERT takes three, the datatype to cast to, the value to cast, and the style to cast in
 
Do all data types have a style, or just DATETIME?
 
Not all, but a few do
msdn.microsoft.com/en-us/library/ms187928.aspx scroll toward the bottom for the different options for the style argument with different datatypes
 
Do you know if one is faster or slower than another?
 
0
Q: CsvReader class in C#

user43058For the amusement I fully implemented a CSV reader. I think I did pretty well, considering that most popular CSV readers that I know take thousands of lines to achieve the same thing while being slower. Since CSV is a pretty hacky format to begin with I decided to forgive any malformations, like ...

 
9:58 PM
@Phrancis why not just go with readability an use CAST(... AS ...)?
 
@Phrancis I had one in a previous life. Life was good.
Mine wasn't that nice though.
 
I think I just may have found my candidate for . Not just the question but specifically also the answer from Sriwanta
1
A: How can I check if a View exists in a Database?

Sriwantha AttanayakeIf you want to check the validity and consistency of all the existing views you can use the following query declare @viewName sysname declare @cmd sysname DECLARE check_cursor CURSOR FOR SELECT cast('['+SCHEMA_NAME(schema_id)+'].['+name+']' as sysname) AS viewname FROM sys.views OPEN check_cur...

 
@lutz: +1, for lack of support on SQLite. — Alix Axel Aug 21 '09 at 22:50
Lol
Huh, they changed the wording of the new badges, it's now a "well-received" question you need to ask!
 
@Mat'sMug lol. That didn't take long.
 
And this is interesting too:
17
Q: I can add moderator only tag via a suggested edit, and I got no diamond!

nicaelLook at this edit. I didn't really expect that I would able to suggest adding featured tag, but I could! How is it possible? (seems that usual users can add mod-only tags without moderator help!) Edit Oded removed featured back :-(

 
10:11 PM
@SimonAndréForsberg Which question?
 
2
Q: Does setting the same element in a list does something at all?

Akira YamamotoI have a code similar to this: public class PlayerRound { private final List<Strip> playerStrips = new ArrayList<>(); public boolean addStrip(final Strip aStrip) { // ... if (playerStrips.contains(aStrip)) { playerStrips.set(playerStrips.indexOf(aStrip), aStr...

It was re-opened by the community though
Correction: Community + monkey
 
It seemed to be asking a question rather than calling for a code review. But I don't feel strongly about keeping it closed. That's fine.
 
@200_success OK, it was a question. The question was similar to: "I did this Code Review of this code I'm maintaining. Is my own review of this code correct?"
 
I seriously can't thank you guys enough @Mat'sMug & @Malachi. This is working out really well.
 
@ckuhn203 You could always give them a bounty on one of their answers...
 
10:17 PM
That's a good idea @SimonAndréForsberg. I'll probably do that once it's eligible.
 
@ckuhn203 Don't do it to @Mat'sMug though, I'm racing him. :P
 
lol. Okay.
 
Was it snarky of me to post a comment on the CSV reader asking why he didn't just import the VB built in version?
 
@JohnP Considering OP said he did it for fun, probably.
 
Can I ask why you didn't just import microsoft.visualbasic.fileio and use the native textfieldparser class? — JohnP 7 mins ago
I don't see anything snarky about that comment. It's very friendly. "Can I ask why ..."
 
10:22 PM
Meh, I spent the better part of 5 years writing text extraction routines in clipper for various formats, I'll take any shortcut I can find. :p
 
1 vote away from 200!
 
6 votes away from 200!
9 away from 230, which technically would be today's max.
 
Gotta love it when a new 1-rep user posts a non-answer on a question you've answered, causing it to be bumped.
 
@JohnP Effective Java Item 47: Know and use the libraries
 
10:26 PM
@Mat'sMug - There. I upvoted your answer on the c# dataset
 
@JohnP Oh, you're on the Mug's side!
 
I'm on anyone's side that will upvote my rare and sporadic attempts at answers. :p
 
@JohnP I've upvoted 50% of your answers already, now you have to do the same for me.
 
Thanks @Santa!
 
@JohnP It gets easier. Heck, I even answered a javascript question today. I don't know javascript.
Only JAVA. lol
 
10:32 PM
Well, I'll tell you, when a clipper question comes through I'm all over that beeyotch.
 
Congrats for reaching 17K today @Simon!
 
@Mat'sMug Thanks! Although I'm afraid you're not far away :)
 
One little checkmark actually :)
"Only" 3K left!
 
@Mat'sMug Or one and a half upvote
Oh, wait... you're rep-capped...
 
Awww... I think snowbody downvoted my sql answer because it's technically vulnerable to injection. :(
 
10:46 PM
@sim well I just got +5 from an answer upvote.. so now I'm officially rep-capped for the day ;)
 
@Mat'sMug I think I killed 5 Simons. I'm masochistic, apparently.
2
@JohnP
 
lol
 
Every time I hear "wasn't me" I think of the shaggy song.
 
@JohnP It's almost like you just read my mind...
These new question badges makes me want to ask more questions...
I just don't know about what...
 
C++!
Thanks, Santa!
 
10:53 PM
@sim you could implement a JAVA parser +analyzer that spits out CR answers, and get that reviewed :)
 
I see javadeveloper is back with another homework assignment.
 
@JohnP Has he ever been gone?
 
@ckuhn203 - Yes, there's a beer beta. Is it shameful that I have higher rep there than here?
 
@Mat'sMug Which reminds me: do you know any good guides on writing a JAVA compiler?
 
@SimonAndréForsberg - There was that 6 hour sleep period...
2
 
10:54 PM
@Mat'sMug
 
Hey, I'm one upvote away from 1k rep on Area51.
 
@Jamal nope. OP smoked the manual, remember?
 
Damn. :-/ Perhaps someone will rewrite it, in crayon.
 
Most JAVA programmers would probably be safer with crayons, actually.
4
 
Hmm... I only need to post 18 more JDQ answers and I'll get a golden badge.
 
11:01 PM
Should we have a tag?
</sarcasm>
 
@Mat'sMug Why am I out of stars now?
 
@Mat'sMug He might be better off as a meme, but I wonder if he'll take offense to that.
 
Being the only user with a gold badge for asking questions, I don't see a problem with a meme. He's been a meme since, like, JDQ#40 or so anyway!
 
11:16 PM
Congrats on reaching 2K, cHao!
 
Confirmed: I'm starting tomorrow!
 
0
Q: Control Your Computer's Fan Speed

syb0rgThe objective of this question is to create a program that pushes your computer's internal fan speed to its maximum RPM. Upon exiting the program, your fan should return to the normal operating RPM. Rules: You may not perform a CPU intensive task in order to modify the fan's speed. Avoid the ...

 
Hm... do we still need ?
 
@JohnP Absolutely not.
 
@Jamal Absolutely not. Perhaps some of those questions could use or similar?
 
11:29 PM
Or maybe not even that, unless there's a better term.
 
@ckuhn203 ping autocomplete fail I presume? ;)
 
huh?
 
Speaking of tags... why do we still have ?
 
it's like super-8, only the monster is bigger and more evil
 
I feel like saying "TOLD YA" right here ;)
@ckuhn thought you means to ping Jamal
10
A: The [java-8] tag, here to stay?

Mat's MugNO, it shouldn't exist, not even be a synonym! c# has major differences between versions, too. And yet, the only C# tag we have is c#. How do we address this? C# 2.0 introduced generics. Enter the generics tag. C# 3.0 introduced linq. Enter the linq tag. C# 4.0 introduced the Task Parallel Li...

 
11:41 PM
@Mat'sMug Ahhhhh. Ok. Yeah. No. I was just away for a minute.
 
*meant, not means. Stupid phone.
 
TTGTB with +180 for today and 71 Simons on the wall
 
lol 51% :)
@sim oops just broke 20 mugs!
 
dum de dum.... thanks Santa!
 

« first day (424 days earlier)      last day (3590 days later) »