« first day (2287 days earlier)      last day (2886 days later) » 

16:00
if the Counter had a 0 count, it'll be 0; otherwise a hitherto-absent value will have None (or whatever sentinel you choose)
DSM's pre-defined NO_VALUE = object() is foolproof
I just got lazy with the REPL :P edited the above
there you go, good as new
>>> c['g'] == 0
True
>>> d['g'] is NO_VALUE
True
16:32
I wonder how people generator crossword puzzles without a computer.
A lot of late nights.
Probably make a few words up too.
Anyone interested in submitting a paper to Pydata London? If you'd like to, but don't feel confident, there's a mentoring scheme for prospective submitters. You can join up at docs.google.com/a/bmlltech.com/forms/d/e/…
The PyData London Call for Papers is linked here: pydata.org/london2017
16:47
How do people generate a crossword puzzle with a computer? Finding a dense interconnected grid of words seems like it would take, like, O(2^number of legal words) time
@Kevin a lot of crosswords have strategically placed blocks that allow only a few intersections per word
and no "cliques", so to speak, of simply connected cells
Does pydata go on pycharts?
Project: Word square generator
now that's more like it
@kevin i think papers on visualisation would be welcomed, if that's what you mean?
17:05
Nah I was just going off on my own little tangent
No change there, then
17:51
TIL that they're making an emoji movie. Oooooohboy.
18:04
@AndrasDeak I remember seeing that announcement right after the angry bird movie. I thought every phone app game or related to that subject was getting a movie... ><
Is there a defacto standard way (format code) to refer to "peps" in stackoverflow?
Nope you gotta link them just like a regular url
It would be lovely if [pep8] turned into a link the same way [mcve] does but the devs don't love us that much
heck, they make python users' life especially miserable in chat
and I'm told they thoroughly ignored python web frameworks in the survey:P
[mcve] does?
on main, yes
so does [ask] (works here too) and [help] and [help/on-topic] and stuff
and [edit], very useful
18:10
what's the point of edit tag ?
all of these are magic links, not tags
[ask] expands to How to Ask
I remember seeing that meta post, I think I'ma go refer to it again
[edit] just says "edit", with a link to editing the given post at hand
it's in the comment context menu's "read more" or something
they should have a [tags] that links to that meta post
those are not tags
18:12
they are tags if you believe hard enough! (I know they get masked into links just giving you a hard time) ;3
THEY'RE NOT TAGS
tags have [tag:...], anything else is not a tag
in dct[key], [key] is not a tag
Leave it to programmers to fall over the words used -.-
Tags can be whatever they wanna be ;( who are we (their creators[?]) to judge
Ĩ̵̤̗̖̰́̿͗͌̆̎̏ͦ͞ ̵̟͉̤̬̞̹̍͗̿̀ͤ̋̈ͮ͒ͦͭ̃̓̓ͫ̎̕A̵̡̤̗̫̝̜̫̠͉̻͔̮͕̺͎̞̜͈̋̐̒ͩͬ̀͠͠ͅM̓ͤ̄ͪ̍ͮ҉̨̹͙͇̼͉̩͉͇͖͚̫́ ͑ͥͬ͆̐̅͛ͮ̓ͧ̿҉͜҉̻̱̹̦̮͕Tͧ̄̾̍͐͊͑ͧ̉͋̂̓ͤ͒̃̏̚͏̡̢̢̹̙̙͓̜͍Ą̷̥̖̦̣̋̄ͣ͜͞G̵̛̝͓̼̬̗̗̞̪̙͚̗̟̺̊͂̒͢‌​͎̹̜̯͓
in :[____], [____] is not a tag
@MarcusS tag, you're it
18:14
@AndrasDeak it's a tag of ____ ;P
@MarcusS guten tag, nice to meet you
When you're in a profession where a million users' personal information can leak out because you forgot a break in your switch case, words matter.
@Kevin Just have to remember to take many breaks while you work.
Bah, my rotation matrix is not unitary :/
18:29
k so brute forcing a double square word generator is not a good idea past 3x3
Bah there's only like 1,000 ^ (word size) combinations to check
past 3x3 not including 3x3.
DSM
DSM
Aaargh I hate working with realtime data. When the bug isn't in the driver but the intersection with their API, you can have problems which don't occur in the unit tests but do occur in the integration tests, and you only have a narrow window to find it.. the problem only occurs once every minute, and the data stream will stop at 4:00. So instead of trying to solve it I'm wasting time describing it. :-P
any suggestion to some nice link to a blog or any suggested book for python related design patterns?
@DSM "it's not a bug, it's a feature"
18:34
Design Patterns: Elements of Reusable Object-Oriented Software is a software engineering book describing software design patterns. The book's authors are Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides with a foreword by Grady Booch. The book is divided into two parts, with the first two chapters exploring the capabilities and pitfalls of object-oriented programming, and the remaining chapters describing 23 classic software design patterns. The book includes examples in C++ and Smalltalk. It has been influential to the field of software engineering and is regarded as an important source...
DSM
DSM
"If we gave you any data, you'd have to do work with it. Think of all the time you're saving by not receiving any!"
hope that counts, @Moinuddin ^
"We never received any data therefore we can just sit here and play snakes and ladders all day."
You don't actually need to buy the book, you can just read every link under en.wikipedia.org/wiki/Design_Patterns#Patterns_by_Type
@AndrasDeak Looks more like a DNA pattern painted on Python :'D
18:37
That just shows the deep philosophy underlying python
I will take it as a recursive pattern. Snake over a snake. May be python interacting via remote procedural calls
that's what happens when the ouroboros finishes its meal
If I'm looking to clean text strings from a user to display on a webpage, what would be the best way to do that? I mainly just want to strip tags and whatnot to prevent XSS and get just plain text.
It also depicts the code one writes when deprived of sleep. Most of the functions loosely coupled (as were supposed to be), but some tightly coupled with each other (overlapping snake in the image)
DSM
DSM
@AndrasDeak: I'd pick that up if I saw it in a shop.
18:42
Base64 encoding and ignore the whiners that say it makes text human-unreadable
@Programmer as a wary end-user, I think the first step is forgetting things such as "just want to strip" :P
I spent an hour to make a post explaining why a certain question is not the question to ask.. Did it get deleted :(
@paul23 ?
you were posting to a bad question, explaining why the question is bad, but the bad question got deleted in the mean time?
"Hello how are you today? I am fine" translates into SGVsbG8gaG93IGFyZSB5b3UgdG9kYXk/IEkgYW0gZmluZQ==\n which you will notice is completely free of any script injection attacks
18:44
@AndrasDeak it's honestly a bunch of system info, but there's a slight possibility that malicious_user knows. In other words there shouldn't be any tags, so I'd want to get rid of all tags
Saw someone posting a "stupid" question, but one that showed he didn't understand what the underlying (mathematical) meaning of the "function" was, so I went to explain the mathematics behind it.
Took a bit more than a simple paragraph, but once I start such a thing I hate to not complete it.
@Programmer my point is that if there's physical possibility that malicious_user has access to it, then I'd expect that you should proceed with maximum vigilance, in a hazmat suit, with a flamethrower
@paul23 It would have been better if you would have done that much effort on explaining those things over the Meta site :)
18:45
@paul23 sounds like an off-topic question; just don't answer those, it's good it's deleted
(but I understand it's frustrating)
@AndrasDeak ah I interpreted that as it may ruin the general users' experience :P
getting your system compromised would be the ultimate rock bottom of user experience
Had to fetch my textbook and very old slides to bring up the exact explanation and good example figures.
Can't argue with that.
Well I tend to have to delete my answers anyways, never manage to "not get beaten" by someone on SO.
18:47
@paul23 you don't have to
ony if you post them on shitty questions that need deletion by roomba:P
multiple answers are fine; even if others have superior answers to yours
as long as there's some additional info in yours
you might find months later that somebody appreciated your approach and still get an upvote
But posting answers to off-topic and other kind of crap questions is unhelpful for the site, and a waste of your time (as you've experienced just now)
if OP has 20 rep, you can try inviting them to a chat room
Well it's not that much a problem lol :P. It's just that I was like "hey finally some question that touches the field I'm actually good at", instead of another flask question a question that is best explained by describing the underlying algorithms used by numpy and when to NOT use those.
Yeah, I understand. Of course my point is still "don't answer those questions" :D
can I override properties?
that sounds like a question that needs further disambiguation
@AndrasDeak thanks google
18:59
no worries, javascript
12 hours ago, by khajvah
Turns out, I am gonna be doing Java instead of JS in my new job
:P
I read that
you'll always be javascript for me
<3 aw
Java makes me sad :(
I stopped complaining about programming languages in general
19:04
Any language where foo == "some string" can evaluate to False when foo = "some string" is a language that needs to be punched in the face.
there is really no good excuse for that
It's the first language I learned :), though my teacher (was 15-16 years old back then) said: "I'm just doing this because we get a decent free ide with java", "otherwise I would teach you about the new kid on the block, c#".
Directly suggesting people who wish to study computer science learned that language themselves.
DSM
DSM
I.. I don't believe this. The bug which has been driving me crazy was because of a capital B where there should have been a lowercase b.
oops.
So you'd say that's a Bug, then?
I've definitely done similar.
DSM
DSM
@WayneWerner: it's good that you're not within reach at the moment.
19:06
yesterday I spent 2 hours hunting on a bug which was because I did my_dict["my_id"] instead of my_dict[my_id]
1, I and l are my favourites.
DSM
DSM
This change led to a cascade of errors which resulted in data being sent down the wrong channel but only when several other things occurred.
Especially in for loops making a type somewhere about that.
@DSM What? I'm honestly wondering why a string input isn't sanitized on the spot, or cascades into errors XD.
@paul23 b and B can both be valid and still lead to problems down the line
such as %[bB]
DSM
DSM
Yeah, in some cases B would be right here. Just.. not where it is. And because of three or four separate seemingly non-frightening choices, the only way I tracked it down in the end was by noticing that a 6 should really be a 5. :-/
I'm not good with details..
19:16
Guess so, though it always irks me when using string literals as flags. (Like in file opening, I wonder why python opted for string literals instead of just named constants that can be chained into bitmasks?)
@DSM at least you found it, good job
DSM
DSM
In this particular situation it wasn't a flag, it was a name of an element in a JSON file being produced by a different source.
@paul23 I hate SLLY_LNG_FILE_PERMISSION_AND_MODE_FLAGS for no objective reason
readability? Expressionism?
they're silly
19:23
I prefer: open(fname, IO.files.constants.WRITE | IO.files.constants.BINARY) over open(fname, "wb") - It is clear what the first means without having to look things up in a manual. But I guess that's me.
python is all about not having to distract yourself from programming with syntax
you (should) only have to look up 'wb' once.
If you can't remember "write binary" then you might have bigger issues.
white balance
@WayneWerner Well scalability means a project might happen to have an infinite number of different "constants", so yo will have forgotten what some mean before you get to the end. Thus I really prefer complete self-documenting code with only a small set of things you have to remember.
Worse, "b" would mean different things in different contexts: thus potential for hard to debug bugs; since the code and input is "legal".
But I'm the one who thinks it's good to have even stricter typing than generally is done in languages: instead of just floats a "numeric" should be described by the amount of bits it uses and you shouldn't just be a able to convert one to another.
Need a conversion function there.
I think if you're in a case where that's a problem then you probably have an issue with your design
@paul23 You should enjoy Cobol then ;)
19:33
I was never fond of limited precision ints in other languages. The last question I want to ask myself when I'm three lines into a program is, "am I sure this value will never exceed 2^16?"
^that
Unless you're working for NASA then you really don't need that kind of safety
Boeing, Airbus, Tesla/Volkswagen(!) good enough?
aye o/
Yeah - that's the same vein, though.
I've been actually asked to "help update our flight simulator API simona". Doubting if I wish to do that as extraculinairy work.
19:38
But what if Hitler is driving that Volkswagen?
It's basically an old codebase still python 2.4. But I'm afraid of the mess it currently is, yet it would be too big of a task to completely rewrite it.
Worst is: nobody in the faculty seems to understand the code anymore. The ones that wrote the scripts have long left and it's not in a state of "don't touch it, you might break it and we can't fix it".
recbg
Additional info on my debian leaking memory: sar tells me the missing memory is in a bucket called
> kbslab
Amount of memory in kilobytes used by the kernel to cache data structures for its own use.
does that say anything to any of you?
is it possible that the kernel is overcaching (?) memory, and forgets to free that and starts reallocating/swapping instead?
@paul23 If it's in VCS it's likely that a "fix" is just "git checkout <it works revision>"
what type of mathematical formula would be used to predict the time at which an upload would complete based on a set of timestamps/progress stamps?
19:53
[(1484855554712, 0), (1484855554722, 1), """ etc """]
or maybe some kind of polynomial extrapolation
compute an avarage progress speed with a window?
IIRC Windows pulls arbitrary numbers out of its ass
so no need to overthink it:P
I forget where I heard the joke... windows as a person: "I'll be at your house in 20 minutes. I'm 2 years away. Okay I am at your door"
Ever reliable Kevin
@corvid The mathematicfa formula would be "extrapolation", but the type (polynomial, linear, moving averages) depends on the data. Windows and the like probably just use a moving average to calculate the average upload speed.
19:57
The secret to being me is to make your failures more forgettable than your successes
cbg
@paul23 so you are a Haskell fan, I take it?
KXCD no longer brings weekly what-ifs :(
@Code-Apprentice I'm not bright enough to understand functional programming. You need to be enlightened for that.
Intelligence has nothing to do with it. Just a new way of thinking about programming.
You should definitely try it out if you want a stricter type system. The functional part is very nice too because it makes it easier to reason about the correctness of your code.
something something monads something
All I know about monads is that boxes and maybe nothing
20:11
I remember that monads are [something] in the category of endofunctors
So, anyone else going to watch Trump's first Official speech as the President?
so this is fantastic
I've (probably) failed to understand monads so far, so I'm going bottom up and I've just found out what typeclasses actually are, hoping that's a good step on the road
Turns out they're really simple (typeclasses)
@idjaw nice
I intend to completely ignore politics for the next four years. Don't disturb me unless nuclear bombs are falling on American soil.
20:14
@MarcusS sadly, that was probably my best coding ever
type form is super nice
I like filling out forms that people send with typeform
Also hackertyper is great :D
There are some things like that...
that's the one I was thinking of
cabbage
20:35
@Kevin I'm kind of afraid nuclear missiles will be launched from there in the next 4 years. I don't get those 'muricans anymore.
@Kevin you should mail me some of your soil, so we can get in touch, just in case
I have an idea... how about kevin mail us all a jar of americal soil so bombs dont drop
Don't tread on [my soil that I mailed you]
DSM
DSM
People interested in showing that they are actually worried about the things they like to pretend they're worried about are welcome to contact me to arrange proposition bets. I am willing to offer excellent odds.
20:38
Oh well the actual worry is that trump just ignores the whole climate debate and doesn't help us progress.
"doesn't help us progress", yeah, he's a real progressor:D
It's hard to make bets that the apocalypse will happen because you don't know if the new economy will run on bottle caps or cool looking rocks or what
or braaaaaaains
20:39
How you gonna collect your winnings when all conventional currency will drop in value to that of their component materials?
This is why you should have all of your savings in buttcoin.
It'll be hard to use once we lose access to electricity, but passing around paper where you do the hashing yourself shouldn't be too hard.
@Kevin not to mention the difficulties of trans-atlantic relations in a post-apocalyptic society
DSM
DSM
@Kevin: on my side that's a risk I'm willing to accept, given my estimate of the likelihood someone will be paying me in useless paper when I want ammunition.
dudee... zombies... lets be honest all coders would be dead and all MMA fighters alive :D
pandemics are spread by people; the less you touch the better your chances
20:42
i though they were spread by pandas ... O.o
Programmers and martial artists will both be outcompeted by average folks that are capable of working genially with other humans
you're right, we should try feigning cooperation with others so that we can trip them when the horde arrives to eat us
Doesn't matter how good your katana skills are, your communal garden won't grow faster
I'm just curious about two things. What they plan on doing with ACA (if they want to remove, change, or replace it) and how Trump's leadership will affect other countries: leadership, values, economy, and what not.
20:44
American something somethin
obamacare
aka health insurance
aaah, thanks
Thanks, Obama. Thobama.
DSM
DSM
I feel like I should be able to do something with "Nobama", but I've got nothing.
DS, like do what ?
20:45
Banana fanna fobama
I should join in; I don't wanna be Obama self
... Meanwhile here we wonder why people make such a fuss about healthcare.
@MooingRawr I'm hoping the resulting rise in human tragedy will help other countries to make their public healthcare systems better
in America you have private health care , right ?
@RobertGrant if that reasoning went anywhere, the muppet shouldn't have risen to power in the first place
20:46
@paul23 yeah, seems to be almost only the US where people might get broke, make debt or at least spend tons of money due to health care
DSM
DSM
I keep hoping Canada replaces our barbaric and tyrannical system with something more free, but I'm always disappointed.
at least if Hungarian internal affairs have actually reached the Western world:P
the fact alone that you see that other people are being stupid is no guarantee that you yourself and those around you won't be equally stupid
Yes, it's private. The ACA required that everyone have private healthcare but also in theory removed barriers preventing people getting it. It worked really well for some people, worked terribly for others, and all the people who already had health insurance through their employers and/or were rich enough to not need it or care about it were unaffected.
@DSM like ? And in what way is our system, barbaric and tyrannical ?
Except now we have to file another stupid document on our taxes :(
20:49
Secure offsite backup and restore would be nice
I just wish Canada adopted a social drug system to go along with our public health care system, but that might be wishful thinking.
well... public aint ... anyways, this way it is tied to personal welth , if healthcare is public it depends of wealth of country... lets be honest, public care would be cool for america when america has wealth, otherwise all people would want private.
In the book Down and Out in the Magic Kingdom, the majority of medical treatment has been replaced with "this body's a lost cause, we'll upload you into a new copy"
For basically anything more severe than the flu
@MooingRawr happily lives in the netherlands.
@Kevin The borg way!
DSM
DSM
20:52
@MooingRawr: I can spend hundreds of dollars on a life-size plush Korosensei. On the other hand, it is actually illegal for me and my that-kind-of-doctor friends to come to an arrangement. I can send my father Leafs season tickets, which he can't use, living in another province; I can't pay to improve his medical care except in trivial ways. As long as the Canadian government puts people in prison for freely negotiating medical services, I'm going to find it barbaric.
... first world problems...
Economic principles get distorted around industries with the implicit premise of "buy our product or literally die"
DSM
DSM
@AndrasDeak: paying for my father when he got sick is exactly what I wanted to do, and couldn't. It was our health care system which prevented me from doing so. Was that unclear?
This room was placed in timeout for 20 seconds; This is the Python room, not the healthcare room. Getting a bit too heated here.
So who likes ice cream
20:58
@davidism tnks
what about zombies
Woah, since when is that an RO power. I need to look at these menus more often.
lets make a genetic algorithm of percentage of survival of zombie apocalipse in contrast to profesion , fitness, and ... stamina ?
@Kevin timeout, it looks much more interesting to non-ros.
Gus Johnson <3
From reddit comment: "You need help."
21:00
He probably does need help after that, unless he has very good neck muscles. Not common in most workout regimens.
@DSM No, I was trying to be sarcastic but I figured it's too difficult to explain what and how I exactly meant it; and I realized what I wrote was plain confusing (hence delete)
I'm sorry for your country's (and, consequently, your personal) sucky times :(
From YouTube comments: "I woke up with terrible neck pain."
ah, and I've just noticed the intervention (I've been away miscomputing ladder operators), carrying on
ok, here is general python question, does open(file,'rb') read the whole binary file or skips some aspects
It doesn't read anything.
21:04
"it" reads the permission bits and associated metadata, at least ;)
That's not actually part of the file, but the filesystem. You're technically correct though.
cue best kind of
@DSM I'm still trying to look up the exact law for health care (still digging) negotiation; I remember having this conversation with her when she took your stance, but I don't remember my sources so I can't really comment on it. Either way, time to drop the topic, but I don't think our system is barbaric; imperfect and still needs a lot of work, but still way better than other developed countries.
Wait.... you can't use a leafs ticket bought in Toronto if you live outside of Ontario? (I was not aware of this...). that's barbaric if anything...
Corrective pedantry in response to pedantry is even better than being technically correct
ok... @davidism .... do your thing
21:07
Every Canadian should have the right to watch a hockey game if they have a ticket no matter on how they've came into possession of the ticket.
What if they murdered someone for it
only with a hockey stick or puck
21:09
cbg
anyone wanna talk about sklearn for a bit?
I have a random forest classifier running on a cluster somewhere, and it doesn't seem to process more data, even if I give it more time
thoughts on what might be happening there?
trivial quesiton: any chance to try it sequentially?
or is it serial, only in a scheduler?
it's serial, in a scheduler
any chance to redo it exactly on a local machine to see if it stops the same way?
(you might tell that I don't know sklearn)
(that's fine - it's very possible that I've overlooked the otherwise obvious stuff)
21:16
$ fusermount
-bash: /bin/fusermount: Permission denied
$ ls -al `which fusermount`
/usr/bin/which: no fusermount in ($PATH_HERE)
...have I forgotten how linux works or something
try sudo ls
type fusermount?
($PATH_HERE), go home, you're drunk
oh, you redacted it
*facepalm*
I blame angular momentum operators
@davidism type -p fusermount does do the job. But I wonder why which wouldn't work.
maybe it's an alias thing?
21:19
/bin is definitely in the $PATH, and there's no alias for it.
@AndrasDeak: I run 30 runs in parallel, and have each run sequentially do 10x10fold incremental validation. I always get 30 runs of data, but each run reports only about 15-17 folds. Thoughts on what I could be doing wrong?
The which manpage says It does this by searching for an executable or script in the directories listed in the environment variable PATH using the same algorithm as bash(1)., so that's... a lie I guess
how about echo $PATH vs echo `echo $PATH`?
I could try running it on my machine, but I'd have to get permission to bring the data to my machine, so I might try to avoid that
Those would do the same thing?
21:20
wait, backticks don't prevent the current shell from expanding $PATH first
$PATH was correct enough for typing the command to work, and /bin is the third element in it
It will have to remain one of life's mysteries
@KevinMGranger oh, right, you see the path
It's a MCVE, I left out the extraneous details, although I should have left /bin in there :P
@inspectorG4dget every sixth?
@KevinMGranger yup, I'm afraid
@AndrasDeak good question. I'll check
21:23
I meant roughly, but OK;)
so the question is, which 15-17 are those out of the 100
@AndrasDeak no. It's the first 15-17. I should have also known this before - the 100 folds are run sequentially
so they're always 1,2,3,...,n (where n is 15-17)
Is there a way to generate data of your own so that you don't need permission? Some kind of lipsum.
shouldn't be an issue to get permission for that data. I just won't be able to run the experiments until tomorrow, is all
21:31
yeah, but if you can generate placeholder data that reproduces the issue, you can test with that right now
I don't know what kind of input you have, how hard it is to generate it
can't really - it's 30d data based on weirdly interdependent distributions. lipsum data is going to be difficult
And have you done this before? Is it possible that it's supposed to stop once it's converged? (*hand-waving shrug*)
I don't think that's an issue here
OK, I'm out of rubber duck ammo:)
well, some clusters allow you to log in to a machine locally to tinker with jobs
thanks. I'll run that test tomorrow and see what happens. Thanks for that - I missed it in my original debugging
21:35
you could try doing that if it's an option
30 seconds for a run could even qualify as a debug calculation that might be allowed to run on the head node (I know smaller clusters that allow this too)
It is, but it'll have to wait until I go to the office tomorrow (at the lab in the university now)
thanks :)
Now, I'm onto my next task
no worries (not that I helped much:)
22:00
Hi , I need to pass a list of values to a single parameter while running python script from command line. i am using argument parser. Are there any inbuilt methods for handling this ? Google search didn't do much good
i.e. you want to pass this style --something foo,bar,biz,bang,quux?
Really, you tried searching? I don't believe you: duckduckgo.com/?q=python+argparse+list&t=ffab&ia=qa
yes ... nargs would do it i think
let me try
@davidism Thanks agent
So next time, you're going to actually search first, right?
125
A: argparse option for passing a list as option

SethMMortonUse the nargs option. parser.add_argument('-l','--list', nargs='+', help='<Required> Set flag', required=True) nargs='+' takes 1 or more arguments, nargs='*' takes zero or more. Let's take a look in more detail at some of the different ways one might try to do this, and the end result. impor...

22:03
Sure
22:59
recbg

« first day (2287 days earlier)      last day (2886 days later) »