« first day (1586 days earlier)      last day (3355 days later) » 

12:04 AM
I dont think "better call saul" is on netflix .... but its definately interesting
 
@Joran it's on the UK netflix at least
 
@JoranBeasley It's only on netflix :)
If not for you get a better country :P
 
(or just proxy cough)
 
Damn it! My SO goodies are stuck in custom clearance.
 
12:23 AM
its on amc here ...
which does stream it online for free for 30 days ... but its a garbage interface compared to netflix/hulu
 
12:58 AM
I saw something about a Winter Meeting. What is that?
 
@JonClements Puppy, I left you a message in Skype.
 
1:32 AM
will a proxy work for netflix? ... I assumed they used your billing infos or someat
 
@JoranBeasley they don't care...
 
oh yeah ... google skillz 101 for the win
 
their only obligation is to restrict content on certain criteria
if the user wants to circumvent, it's not in their legal interest to pursue it or something
they've fulfilled their part of the their contract with the producers etc...
 
2:31 AM
cbg
 
 
2 hours later…
4:24 AM
Hi, can anyone help me with best tutorial to learn python
im new to python
 
Hi @Birlla ... the official tutorial is actually pretty good: docs.python.org/3/tutorial/index.html
BTW: there's usually not many people around at this time; many of the regulars are in Europe. I'm here but a little distracted / busy right now.
 
Im completely new to python. Is it ok for me to go with official tutorial.
thanks for your info.
 
I have two modules. Both modules need data defined in the other module. When I try to import them, they try to import each other and back (and fail). How can I get over this?
the problem is probably my design but that'd be difficult to change
 
@Birlla Yes, I think so ... feel free to ask questions here if you don't follow something. You might want to read sopython.com/chatroom to acquaint yourself with the room culture :-)
@Blob google "python circular import" (or search for same on SO) – I don't have any resources to hand but you should find some advice.
 
@ZeroPiraeus thanks
 
4:36 AM
@zero thanks
 
Accepted solution says "You should never use circular imports in Python. It's just asking for trouble. Refactor your module organization." Sorry...? :C
i'll stick to import main for now
 
@Blob they are often a sign that you need to rethink your design - if absolutely necessary you can fudge it by importing inside function / method definitions, but it's a hack, and one you shouldn't rely on.
 
@ZeroPiraeus I'm trying to prototype something and it's a mess. I'll get around to rewriting it eventually.
 
imports in the usual place happen at import time, so if two modules import each other you get an infinite loop, but inside a def they don't happen until the func/method is called, so you get away with it. It's considered bad style though, at least in part because its much harder keep track of what you're importing.
A thought: if "Both modules need data defined in the other module", why not define that data in a third module and have the other two import it from there?
 
yeah, that'd work.
 
4:49 AM
If you have a package, __init__.py is sometimes used for that kinda thing.
 
i'm trying to implement a language in a language i barely know ;_;
 
Sounds like fun :-)
 
The ratio of happiness to sadness is quite high
 
 
2 hours later…
6:45 AM
cbg
@ZeroPiraeus there is no infinite loop
@Blob what happens when imports bar and bar imports foo, as soon as they do the import statement, an empty module is put into sys.modules['foo'] and sys.modules['bar'] respectively; the main body is run with such module as the global scope
if foo imports bar and bar imports foo in the very beginning, bar will see an almost empty module
it sees all the imports of foo, and all the def clauses of foo until the point that import bar is run
the problem of course is that if you import bar first, then it is going to be the other way...
 
@AnttiHaapala Hmm, yes, what I wrote was nonsense :-/ In my defence I was conducting an Important Conversation with gf at the same time, so a little distracted.
 
7:38 AM
Cabbage!
 
7:51 AM
Cbg
 
Cabbage
stackoverflow.com/questions/28578248/… (duplicate of this question – I already used my vote before it was clear that this was a duplicate)
rbrb
 
8:53 AM
cbg
 
9:12 AM
How to check if type is module...? stackoverflow.com/a/2225066/145682
Nev mind...got it ^
 
re-cbg
 
my cv-pls above…
 
Voted. Need one more.
 
Thanks
 
9:40 AM
Going through the meeting and writing a brief summary (that, it turns out, isn't particularly brief -_-)
 
9:58 AM
Okay (not-so-brief) summary finished.
 
Cabbage
 
10:13 AM
train cbg
 
cbg
 
10:38 AM
cbg
 
cbg
 
11:10 AM
I've read the transcripts since my last post here and noticed that someone mention we should have a sopython chatroom song. I nominate King Otto's song "Yowtie buggetty, rum fing f-tooo, Ni! Ni! Ni! Yow-oooo!!" from the Monty Python sketch A Fairy Tale. Here's a YouTube clip (from Monty Python's Previous Record) of the song.
FWIW, that sketch was originally in the 2nd German episode of Monty Python's Fliegender Zirkus.
 
11:41 AM
@Ffisegydd We await with eager eyes :p
 
12:03 PM
awesome - sorry - was afk for a bit
 
morning cabbage
 
Oh ye gods. "The Excel" has reared its ugly head again
I thought I was free of you!
 
context?
 
Old joke between Jon and I. I had a client that had done amazing terrifying things with Excel. And contracted me to bug fix/extend it
 
oh, I have a client like that. absolute Excel wizard.
 
12:17 PM
I didn't know it was possible to control power supplies with Excel. Now I know better
 
oh lord
 
Yes. Now he wants to interface matlab with it. And so The Excel gains new powers
 
I am literally speechless
 
What was your guy doing with Excel?
 
nothing out of the ordinary (compared to power supply manipulation, at least), mostly fancy Vertica query + data massaging
s/query/queries/
but his absolute control of excel was pretty impressive, I struggle when I need to define a sheet to be RTL, or link something from a different workbook
it just feels so alien
 
12:24 PM
I'm guessing he's a "non coder"
I know right? Sometimes with Excel I feel like I should be chanting in a low voice, surrounded by candles
 
he's originally a construction engineer, yeah
 
Do we have enough cv voters here to reopen a question? I need four people.
(cv voters is kind of redundant)
 
don't look at me :)
 
Definitely don't look at me, I gave up competing on rep whilst we allow the Martijn AI to thrive ;)
 
Err... very busy - what's up @poke
@IntrepidBrit well... he was meant to go after John Connor... but it got corrupted on went after "Python questions on Stack Overflow"
simple mistake to make I guess...
 
12:40 PM
It happens. What it a " error?
 
:) - whatever it was - it's proving more difficult than we thought to get him back to the skynet labs
 
from __future__ import john_connor?
 
do not give IT hints!
 
cbg all
 
cbg - long time no see
 
12:49 PM
Oops :P
 
actually i visit this room quite often but did not know what to talk about :P
 
salads & dressings seem like a good topic
 
I'll be back bzzzt +++ OUT OF CHEESE ERROR +++ PLEASE REINSERT UNIVERSE AND REBOOT +++
And now for something completely different
(A band strikes up a jitty tune)
 
@MarkR. yeah but I still don't know what to talk on salads :(
 
It was the Monty Python skits feed that made me veer of course, there, @Jon.
 
1:00 PM
I can't believe I forgot about the room meeting :-(
Probably it's because I was snowed in yesterday, disrupting my usual routine
 
/me puts the "Dunce hat" on @Kevin
 
I deserve this!
 
Yes... now go sit in the corner on stool!
 
@Kevin see, this is why you lost the Star Lord title.
 
It's better that no one man be star lord anyway. Soligarchies never last.
4
 
1:03 PM
aaaand he's back.
 
@Martijn well - we gotta love our @Kevin :)
@Kevin on a more serious note: please read up on sopython.com/transcript/3/winter-2015-general-meeting when you have time :)
 
Got it.
 
How do we use the new Salad word, garlic?
 
was just about to mention garlic, heh
 
I get a feeling "garlic" will be a noun, an adjective and a verb, or using the term I just made up, an nadjecverb.
 
1:11 PM
I guess if someone's helping a HV we can just say "@someone You need garlic". Or even just a simple non-directed "garlic" may be sufficient.
 
I've read the summary and these points seem reasonable.
 
"She's a garlic", "He's garlicing", "Don't garlic with me, boy." The possibilities are endless.
 
Given that most help vampires don't read the wiki, I imagine "garlic" will mostly be used as a code word to signal between regulars.
Although I think most of us can spot an HV without assistance anyway
 
halp
 
gief codez?
 
1:13 PM
yase, how may we halp you
 
I can't say I've seen an HV in the last couple of days
 
i ned GoOgLeS sauce codes. For tomoz, plox
 
kindly do the needful
 
but it's urgent!!!
 
My mother will beat me again if I don't work out how to non-integer divide :(
 
1:14 PM
I did find myself irritated the other day by a user asking for database help. At the worst point, I recall he was basically asking us to write a format expression for him.
 
@Kevin Well yeah, the problem (as mentioned at the GM) is that you can start helping someone with a legitimate question, and then an hour later you realise that you're trapped by a HV. And then you wonder how you can bail out without seeming rude.
 
wow, sqlite is so slow. ugh.
 
Or maybe he couldn't figure out how to get the first item out of a tuple? Something like that.
 
pretty sure I've seen this before, can't find the original -- stackoverflow.com/questions/28584533/…
 
@MarkR. It is?
 
1:16 PM
@PM2Ring I generally escape by saying "I don't think I can help any further without a minimal reproducing code sample"
Which they generally interpret as "I'm not qualified to help" rather than "you didn't ask a very good question"
And if they do come back with a code sample, then hey, they've magically turned into a good question asker!
 
@IntrepidBrit, it is on a slow laptop disk, apparently
 
@Kevin ... and if they come back with a screen capture of their IDE, you know we've got a keeper ;-)
cbg all btw
 
At some point I'll follow davidism's example and just say "I don't think I can help any further."
 
cbg(zero)
@MarkR. That'll do it
 
@IntrepidBrit, tmpfs to the rescue
 
1:23 PM
One thing I loved about C, you could abuse the system into thinking RAM is hard disk space
 
@Kevin There was a brilliant one the other day, but I think it got deleted. The OP wanted to know if there was an inverse method of list.index(). Eg if i = seq.index(val) how do you get val if you know i. :)
 
Heh, I commented on that one
 
@IntrepidBrit, what do you mean?
 
I generally don't like posting answers in comments, but I make an exception if I can fit it in 15 characters.
 
Ditto. And if the answer fits in 15 characters the question's probably close-worthy.
 
1:26 PM
My reasoning exactly :-)
 
> What is the beast, most pythonic way
HEH
the beast, indeed
 
I choose to assume that is not a typo. And he does in fact want a beastly list comp.
 
@MarkR. (I mean, I know that you can do it with sqlite anyway. But one time I was using an encryption library, and the library would only take a FILE* as a parameter. So I had to generate a once use key in memory, and then convinced the system that it was a file)
 
@IntrepidBrit you're a bad man.
 
1:31 PM
What can I say? I lead many astray.
Say, Fizzy, I'm selling these fine leather jackets...
 
@IntrepidBrit, that's why C is so great, the precision with which you can shoot yourself in the foot is unmatched
3
 
Agreed. No nanny state mentality there!
 
only 500 rep to go until "911"
 
ma kara?
 
oh dear
 
First answer is nice, I wrote mine as a comment first I think, and now it's 20 upvotes. This is as high as I got so far
the one with the answer in #1 has only like 500 rep, most of which from this answer alone
good for him :D
 
@KasraAD I don't see anything closeworthy in that question except the use of the forbidden word "best" (which I've edited out now).
 
not really an exhaustive answer, though
still upvoted :)
 
It's a nice answer, I didn't think of it immediately... I actually never thought of code injection outside eval
 
1:46 PM
I considered voting on the question Kasra indicated. While it would be nice if the OP provided the contents of the evil function, I think it's still possible to make a good answer without that information.
It does smell a little like an XY problem, the solution being "rewrite your evil function so it isn't evil any more"
 
I did CV it. I didn't feel it was clear enough what EvilFunction is doing.
 
These are by far the most frustrating answers a user has given me: stackoverflow.com/questions/28571895/while-loop-hangs/…
(read the question first I guess)
 
OP has literally just edited it though, so I've retracted my vote.
 
Ooh, he's edited the post so the evil function doesn't directly modify S. That's a step in the right direction.
 
It's still a bit unclear, but less unclear than before.
 
1:50 PM
I wonder if it's now possible to have a solution that doesn't use set differences...
 
DSM
Ash-coloured cabbage for all!
 
Cbg DSM.
 
DSM
If we had an example EvilFunction I think it'd be a lot easier to see what the right path forward is.
 
I tried finding a "Don't iterate over a set while modifying it" but could only really find it for lists.
 
1:54 PM
@Ffisegydd how can you modify a set?
 
@DSM evil = eval
@ReutSharabani add, discard etc all are mutating
 
Sets are mutable so you can modify them inplace without creating a new object.
 
the clojure way is interesting
 
oh that's right, I'm thinking of frozenset. I actaully need to fix an answer now :)
frozensets aren't mutable right?
 
yes, no
 
DSM
1:55 PM
@AnttiHaapala: if I have a dynamic expression I need evaluated at runtime, and I'm the only one writing the code, I'm going to use eval rather than write a parser. Life is too short..
 
the clojure way is that they built all the main datastructures so that the non-mutability is fast
@DSM who said one needs to write the parser!
python has written the parser.
ast.parse
 
DSM
Let me rephrase: I'm not going to write anything to evaluate the results, only to reimplement a less-useful version of eval.
"Celery Beat" is a great title for something.
 
News about celery for adolescent girls, a la Tiger Beat?
 
DSM
A girl I went to high school with wound up with a TV show on one of the lesser networks for a while -- the WB I think? -- and one day in line I saw she was on the cover of one of those Tiger Beat magazines. I read the interview (mostly of the "puppies or kittens" level), but when I saw the claimed age I lost my confidence in their journalism. :-/
 
2:04 PM
To be fair, the stereotype is that women guard their true age, perhaps by locking their birth certificate in a safe and dropping it in a river.
Watching Harry Potter, all taking notes about hiding places for objects during the horcrux scenes
 
My horcrux would be a pebble on a beach.
 
Or even better, a pebble that I've sailed 30 miles out to sea and dropped.
 
Or a cookie, then eat the cookie
 
2:09 PM
My horcrux would be duct taped to the side of the Voyager probe.
 
Can wizards apparate into outer space?
 
I don't think wizards know that space exists.
They probably think stars are just holes in the firmament.
 
@Kevin I take it you've read HPMOR.
 
Darn, you figured out who I stole the idea from!
I'm assuming Accio doesn't fetch objects more than a million kilometers away.
If not, I'll hold the world ransom by threatening to do "Accio Alpha Centauri"
 
@ZeroPiraeus Actually he's question was ambiguous he didn't share any code of his function! as all of the question was about that function!
 
2:14 PM
That's true, but:
> While it would be nice if the OP provided the contents of the evil function, I think it's still possible to make a good answer without that information.
 
@MartijnPieters He's running out of grace. I'm tempted to answer (in a comment) "Yes. You need to change line 17". :)
 
I'll write the new cv-pls wiki page now, before I forget.
 
@Kevin But he's still modifying setOfManyElements inside the loop, and that's a sure path to madness.
 
Yes. Yes it is.
 
@Kasra well, no, the question was about how to proceed given the existence of an expensive function, which doesn't necessarily mean we need to know what that function does. It might help to throw light on whether it's an XY problem, but as it stands I think it's reasonable to treat EvilFunction as a black box.
 
2:20 PM
@Ffisegydd I guess that really does need a separate canonical answer, since modifying a set while iterating over it is even worse than doing it with a list, due to the unordered nature of sets.
 
Indeed.
 
sopython.com/wiki/cv-pls thoughts? Corrections? Addendums?
Updated it with a bit about delv-pls
 
Need's more apostrophe's!
someones -> someone's
questions existence -> question's existence
 
DSM
Hah! Not only did I beat Kevin to it, I fixed them before he posted!
 
2:29 PM
Blast!
 
You do not know his latency.
 
DSM
This makes me waaay happier than it should.
@Ffisegydd: "duress" doesn't seem right there.
 
I spent too long deciding whether to use apostrophes ironically :-(
 
Two households, both alike in dignity,
In fair Cabbaga, where we lay our scene,
From ancient grudge break to new mutiny,
Where civil blood makes civil hands unclean.
 
From my MTG experience, I understand that "duress" means "to cause a player to discard a card of your choice from their hand".
That does indeed seem like it's out of place.
 
2:31 PM
@DSM it seems fine to me, but change it to something more appropriate if you think it may be confusing in the long run.
 
@Ffisegydd Looks excellent to me. Maybe mention the 3k/10k thing? Just to avoid "I tried and it won't let me" etc.
 
@Zero yeah good call, I'll actually explain what CVs are.
 
DSM
@Ffisegydd: any reason not to simply use "pressure" or "obligation", depending on which you're getting at? "You're under no duress to do X" sounds odd to my ears, although "he was under duress when he made that decision" sounds fine. I can't explain why, although probably the guys over at English could.
 
I'll go for obligation
 
@Ffisegydd looks good :)
 
2:35 PM
Added a quick def. of CVs and changed it to obligation
And added a link to the Mjolnir meta thread.
 
DSM
Have I mentioned before that I like the look of the sopython pages? They feel comfy, somehow.
 
@IntrepidBrit
FILE* is no problem
 
@Ffisegydd Stupendous :-)
 
fmemopen on glibc
 
@AnttiHaapala (that's what I ended up using in the end)
 
2:39 PM
same in python, only in python when someone says "this needs to be a file"
you actually can't know s**t what it actually needs :D
use StringIO and it needs the other file...
 
@JonClements Oh… sorry… late answer is later.
 
I love StringIO... Use it a lot for pandas questions.
 
I was asking to get this question reopened again, so we can close it as a duplicate instead.
 
StringIO and regex separators are beautiful.
 
DSM
Regex separators do make life a lot easier.
 
2:42 PM
'\s+' <3
 
DSM
'\s\s+' has saved my bacon more than once.
 
@ZeroPiraeus mmm... yes now after he's edit and as i attention more! i think it could be interpret as you say!
 
Is there a comprehensive list of common programming terms, especially algorithms and data structures? like merge-sort, linked-list, binary tree, etc?
 
Anyone know of an online Python evaluator that lets you use multiple files? It would be nice for questions involving import dependencies, etc
 
@ReutSharabani wikipedia?
 
2:44 PM
@AnttiHaapala , I know there are wikipedia entries for each, but I'm looking for a list with no information on them, just the list of their names.
 
the bottoms there :d
I mean for what?
get a book, introduction to algorithms
 
The following is a list of algorithms along with one-line descriptions for each. == Combinatorial algorithms == === General combinatorial algorithms === Brent's algorithm: finds cycles in iterations using only two iterators Floyd's cycle-finding algorithm: finds cycles in iterations Gale–Shapley algorithm: solves the stable marriage problem Pseudorandom number generators (uniformly distributed): Blum Blum Shub Lagged Fibonacci generator Linear congruential generator Mersenne twister === Graph algorithms === Coloring algorithm: Graph coloring algorithm. Hopcroft–Karp algorithm: conver...
 
He wants a list of algorithms and data structures and other programming terms.
 
@PM2Ring exactly
 
Such a list would be thousands of entries long, though.
 
2:45 PM
would be useless
 
@Kevin that's fine... I need the list! :)
 
for what???
purpose?
to cross over on the list when you learned them? :D
 
Considering the habit of library developers to pick random words as their project names, it would probably encompass the entire English language.
 
@AnttiHaapala something like that.
 
@PM2Ring yeah I found it already :D
 
then get a book instead.
the intro algo say
 
@DSM is the winner. Thanks.
 
DSM
Or just read the index for NIST or TAOCP or something.
 
there are lots of algorithms with zero general use etc, I'd still suggest a book
unless you have read one on algorithms ever
 
2:48 PM
Depending on how you define "thousands", I was right. 1222 entries.
 
TAOCP is intimidating
 
DSM
At the level of precision we usually hold ourselves to, I think "thousands" works.
 
Re We need one more vote for stackoverflow.com/questions/28585319/… ; OP has not responded to requests for code or info.
 
Ok, voted
 
@AnttiHaapala how would a book help me? I don't want to know how to implement them, I just need to actually know they exist.
 
2:50 PM
ha?
it is like math "oh there are such things as sin, cos, tan, sqrt" :d
 
DSM
Get a phonebook. Choose a thousand names. Add "'s algorithm" to the end of the name. Problem solved. :-)
 
"dunno how they're used though, who cares" :D
 
You could buy a textbook and tear out everything but the glossary.
 
no a good book goes with narrative on why and when an algorithm is used
 
The best way to find out about algorithms is to consult Knuth
 
2:51 PM
Hey
 
The gang of four design patterns book has a list on the inside of its cover. You could cut that off and staple it to your wall.
 
I need to determine who won the blackjack game, each player is assigned a score, it could be over 21. How can I only return that max who is not over 21?
winner = max(player_score, dealer_score)
 
DSM
Just don't read it backwards in the dark while holding a candle. Just.. don't.
 
@AnttiHaapala most books probably use a subset of these, relying on you to find and understand the rest when you need them. I don't need them, I just need to know they exist, this is literally my requirement.
 
DSM
@ReutSharabani: I think what's puzzling everyone is how strange that requirement is.
 
2:53 PM
That's ok, I agree it's puzzling :)
 
@poke Ok. What's the dupe?
 
:D
@ReutSharabani you're like the mathematician in that joke...
 
DSM
@Vader: usually something like max(score for score in scores if score < 21).
 
I don't know that joke
 
How about None if player_score > 21 and dealer_score > 21 else (player_score if dealer_score > 21 else (dealer_score if player_score > 21 else (max(player_score, dealer_score))))
 
2:54 PM
An engineer is working at his desk in his office. His cigarette falls off the desk into the wastebasket, causing the papers within to burst into flames. The engineer looks around, sees a fire extinguisher, grabs it, puts out the flames, and goes back to work.

A physicist is working at his desk in another office and the same thing happens. He looks at the fire, looks at the fire extinguisher, and thinks "Fire requires fuel plus oxygen plus heat. The fire extinguisher will remove both the oxygen and the heat in the wastebasket. Ergo, no fire." He grabs the extinguisher, puts out the flames,
4
 
max(filter(lambda x: x <= 21, scores)) ?
 
I have this as the long method
 
DSM
See also "assume we have a can opener", etc.
 
if dealer_score > 21:
    winner = self.player
elif player_score > 21:
    winner = self.dealer
else:
    winner = max(player_score, dealer_score)
 
Reminds me of the hot air balloon joke
 
DSM
2:57 PM
@Vader: FWIW, that logic seems pretty clear to me. We could one-line it with max if we wanted, but I'm not sure it would be any better after that.
 
@Kevin I prefer the Microsoft version.
 
@Vader not all rules go like that
 
DSM
@Vader: although now that I look at it, in your first two branches you're setting winner to either player or dealer, and in the last branch you're setting it equal to a score. Can that really be right?
 
that dealer goes over means player wins
 
I always imagined the Microsoft campus as having many squat buildings, rather than one tall one.
 
2:59 PM
@DSM yes I am working on this very problem atm
I will maybe have to use something like map
 

« first day (1586 days earlier)      last day (3355 days later) »