« first day (894 days earlier)      last day (3139 days later) » 

Zak
8:03 PM
'night @all
 
0
Q: Is this AppendNode() good form?

mersenne_twisterTrying to improve my style and form with a modern C++ AppendNode(). Would this hold up under a code review? Where can I improve? void AppendNode(shared_ptr<ListNode>* node, shared_ptr<ListNode>* tail) { *(tail)->next = *node; *node = *tail; *node = *node->next; }

 
It seems like my recent questions don't draw attention. It's sad. But I feel like 2 out of 3 of my previous questions were maybe too small to be interesting to review.
Goodish question here from a new user
2
Q: Password generator script

MetadataWhat I was trying to do here was create a Python script that would generate passwords with 16 characters with uppercase and lowercase letters, and numbers. The generated password would then write itself to a file. Let me know what you think because I know they say the point of Python is to be ab...

 
I think the next version of the Brainfuck interpreter is to have it reduce operations. I.e. when multiple +, -, > or < signs follow each other, it should reduce those down to += or -= calls.
 
@TopinFrassi that question was beatiful
 
I had a feeling there was too much code. :p
 
8:16 PM
@TopinFrassi well, my code does not do everything that the OP code does, mine has less functionality
 
Yeah but still, there's too much code anyway :p
 
I think beginning to program is hard also because you bury yourself under tons of unecessary code
 
Indeed. But sometimes it's hard to see how to do something with not too many lines
 
I once wrote a Tic-Tac-Toe in hundreds of lines, using only if statements, a single while loop to handle re-play and 9 variables for the 9 squares. It was crazy
 
Heh, found some code of my very first programming examination in end of 2011
  //The constructor
  //@pre: avgDFI >= 1, gen is a boolean, yOB is an int, man is a Manger
  //@post: the values have been initalized
  Animal(int avgDFI, boolean gen, int yOB, Manger man) {
    avgDailyFoodIntake = avgDFI;
    gender = gen;
    yearOfBirth = yOB;
    manger = man;
  }
We were forced to use pre- and post-conditions
Stating that something is a boolean or int is rather... obvious though
 
8:24 PM
Just found a SQL table called CONTRACTUAL_ADJUSTMENTS_OVERRIDES_SUPPLY_PACKAGE_SET_DETAILS
All the fields in it are prefixed by its acronym, like caosps_inserteddate
@Mat'sMug Wouldn't you love to have to type that all the time? ;)
 
@Phrancis Well, sometimes a single name is not enough
 
0
Q: Grouping two sets of data

PKDThe following method retrieves a list of users and the subscriptions for each user, from my database. That said, it works, but it runs pretty dang slow. I'd like to improve the speed on it. Currently, it fetches a mere 90 records, and takes nearly 20 seconds to do so, partly because, for every re...

 
I was reading some of my old code, I already was pretty allergic to "boilerplate" back then:

#Boilerplate code
master = Tk()
^ After that single line the program that does stuff (logic, and user interface) starts, I left a comment for a single line that I thought was not strictly necessary (now I think it really was necessary)
 
8:57 PM
Well, goodnight people
 
0
A: Connecting to an insurance database

Robert SnyderAfter cloning your project and reviewing the blog post you mentioned I find that your structure is close. I can see that you tried copying what he did, but missed a few points: Your tests are in the same directory as your production code. This is frowned upon in all words of languages that I've b...

 
@Caridorc is that a typo, or it's "beatiful" as in "deserves a beating"?
 
How do people not watch Bruce Almighty
 
@Phrancis shivers
Awaiting the Roslyn-empowered answer now ;-) — Mat's Mug ♦ 51 mins ago
;-)
 
Yeah that definitely should've been through Roslyn rather than spawning a process
I would've given major bonuspoints if it was done through IL.Emit instead
It's more to the bone which makes it look more appropriate for translating brainfuck
 
9:09 PM
Who is Uncle Bob?
 
@Phrancis you... don't know Uncle Bob?
the author of Clean Code
 
Nope. I haven't read Clean Code...
 
Robert C. Martin
 
It's on my Amazon wishlist
Which I will make public when my birthday is near
say.. in 1 or 2 weeks
 
Does it apply in general to programming, or to one domain in particular?
 
9:10 PM
I'm not saying anything but you could, for example, get me a book from there. Just a suggestion
Thinking of a different one. Clean Code is general and from 2008 apparently
 
examples are in Java. and I read it.
twice. ...in 2009 I think. dang. I need to read it again.
 
Debating whether to do "minor" releases for C#. E.g., 6.1, 6.2, ... prior to 7. Pro: faster innovation; con: more variants of the language.
 
9:32 PM
oh gawd, it's starting
next year they'll release C# 42
TTQW
 
9:46 PM
Welcome to Stack Overflow. Please take the time to familiarize yourself with the Stack Overflow help file, which will help you understand what kinds of questions are appropriate for this site. This site is intended to help you obtain answers to specific programming questions, as opposed to providing tutorial, design or code review assistance. — MarsAtomic 45 secs ago
Codereview would be a better place — sam2090 21 secs ago
 
-1
Q: stopwatch in swift

guest1134 i'm new to swift so i'm kind of struggling with it. i need help with 1- to make the counter with HH:MM:SS 2- make the start and stop in the same buttoun 3- makes labs; means that when i press lab the number should be save in other label like 3 labels

 
10:04 PM
IMO compilers shouldn't release often.
 
1
Q: Find values in list which sum to a given value within tolerance

MarkThis is really a follow on from a question I asked earlier this year on Stack Overflow. I received a great answer to the following problem: I'm trying to code up something simple and pythonic to identify combinations of values from a list which sum to a defined value, within some toleranc...

 
10:24 PM
0
Q: API to determine file upload location and scrape city government website to find corresponding government official

sunnyI wrote this script as an NYC-specific-API for file upload for a mobile app. Users upload a video file and also their geographic coordinates. I then use an external API to get the corresponding borough in NYC (since the iOS reverse geocoding SDK labels everything as New York, NY regardless of u...

 
10:41 PM
So if there is no reason to do this, why chrome do exactly the same thing? Please explain it, because i am really curious... — Mattia 28 secs ago
 
10:51 PM
@Mat'sMug Just like Firefox went from 3 to like 50 in about 5 years.
I remember when Mozilla was making a huge deal about Firefox (either 3 or 4).
And then they did what Google did and just started ramping numbers up there.
And now everyone things a larger version number is better.
 
11:09 PM
@SimonForsberg Thanks!
 
11:48 PM
posting to codereview community will probs be more fruitful — R Nar 59 secs ago
 
So I'm looking for a good name for the method that concludes the building being done by my DB object builder. Would just myObjectBuilder.build() be good? Or not explicit enough?
Or perhaps .finish()?
There's a native method of the API called .get() but for some reason I don't like the sound of it... is it just me?
 
@SimonForsberg that's a rather interesting false alert from @Duga. The one from Mattia.
 
Or is "getting" a thing from a builder a pretty standard thing?
 
I like builder.build() @Phrancis.
Or maybe create()
 
Seconding@RubberDuck on build()
 
11:52 PM
=)
 
OK
thx duckies :)
 
if you really want it to mean something is done, I also like finalize()
Yeah.
 
Make sure to up-vote all the answers that are helpful throughout your travels on SO. For code review, there is also a specific site for that codereview.stackexchange.com too — sheriffderek 35 secs ago
 
As a reader though, I'd just be curious what that means -- method names shouldn't refer to the state of something, but more what they do, so the former works unless you're strictly finishing a process with the method.
Just an aside to keep in mind.
 
Sorting a string in Python: self.list_votes[idx]= [a for a in vote if a!='0'] + [a for a in vote if a=='0']
Say what...
 
11:55 PM
That's intuitive...</sarcasm>
 
Python looks dumb often, lol.

Pretty ironic considering what people supposedly like about it.
 
    for idx, vote in enumerate(self.list_votes):
        self.list_votes[idx]= [a for a in vote if a!='0'] + [a for a in vote if a=='0']
This is so going to need a review when it's done.
 
Hm. I'd shove that thing in a method and document the hell out of how it works for Mr. or Ms. Maintainer
 
It's part of a method. It should probably get it's own.
 
(or function)
Um, I'd say so lol
You'll thank yourself later
 
11:57 PM
Well, it's only used once and all other parts of that function perform similar clean-up duty.
So it will get messy anyway.
But splitting it up is usually a good thing.
 
The one bad thing about Python, with one-liners like that, is you can't really break it into smaller chunks very easily with line breaks
 

« first day (894 days earlier)      last day (3139 days later) »