« first day (1161 days earlier)      last day (2857 days later) » 

7:00 PM
I'm about to nuke a battery test my new charger.
Not sure where that fits on the scale.
 
Don't get arrested for a DWC (driving while coding)
 
I'm pretty sure that's just distracted driving.
 
don't go to work because it's friday.
you don't really need another reason.
 
I should go though, I have a review for my raise today.
 
Welcome @James
 
7:06 PM
@EBrown Now he tells us...
Welcome @James
Unfortunately you don't have the required reputation to talk yet.
 
@Mast Yeah, not that it's much of a raise.
It's like, $0.60/hr.
Whoopee.
 
@EBrown Better than a kick in the pants.
 
that works out to $1,248 per year (40 hours per week)
 
That's a new PC.
Each year.
 
for free
 
7:08 PM
@DanPantry Before taxes.... Still money is money.
 
What do we think about this question?
 
I pick up pennies off the street still
 
@Mast Hm
 
Coding while driving is a bad idea, guys: i.imgur.com/EWbnxAM.jpg
 
7:09 PM
Well, if his question is about optimisation, then i don't think the part about it "working on a cluster" as he puts it is relevant and is just making potential reviewers think the code is broken
Should definitely mention he wants to run it on a cluster and has run it on a local one, but asking if it will work on a cluster makes it sound bad
s/cluster/Spark
 
@user2296177 Forgetting to close your bracket kills
 
@user2296177 You could use std::copy_if to do something like that. For example: coliru.stacked-crooked.com/a/d3c48404512c6aa1
 
@skiwi couldn't close the bracket due to the crash
furthermore showing how dangerous it can truly be
 
@user2296177 But how did the message still get sent? dun-dun-dun
 
@Mast commented
 
7:12 PM
@Edward I was thinking of wrapping a reference to the container in a class that provides a custom iterator that simply skips elements that don't return true for Predicate. I specifically want to avoid copying.
I think I'll implement it later and submit it for code review.
 
Seems like std::find_if might work for that.
 
Don't forget to post suggestions everyone!
6
Q: August 2016 Community Challenge

EBrownWe've just gotten the July 2016 Community Challenge going, so it's time to pick one for August. It's time to choose a community-challenge for August 2016. Post your challenge as an answer to this question. Feel free to resubmit non-winning ideas from previous months. Vote for those answers w...

 
@Edward It could work, but I'm not sure it would be the most optimal solution until I try it. Hopefully you can review my implementation once I get around to it. I'll post it tomorrow... got a flight to catch soon.
 
or just a standard for (auto &item : bunch_of_items) if (isDesired(item)) process(item);
 
@EBrown You know what wouldn't be a bad idea, stealing some of PPCG's sandboxed challenges
 
7:16 PM
I was thinking the same thing^
Found an interesting one the other day
Jul 3 at 2:58, by Phrancis
0
A: Sandbox for Proposed Challenges

Dr Green Eggs and Iron ManWhere should I put my mirror? code-golf string palindrome This is a mirror: |. I just found out that you can stick a mirror in the middle of a string if the string can be mirrored on itself! For example, the string abccba. If you cut it in half the two halves are mirror images of each other: ...

 
0
Q: C++11 way of implementing a factory

user695652I have implemented to following generic factory in C++11 using smart_pointers and I would like to get some feedback about it. class FooFactory { public: enum FooAlgorithm {UAR, BAR}; std::unique_ptr<Foo> getFoo(FooAlgorithm sa) { if (d_FooMap.find(sa) == d_FooMap.end()) { ...

0
Q: Python regex application - request for more well defined tests, and better modularity

canoycanoHello I'm a newbie to StackExchange, exciting to be here. I recently wrote some code that was dinged on not having well defined tests and poor modularity. Was hoping someone could review my code and give me pointers on how to create more well-defined tests (Which is where I might be the weakest) ...

0
Q: Comparing algorithms for computing binomial coefficients in Java

coderoddeI have these 3 different algorithms for computing binomial coefficients (I also had the 4th recursive one, yet I discarded it since it is super slow). The first uses the factorial formula, the second optimizes it a bit, and the last is a dynamic programming algorithm that maintains a Pascal's tri...

 
@Phrancis I wouldn't mind implementing one of those fun long ones
 
@Edward Probably the simplest, straight to the point ways to do it. It would be more of a programming exercise than a replacement for a C++ feature.
 
@CaptainObvious looks example-ish?
std::unique_ptr<Foo> getFoo(FooAlgorithm sa)
 
@Phrancis Looks like they're running extra shifts at the FooFactory.
7
 
7:21 PM
@Edward Lady friend didn't get that joke.
I need to ditch her.
This is unacceptable.
 
Clearly.
 
@CaptainObvious SO MUCH REGEX
 
Ciao, y'all!
 
Bye.
 
@Phrancis We must fight the Foo.
 
7:23 PM
ba-dum tsh
 
and then learn to fly
 
Walk first.
Or at least pretend.
 
no no no, Walk is not Foo Fighters, it's Pantera. you got it all wrong.
 
They must have covered it though.
 
dunno, not really a fan lol
 
7:26 PM
@Edward Bye!
 
You mean the working code is really written as FooFactory, FooAlgorithm, BarFoo() etc.? — Phrancis 26 secs ago
 
@Mat'sMug Fly me to the Moon?
Shoot, that was Sinatra.
 
I guess it's open game for shooting down the code's crappy FooThing naming then...
 
"I thought we had to use Foo and Bar in all our codes?"
Oh god
Idea
 
enough. it's hypothetical, period.
 
7:28 PM
I'm going to be changing all my code to have a specific signature, so people can tell I wrote it.
Oh wait, I already XML doc everything.
 
Endless naming opportunities: Foo, Bar, FooFoo, FooBar, ...
 
No one else in the world does that.
 
^ true
 
docuwhat?
 
@Phrancis Exactly.
 
7:29 PM
@JoeWallis walk_branch isn't very extendable, is it? :(
 
@syb0rg Depends... if you want to change one of the things already there, no. Otherwise 100% yeah
 
Not bad, this answer
 
@Phrancis
@JoeWallis So, I want to change the code to add ClientDataSets, I would need another method probably?
 
@syb0rg What's that? The other function?
 
@JoeWallis It's an XML field
 
7:32 PM
Due to company policies I can't post business object names here. — user695652 4 mins ago
 
I need to be able to change Cds on demand now
Apparently a Cds can only hold 1024 vars in it at a time
So for 5000 points I need 5 data sets
Thank my coworker for clearly communicating that to me before I wrote the software
</sarcasm>
 
Anonymizing code is fine, just not with foobar identifiers. Please keep it to something that at least looks like it could be real actual code. Note that reviewers are free to comment on any/all aspects of the code, including comments and naming. — Mat's Mug ♦ 5 secs ago
 
Hmm, is it needed across all the data_branches?
 
watch for edits
 
I'll be watching till I fly.
 
7:35 PM
@Mat'sMug I'll keep an eye on it
 
@JoeWallis What do you mean?
I don't think so, if I understand you correctly
 
Do you need to make the change across all the functions that use walk_branch?
 
No
Those still need to be changed as well
ClientDataSets has a different branch structure as well
 
Ok, you can make another generator that extends walk_branch like walk_branch does get_items
 
Hm, that's a good idea
I'll do that
 
7:37 PM
And this is why I like generators, :)
But if it overwrites walk_branch I'd make a new function
 
nice, now we have a car factory
 
@JoeWallis Wait, isn't that how a generator extends already?
 
@syb0rg I mean if you overwrite all the changes you do in walk_branch you might as well extend get_items instead.
 
@Mat'sMug His company's code is actually motorcycles.
 
Oh... gotcha
 
7:43 PM
lol
 
I have 50 minutes before I leave, let's see if I can kill this baby code review.
 
@Mat'sMug Good to open?
 
you're the C++ guy... good to reopen?
 
Looks good to me
 
Well, it looks good to me.
 
7:44 PM
needs a better title though
 
0
Q: XML Serialize byte data type

KulstadI have the following code to serialize my reports: [XmlRoot(Namespace = "", IsNullable = false)] public partial class ReportSpecification{ /// <remarks/> [XmlElementAttribute("Reports")] public ReportsHolder Reports { get; set; } /// <remarks/> [XmlAttributeAttribute()] ...

 
@Mat'sMug What do you think of that
lol
 
Lol, that's a silly title. Made me laugh.
 
Exactly
HNQ quality
 
I lol'd... but it would be a Taxi Factory
 
7:46 PM
Doesn't rhyme :(
 
eh, made it "car"
 
Comment cleanup in order?
 
:(
 
revs vacuum engine
and clean
thanks guys
 
7:49 PM
Darn, I won't have time. If anyone wants to review him, make sure you mention that using template specialization can remove all those if...else checks and to switch at compile time instead of run time.
 
hey @Zak
pretty sure my answer came as a surprise.. did it?
 
Zak
@Mat'sMug It was certainly interesting.
 
the only other thing I can think of that would be O(1) involves lovely Win32 API calls
 
cringes
 
I started using this chat yesterday and I just want to say that everyone around here is really nice and I'm having a lot of fun.
9
 
8:02 PM
@user2296177 Glad to hear it! Now, at some point perhaps you should set yourself with an actual user name (and maybe even an avatar!)
 
@Phrancis I was just about to say that
 
@Phrancis Maybe something like cpprulez_csharpdroolz
I think I'm going to learn some C# with @Mat'sMug recommended book: C# in Depth
 
@user2296177 Whatever you choose, you're stuck with it for 40? days
 
ding!
@user2296177 if you're starting C#, it might not be the easiest read though
 
@Mat'sMug I'm surprised you don't have a chat "about me" section filled out
 
8:06 PM
@Mat'sMug Gratz
 
too many "about me" sections to fill up everywhere
 
@syb0rg Does anyone?
 
@Mat'sMug So is C# In Depth the 2nd book after some other book?
If so, what's the first one?
 
@Mast Click on my chat picture
 
Something that has the new goodies.
 
8:07 PM
You should see a guy with sunglasses
rolfl has one too, I know
 
@syb0rg That's deep.
 
Same with @Phrancis
 
nah, it's just.. it covers C# in depth - it assumes somewhere between beginner and intermediate knowledge of the .net framework. the book is basically a walk through C# history, starting with 1.0
if you know nothing of .net, you're probably better off with something else
but I can't recommend anything, ....I learned from a 3-inch thick brick book
 
well I could recommend a 3-inch think brick book, but some would say it's a boring read
 
8:10 PM
possible answer invalidation by Tim on question by Tim: codereview.stackexchange.com/posts/134028/revisions
 
@Mat'sMug I'd say it's a monitor stand.
I got one of the O'Reilly books on Python. Heavy enough to break a window.
 
I have enough monitor stands to bend library shelves
@Phrancis no
just.. no
 
^ ah! there! Andrew Troelsen's
 
8:16 PM
Oh, hai thar
 
hai
 
How is it going?
 
The starwall clearly indicates that today is Friday and everyone is happy about it!
 
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: An iterator returning all possible permutations of a list in Java
 
8:20 PM
I was away for 2 hours, and this is how the starwall turned out? Who is to blame for this? points to the funcup of shame
 
0
Q: An Algorithm that Merges, and Sorts two Arrays without mutating one, in two languages

SamiDenaThis algorithm, which I have included its flowchart as well, takes an array of A[n] which is unsorted and unmutatable and an array of B[k] which is sorted and includes n zeroes and then merges, and sorts them together. The entire code in Python and C# can be found here but as per rules I'm going ...

0
Q: login of two tables with one procedure in asp.net

Sundas Ali i have 2 tables one is passengers and second is driver but am confuse how to make one login page for both users, i can not write stored procedure of login for both tables. ALTER PROC [dbo].[SP_SELECT_Login1] @Email As varchar(50), @Password As varchar(50) As BEGIN SELECT Reg_id,Fname from reg...

 
@CaptainObvious Interesting
5 votes left for the day
This guy kinda reminds me of JavaDeveloper
coderodde, Espoo, Finland
7k 2 7 40
 
He ain't too bad.
 
I didn't mean that in a bad way
 
Time to fly, insert chat acronym for leaving here. Bye.
 
8:25 PM
@user2296177 Hope to see you again! Bye!
 
Do we have a meme for leaving?
 
@user2296177 TTQwhateveryou'releavingfrom
 
Welcome to Code Review. Please don't hesitate do include all the code you would like reviewed in the question, our character limit for posts is really large (65K characters or so). It may also be better to not include code from 2 completely different languages unless it is implemented to work together; rather, ask 2 separate questions one for C# and one for Python. — Phrancis 8 secs ago
 
Code Review folks might deal with query optimization. — PM 77-1 12 secs ago
 
@N3buchadnezzar TTQW / TTGH / TTGTB / some-over-long-acronym-beginning-with-TT
 
8:28 PM
TTTB = Time to tear butts = work hard
 
Yes, improving SQL queries is on-topic on Code Review, as long as the query works. — Phrancis 10 secs ago
 
@Phrancis The Python function is used in the C# code
 
@syb0rg huh? Didn't know you could do that
 
-1
Q: Conversion between bool array to uint and vice versa

anonymouspublic static class ArrayConverter { public static uint BoolArrayToInt(bool[] bits) { if (bits.Length > 32) throw new ArgumentException("Can only fit 32 bits in a uint"); uint returns = 0; for (int i = 0; i < bits.Length; i++) ...

 
8:31 PM
@Phrancis I didn't either, but I can't verify it as broken
 
@CaptainObvious Code dump.
 
@Phrancis: I'll be honest, I want more people to visit my repo. The rules say I should include some code, and I did. — SamiDena 48 secs ago
Not sure what to make of this...
Not much on that repo to be seen, honestly
2 code files, a readme and a picture
 
@Phrancis How does a repo like this get 3 forks
 
Dunno. More to the point, how is anyone supposed to review this?
def ParseListA(listA):
    newListA = sorted(listA);

    return newListA;
 
If you want visits to your repo and contributors, post an ad on Stack Overflow. If you want your code peer reviewed, include the code you want peer reviewed in your post. It's perfectly fine to include a link to your repository, but that's for additional context - the code that's up for review is the code you're embedding in your post. — Mat's Mug ♦ 5 secs ago
 
8:39 PM
@Mat'sMug I was just about to push enter with a comment saying something similar
 
I'll just downvote and walk away
I'm eating edamame like it's candy and it's making me happy
 
that said Rubberduck didn't do too bad there
> Score: 15
Created: Jan 23 at 4:05
Clicks per day: 6.52 (1,089 total)
 
@Mat'sMug Traffic generated from an ad?
 
How do I delete the question from codereview. I don't see it on there anymore. — inquisitive_one 51 secs ago
 
on SO
+19/-4 is the actual score breakdown
 
8:42 PM
@Mat'sMug Where did you put up the ad?
 
83
Q: Open Source Advertising - 1H 2016

Grace NoteIt's 2016 now, and we've made some changes to the sidebar size (on top of... accidentally passing over 2H 2015). And with that all in play now, we're restarting our Free Vote-Based Advertising for Open Source Projects. We are clearing the leaderboards for the beginning of 2016. We are also instit...

 
Hm, I'd have to get a good logo for Khronos to put an effective ad up
I could maybe whip up one for tritium quick tho
 
@syb0rg I have a friend that does graphic design if you ever need, he would do it cheap if it's just a small logo
 
@Phrancis Does he have examples I can see? I usually like making them myself but who knows, I'm quite busy on the dev side
 
8:48 PM
TTQW
@Phrancis I'll give that a look later
Have a good weekend everyone!
 
later!
 
You too!
 
0
Q: USACO Mixing Milk

Darren SadrProblem description: The Merry Milk Makers company buys milk from farmers, packages it into attractive 1- and 2-Unit bottles, and then sells that milk to grocery stores so we can each start our day with delicious cereal and milk. Since milk packaging is such a difficult business in w...

 
@Mat'sMug I'm starting to wonder if I shouldn't build all the logic/functional/database parts of my app and just do console input/output, and make the GUI later after all that works. The GUI seems to really take up a lot of time
Probably wouldn't take more than about a week to get all the functionality in place to where it's usable with console
Alright, OP improved that C#/Python question to include all the code, please show some CR love :)
 
0
Q: Multiplayer game MOBA

Petros VelidakisHello gyes i want your help in my project... I want to create a simple MOBA game in Unity... I have created login server base C# with sockets connected with mysql. I have create game server base C# with sockets with different port from loginserver. When client login and go to gameserver, i have c...

 
9:04 PM
@CaptainObvious broken
@CaptainObvious I'll improve the English after they confirm that the code works
 
9:24 PM
What would 1x002 mean? It's almost like it's supposed to be a byte literal, but sending the literals as a string is not really going to work...
 
0
Q: Converts a String and a Comma Deliminated String to a boolean

Tom LazarHere is a simple WPF converter method designed, where the object is a string, and the parameters are a string, which contain a set of comma separated values. The program return true if the list has the value in and false otherwise. public object Convert(object value, Type targetType, object...

 
@CaptainObvious I know what it's about, though I'm tempted to think it needs more context, opinions?
It's for example the IValueConverter that doesn't use generics, not the OP
 
@skiwi It's pretty strange indeed, and may have a few bugs later as consequence
 
Welcome to CR! With (much) more information and details about exactly what you're accomplishing, reviewers could not only shred your converter code, but also recommend completely different approaches. What makes you think a converter is the best way to do what you're doing? — Mat's Mug ♦ 27 secs ago
keyword: shred
 
It doesn't even make sense [to me] to convert a string to a boolean. How can a string be true or false?
 
9:39 PM
@Phrancis Javascript would like to have a word with you
 
it's a converter - it depends what the xaml markup is doing
could very well make sense
but...
I doubt it
 
@Phrancis In Python, all strings have a truthy value of True except the empty string which evaluate to False
And it made total sense to me since I learnt it
 
2
A: WPF - Generic IValueConverter?

YotaXPThis answer is an alternative to generics. You could use a code generator to help speed things up by creating all the classes in one go. Create a blank 'TT' file, (You won't see it in the new item list, just type the extension in manually.) click OK on the warning dialog, and paste this into it...

This sounds shady
 
(even though one may argue that bool('False') should return False instead of True)
 
@MathiasEttinger Python does have a number of unusual truthy/falsy things IMO
 
9:45 PM
possible answer invalidation by Tim on question by Tim: codereview.stackexchange.com/posts/134028/revisions
 
It's all completely consistent, however. For any container, bool(container) can be interpreted as len(container) != 0
Strings are no different than lists
 
OK fair enough, as long as it is consistent
 
Yep, that why I would disagree with anyone trying to argue that bool('False') should be False.
We’re not converting values here, we're getting a state on a container
 
OP's converter, rewritten:
var values = parameter as string
if (values == null)
{
    return false;
}
return values.Split(',').Any(item => item.Equals(value));
 
possible answer invalidation by Tom Lazar on question by Tom Lazar: codereview.stackexchange.com/posts/134321/revisions
 
9:57 PM
@CaptainObvious Isn't the title misleading? It only is "Checking if a comma-separated list of strings contains a given string", right?
 
@Duga looks okay
 
Is the daily rep reset based on local time or server time?
 
Zulu time, always
 
@MathiasEttinger It's based on UTC midnight
I believe that would count as server time :)
 
So I still have 2 hours to reach the cap…
 
10:02 PM
yep. and to spend 40 votes
 
Also, let it be noted that I dislike troubleshooting index out of range exceptions
 
Code review section? — Carl 43 secs ago
 
Or, more specifically, out of range that happens for some input values but not others
 
@Phrancis those are usually pretty easy to avoid
 
@Mat'sMug 30 ^^
 
10:03 PM
@Phrancis It's a feature request. A dubious one at that.
 
40. you just can't put them all on answers. see Vox Populi
 
@Mat'sMug I'm all ears, actually the previous version of this loop that I had didn't OOR at all, but I extracted a variable for a call to a value in a list that was repeated 3 times, and been OOR since
But, only in some cases
 
@Mat'sMug Why not?
 
I already used 10, so I won't be able to use 40 more in that 2h window
 
Maybe I'll just put it back the way it was
 
10:04 PM
I thought that only mattered for the Electorate badge.
 
183
A: The Complete Rate-Limiting Guide

Lance RobertsRate Limit Rationale Comments Voting 10 comment flags/day (may increase to up to 100 flags/day) 30 comment upvotes or deletes/day no minimum wait time between votes Deleting (treated like voting) no limit Creating Three comments per 30 seconds Editing comment can be edited every...

> 30 votes per day +10 for questions only (Q only votes can't be used after 25 votes cast on answers. Source)
If you vote and undo your vote 30 times, your vote gets locked in.
 
Anyway, I get the point, I should venture a bit more outside my Python's comfort zone to spread some love
 
just remember to vote for posts, not users :)
happy lovin'!
TTQW
 
That's what I do
 
There's plenty of posts in , so if you can throw them all there, that's fine too.
 
10:10 PM
There are a lot that already got my votes ;)
Speaking of which, @Mast, are you OK with my review on your LED post? I read the post again some time after posting and I reallized I didn't address docstrings, do you need an additional paragraph about that?
> Today +200
2
:D
 
Congrats, :)
 
A C# and F# IDE for the iPad! It's a whole new world. Runs your code as you write it. http://continuous.codes/ https://t.co/3qDz8vLhi6
 
Should I wait before upvoting one of your answers then? ;P
 
@MathiasEttinger If you're offering to write one, I'm not going to decline :P
 
Not necessarily, I just wanted to reach the cap on my own, not thanks to a bounty, like the first time
 
10:18 PM
@Quill ha! in your teeth, Java!
 
@Quill Do iPads have keyboards?
 
But if you’re willing to wait, reload is only 105 min away
 
@Mast iKeyboard, sold separately
(half-kidding)
 
I'll be up then, :)
 
@Mast Well, don't really know what to say yet. Plus it's kind of writting doc for fun… doesn't seem like a lot of fun, in the end :p
But Ï’ll try something
 
10:21 PM
@Mast they have onscreen keyboards, but you can just use a Bluetooth one. I use my wireless mac keyboard with my phone sometimes even
It's nice when things just work
 
Why do you post on Code Review if you don't want a review? — Mathias Ettinger 49 secs ago
 
Oh, hai
@MathiasEttinger To brag perhaps?
712.238986981 ms
215.562022838 ms
27.7808596084 ms
# Improving running time
 
@MathiasEttinger You never know where libraries end up.
 
10:43 PM
If your code works, and you're just looking to improve it, you should delete it here and post it on Code Review instead. This site is for questions about problems with code, and correctly working code clearly doesn't have a problem. If it does not work, and you actually have a problem with it, then please edit your question to make it clear what the problem is and what question you're asking. — Ken White 52 secs ago
 
@Duga These SO messages are starting to be really nicely formated
 
@MathiasEttinger I LOL'd when I saw that
 
I thought my React app was alright, and then I checked the console and it turned out there was a wall of text explaining my failure to use react server properly ;-;
 
0
Q: How to exclude tweets beginning with RT when scraping twitter

Nana Yawplease is ist possible to remove tweets begining with RT when scraping for tweets? import tweepy import pandas as pd pd.set_option('display.max_rows', 500) pd.set_option('display.max_columns', 500) pd.set_option('display.max_colwidth', 5000) import matplotlib.pyplot as plt consumer_key = "" c...

 
@CaptainObvious "How do I…" … sigh…
 
10:55 PM
Yup off-topic, seems like it could be made on-topic easily tho
 
Cheers all
 
@Phrancis Cheers!
I'd sent you a picture of my glass, but it's white wine today, not interesting to look at.
@CaptainObvious 3 more CV.
New Belgium, is that a city in the US?
All Belgium beer I've seen is old, classic, like that.
Never 'new'.
 
No it's the brewery, New Belgium Brewing Co., they are located in Fort Collins, Colorado
 
@Mast that'd be the only city in the US Jeroen would visit
 
Does your code working? If so, you may want to take this codereview.stackexchange.com. — shmosel just now
 
10:58 PM
Pretty good IPA here with a nice hint of tangerine
 

« first day (1161 days earlier)      last day (2857 days later) »