« first day (2028 days earlier)      last day (2923 days later) » 

7:00 PM
What do you mean by coding things as they're now?
 
@direprobs various PyTypes in the system are initialized lazily
and of course the lazy initialization is triggered very incorrectly.
 
Type initialization was probably the most headache-inducing part of writing KevinScript, so I'm not surprised if it's responsible for some WTFs even in professional languages
 
Let's have faith on the organization, they really did great job
 
Last night I played a board game called Puerto Rico, which is very interesting in that it has zero elements of randomness and nearly all information is publically known between players.
The exception being that when you collect victory chips, you can hide them so your opponents can't easily count how many you have. But they could keep a tally in a notebook or something if they were really inclined to do so.
So it's a game of pure strategy. When deciding on an action, you know exactly how it will benefit/harm you and your opponents.
 
Interesting. I think I would hate it.
lol
 
7:10 PM
I don't even know how to play chess or poker
 
The challenge is trying to predict what your opponents will do in response to each of your potential moves, and trying to predict what they'll predict that you'll do in response to their moves... etc down as many plies as you can hold in your head.
 
Oooo, I've always wanted to play Puerto Rico. I've heard great things.
 
I'm bad at this game. I can explore the move tree to a depth of like, one and a half.
I worry that I don't have a fully developed Theory of Mind and that's why I can't predict what the other players will do.
Not being able to determine whether I have a theory of mind is also worrisome. So I'm short on both empathy and introspection.
At least these problems only seem to manifest when I'm playing board games.
 
When it comes to FPSs I tend to have a good ToM
especially if I play it for a while
I was really good at predicting where the OpForces would be going in CS
unfortunately I was terrible at a) getting my team to go the same way and b) not dying
 
@Kevin yeah I think Puerto Rico is a brilliant game
 
7:19 PM
cbg
 
I was doing well gumming up the biggest ship with tiny deliveries of sugar, until half of my opponents bought their own private boats. So much for shipping denial.
 
@Kevin I'm also fairly bad at that. I can go about depth=2 in chess, but I also struggle in whittling it down based on likelihood, so I try and analyse all moves
 
I think I really undervalue the worth of tobacco and coffee. I was short on money the whole game and could really have used more profitable trading phases.
 
I have a really weird bit of python that refuses to accept a list is empty...
 
Yeah if I remember correctly, that's a bit like only going for the cheapest and most expensive sets in Monopoly because they have the most obvious benefits
 
7:21 PM
I print the length of the list an it says it is 0
 
Wild guess: at some point you did len = lambda x: 0
 
but when I put it into an IF lent(list) == 0: it returns false
nope
 
or print = lambda *args: sys.stdout.write("0") :-P
 
if len(joker_limitation.limitation_checker(grouping)) == 0:
print "empty"
else:
print "stuff"
 
@LemusThelroy do you get that he's guessing because you're not giving enough info to diagnose? :)
 
7:23 PM
if I print len(joker_limitation.limitation_checker(grouping))
I get 0
 
The code you've provided looks fine. At this point, I can only provide non-joke help if you can produce an MCVE for us.
 
@RobertGrant hope that's a bit more specific
 
DSM
Sounds like the length is zero.
 
@LemusThelroy nah - we need to see the other bit. Saying len(something) is 0 when it shouldn't be isn't helpful; we'd need to see what the something is
I say we; someone else here who's clever needs to. I mostly stick with out of date references to pop culture.
 
I don't want to flood this chat room with the function that provides the empty list lol so maybe this is best of as a question?
 
7:25 PM
Or just paste in dpaste.com or some other pastey website
 
DSM
I suspect that during the process of making an MCVE itself you'll realize your mistake.
 
the amount of functions I am calling to get to get the data would make the MCVE huge tbh
 
Dude you've already flooded it with half your code and people having to ask for more :/
 
at least I have learnt what an MCVE is...learnt something new!
 
Dude where's my car MCVE?
 
DSM
7:31 PM
@LemusThelroy: everyone says that, but there are only four names in len(joker_limitation.limitation_checker(grouping)). That's not a lot to check.
 
@LemusThelroy is the list itself falsy?
 
I like making MCVEs. It's cathartic to gradually destroy the code that has wronged you.
6
 
also, you're talking about a list
yet, it is not a list, it is multiple return values from multiple function calls.
 
@LemusThelroy you're still relatively new to the room, but you've been here a while now, so I think this next part isn't too out of order: you need to start asking better questions. A lot of the time you seem to either be asking questions and only providing half of the necessary detail, or you're asking questions that are easily Googleable if you were to take some of your own time, rather than assuming someone else will take the time for you.
Please be considerate when asking questions here, good will is a finite resource.
 
@Kevin I've thought Kevin M Granger is your alter-ego because you want people to think you're modest now
 
7:34 PM
I'm going to lie low for a while...
 
There's no need to lie low, but please just be more considerate in your questions.
 
@LemusThelroy just remember that not all of us are psychic/clairvoyant/telepathic.
 
Apr 1 at 14:19, by Kevin
@Programmer There are no impostor Kevins. Only projections of the shadow of the Platonic Ideal Kevin into your 3-dimensional realm.
 
If I thought the detail I provided was too brief, I honestly wouldn't have bothered. And with this particular problem, I have been searching around the internet to see if anyone has had something similar. I do know that I ask a lot of questions though.
 
Dear sweet and fluffy Lord I love mechanical keyboards.
 
7:37 PM
@LemusThelroy at first you said: "a list"
but then you said it is a return value from a function call
so you're possibly testing 2 different objects
 
What type of switches do you use Fizzy?
 
@AnttiHaapala In all honesty, I am so new to python that you telling me that has at least taught me something
 
The real problem is, "I've got a problem with [vague thing], anybody have any ideas?" sometimes does get an answer because it is enough information to diagnose the problem. But below a certain level of experience, it's very difficult to distinguish those kinds of problems from hopelessly vague ones.
 
@LemusThelroy you just need to debug it. E.g. are you print()ing what you function returns inside your function before you return it? Don't assume anything is doing what you think it is without checking. Checking everything will let you diagnose.
 
@Ffisegydd don't forget to flip the spacebar
 
7:38 PM
bg
cbg *
 
at the same time all others were thinking of ways how a single object could possibly fail the len vs printing test.
 
@RobertGrant yeah my code is littered with print statements
 
For example, "My program is outputting 0.30000000001 instead of 0.3" is something we don't even need code to diagnose. In a flash, we'll link to the page explaining floating point numbers.
 
@Programmer Just the proprietary ones from steelseries.
They're not Cherry or anything.
 
To give a psychic guess, it's a generator.
 
DSM
7:40 PM
print(type(x), repr(x)) where x is the name in question should be the first step in almost any debugging process.
 
Generator would have a length > 0 though?
 
People see us answer questions of that kind and think "wow these guys must be magic" and assume all questions of that level of specificity are answerable. And there's nothing inherently lazy or evil about that assumption.
 
@RobertGrant Oh, right, duh. Never mind.
 
DSM
You can't take the length of a generator.
 
Some really weird object with __len__ defined really stupidly?
 
7:42 PM
Just thought of a cool little library, a modified print function that will print lots of things about a variable. For example fizzyprint(some_list) would actually print the type, the var itself, if it was a container then the length, etc
 
@Morgan That was my next wild guess :-)
 
What dunderscore does python use to determine if something is truthy?
 
Depends on the version I think?
 
__eq__?
For 3.x.
 
IIRC bool or nonzero, depending on version.
 
7:43 PM
__bool__ for 3.
 
Oh, duh, __bool__. I forgot about that.
 
That little-known* difference caused me a number of hours of grief, many months back.
(*little-known to me, at least)
 
class WhatIsThis:
    def __len__(self):
        return 0

    def __bool__(self):
        return True

if WhatIsThis():
    print(len(WhatIsThis()))
There we go, that's the only solution. ;)
 
That's a solution, not the only solution :P
 
I'm pretty sure it's the only one.
 
7:45 PM
Narp.
 
DSM
Since no transcript actually proved that what the OP said was occurring was actually occurring, we have no evidence that the object returned has a length of 0 even in the normal sense.
 
Preeeeeeeetty sure.
 
I'm absolutely sure.
 
I half-suspect a __len__ implementation which does return the correct length of the underlying data, but which also performs some kind of mutation on the object.
 
Want to know my solution? Oh Dennis old pal?
 
7:46 PM
A len that exhausted an internal generator?
 
PEBCAK.
 
So calling len once causes it to correctly return a nonzero amount, and calling it again causes it to empty the collection for some reason and correctly return zero
 
DSM
I just want you to stop saying "narp".
 
Not a fan of Hot Fuzz?
 
@Ffisegydd I prefer PICNIC, but yeah.
God I love that movie.
 
7:47 PM
I've never heard PICNIC.
 
DSM
Never having seen it, I think I have to go with "no".
 
I shall assimilate it.
 
@Ffisegydd Problem In Chair, Not In Computer.
 
It's a very good movie.
 
Definitely worth watching.
 
7:48 PM
Same guys that did Shaun Of The Dead.
 
@DSM yarp.
 
DSM
Shaun of the Dead: also never seen.
 
Wow.
 
That one's my favorite of the Cornetto Trilogy.
 
DSM
What's the third movie?
 
7:49 PM
Hot Fuzz is a very close second though.
The World's End.
 
DSM
And I score the trey!
 
At World's End always looked crap, never seen it.
 
It was, uh, not very good.
I was super disappointed.
 
yeah. I didn't like it either
 
Well, DSM definitely just went down on the internal leaderboard I keep for you lot.
 
7:50 PM
It's basically sotd and hf combined. Badly.
 
Now, This Is The End, while dumb as hell, was hilarious.
 
As a data scientist and ex-physicist he was doing really well, and who doesn't love a Canadian? But now? Well.
 
DSM
Watch it be my favourite, if I ever get around to watching them.
@Ffisegydd: I actually described myself as a data physicist on my CV this time, because why not?
 
I just want Super Troopers 2 :P
 
This does now mean that @idjaw is top of the Canadian sub-league.
 
DSM
7:53 PM
I can't complain. I had a good run. The Inspector and me can commiserate together.
 
\o/
 
This is a sad day for Canada, and therefore, the world.
 
I'll wear your disappointment proudly
 
That is not sad for my ass @Ffisegydd
narcissism
 
8:01 PM
^^
 
@BillalBEGUERADJ okay I'll bite. What?
 
@Robert I wouldn't.
 
% python3.5 -S
Python 3.5.0+ (default, Oct 11 2015, 09:05:38)
[GCC 5.2.1 20151010] on linux
>>> dir(iter([]))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: object does not provide __dir__
 
That seems weird
 
DSM
8:12 PM
Those are some murky waters you've been exploring lately, Antti.
 
But you probably already knew that
 
what's that -S flag?
 
@RobertGrant you forgot -S
 
Oh sorry, I didn't see that flag
 
-S : don't imply 'import site' on initialization
 
8:13 PM
yes.
 
Yeah, I see :)
 
So... hmmm. Wait what? lol
 
DSM
The whole thing seems like some very flaky design choices, to this inexpert eye.
 
the import site will do something that makes the bug go away for this class
@DSM I agree
and these design choices were present already in 2.3 and even before...
and perhaps by Guido himself :d
 
chat.stackoverflow.com/transcript/message/30370368#30370368 - And if you're using VCS, then you probably committed, right? RIGHT??
@DSM It's because you're not dutch ^_^
 
DSM
8:16 PM
The closest I can get is that one of my best friends is Frisian.
 
"Here is a patch against 2.7 that restores the solution from issue551412, but returns NULL if type->tp_mro is still NULL after calling PyType_Ready. I found one place in tests when this is happened (CIOTest.test_IOBase_finalize in test_io)."
hem?? :D
like... wat?
 
8:31 PM
Weird. It looks like if you access iter([]).__dir__ manually, suddenly dir(iter([])) starts finding the __dir__ method.
Maybe something's wrong with the method cache.
 
Isn't it saying that it's only initialised when you request an attribute like ____dir____?
Argh can't work out underscores
 
Oh, I found your bug report. PyType_Ready isn't getting called, apparently.
 
__dir__?
nope
wait
what!
That was really weird. __dir__ was italics at first, then a moment later it changed to fixed font.
It did it again! Crazy -_-
 
@WayneWerner yeah, chat is buggy.
apparently when you add a new message, the markup is parsed in javascript; that is shown in green. Then the server will parse it correctly and return the html, which will replace the initially shown one.
 
oh that's wild. I don't think that I ever would have imagined that :P
Maybe they should just port to CommonMark ;) spec.commonmark.org/dingus
 
8:47 PM
Or just fix their js
Seems bizarre
 
hardly the only bug
@WayneWerner you can test the behaviour by disconnecting, then entering `__dir__`
 
Nice.
 
lol, more nice bugs:
() = []
[] = ()
One of them isn't a SyntaxError. Can you guess which?
 
the one that has a mutable on the left?
wait () isn't even a tuple
or is it?
nailed it
 
9:03 PM
it is
well,
(a, b) is mutable or not?
 
In [33]: [] = ()

In [34]: () = []
  File "<ipython-input-34-c7775171f31d>", line 1
    () = []
           ^
SyntaxError: can't assign to ()
I know it's cheating, but I like to cheat
 
then (a, b) = [5, 6]
 
Don't get why [] = () works
 
^ that
 
yup
hence "bug"?
 
9:04 PM
it unpacks an empty iterable to an empty sequence of names
 
is None mutable?
 
Yeah
 
nevermind
 
DSM
? You can't mutate None, and you can't even rebind it.
 
9:06 PM
@DSM of course you can mutate None :P
 
@RobertGrant I think [] = () is actually the bug. At least it feels that way. Because with () = [] you're trying to unpack [] into nothing, and that fails. It feels like the other way around should also fail.
 
Yeah well () isn't a tuple, is it? No comma?
 
DSM
@AnttiHaapala: ?
 
@DSM ctypes :D
 
I'm probably missing something there, but that's as far as I got :)
 
DSM
9:08 PM
@AnttiHaapala: :-P
@AnttiHaapala: ... :-P
 
@RobertGrant type(())
 
Smartass :)
 
hmm ubuntu 16.04 dropped sslv3? :d
default options disable
 
Damn time
TLS1.0 was out in 99
 
9:12 PM
I spose that means that python can't talk to servers whose highest protocol is v3?
 
yeah, ofc.
 
I guess that's a bit interesting
 
though...
 
I was told by smart-looking gentlemen to ditch ubuntu and use something less commercial
 
if you wrote that as "python can't securely connect to a server whose highest protocol is v3"
 
9:13 PM
a distro made by people who hadn't removed their original open source obligations from their memento
 
@AnttiHaapala do you mean v3 is insecure, or it'll do it another way that's also insecure?
 
of course v3 is insecure
 
@RobertGrant I read that as the latter
 
Yeah I know dude
I'm trying to figure out what you're saying
Please attempt unbarbed responses
 
lol :D
 
9:15 PM
Antti's being so barbie today, right?
 
It's beyond my ken
 
well. What is the point of using SSL/TLS -> to make a secure connection to somewhere.
 
<waits for Hello Kitty gif from davidism>
 
DSM
I was trying to think of a joke on "skipper" but couldn't get there in time.
 
@AndrasDeak I'm pretty sure "too commercial" is an art student's vague criticism of anything vaguely money-related.
Even though they're pretty happy to wear clothes and drink coffee, both of which rely on highly optimised and mechanised supply chains, with margins squeezed to within an inch of their lives.
 
9:17 PM
firefox 32 has stopped supporting SSLv3
 
DSM
I use ubuntu not because of anything technical but because it was the most common linux-for-dummies at the time, and I want to minimize my configuration headaches.
 
@Kevin <insert slowpoke meme> you could have a dust allergy
@RobertGrant no, that was just me paraphrasing a longer discussion:)
 
@AndrasDeak and how was your PPE? :D
 
they explained to me how canonical's become quite shady in recent times
@RobertGrant my what?:D
personal protective equipment?
 
Just kidding - it's an Oxbridge degree. Politics, philosophy and economics.
 
9:20 PM
ah:D
I'm offended
by the economics part
 
turning SSLv3 off by default in openssl is the only non-shady thing I've heard of canonical lately
 
DSM
I have a friend who's an economist. They look down on the finance people. I don't know who the finance people look down on.
 
Lol the economics part is the best bit!
@AnttiHaapala making python3 the default? (Soon)
(If it's not already done)
 
you can possibly glimpse my glaring ignorance when it comes to computers
 
DSM
Ah, friend just invited me to tonight's Jays game, so I'm off. Blue Jays-themed rhubarb for all!
 
9:26 PM
good night:(
I'll harass you later with ubuntu, then. I have time. flings scythe
Sanity check please: did the accepted answer on this post by 200k user mess the code up even further?
the two simple problems would be 1. return that yamming answer and 2. read it and store only once
now the accepted one doesn't teach OP to return, but tries some scoping magic, meanwhile moving all the ifs into the function that is supposed to call itself
 
Presumably he meant conversion instead of mainquestion() as the first if?
 
wty?
 
Dunno, I just thought it looked like a bizarre way to structure the code
 
9:44 PM
but the indentation's off too.....argh
 
@RobertGrant "default"?
it cannot be done because it'd break too much stuff
 
9:59 PM
Either I'm going crazy, or you have massive bugs in your code. 1: the whole if block is indented inside the mainquestion(), never getting called for the first time. 2: you should teach OP to return the value rather than using scoping tricks, which is one of the main issues with the original code. 3: you're not passing conversion to the conversion routines, the originals would try to read user input again. 4: you're using recursion to restart the code. Python (in)famously doesn't optimize tail recursion calls, so this should generally be avoided, and definitely not used in answers. — Andras Deak 9 secs ago
242k user, and while multi gold badger in other tags, he still has 360+ score in from 200+ answers
 
I don't get your point about the if statement indentation, but then I'm very tired
Can I comment that I don't know why on earth he's using in instead of ==?
 
be my guest:P
my point is that his python file doesn't have any statements on the outermost level, only function definitions
I'm mostly interested in his reaction, to be honest
so far he's added the call to mainfunction(), which was the indentation issue
Maybe he learned Python the hard way.
 
Yeah and without acknowledging the edit in the answer, which is annoying. But anyway.
 
he's still only addressed #1 of my issues
as it is, it still doesn't run properly
OK, I screwed up #3, he's right on that one
and #2 and #4 are really conceptual issues, I disagree with giving answers like this on SO as too many stupid noobs copy these (anti)patterns
but the program should work like this
 
I understand, but SO isn't a code writing service; it's a place to give canonical answers to valid questions. On that basis, even if answering this quality of question were a good idea, I don't see how minimising the changes could ever be. — Robert Grant 52 secs ago
 
10:13 PM
Yesss Antti to the rescue!:D
Please do not use recursion for a loop in Python. Other issues in your code are just matter of very bad style, but using recursion where a simple loop would suffice is really broken in Python. — Antti Haapala 2 mins ago
 
Yeah, upvoted that. Succinct.
 
and much more authoritative than our measly <10k jabs
 
well I added some more :D
 
updated;)
sheeeet, I have to pack my stuff for leaving tomorrow!
 
rep does not show on comments
 
10:15 PM
@AnttiHaapala I'm sure they can sniff it above 100k
 
ah, tooltip on username shows it
 
no way:O
whooooah maaaaan
 
lol
oh well, delv'd that post
 
I am become Antti, the destroyer of crap.
 
10:48 PM
hey guys, can someone give me a quick heads up how to "compile"/install a python-gui application on osx?
 
I think you can skip the compile part
 
do I just ran the python foo.py install? I'm just wondering which python file to call
 
Are you sure you want to use it if you don't even know how to use it? Have you tried contacting the author?
what if it summons the meteors that killed the dinosaurs?
 
Well... I know what it's supposed to do, I actually just want to play around with it. But I have no clue how to run a python-gui app :-P
 
Do you have a clue regarding how to run a python program?:)
 
10:51 PM
if it's only one file and it's does magic.. hell yeah :)
again, I have no clue about the structure here. There are the window element resources and stuff, just wondering what is the entry point script to run really
 
I haven't used stuff like this, but it should generally be modulename.py. But setup.py is a special thingy, see here for instance
note this bit:
> Additionally, the distribution will contain a setup script setup.py, and a file named README.txt or possibly just README, which should explain that building and installing the module distribution is a simple matter of running one command from a terminal:
not giving a readme is a user-unfriendly, even hostile gesture
at least in my narrow and blunt opinion
hey, there's a readme
> Teil 2: bm_gui
>
> Dieser Teil ist von mir, bloodywulf, und ist dazu da, dem Benutzer eine grafische Oberfläche zur Bedienung zur Verfügung zu stellen. Ebenfalls konvertiert dieser Codeteil die CSV-Datei in das swd-Format, welches die SenseWear-Software einlesen kann. bm_gui steht ebenfalls unter PUBLIC DOMAIN! Dieser Codeteil ist Python 3.4 und PyQt 5.4 Code! Gebaut wurde das ganze mit: pyinstaller --onefile
note the final bit, which seems to say something like "It builds with pyinstaller --onefile"
 
so I guess I need to install "PyQt" first?
 
that should be a prerequisite, yes
 
and pyinstaller is also unknown to my os right now :P
 
OK
again, you might not want to jump head-first into a pool if you can't swim
either you drown, or you break your neck
 
10:58 PM
I figured the pip already so installing that.. I can do!
 
OK, good luck
 
yea I know, it's pretty fishy. I was just curious about this application and what it does. It's pretty specialized for a device and it seems the only legit piece of software which does some magic
 
yeah that doesn't sound shady at all
also, "legit"
 
the software runs fine and does it's job, but it's written in python (me clueluess) and it's only compiled for windows
I ran osx.
 
again, compiled
 
10:59 PM
so if I want to have a look, I have to somehow bring that to work :)
 
Python is a widely used high-level, general-purpose, interpreted, dynamic programming language. Its design philosophy emphasizes code readability, and its syntax allows programmers to express concepts in fewer lines of code than would be possible in languages such as C++ or Java. The language provides constructs intended to enable clear programs on both a small and large scale. Python supports multiple programming paradigms, including object-oriented, imperative and functional programming or procedural styles. It features a dynamic type system and automatic memory management and has a large and...
 
I guess they used py2app or py2exe there, because they ship an executable
 
ah
I was going to point out how Python is an interpreted language
 
lemme just try that python setup install and see how much the world explodes
 
Arch linux is strange ._.
 
11:04 PM
don't worry, in fact the worst thing that can happen is your computer getting bricked
@corvid isn't it supposed to be?
 
it's very simple, but I didn't quite grasp how simple it actually is
 
Without knowing Arch at all, I always imagine it to be the flagship "unix or die trying" OS that used to be the stereotypical image of unix in old days
before gate drugs like ubuntu
 
when was the last time YOU sudo rm -rf /?
 
I think I'd remember that one;)
nightly rhubarb
 
11:28 PM
Ha, just read the preceding comments. Thought - weird, that code from a 242k user??? Viewed profile. Gold PHP, 5000+ votes. Ah, now I see.
 

« first day (2028 days earlier)      last day (2923 days later) »