« first day (1147 days earlier)      last day (2871 days later) » 
00:00 - 17:0017:00 - 00:00

5:10 PM
= /
 
Hi all
 
@Malachi Why is it Mug's fault and how is it Friday related?
 
@Mast because the Friday Meme started with me not knowing about Rebecca Black's Friday song and hating it badly
 
@Malachi But you gotta get down on friday
party and party and wo. fun fun fun
 
5:16 PM
@syb0rg Is it a reference to something?
 
12
A: What's a Zombie? And what are the many other memes of Code Review?

PhrancisMeme: Friday Originators: rolfl, SimonAndréForsberg & Jamal Cultural Height: The 2nd Monitor Background: On Jan 10 2014, the following remark was made in the chat room: Simon André Forsberg: It's Friday, Friday. Gotta write code on Friday. singing And then this happened: Since then, ...

 
@N3buchadnezzar You go party, I go mow the pasture.
 
@Mast It was a reference to the song Malachi loves.
 
@Malachi I'm perfectly aware of the horror happening there.
 
@Mast &something
 
5:18 PM
So, it's a new phase of rebellion?
@skiwi Perhaps even a *something
 
I don't know enough C++ to know that ;)
In my world & are references and * are pointers (or derefences)
 
If you point at something, aren't you referencing it in a way?
And yes, it's very dangerous to confuse the two in code.
 
0
Q: C# Writing a program that calculates the Collatz Conjecture

Devid DemetzhToday i read this thing about the Collatz Conjecture. I wanted to try and write a programm that calculates all the numbers. wanted to share my code: List<string> liste = new List<string>(); long num = 1; long z = num; while (num != 100000) { while (z != 1) ...

 
@N3buchadnezzar That's the difference between being a programmer or not
 
5:36 PM
You really shouldn't use your own salts on password hashes and you really should use PHP's built-in functions to handle password security. Make sure you don't escape passwords or use any other cleansing mechanism on them before hashing. Doing so changes the password and causes unnecessary additional coding. — Jay Blanchard 9 secs ago
The specific problem I am trying to resolve is to get gerrit (ver 2.12.2) code review working with mysql database. I had it working with the default H2 databse. As my post says, when I did the configuration to switch to mysql, gerrit fails with the exception shown in my post. I know exactly why its failing. Its failing when its creating a table, and its complaining about default values for one of the columns. So I am trying to see if anybody ran into this and what are the solutions available. Appreciate any help. — devMKZ 21 secs ago
 
@Duga false positive. Doesn't mention Code Review the SE site.
 
0
Q: Shortest prime number generator we could come up with: can it be even SHORTER?

Joseph FarahAhoy! Joe here. I worked with a friend on the following prime number generator. Our goal was to make it as short and as fast as possible. This is what we came up with: def p(n): # will print out primes between 0 and n s=[True]*(n/2) for i in range(int((n/2-1)/2) >> 1): for j in range((i*...

 
@OlegV.Volkov You haven't really given a reason why it belongs on Code Review. Furthermore, "belonging" on another site is not a sufficient justification for ruling a question off-topic here. — 200_success 33 secs ago
@jcubic While you are correct that this is a code review request, you still need to provide a bona fide reason to close on Stack Overflow. — 200_success 28 secs ago
 
5:53 PM
@CaptainObvious Is this off topic?
 
6:03 PM
@Mast Well, since the requirements for the shortest password were a uppercase letter, a number, and '$', I tried to do leet speak with the password and the only good one I could come up with was H8$ -> hate money
I could've added a question mark I suppose
 
@JoeWallis No, the "shorter" part may be tho
 
I hate to sound difficult but I've been trying to work this solution in and it still hasn't worked... if any other c# programmer could have a look at this codereview.stackexchange.com/questions/132765/… I'd love you forever
 
monking
 
@DanPantry So... what's the issue?
 
6:15 PM
@syb0rg
 
@skiwi Check the app description
 
@DanPantry obviously we should upvote the answer, since we have photo proof it works ;)
 
@syb0rg I thought golfed code and golfing was (IMO crux of the question), I'll have to check as a mod let it go... :S
 
@DanPantry I don't see an issue to be honest
 
I removed the part of your question asking for it to be shortened, as this is not a code golfing site. Please do not revert further edits. — syb0rg 16 secs ago
 
6:16 PM
@skiwi The app description says "The spirit of StackOverflow is helping others". Nothing about Nissan :P
 
Could use some upvotes on that comment ^
Hm, someone other than OP downvoted my answer...
But no comment
 
@syb0rg I was also tempted to DV it, it's not really a review, more of copying code saying "use this instead". TBH though, it's a pretty crappy question
 
@Phrancis It was more of: use this algorithm, here is an implementation I found, I can't vouch for the quality of this implementation since I'm not a Python programmer
Which should be a valid review?
 
Where are all the Rubberduckers?
 
@Hosch250 It's a holiday in Quebec today so you're not very likely to see Mug around much
 
6:23 PM
And why is Excel having trouble loading my doc to OneDrive?
Oh.
 
I was busy exterminating ransomware
 
@Hosch250 Exccel has trouble with a great many things...
 
It isn't fun working on it all by myself.
@Phrancis Well, this is really a OneDrive issue.
I think it might be trying to resave the entire document.
 
http://www.commitstrip.com/en/2016/06/24/how-to-host-a-coder-dinner-party/
CommitStrip
How to host a coder dinner-party
CommitStrip
1466792329
2
 
This post is looking like something from SO, downvotes and upvotes all over: codereview.stackexchange.com/q/132965/27623
 
6:29 PM
There's a limit to how much golfing you can do in Python, though. The best you can do is mini-golf.
 
thanks for the rollback earlier @200_success
 
you might have better luck posting this on codereview.stackexchange.com , if your code is already working. — Jeremy 24 secs ago
 
@200_success Python is actually pretty good for golfing for a language that can reasonably used in production.
Anyone want to review this PR for any security concerns? github.com/rubberduck-vba/Rubberduck/pull/1913
 
@syb0rg Ah, of-course.
 
Anyway, about the PR, don't worry about how much it needs a refactoring--I know about that.
I need to get the commands extracted into their own files, etc.
 
6:39 PM
0
Q: C# Speed up Binary Search

Brent SullivanThe challenge requires the program to receive data from the console and use binary search to find if a term is contained in a set of other terms. I've unit-tested the solution below, but according to the grader, my solution is too slow (i.e. the logic is "correct" but inefficient). The grader ret...

 
my head hurts, and it's Friday
 
s = [True] * (n / 2)
What does that even do? What type is s if it's assigned like this?
 
@Phrancis Language?
 
6:48 PM
Python
 
"Watch your language, please."
5
 
@Phrancis Builds a list or array.
 
Ah, ok
 
Elliotts-iMac:~ elliottbrown$ /usr/bin/python
Python 2.7.10 (default, Oct 23 2015, 19:19:21)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> [True] * (15 / 2)
[True, True, True, True, True, True, True]
Mac > all.
Python is accessible via the command line.
And is an interactive shell.
 
@EBrown That's all of Python
 
6:50 PM
Either way, I like it.
 
@EBrown It also works on Windows :D
 
@skiwi Ah, I should get it setup then.
 
You need Python in your PATH and then Git Bash installed :P
Eh probably you don't need Git Bash
 
Eww no to Git Bash.
 
@skiwi You don't, on windows with Python
 
6:53 PM
My laptop is 10x faster since I put the SSD in it.
 
My PC would be infinitely many times slower without SSD :P
 
@EBrown Git Bash is far superior to the regular Windows CLI, for sure. I do prefer OS X's CLI though, it works great
 
@Phrancis OSX's CLI is amazing!
 
[Zomis/MinecraftScripts] Zomis created repository
 
@Duga Minecraft? What's up next, in redstone?
 
7:01 PM
@Mast I built a 16-bit ALU in redstone once.
 
@Mast Don't give him the idea ;P
 
@EBrown Oh really, I built a 17-bit ALU!
Ok, I'll show myself the door now :P
2
 
@skiwi >.>
 
@EBrown Yea, they take a surprisingly large amount of space.
 
@Mast I made mine multi-level.
It saved some space.
I want to remake it now.
 
7:04 PM
I doubt it's practical to do it single-level.
I want to build a Turing-complete machine of rockets in Kerbal Space Program.
 
@Phrancis any CLI is superior to regular windows CLI
 
Very true
You can't even resize the Windows CLI
Well, at least not horizontally
 
and any real CLI is better than Git Bash for Windows, because Git Bash for Windows is just cosmetics
 
@syb0rg Yes, you can.
 
@syb0rg actually they fixed that... in Windows 10
 
7:06 PM
Time for work.
 
Oh, sorry I'm running Windows 7 still
I don't think I can upgrade cause the company I work for wouldn't like that
 
nuked some ransomware today
 
@syb0rg Yeah you can, in Windows 8 at least.
 
As long as we're doing Super User cross-site pimping…
2
Q: Is compiler bootstrapping on-topic?

200_successHow can a compiler compile itself? became a Hot Network Question, and I answered it, before I noticed that it might actually be off-topic. According to the Help Center, questions about programming are explicitly off-topic for Super User. Is an abstract question about compiler bootstrapping out o...

 
Good for you, one more down.
 
7:09 PM
I really should've put a disclaimer with that Windows CLI statement
 
You go into the properties and set the width of the window in characters.
 
Funny things can happen with migrations.
 
Yea, I've never been a big fan of them. Closing and making the OP re-post seems more appropriate in most cases.
 
@Hosch250 that's a dirty hack. and it works since the windows CLI exists
 
Anyone have Python handy who could test this? I tried an online REPL but it gave me syntax error in main
def get_primes(n: int):
	"""
	Find all prime numbers between 0 and n
	Args:
		n (int): The input number to find primes up to.
	"""
	primes = [True] * (n / 2)
	for i in range(int((n / 2 - 1) / 2) >> 1):
		for j in range((i * (i + 3) << 1) + 3, n / 2, (i << 1) + 3):
			primes[j] = False
	return [2] + [((i << 1) + 3) for i in range(n / 2) if (primes[i])]

# test function
if __name__ == "__main__":
	print get_primes(input())
 
7:10 PM
Especially if the comments state there should be something rewritten to make it actually on-topic on the new site.
 
But it makes no sense to leave a highly-voted off-topic question on the original site.
 
@Phrancis Preference for 2 or 3? Got both.
 
The REPL was using Python 3, maybe this is Python 2.x syntax
Traceback (most recent call last):
  File "python", line 15
    print get_primes(input())
                   ^
SyntaxError: invalid syntax
This is what Python 3 REPL gave me
 
print needs parens in 3.
print(get_primes(input()))
 
  File "Phrancis.py", line 1
    def get_primes(n: int):
                    ^
SyntaxError: invalid syntax
That's on 2.
2.7.6 to be exact.
 
7:13 PM
Python versions, ugh
 
@Mast Can you specify argument types in Python?
I don't remember that feature.
 
@Hosch250 Not that I know of, I'm just as baffled as you.
 
Apparently you can in 3.x
 
Yeah, what the...
 
@JoeWallis You still around?
 
7:14 PM
Type hints are a new feature in Python 3.5.
 
I'm surprised it was left out of pre-Python 3
 
@Mast Yeah?
 
They are merely hints.
 
OK.
 
Oh, hints eh...
 
7:15 PM
Oh, I should update my Python3 installation...
 
The language itself is still ducky.
 
@JoeWallis Do you happen to have a Python 3.5 installation around to try this?
 
Yeah, I only used 3.4.3, IIRC.
 
@Mast Yeah sure
 
I feel like I'm not working hard enough at RD today.
 
7:17 PM
In fairness, repl.it uses 3.5.1 and it refuses to run it.
 
@Hosch250 It's Friday afternoon, that's a common thing :)
@Mast repl.it is what I tried as well, it seems pretty flaky most of the time (for other languages as well)
 
@Mast You didn't use print as a function
 
Also, just noticed that Q is tagged Python 2.7 so I guess my code is broken for 2.7, should I only remove the type hints to make it compile on 2.7?
 
@Phrancis Ya
Then maybe comment in your post about that
 
7:20 PM
So if type hints make it 3.5 specific and the lack of print as function makes it 2.x specific, something odd is going on.
It does work if you turn print into a function, although it never prints anything.
 
Meh, moving on
Thanks for the help on this
 
Traceback (most recent call last):
  File "python", line 14, in <module>
  File "python", line 7, in get_primes
TypeError: unsupported operand type(s) for /: 'str' and 'int'
 
It doesn't work broken beyond belief, probably works in Python2
 
@Phrancis Was not able to compile it on 3.5
 
@Mast It's wonky code at best, there's much simpler ways to find primes than how they are doing it
 
7:23 PM
@JoeWallis def get_primes(n: int): is never going to work on Python 2 AFAIK.
@Phrancis Yup.
 
Invalid in 2.7 as well
Worked without the (n: int) though. Do not people test their codes? Seems it worked with STDIN
 
@N3buchadnezzar I don't have Python installed on my PC, and the online REPL only supported 3.5
Thanks for testing it, I fixed my answer for 2.x :)
 
I really like my answer ^^
 
It's a good answer and well deserving of the check mark!
 
354
[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353]
 
7:28 PM
OP: Hey guys I made this unreadable slow code, can someone please make it even more unreadable and slower?
5
 
Drop the hint and all is well.
@N3buchadnezzar I think it could've been a one-liner generator.
 
k=P=1
while k<1e6:P%k and print(k);P*=k*k;k+=1
 
Still not a one-liner.
 
Yeh. If we were to accept two lines i would go for
 
Also not a generator.
 
7:34 PM
from primesieve import generate_primes
print generate_primes(2*10**6)
 
^^
 
def primes(n):
    return set(range(2,n))-{c for i in range(2,n) for c in range(2*i,n,i)}
^ That could be made into a one line, but I dont care teddy bear.
 
Euler must be turning in his grave right now... :)
 
You mean Eratosthenes?
 
Uh, yeah, that :P
while(true):
    print "Phrancis sucks at maths"
 
7:39 PM
It is a common misconception that primesieves are the sieve Eratosthenes. However it is a easy name to remember for most people.
 
@Phrancis s/maths/history
 
If that is meant to be Python, you suck at it too. True needs to be capitalized.
3
 
^^
 
lol
I've written all of 1 Python script that did anything useful in my life
 
Here is the sieve: rosettacode.org/wiki/Sieve_of_Eratosthenes. No crazy weels or other alien improvements.
 
7:42 PM
Are we still recommending Sieve of Eratosthenes for prime generation?
 
Isn't Atkin faster in this case?
 
Isn't the Sieve more of an academic type exercise?
 
Everything is faster.
 
@Mast Yes, it is in all prime generation cases
 
However when someone asks: how do i generate primes?. The answer is always use The Sieve of Eratosthenes. When they actually recommend Atkin, Wheel factorization, or some other variant.
^ Pet peeve
 
8:00 PM
0
Q: RPG stackexchange chat bot

BálintRecently I made a small bot to simulate an ASCII-based RPG in a chat room. The other users can enter commands (.left, .right, .up, .down) to move the character. It's made with JavaScript. Everything is on the global scope, so I can simply enter it in the console window to create a game. This ve...

 
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: An asynchronous service to produce a results cache for a list of items
 
@CaptainObvious Neat idea
 
Turns out doing the Sieve with SQL is really really simple pastebin.com/euwMegjV
 
@Phrancis Like taking candy from a baby
 
Yeah
Calculates up to 10000 in about 3 seconds
 
8:03 PM
> ReferenceError: walk is not defined
I probably misunderstood the instructions there...
 
@Phrancis 0.268207278721 ms
 
@N3buchadnezzar Depends on the server I suppose
 
Probably. Hard to get exact results for so low values
primesbelow         0.32437052521  ms
generate_primes     0.156317926358 ms
Joseph Farah        4.89585165444  ms
 
The percentile difference in execution time says enough though.
 
roughly 60 times. However it increases for larger values.
 
8:38 PM
The crazy stuff people come up with sometimes:
 
-1
Q: Is there a way that I can omit an empty catch block

SaurabhI'm posting this because I have a catch block in my code that is useful to me in catching an exception, but does not do anything further with it. In other words, I don't want the program execution to get interrupted so I am catching the exception but I am not doing anything with the caught except...

 
@CaptainObvious Why did someone answer you?
wags finger
 
@Mast Atleast they are no strangers to love
They would never give you up either
 
Unless, you know...
 
9:10 PM
0
Q: Personal game creation refuses to work (C Programming)

Samuel FI have been debugging my Fallout Lockpick Simulator for a couple days now and had no progress. Every time I load this game up and type in a degree to move the bobby pin, it says I win. Instead, the game should loop until win is set to 1 and then say I win. The only components I left out of this s...

 
"refuses to work"
I see no problem here
 
Broken code is a problem.
Code making decisions on it's own is as well.
If my code would say 'Hey, I know we go way back, but I just don't feel it today', I'd put it down.
 
@A_S00 Mexican code?
 
@N3b We don't flag easily, but you're entering dangerous territory there. Just a heads up.
 
@Mast "put it down" like, euthanize it, or like, set the laptop down on the desk and back away slowly?
 
9:22 PM
@Mast Sorry :p
@Mast Id try to fix it...
 
@Mast was about to say that
 
@A_S00 I'd nuke it from high orbit.
Code with a will of it's own is unacceptable.
For all we know it turns into an ASI.
 
@Mast Very Quarian.
 
3 Laws of robotics
 
I'm waiting for AI robots that disconnect their power off button
 
9:27 PM
 
@A_S00 The quarians were too late.
@skiwi Which is why you always remember where the hard-disconnect is located.
4th law of robotics: Robots should have a mechanical weak spot.
 
0
Q: Given three numbers, find the second greatest of them (C)

Lúcio CardosoI've just coded (in C) this for my country's programming olympiad. I want to know if this method is a good approach in terms of readability and perfomance. I would also like to know how to improve it. #include <stdio.h> ...

 
@CaptainObvious Probably slower though a*b*c/(min(a,b,c)*max(a,b,c)
 
@Mast But I mean they can physically protect the hard-disconnect
TTGO
 
9:54 PM
@skiwi Only if you give them the means to or don't watch them closely enough to prevent them from acquiring the means.
 
0
Q: Several php general use functions

Brad<?php $headers = 'From: noreply@website.org' . "\r\n" . 'Reply-To: noreply@website.org' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); function sec_session_start() { session_start(); if (loggedin()){ $session_name = 'session-' . rand ( 100000 , 999999 ); // Set a custom ses...

 
10:12 PM
0
Q: New User Creation Not Working in Pyramid SQLAlchemy + URL Dispatch Tutorial

Unnecessary BeesI've been working through the Pyramid tutorials at pylonsproject.org and am currently working on SQLAlchemy + URL Dispatch wiki tutorial. I've gotten to the portion on authentication and the button to the login screen works and the login screen is what is expected, but every login fails because ...

 
10:25 PM
@SimonForsberg @Duga's been really glitchy for a few days. She'll not post anything, and then she'll post enormous dumps.
 
10:54 PM
@Hosch250 Has there been a higher load than usual on her recently?
 
Not as far as I know.
GitHub has apparently been having trouble delivering the payloads.
 
I know chat messages have to be throttled, but no clue where I can see output of that, @Duga probably doesn't post that much about that right now either :p
 
Nope, it isn't that.
She'll absolutely dump them when she does post.
 
Then it has to be Github I think, not much to be done about it I'm afraid
I was looking at Services integration on Github yesterday but looks like they don't accept new ones anymore
 
It is getting Service Timeouts.
 
11:00 PM
 
I guess EU now has 1 GB of free space.
8
 
11:21 PM
I guess EU has now 1 GB of free space.
:(
 
OOOH
I get it now
UK has way too many names tho. GB, Britain, UK, England.
 
@ardaozkal The terms aren't synonymous. It's complicated. (← diagram now subject to revision)
 
0
Q: Test for many different criteria elegantly

AmandaI'm trying to write a basic Slack bot with slackclient python library. I want it to listen for a specific phrase in a subset of channels, and reply with a standard reply. That seems like it should be relatively straightforward. Because the call might be included in the response, I need to make s...

 
@200_success ah
thanks for making everything more confusing
(jokes aside, thanks)
 
11:38 PM
monking
 
@EthanBierlein Brexit
 
@EthanBierlein Good morning!
 
Hi!
@N3buchadnezzar Are we using "brexit" as a greeting now?
 
Sorta sounds like breakfast
 
@N3buchadnezzar yeah, just much more expensive breakfast
 
11:41 PM
Old people need breakfast too
 
11:53 PM
Post your working code on http://codereview.stackexchange.com/ to gain improvements. — chux 29 secs ago
 
00:00 - 17:0017:00 - 00:00

« first day (1147 days earlier)      last day (2871 days later) »