« first day (929 days earlier)      last day (3071 days later) » 

12:00 AM
RELOAD! There are 1612 unanswered questions (94.4148% answered)
possible answer invalidation by holroy on question by PythonMaster: codereview.stackexchange.com/posts/111150/revisions
 
@Duga I answered it, and then found the code was a little buggy (or untested). Took the liberty of changing it, instead of closing it! :-)
 
0
Q: Code Golf Challenge: Calculate Phi (not Pi)

James KoI'm a newbie to C++ (coming from C#) and I decided to complete this Code Golf challenge for fun (though I definitely wouldn't say it's short). Essentially, the challenge was to calculate the phi(not_pi()) of all the numbers from 1 to 100, and print them out in a loop, where phi(n) is the number...

 
@Duga Well, well. 1612 < 1613!
 
12:26 AM
@holroy Have you tested it?
 
@Phrancis Yepp, works like a charm...
I've also written a nice answer, but it's still not reopened... :(
There is however a missing ) in the OP code still missing... ;-/
 
Well, sometimes lol...
 
in the $r3 line... I suspect the OP cut away some of the real code, when presenting it here at Code Review
 
Ooh nice!
> Rubberduck.Setup.1.4.3.0.exe(4.32MB) - Downloaded 1337 times.
4
 
What is that RubberDuck-thingy you are talking about?
 
12:30 AM
My little pet project: (<-- check out the tag wiki!)
 
You don't know RD?!
 
@Hosch250 Sorry!!! But then again I tend to stay away from VBA, or any other variants from Basic... Have done so since QBasic way back in the 80's... I rather used assembly language... :-)
 
It is written in C#.
 
C# is good, C++ is bad, and C- is the name of a language named after the grade the programming student got for creating the language...
 
LOL.
I started with C++, actually. I was using the FLTK GUI library and learning to create GUI's when I stopped.
I need to go back to my C++ book and at least read about the more advanced concepts sometime.
 
12:37 AM
I started firstly with Spectrum 48K basic, moved on to Z80 assembly language, before Turbo Pascal and x86 at end of assembly. Continued with C, and later on Java at university, before moving onto somewhat modern languages...
 
At this point, I'm still not sure where I want to go with my programming.
I love application and metaprogramming.
I would like to learn hardware programming and write a simple operating system kernel some day.
 
Did recently work in a firm where I had to revisit C++, C# and .NET CLR. And the latter is a beast!!!
 
C$?
 
ooppss....
 
Is that a form of C that generates $'s?
 
12:39 AM
Yeah, right. I wish it was something like that... Could use some more money... :-)
 
Write a popular game like Flappy Bird, or something.
 
I don't really like going towards hardware programming, since as you'll get closer to hardware the more fuzzy the logic and programming becomes. Much better with simple logic where 1 is 1, and 0 is 0... When electric signals enter the game room, you'll get possilby 1 or 0, or not stable values, or having to wait for some time. Yikes...
I sometimes say: I would love a computer made entirely out of software, so we could avoid all the icky hardware issues!
 
Other projects I'd love to work on is building an accounting system, powerful like Excel, but that automatically generates the periodic statements, etc., out of the logs, or whatever they are called.
 
Accounting is a bit of magic, you gotta keep your haid straight there!
 
Or possibly an ERP system, although that is also unlikely.
@holroy I'm no genius, but I'm pretty good at math.
 
12:45 AM
I suggest starting with something a little smaller...
 
I had no trouble in my accounting courses.
LOL, yeah, I dream big.
 
Nicely done ^ @holroy :)
 
The problem with accounting systems is not the math, but keeping all links and connections correct, and at the same time handle all the race conditions occuring when you starting moving something inbetween accounts and/or credit/debits...
 
Hmm, sounds tricky.
I'll probably end up being a system admin like sadserver.
 
@Hosch250 It sure is... Been there, done that... For 5 years I was lead architect for a payment solution for a major oil firm in Norway, where the system was the message broker between internal systems and international banks. Me and my team learned some lessons during that time regarding doing things safely and robust!
 
12:49 AM
Cool.
 
@Hosch250 Every accounting-like type of system I've seen was very heavily using database code for the logic, which can become ugly but you often need the transactional nature to make sure all the numbers add up in all the right places before you commit it
 
@Phrancis HeHe... Told you it worked! :-p Don't have a mysql at my local computer, but created a simple database at db4free.net
 
Nice, didn't even know about that site. I usually use sqlfiddle if I don't have the DBMS on my machine, but it's garbage
 
@Phrancis It's a plain phpmyadmin interface towards MySql 5.7 or 5.6... Works nicely if you've used phpmyadmin before... Haven't tested if I can attach remotely, but didn't that for this test...
 
@holroy Ah, never used phpmyadmin, only used Workbench
Then again, I don't write PHP so there lol.
 
12:56 AM
You don't need to write php... That's just the name of the interface... How is Workbench to work with?
 
I've endorsed you for "Oops" on LinkedIn
 
@Hosch250 what?
 
LOL.
 
@holroy It's quite a bit like SQL Server Management Studio, except less good.
 
Talking about LI, I need to check that after the finals rush.
Actually, checking it now since I'm not doing anything anyway...
 
12:57 AM
Can't remember the last time I checked LI...
But now I gotta get some shut-eye
 
See you.
 
bye...
 
You should post such questions to code reviewroeland 50 secs ago
 
1
Q: Started learning python, could use some opinions

BiezorI wrote a small "game" in python for practice, I would like if someone could go over it and tell me if there is anything wrong, any improvements I can make, or any other piece of advice would be great! import time import sys class Creature: def __init__(self, name, hp, inventory): se...

 
@Duga Is the original of ^^... Asked him to remove SO-version (which I've also flagged)... But now I really gotta go...
 
1:14 AM
BTW @holroy...
SELECT `OUTER`.*
FROM
  tableX AS `OUTER`
  INNER JOIN (
     SELECT
       min(id) AS `startId`,
       max(id) AS `endId`
     FROM tableX
     WHERE speed > 0 AND date = '2015-01-01'
  ) AS `INNER`
      ON `OUTER`.id >= `INNER`.startId
      AND `OUTER`.id <= `INNER`.endId;
That^ is how I'd write your version ;)
 
I'm voting to close this question as off-topic because it is a code review — codeMagic 51 secs ago
 
Although, perhaps my aliasing the table and derived subquery as OUTER and INNER is probably not a good idea at all :)
@Mat'sMug ... I gave this to MySQL and it didn't even flinch ... DELIMITER DELIMITER
DELIMITER DELIMITER
SELECT `OUTER`.*
FROM
  tableX AS `OUTER`
  INNER JOIN (
     SELECT
       min(id) AS `startId`,
       max(id) AS `endId`
     FROM tableX
     WHERE speed > 0 AND date = '2015-01-01'
  ) AS `INNER`
      ON `OUTER`.id >= `INNER`.startId
      AND `OUTER`.id <= `INNER`.endId DELIMITER
DELIMITER ;
 
0
Q: Show byte representation of generic type.

MAGI am new to rust programming language. I would like to know any better way of doing this and if it can be done preferably with safe code. use std::mem; use std::mem::size_of; fn show_byte <T> ( element: T) { let array: * mut u8 = unsafe{ mem::transmute(&element) }; for i in (0.. size...

 
@shanselman @Nick_Craver Thanks! Added to our collection.
 
That is the best thing I've read this year.
 
1:27 AM
LOL
they should really switch to Win10
 
Hahaha
 
This is what skiwi's browser looks like: i.imgur.com/nnGvxJS.png
 
what..
 
... this almost works, and the reason that it doesn't is exactly for the wrong reason that I would expect that it shouldn't work...
DELIMITER SELECT
SELECT 'Hello' AS `World` SELECT
DELIMITER ;
Anyone take a guess why above query fails?
 
@Hosch250 Skiwi is learning PHP? Oh no; we were too late.
 
1:30 AM
No, the tabs.
 
I know. It was intended as a joke.
 
user image
3
 
@Hosch250 wtf! lol
The timestamps give a different meaning though
 
Has Joel showed up yet?
Could you super-ping Jeff, too?
 
1:42 AM
I could. ...I just wouldn't. ;-)
 
I was about to say...
 
Why not?
Why ping one founder but not the other?
Boromir?
 
lol
 
Well, you know how when there's a flagged message, and moderators from every other site end up here... just imagine if you got both Joel and Jeff here, and how many random people would come here to see what the occasion was
 
riiight
 
1:46 AM
They wouldn't necessarily know they were here.
 
Could get really messy reallllllly quickly methinks
 
A flag shows up everywhere. Their being here doesn't.
 
Besides, in my opinion, I think Pops has our back and sees the frustration, and is likely equally frustrated that he doesn't have something more definitive to tell us
 
^^ that
 
Isn't that exactly why Joel was pinged?
 
1:51 AM
He's our "inside manager" contact and those are often the best way to get represented, in a big enterprise setting
 
Now, I'm not trying to persuade you to ping Jeff, just curious.
 
I've only ever seen big messes happen when a customer/end-user (like all of us in relation to Stack Exchange) jumps the communication chain and goes straight to the "big dogs"
 
> Would you drive across this bridge? No. If it somehow got built, everybody involved would be executed. Yet some version of this dynamic wrote every single program you have ever used, banking software, websites, and a ubiquitously used program that was supposed to protect information on the internet but didn't.
 
> Websites that are glorified shopping carts with maybe three dynamic pages are maintained by teams of people around the clock, because the truth is everything is breaking all the time, everywhere, for everyone.
"everything is breaking all the time, everywhere, for everyone"
^^GOSPEL
 
nice findings @Hosch250!
 
@Mat'sMug I found a pretty bad f_ up on Tuesday. Apparently some high-permission CTO or some other big wig deployed some mysterious SQL job using the SQL archiver user (as opposed to our standard production users). And deployed it for only this one customer's database. Every audits-related trigger on every customer databases is explicitly designed to immediately RETURN if the write operation is performed by this special archiver user.
 
nice
 
So, we're down to me and a systems admin setting a trace on that user tomorrow ad watching the database for probably an hour or so to try and find how and more importantly WHY it's ... duplicating delivered supplies charges at the tone of 50-100 per day, on most but not all days, between 17:00 and 18:00
One other weird thing is that whatever thing is doing this, is duplicating either a few times (1-5) or... multiples of 50...
On the positive side, all this FizzBuzz practice paid off when I decided to use a qty % 50 = 0 operation in my queries :)
 
2:22 AM
0
Q: C++ Title Screen Problems

Andrew Tewthis is the title screen that I came up with in order to refrain from using system ("pause"). I came up with it and realized it would be more convenient for the user to simply PRESS Q and the screen switches rather than pressing Q and then pressing enter. do { system ("cls"); cout << " @@@@@@ ...

 
@CaptainObvious Oh boy...
 
@CaptainObvious [reads like a] troll [post]
 
@CaptainObvious What the... what the... what?
As much as I want to VTC... I can't find a fitting VTC reason... because it's technically not off-topic
 
Unclear?
 
Nope, it's quite clear
Not broken, not hypothetical, not unwritten, not unclear, not opinion-based, not abusive or offensive, not a duplicate... it's just... garbage
 
2:34 AM
it's off the front page already, just... ♪ let it go ♪ ;-)
 
@Mat'sMug UGH!
 
0
Q: Simplify my currency converter

HautchI am looking for some ways to make my code simpler for this currency converter. Thanks in advance currencies = { "BRL":"(Brazilian Real)", "USD":"(US Dollar)", "EUR":"(Euro)", "GBP":"(Great Britain Pound)" } def real_to_dollar(): user_value = raw_input("How many reais? ") ...

 
@Mat'sMug That is a scream of an article.
I liked the s/camel/_/ bit.
 
yet...
9
A: Handling Asker not learning from previous reviews

Mat's MugPretend you never answered the previous review requests. Other reviewers might not have seen those and will point it out as well, so you could also ignore/walk away from his posts if you find it irritating, but odds are he's pasting different parts of his codebase into different review requests ...

no other answer was posted
...
> answered Sep 12 '13 at 21:35
damn time flies
 
2:51 AM
How would you like three in non-rapid succession without incorporating any changes?
 
@CaptainObvious That seems a bit... incomplete? There are a whole bunch of empty methods/functions...
 
@Hosch250 we get enough questions per day to let it zombify with a negative score, and perhaps end up answered by a new zombie hunter - today's bad question is tomorrow's [necromancer] badge. just let someone else answer it if you're tired of this OP ;-)
 
That is what I did.
It wasn't funny.
 
??
 
I have to admit, that huge bunch of ASCII "art" showed some effort
I was going to suggest putting it in a constant SPLASH_ART somewhere out of sight of the main
 
2:58 AM
print ("|   Serial Key: 357-494-626-181                             |")
love it
 
What does that mean?
 
he's printing the "about" screen
with the "serial key" hard-coded
 
...?
Oh. LOL
 
I'd be dead before I became a slave. That's one thing good about death - everyone is equal.
 
This Java code is not that bad working, maybe I'll post it for review
The main I use to test it is a mess though, maybe I'll try to clean it up a bit
class Main {
      public static void main(String[] args) {
          String input = "asd14sd67fgh007";
          String expectedOutput = "1467007asdsdfgh";

          PatternMatcher inputMatcher = new PatternMatcher(input);
          StringBuilder actualOutputBuilder = new StringBuilder();
          actualOutputBuilder.append(inputMatcher.getNumbers());
          actualOutputBuilder.append(inputMatcher.getLetters());
          String actualOutput = actualOutputBuilder.toString();
          if (actualOutput.equals(expectedOutput)) {
 
3:15 AM
possible answer invalidation by Maven Maverick on question by Maven Maverick: codereview.stackexchange.com/posts/111105/revisions
 
@MikeAgustin no, I mean the syntax is If {bool expression} Then, where RadioButton2.Checked evaluates to a Boolean, hence RadioButton2.Checked = True compiles, but makes If {bool expression} = True Then - the = True part is already implied with the keyword Then. — Mat's Mug 2 mins ago
thinking again, that's pretty badly explained..
 
I really need to get me an actual rubberduck. I just tried explaining some process to myself, out loud, and it took almost 10 minutes to explain the logic of it...
Maybe I can get one that fits in my back pocket, so I can pull out the rubberduck on-demand.
 
Get a bunch of balloon ducks.
 
But... they're balloons... latex <> rubber
 
@Phrancis a keychain ducky?
 
3:28 AM
@Phrancis Apparently, you use Bit for boolean in SQL Server.
It shows True/False in the designer.
 
> Giant Rubber Duck 8"Wx11"Dx9.5"H
Looks like just the right size for my cubicle.
@Hosch250 Yes, that is the case
 
You know, I know a dentist that does carved-duck dental-debugging.
He has them lined up in his office.
The working-office, not the reception room.
 
The rubberduck asks what "them" means...
 
The carved ducks.
They look better than that thing.
BTW, is it bad that I talk to myself when I'm working under pressure?
I find it helps keep my facts straight, but my family always tells me to knock it off.
 
@Hosch250 Isn't that the whole point of rubberduck programming?
 
3:34 AM
I do it most in time-critical exams.
Usually, I don't need to when I'm programming.
 
Well, does your self-talking help with sanity checks?
 
Not that, really, it just helps keep facts straight.
 
OK. Then, it's not bad at all
 
Like, if I'm doing calculus, I'll say the equations as I write them down.
(I had a hard time not doing it when I took my ACT. That must be why I only got a 32 instead of a 36. I hope you didn't think I was serious.)
 
If programmers had to speak their code out loud as they were writing it, I think most places would make sense and write better code
 
3:36 AM
BF will never make sense.
Nor will Whitespace, Golfscript, or Ook.
 
It'd still be funny
 
Ook! Ook! Ook? Ook.
 
*pictures @Mat'sMug writing LOLCODE and speaking the code out loud...*
 
BTW, what's up with the CLR LOLCODE I've been hearing about?
 
No idea
 
3:49 AM
0
Q: Text Based C++ Video Game

Tewthis is my first post. Please critique this and make suggestions on the best practices. Also, if this resembles Andrew Tew's posts it's because we are working on the same project and he told me to post here. //Seasons Divided #include <iostream> #include <string> #include <iomanip> #include <std...

 
@Mike: Many thanks for the code review. I will definitely take care of it. — Helper 34 secs ago
 
0
Q: Permuting lines two by two

Taha ArmandoSo this is my code, given a pair number of lines, in each line a string, exemple : This is my code and it's supposed to give : my code This is instead it inverts after each space not after each line: is This ...

 
4:05 AM
Well, I just wasted an entire evening. :P
@CaptainObvious Some part of me is a little suspicious that the user there is the same person as "Andrew Tew", and that account was created because the other was question banned.
@Mat'sMug Thoughts? ^^
Or any mod that's around, really.
 
Tewtally
 
right, sorry.
5 hours of non-stop PlanetSide 2 = fried brain
I assume you can do an IP compare as a mod, right?
 
4:23 AM
codereview.stackexchange.com/questions/26839/… - this may be a good place to start. — David 46 secs ago
 
4:47 AM
0
Q: Visitor Pattern in C++ 11

Pranit KothariI have referred some class diagram to actually create visitor. #include <iostream> using namespace std; //know should not be used, but for simplicity class Book; class Pen; class Computer; class ICartVisitor { public: virtual int Visit(Book &) = 0; virtual int Visit(Pen &) = 0; vi...

 
@EthanBierlein Yes, and action was just taken.
 
Cool
huh
Somewhat interesting, there's another account with the exact same name as the "parent" of the one you just banned:
Probably just a coincidence though.
Mkay, it's almost 11... time to hit the hay..
 
It was created before and has no activity, so it's fine.
 
5:14 AM
wow man, epic code review, well done! :) — LachlanB 25 secs ago
 
5:51 AM
Monking
 
monking
 
6:07 AM
mONKING
 
hey @Phrancis how are you?
 
Good, and you @chillworld?
 
great, finished yesterday my custom component with an extra class for spring
 
 
2 hours later…
Zak
7:49 AM
Monking
 
monking @Zak
 
Zak
8:12 AM
blergh. How is it ten past 8 already.
I don't wanna get out of bed yet :(
 
@Zak funny, I am at work for almost 3 hours
 
2h15 minutes here :)
 
8:57 AM
@CaptainObvious Guy doesn't learn.
Monking all
 
0
Q: Interview programming challenge

JuanThis is a programming challenge I submitted as part of a job interview, which I failed because it lacked "maintainability" and "patterns and best industry practices", so I guess we could all learn something from my mistakes. The challenge was to write a program that, given a list of programming...

 
9:16 AM
> The RegexResultFinder is a nasty Finder that uses regex to search the result count in an HTML page. But then the JSONResultFinder can read JSON in case you'd rather use official APIs. I figured they may want me to read HTML since they're using MSN Search in the sample output, so I added both options.
There probably was a cleaner way.
 
monking
@Phrancis "Hey baby, wanna see my duck?"
 
Monking
@DanPantry I think I prefer seeing this without context.
2
 
@SuperBiasedMan I think you starred the wrong thing :p
 
Thanks! Fixed my starring faux pas
 
It's mid November and the locals started using carbide cannons. Not good for my concentration if they keep this up...
 
9:26 AM
@Mast Where can I get one of those? Asking for a friend.
 
@DanPantry I used to build them.
You know those butane gas containers they use in caravans?
90 litre something
 
ah right
 
Cut off the head so you have a hole in the right size.
3
 
@mast Reading through the Nth monitor discussion about that tuple question last night. My opinion is "woops"
 
Make sure it's absolutely empty first ^^
 
9:28 AM
@Mast starred for out of context
 
It's a good day for no context.
 
Got an hour or so till my next meeting and the preparations are done anyway, so, yea.
Anyway, once the head is off, you only need to drill a small hole in the behind of the container.
And voila, you got yourself a carbide cannon.
Use old, wet jeans to make the ball stick in the top opening. Makes the bang louder.
 
monking @Mast @SuperBiasedMan and @DanPantry
 
But hey, some do it with old heating installations. As long as it's somewhat cylindrical and made of something roughly as strong as cheap steel, you can make it into a cannon.
@chillworld Monking
 
@chillworld Monking!
 
9:42 AM
If there's nothing wrong with the code, or you're not having problems, you might want codereview.stackexchange.com instead. — Andy 7 secs ago
 
Zak
TIL that Switzerland has no official capital city
 
@Zak Bern is no longer considered a capital city?
 
@Mast No, Bern is a muppet. :^)
Wow.
Not only am I wrong, I managed to think Bert and Ernie were actually Ert and Bernie.
I am too tired for this..
 
@DanPantry What did they give you at the hospital, opiates?
2
 
@Mast I don't know what anaesthetic they gave me, :(
 
Zak
9:52 AM
@Mast It is the de-facto Capital City
 
@Zak So, what's the difference?
 
Zak
@Mast In terms of real-world applications, nothing
But technicaly, legally, according to the constitution (or whatever the relevant document is), Switzerland has no Capital City
Switzerland (/ˈswɪtsərlənd/), officially the Swiss Confederation (Latin: Confoederatio Helvetica, hence its abbreviation CH), is a country in Europe. While still named the "Swiss Confederation" for historical reasons, modern Switzerland is a federal directorial republic consisting of 26 cantons, with Bern as the seat of the federal authorities, called Bundesstadt ("federal city"). The country is situated in Western and Central Europe, where it is bordered by Italy to the south, France to the west, Germany to the north, and Austria and Liechtenstein to the east. Switzerland is a landlocked country...
Capital city: None (De Jure)
Bern (De Facto)
 
Now I'm wondering whether the USA have the same thing rolling.
 
its switzerland neutral in the eu as well/
as in its not part of the EU
but has the schengen area
> it is not part of the European Union, nor the European Economic Area. However the country does participate in the Schengen Area
 

« first day (929 days earlier)      last day (3071 days later) »