« first day (1225 days earlier)      last day (3088 days later) » 
00:00 - 21:0021:00 - 00:00

00:00
RELOAD! There are 2701 unanswered questions (92.7775% answered)
n @ Token::Number(_) => queue.push(n) says n should be equal to the value if the value matches Token::Number(_)
I'm not sure why you would use that though
in that scenario
Makes sense here though: op @ Token::Mul | op @ Token::Div
Cus the alternative would be messy
ohmigawd...
I found the bane of webdesign..
how can I screencap a gif?
whatever you have, I can top it
@DanPantry That tops it.
01:05
CodeReview.stackexchange.com is the place to ask questions about design improvements to working code. — Barmar 47 secs ago
01:20
As mentioned in code review if you use unique_ptr then atleast it is ensured that destructor of our MyClass is called — Kapil 39 secs ago
01:46
0
Q: Is the following a good way to use the revealing module pattern?

Mark AdelIt's a simple words counter app .. $(document).ready(function() { var wordsCounter = (function() { function init() { bindEvents(); } // cache dom var $textArea = $('#textArea'); var $words = $('#words'); //a span var $chars = $('#chars'); //a span func...

Error: {
"message": "Uncaught ReferenceError: $ is not defined",
"filename": "http://stacksnippets.net/js",
"lineno": 13,
"colno": 9
}
is it the stack snippet that's missing a library or there's something wrong with the code?
hmm there's no html/css in the snippet
I like the stack snippet idea very much, it's nice to be able to run the code right there in the post. You could add a bit of html+css - just enough to demonstrate the code in action; when I click to run your snippet, the output is Error: Uncaught ReferenceError: $ is not defined. If the code isn't meant to be executed on-site, it's probably better to edit the post and just keep it a normal code block, without the <!-- begin snippet and end snippet --> meta-comments. — Mat's Mug ♦ 55 secs ago
ah, wasn't intended as a snippet after all
 
2 hours later…
04:31
0
Q: custom basic std::variant

Olzhas ZhumabekI was amazed by std::variant and got inspired to write my own. For now, it supports constructor+destructor pair, assignment operator and get<>() function to retrieve the value. The object doesn't allocate any dynamic memory. All of the supported functions are type safe. Here is the variant: #if...

Monkevening
05:15
I think you need to be more specific and point out the exact line(s) you don't understand. BTW: Maybe codereview.stackexchange.com would be a good place to try — 4386427 9 secs ago
05:27
0
Q: Lucas sequence implementation

ralphsolCould you suggest any improvements in this lucas sequence's implementation : from mpmath.libmp import bitcount as _bitlength def _int_tuple(*i): return tuple(int(_) for _ in i) def _lucas_sequence(n, P, Q, k): """Return the modular Lucas sequence (U_k, V_k, Q_k). Given a Lucas sequ...

05:44
@Phrancis Hey
0
Q: Why is my listener not .. listening?

ShammyI am new to Java and OpenGL. I have a listener and I am trying to figure out why it isn't working? When I press a key absolutely nothing happens. Here are my files. HelloOpenGL.java package helloOpenGL; /************************************************************************************* * ...

0
Q: Encoding data into integer handles for language interpreter

luser droogAs an integral part (pun intended) of my APL interpreter (previous questions: 1 2 3 4), this suite of functions converts any data into integer handles. APL operates on arrays of data cells, so with this encoding my cells are all int but may semantically contain other types. common.h contains def...

05:59
StackOverflow is a Q&A site, not a place where someone writes code for you. I would recommend to try to convert the code yourself and post it to Code Review if it does not work. — Ruslan Batdalov just now
06:50
0
Q: Populating a ComboBox from a Range

Mat's MugI recently had quite a lot of run answering a Stack Overflow question, and I think I've gone a bit overboard and ended up with a fairly decent way of populating a ComboBox from a Range. Given a simple UserForm featuring some ComboBox1 control that I'd want to populate from a ListObject on Sheet1...

 
1 hour later…
08:00
sigh, anyone set up jenkins before?
No matter what I do or how many times I install it, the 8080 page doesn't open
port is open
logs are normal. systemctl shows ok
Naruto answer; accepted non-selfie answer with 0 score: Listener callback functions
0
Q: Multiple singleton services - How to name and access them

Luca FülbierI am currently writing a Java interface to a C library. It mostly just delegates calls and adds a object oriented layer on top of it to make integration into a regular Java program more natural. The C library talks to a server (local) which in turn communicates with a real device. My current de...

to not be surprising, I voted to close my question to fix some behavior of it. I will do it probably very soon
08:20
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: [Haskell in-place quicksort, Ord a => [a] -> IO [a]](codereview.stackexchange.com/questions/75530)
possible answer invalidation by Sarkout Mahmoud on question by Sarkout Mahmoud: codereview.stackexchange.com/posts/93120/revisions
thanks for your comments. I'm more interested in a crypto review than a code review. May I rephrase my question as: would this be safe to share publicly iv, aad,encrypted string, and salt assuming that aes256 implementation is correclty done ? — landbit 26 secs ago
08:36
0
Q: Cyclomatic complexity

iScrE4mmy first post on codereview, I hope I'm within the bounds of a proper question :) I'm using CodeClimaten to determine cyclomatic complexity. My method has complexity too high (6): def play_card(self, card: KittenCard, player: Player = None, target: Player = None): if card.selfcast and playe...

 
1 hour later…
09:44
Oh that feeling when you fix all of the bugs
0
Q: Assembly beginner exercise: Sum up all odd numbers between 1 and 2n + 1

mizechAssignment: Write a program which reads a number n from the console. Then calculates the sum of all odd numbers between 1 and 2n + 1 (incl.). Assignment also on GitHub, Exercise 0.0: https://github.com/xorpd/asm_prog_ex/blob/master/4_basic_assembly/0_branching/2_basic_conditional_branching/ex/2...

0
Q: Escape the Trolls console game

KodnotI wrote a simple console game, with the idea taken form a reddit post. There are a few specific points I'd like to be adressed: Are libraries included properly? I go by the logic "include library in a file if it is used in that file", is this correct? Is my implementation of players acceptab...

0
Q: Simple Agent in F#

Overly ExcessiveI wrote a simple agent system based on the agent type from Akka. It allows you to encapsulate a mutable state in a thread safe manner for use cases where mutation would be most convenient (like for counters). Agents must be created by invoking the module create method which requires the agent t...

0
Q: Custom basic std::variant

Olzhas ZhumabekI was amazed by std::variant and got inspired to write my own. For now, it supports constructor+destructor pair, assignment operator and get<>() function to retrieve the value. The object doesn't allocate any dynamic memory. All of the supported functions are type safe. I wanted to use static_as...

hi, @microbuster
need help
if it's not about the site, but about the broken code, SO is the only place to get help
09:50
ya i know the difference in so and cr
i need a chatbot for a room
 
1 hour later…
11:16
I think you should either be more specific about what you are trying to achieve, or then this should be moved to codereview.stackexchange.comWaiski 8 secs ago
Mmmonking
11:57
This is evil
85
A: What is 'tabnapping'?

SjoerdThis page is simultaneously a description and a demo. When you visit it, it shows a description of what tabnapping is. When you then click to another tab, it changes the tabs favicon and title to look like Gmail. Later, when the user wants to read her mail she goes to this tab thinking it is Gmai...

@skiwi You can spare a few tabs
@pacmaninbw Not anymore actually, they're all gone
Hows performance now?
Pretty good ^^
It did impact performance after all
Firefox is still a lot slower than Chrome though, but it's not too bad and I like Firefox more
I don't really use Chromes, Firefox is my browser of choice
@skiwi The way to keep tabs from building up, I always shut down my computer, because I switch between several of them. I always close down all windows before I shut down to make sure I save anything important. This includes shutting all tabs before quitting a browser.
12:08
I've got 50 important tabs open at least :P
2
@skiwi for some values of important
good day Simon
@microbuster There are a good numbers of options for chat bots others have made. All depends what you're looking to do with it. The chat bots we use on CR are programmed to help with site moderation/maintenance, if you're looking for something other than that you'd be better off looking at that link or asking around on some other SE sites
(monking!)
I think the answers on this question can use a little love codereview.stackexchange.com/questions/140822/…
12:49
@pacmaninbw Nice answers, upvoted both
@Phrancis Thanks Phrancis. Neither one is my answers, I upvoted them as well.
@Mat'sMug $ is jQuery fyi
Does anyone here use eclipse/CDT and have they noticed any problems with stopping at breakpoints?
I'm using CDT neon.
I wish MS VS worked on Linux.
what are you developing?
as in language
C++, CDT only works for C and C++.
12:59
nuclide supportsC++ debugging if that's what you're having issues with
That's @DanPantry.
When do you relocate?
Most of my stuff will be relocated on Monday, I leave the country this coming Friday after work
Best of luck!
still have a lot of stuff to take care of, though, but I should be okay to get stuff done before I move
Thanks :)
today i think I'll be spending some time on learning Python, seems a lot of security projects use it in OSS land
13:12
@DanPantry To never return?
yep :P @skiwi
@DanPantry What country are you going to?
republic of ireland
@skiwi @DanPantry Never is such a long time.
I think I've just figured out the perfect name for user2296177, "TheNeverToBeNamedOne"
Sir, that name is awful. It's just going to make me seem like a Harry Potter fan.
Zak
Zak
13:22
@pacmaninbw Obviously it should be "HeWhoMustNotBeNamed"
@Zak I think yours is better!
@user2296177 With @Zak version, could be either Harry Potter or The Lord of the Rings.
Of course, either way it makes you a dark lord
Zak
Zak
How about Null?
@Zak No, whatever/whoever he is, he exists.
Zak
Zak
@pacmaninbw Undefined?
OOOh. You might have something there.
Zak
Zak
13:36
considering the current name, NaN could also be amusing
OK, every time I try to come up with a response to that one, I just break out laughing. LOL
We've probably harassed enough for today.
Can someone make this answer go away? codereview.stackexchange.com/questions/141000/…
13:54
What's wrong with it?
NaNNaNNaNBaTMaN
6
House of Cards is goooooooood.
@user2296177 It doesn't address the code at all.
It provides a mathematical proof as an answer, which does not relate to the problem statement.
@pacmaninbw I thought he was addressing the code by saying no looping was necessary.
It's definitely a very, very short answer though.
That answer is already gone, the existing answer should probably go next.
13:59
I hear you. I guess some moderator will decide.
Achievement unlocked: Earn a star on 10 September 2016
@skiwi OK, what does that refer to?
@pacmaninbw To NaNNaNNaNBaTMaN of course
@user2296177 Re-read the problem statement, All ODD numbers between N and 2N+1, not all numbers.
I see.
Then yes, it is 100% wrong and should be taken down, I agree.
14:14
Ohh, GitHub tells you the project's license on the home page now, along with the commit numbers and stuff.
@MachineLearning this is a simple code example to solve a relatively simple concept. It is the OP's responsibility to take it as such and apply it in their code base in a way that does not increase technical debt. Those conversations are far more applicable to codereview.stackexchange.com. — David L 9 secs ago
14:31
@user2296177 Actually the OP's code is broken, I've flag the question.
All the code in this question is broken and it is generating incorrect Answers. codereview.stackexchange.com/questions/141000/…
@skiwi OK, now you have 2 stars.
14:54
@pacmaninbw I wish I knew Assembly better so that I could verify your claim.
However, I think @Jamal knows assembly
Is he around?
Don't know.
NP, it can wait.
I would like to add though that in my opinion the current answer is definitely a valid answer. It might be incorrect but that's another story. If you don't like it, downvote it.
But I think it is definitely a valid code review to say "There is a formula for this, no iteration necessary"
The answer is valid to the question, which is why I'm flagging the question. I'd like him to provide a little more information.
I didn't flag the answer.
15:03
1
Q: Emojify an image

Guilherme AlmeidaLast night I was messing with image programming in C# and I tried to make a program that takes an image and transforms it into another image, built with emojis. EmojifyEngine.cs /// <summary> /// Holds all methods involved in transforming a image into a emojified version of the image. /// </sum...

This unload_event wrapper is no longer used in Chrome javascript shim layer for extensions (deleted in 2014). Try listening to the event via devtools (F12) - Sources panel - Event listener breakpoints - Load - [x] unload. — wOxxOm 1 min ago
@Duga codereview in the URL
@SimonForsberg I added an answer to show why the original code is broken.
15:25
0
Q: Efficient Prime Sieve - Haskell

MyridiumI'm new to Haskell, and am trying to learn the basics with a simple function that will calculate the list of primes up to a given value (using the Sieve of Eratosthenes). Here is my code so far, which has the problem of becoming very slow for large inputs nmax: primes :: Integer -> [Integer] pri...

15:38
0
Q: Remove repeated characters

funwithlinxI was trying the below problem from a competitive forum.The minimum test cases are passed. Do please let me know your comments. Remove the repeated characters from the input string and output the resulted string. Input string: "abcabd" Output string: "abcd" string input = "abcabd"; string outpu...

@Captain Obvious Remove repeated characters is broken code.
@pacmaninbw usually we don't require imports for java code.
I don't see why we need using statements for C++
additionally you can reply directly to a message to type less :)
What about the wrapping function.
@CaptainObvious broken (according to pacmaninbw)
0
Q: Javascript module design: performance?

user777466I need to turn a lot of html elements as editable elements. You will double click on the element to edit, press enter to validate (send a PUT to the RESTapi), press esc to undo. I've written this piece of code: var editable = (function() { var DELAY = 300, clicks = 0, timer...

-1
Q: C# - How to run a method in BackGroundWorker and display ProgressBar in 1 dialog?

MinhKiyoI have a function to export a list of students into a CSV file when I click the button[Export To CSV], a dialog will appear with Progress bar with percentage completed, when the function is done, the Progress bar displays 100% and show a message: Export Finished!, and close dialog. I was usi...

15:49
@pacmaninbw I don't think that's really necessary.
@CaptainObvious broken, CVs please
Flagged, not enough rep for CV.
I'd like to get someone interested with simple Python program (not FizzBuzz), he's a gamer, any suggestion? Simple console game maybe?
(they have no coding experience but really good PC knowledge)
Games are usually not simple. I'd start with Tic-Tac-Toe, maybe
15:54
Monking Ethan
@Phrancis tic-tac-toe or just something text based could work (think old school MUDs)
MUDs?
Hi @EthanBierlein
@Phrancis text based games
Oh ok like adventure game or whatever
15:57
nobody gets interested by writing 100 if statements
go for tic-tac-toe
Use tables or maps rather than 100s of if statements.
Take a guess how someone new to programming will implement it
I don't expect any votes for this, did I miss represent anything in my answer here codereview.stackexchange.com/questions/141000/…
@pacmaninbw why are you answering in C++ to an assembly question?
16:02
@JeroenVannevel and thats how they learn though
Because I don't want to spend 3 hours programming in assembly, and the OP already admits to looping through all numbers in a comment.
@DanPantry learning comes after interest. This first game is to get them interested, not to get them to do it the right way
@pacmaninbw stupid reason, that's why you got my downvote
pointless answer
@pacmaninbw If both the question and answer are incorrect, shouldn't the question be closed instead of answered?
I think that if the question's problem statement says one thing, and the code does another, then the code is not working and the question should be put on-hold until it is fixed.
@Mast I flagged it for closure already.
16:06
@pacmaninbw Code it in C, get the generated assembly and post that as an answer, lol
So keep your comment, remove the answer and let the VTCs commence.
@Mast Agreed
Will do.
Answer removed.
The remaining answer is technically an answer, just a lousy one.
It should go, IMO, but I'm not sure it's flag worthy.
I'll do TTT it is more interesting indeed and probably decent practice
16:10
The remaining answer is incorrect based on the little program I just removed.
21 != 91
4
Gotta love CSS... and my own stupidity... I click a button, the button disappears.
@skiwi That's ok if it did what else it was supposed to do.
;)
0
Q: A simple Python IDE in Java Swing

Jacob GarbyI've made an IDE in Java, using swing. It uses a couple of resources (prefs.json and help.txt) and some imported jar files for reading the json. I know the code's quite long, but the answer doesn't have to be a very detailed one. Anyway, here's the code: package io.j4cobgarby.github; import jav...

> This book doesn't tell you how to write faster code, or how to write code with fewer memory leaks, or even how to debug code at all. What it does tell you is how to build your product in better ways, how to keep track of the code that you write, and how to track the bugs in your code. Plus some more things you'll wish you had known before starting a project.
I like this book already.
5
Practical Development Environments, O'Reilly. And yes, I wish I got this book 2 years ago instead of last Friday.
> Building from scratch (also known as a clean build) each time is often the only way to get the product to build reliably. This takes so long that the developer goes off and does something else. Consequently, every developer thinks that his build tool is too slow.
16:33
@Mast would you recommend it for reading?
@DanPantry Do you want a provisional verdict or should I tell you when I finished the entire thing?
ah, i thought you had already finished it. neverm ind
I'm about halfway.
So far it's really good.
I dont' think I'll have much opportunity to work on real code projects at Riot (as I'm a sec engineer), so I may have more time for OSS
It makes you think about why you build your builds like you build them. How it can be done better. Where the bottlenecks are. What you should look for in a testing environment.
16:41
@Mast Sound's like it might be a good book for syb0rg.
This question appears to be off-topic because it is a code review request. This is better suited to the Code Review Stack Exchange site. Before posting there be sure to read their FAQ to ensure that your question meets their guidelines. — John Conde 18 secs ago
Some of the information provided is really back-to-basics, but I think it's a good read for anyone interested in helping with long-term projects.
Or those involved in long-term projects at work.
Building, testing, automating, maintaining, communicating, it's all covered.
@SimonForsberg Any interest in adding a new meme "TTYL" Talk To You Later"
@pacmaninbw Memes aren't created. They happen.
16:48
Oh Well,
TTYL
This would probable work better at codeview.stackexchage: codereview.stackexchange.com. I suggest asking there. — Mr.goosberry 17 secs ago
TTYL... pretty sure people were using that back on IRC ca. 1999 or so =)
Probably.
don't we use BTW.TTGH? :p
Among other things, yea.
16:58
I <3 Python3 :D
from typing import Dict
# Note: The 'ttt' acronym is used for TicTacToe throughout this code.

def get_blank_ttt_board() -> Dict[int, str]:
	return {
		1: None, 2: None, 3: None,
		4: None, 5: None, 6: None,
		7: None, 8: None, 9: None
	}
Python is awesome.
types? O:
that's... a lot of spacing though
that'sn ot 8 spaces is it
@DanPantry Yes and no.
17:00
@DanPantry repl.it uses tabs instead of spaces for some obscure reason
Type hints.
Does it make sense to use None in each dict entry for blank board?
@Phrancis Depends on how you're going to implement your X's and O's.
But None can be used for empty fields, yea. That's quite readable.
I'd use an Enum-style construct.
For the Xs and Os?
Not-set, X and O.
3 possible states, the rest is invalid.
17:06
Makes sense, didn't know Python had enums too
(not surprised or anything)
Batteries included, remember? ^^
Added since 3.4, before that you had to improvise.
Oh man
Board = NewType('Board', Dict[int, str])

def get_blank_board() -> Board:
    ...
NewType rocks
> As soon as a project has more than one person working on it, communication within the group becomes vital. By default, communication seems to occur in the slowest, most error-prone ways that it can. If there is some choice between two things, then both choices will usually be made within a project, sometimes at the same time!
17:24
class CellState(Enum):
	NotSet = None
	X = 'X'
	O = 'O'
@Mast Like this^^?
@Phrancis Yea, something like that.
You could set NotSet to - for type consistency, but that's a matter of preference I guess.
@Phrancis You get none, you get none and you get none!
@Phrancis What's that? I Python and don't even know that
@skiwi It's recent.
Like 3.7 or something?
3.7 isn't out yet AFAIK.
3.6 was released this month.
possible answer invalidation by 200_success on question by Ayan: codereview.stackexchange.com/posts/140939/revisions
That's a whole new typing module?
Interesting, I should more often
-1
Q: write a code that will print last name and address

Mizan RahmanGiven the following data as input, write a standalone executable or standalone script that will print to the console or write to a text file the following: Each household and number of occupants followed by: Each First Name, Last Name, Address and Age sorted by Last Name then First Name where the...

17:37
@skiwi s/should/should read documentation/
@CaptainObvious HAMMERTIME!
Why do people even post such questions...
It's Crap. With a capital C.
Unrelated, from a Anno 1404 review:
> Fortunately, the game keeps track of the time and after a few hours of gameplay will ask the player to take a break and a coffee - a saveguard which is much needed.
Developers with a sense of humor.
Wow, the Javascript console is so clear
Was trying var if = something;
> SyntaxError: Missing variable name
Took a while before I realized what the error was
0
Q: Python Prime Testing

Neil A.This code seems surprisingly fast at checking if a number is prime. def is_prime(number: int) -> bool: """Checks if a number is prime or not""" # number must be integer if type(number) != int: raise TypeError("Non-integers cannot be tested for primality.") # negatives are...

Are there any C++ regulars in this chat aside from pacman?
17:54
Depends on what you're going to ask :-)
Just shoot and we'll see.
I just wanted to know who did C++ in here, because there's so many C# people.
I'm C# main but I'm learning C++ atm.
18:10
@arda I actually started out with C# and abandoned it once I learned enough C++
C++ is too complicated to do simple stuff. I'll probably keep using both C# and C++
Simple stuff like what?
i feel C# is also very clunky to make simple scripts and stuff
@Mast a saveguard which is much needed ignored.
but the older anno games already did that
I don't recall Anno 1602 ever telling me to take a break.
18:15
it started with 1503
they did it every hour.
1701 also did it
Ah.
1404 doesn't do it every hour, but every two IIRC
but let's not talk about 2070, okay?
@user2296177 for example I made a small project yesterday. I was waiting for the new episode of Steven Universe to be released on a site (a total legit website!) and needed to take a break from spamming f5 to eat, so I just sticked together like 10 lines of code to check for me (and trigger an ifttt maker channel thingy to send me an sms) in 5 minutes. twitter.com/ardaozkal/status/774160067952160768
I could probably make it faster and less cpu depending or whatever if I used C++, but I don't think that I could be able to do it in 5 minutes
@DanPantry hey, dyed hair to brown?
or is that red?
dark red and brown :)
just the lighting does not show the red very well
cool
18:19
I don't believe the C++ standard library ships with anything ready to do anything like that.
So I can see why it'd be faster to do it with a language whose library does.
You don't write C++ because it's easy. You write C++ because the resulting code can be optimized just the way you want it.
Memory efficient? Sure. CPU efficient more relevant than memory? Let's do that instead.
It's not a rapid-prototyping language.
If you want rapid-prototyping, use Python instead. Python can do anything and everything.
Hey @skiwi, while working on OLog I noticed you're quite proficient at writing issues. Is there a method to your magic?
You get used to writing them if you write code like @skiwi does
18:35
Issues > // TODOs
@Phrancis main = // TODO
That should probably be split-up into something smaller.
@Mast Just write them down whenever you see one, but think about it beforehand
@JeroenVannevel Buuuuuuurn
18:50
> "Fixed Paul's ugly code." "I hate this parser!" "Stupid customer request implemented against my better judgment." Such commit messages seem funny at the time or may temporarily relieve some frustration, but remember that the purpose of SCM tools is to store information for a long time. None of these messages will tell someone looking at the code two years from now why you bothered to change it at all; it's just noise to be ignored.
> Take a breath and write a message that you might want to find yourself reading a few months from now. Huge messages rarely get fully read either. If the message is that large, then add it to the project documentation elsewhere and refer to that file in the commit message.
Proof of how often good advice got ignored.
damn penguin
19:10
This question doesnt belong to here. See codereview.stackexchange.com — ali 48 secs ago
Smoking old documentation is really fun /s
/**
 * Returns a global variable.
 *
 * Needed because a @grant other than none puts the script
 * in a separate scope.
 *
 * @param {string} name The name of the global variable.
 */
function getWindowVariable(name) {
    return window.eval(name);
}
What is needed because <insert reason>?
@ali It would need some serious clean-up to fit the guidelines first. As it currently stands, it's not clear what he's trying to achieve which would make it Unclear at CR. — Mast 59 secs ago
@skiwi You're returning a window.eval in global scope?
Do you even know what madness lies in front of you?
@Mast I need it for similar reasons as when I needed it in OGNext ;)
@skiwi It's a wrapper. And an ugly one at that.
It's Java. On a C++ question. Without reviewing what's wrong with his code. That makes it a non-answer. — Mast 3 mins ago
19:21
This is not evil at all...
var convertFormattedPriceToCents = getWindowVariable("window.Formatters.convertFormattedPriceToCents");
var formatPrice = getWindowVariable("window.Formatters.formatPrice");
price = formatPrice(convertFormattedPriceToCents(price));
That is a poor comment at the top of your function. Please replace it with a documentation string that explains the purpose of the function, as in this part of PEP8. Also, this seems to be a question for CodeReview, not this site. — Rory Daulton 12 secs ago
@skiwi You formatPrice a FormattedPrice?
That doesn't make sense.
@Duga RBA, possibly incoming.
@ceving, tried to research whether this question should be posted to codereview insted, but I am not yet convinced that it is off-topic for SO. This guide to code review for SO users specifically advises: "Please do not vote to close with a custom reason that 'it belongs on Code Review'" — Tomas Langkaas 21 secs ago
19:36
0
Q: Most used user defined functions in python

Bhishan PoudelHere is my favorite user defined function in python, def replace_outfolders(outfolders): ''' Replaces given list of output folders ''' # imports import shutil,os for outfolder in outfolders: if os.path.exists(outfolder): print('Replacing folder: ', outf...

@CaptainObvious I highly suspect he didn't write it himself.
@Mast Not much makes sense
This website formats numbers when you leave a field, I cannot mimic that functionality in my userscript though for whatever reason
0
Q: Printing the hierarchical representation of a self-referential table in Python with recursion

Matthew MoisenI have a self referential database table: CREATE TABLE category ( id INT PRIMARY KEY, name VARCHAR, parent_id INT REFERENCES category (id) ); And the following INSERTS: INSERT INTO category (id, name, parent_id) VALUES (1, 'Programming', null); INSERT INTO category (id, name, par...

20:06
@skiwi
77
Q: What is 'tabnapping'?

Matas VaitkeviciusWikipedia is not very explicit on this, The exploit employs scripts to rewrite a page of average interest with an impersonation of a well-known website, when left unattended for some time. What is 'tabnapping', how does one do it?

I don't know why, I read this and immediately thought of you =)
8 hours ago, by skiwi
85
A: What is 'tabnapping'?

SjoerdThis page is simultaneously a description and a demo. When you visit it, it shows a description of what tabnapping is. When you then click to another tab, it changes the tabs favicon and title to look like Gmail. Later, when the user wants to read her mail she goes to this tab thinking it is Gmai...

@Mat'sMug It's okay, I immediately thought of myself too
4
Naruto answer; accepted non-selfie answer with 0 score: Ackermann function
@Mat'sMug He's got so many tabs open that the chance of actually getting to any phishing one is extremely low, he's safe.
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: QNetworkReply network reply timeout helper
20:24
@skiwi wtf are you doing
and why
@skiwi oh god
@Mat'sMug He has so many tabs open, the chances of you linking to a site he doesn't have open already are slim.
@CaptainObvious RBA
0
Q: Handling User input *UPDATE*

chris360Original Code: Getting name from user, and handling any errors in C Fixed the bugs, anything else to consider? #include "stdafx.h" #include <stdio.h> #include <string.h> #include <ctype.h> #include <stdbool.h> #define BUFFSIZE 10 /*Checks to see if name contains actual characters and not jus...

0
Q: Using a new thread to post to observers

J_StrautonI have implemented my own Observer pattern. I want to post my events in a new thread. This thread would simply call all the the observers/listeners with the posted event. public class EventManager { public void post(Object event) { new Thread(new MyRunnable(this, event)).start();...

20:55
Hrngh
class Player:
	score = 0
	def __init__(self, player_num: PlayerNum, token: Token, name: str):
		self.player_num = player_num
		self.token = token
		self.name = name
	def add_win(self):
		score += 1
If I call add_win on an instance of Player I get UnboundLocalError: local variable 'score' referenced before assignment
shoudln't it be self.score
or is that not how python works
I tried that too but didn't seem to work
@DanPantry That is how the Python works
Pretty sure you need self.score = 0 in the constructor instead
00:00 - 21:0021:00 - 00:00

« first day (1225 days earlier)      last day (3088 days later) »