« first day (1944 days earlier)      last day (3002 days later) » 
02:00 - 19:0019:00 - 22:00

2:21 AM
Hello all. Anybody experienced with Scapy and/or XPath?
 
 
3 hours later…
5:46 AM
CBG all.
@poke hmm yeah saw the source code after you said. But this was the first time I saw a page like that so was impressed.
 
 
2 hours later…
7:46 AM
Good morning
a python question to the forum

I'd like to sort dictionary by forth value in dictionary keys :
dictionary example :

d={
('a','b','c'):(1,2,3,4),
('a','d','b'):(1,2,3,5),
('g','d','b'):(1,1,1,8)
}

I'd like to sort by 4,5,8
Thanks !
 
8:02 AM
Greetings, @Toren. This is a chat room, not a forum. And Stack Overflow is a Question and Answer site, not a forum. But anyway... Normal dicts in Python are ordered based on the hash of the keys, so they aren't sortable. But if you convert the dict to a list then you can sort the list. Eg,
d = {
    ('a','b','c'): (1,2,3,4),
    ('a','d','b'): (1,2,3,5),
    ('g','d','b'): (1,1,1,8),
}

a = [(k, v) for k,v in d.items()]
a.sort(key=lambda (k,v): v[-1])
print a
output
[(('a', 'b', 'c'), (1, 2, 3, 4)), (('a', 'd', 'b'), (1, 2, 3, 5)), (('g', 'd', 'b'), (1, 1, 1, 8))]
 
Great , I'll take in account all you said
 
good morning
 
8:33 AM
i wanna find the postion of a string in a bigger string, i could use find, but one of the characters of the smaller string alternates, so its not a exact match.. is there still something "out of the box'
 
Yes, regex.
 
seems like alot :)
 
Unfortunately there cannot be a library for every single individual's smallest use-case built into the stdlib.
regex is an incredibly powerful and generic tool that can solve a multitude of problems. By learning to use it you will be getting a very powerful tool for the future.
 
i am not bitching about it
 
8:51 AM
Cabbage!
 
9:16 AM
cabbage
 
9:44 AM
I wonder why I never bothered to use itertools functions. They are great.
 
cabbage
 
ok this regex thing is pretty amazing.. still looking though for the one i need
 
M_T
10:32 AM
good morning
 
@PM2Ring Sure sir thank you
 
10:49 AM
any body please help in this Error: GtkWarning: IA__gtk_table_attach: assertion 'child->parent == NULL' failed
self.table.attach_defaults(self.slider, 1, 2, 5, 6)
 
M_T
what lib are you using for tests?
 
i am using pygtk
Gtk2
you can see my code here: pastie.org/10717663
 
@Anes You can't add the exact same widget (self.slider) more than once.
I'm not sure what you're trying to do, but get rid of caja_principal.pack_start(self.slider, False, False, 0). You do need to call show on the slider widget, but there's no need to pack it into caja_principal since you're putting it into your table.
 
PM 2Ring : Thanks PM 2Ring , it's my typo ... problem fixed thanks alot
:)
 
M_T
11:28 AM
> python test_um_unittest.py -v
test_numbers_3_4 (__main__.TestUM) ... ok
test_strings_a_3 (__main__.TestUM) ... ok
how to save the output to a file?
i mean line 2 and 3
 
M_T
thx
 
> > to redirect output.
 
12:23 PM
I kind of want to this question: stackoverflow.com/questions/35333234/…
 
M_T
class Test_empty_tree_constructor(unittest.TestCase):
def test(self):
self.assertEqual(type(Tree()), None)
does that make any sense to you guys? just checking if empty constructor returns nothing? I mean it should not create any object
 
Why do interview people like bombarding with datastructures questions
 
cbg
 
@M_T No, such a test doesn’t make sense to me. Unless you overwrote __new__, but the initializer __init__ will always end up with an instance of the object (since it doesn’t actually return anything), and only an exception can cancel that (in which case you should test for an exception)
 
M_T
When i run python unit_tests_1.py and the class tested ( eg. Test_non_empty_tree_constructor) is passed why don't i get any info about that?
python unit_tests_1.py
E.
======================================================================
ERROR: test (__main__.Test_empty_tree_constructor)
----------------------------------------------------------------------
Traceback (most recent call last):
File "unit_tests_1.py", line 13, in test
self.assertEqual(type(Tree()), None)
TypeError: __init__() missing 1 required positional argument: 'new_value'
 
12:42 PM
__init__ is not a constructor, it's the initializer. __new__ is the constructor; __init__ is passed the new instance created by __new__.
 
M_T
thanks
 
@PM2Ring For the purpose of “constructor tasks” (i.e. things you would usually do in a constructor), it’s better to see __init__ as the “constructor” though since you shouldn’t usually override __new__.
 
M_T
i dont use new in my class
 
Hmmm. I agree that it's really desirable (or necessary) to override __new__. OTOH, thinking of __init__ as the constructor is a bit misleading, but I guess it's a reasonable approximation for people coming from other OOP languages.
@M_T That means that your class inherits its __new__ method from its parent class. Which is probably the __new__ method from the object class. That's generally adequate.
 
M_T
whats the common approach?
 
12:54 PM
It doesn't really seem like you need a test at all here. You don't want the user to be able to create a Tree by passing it zero arguments; and they can't, because a TypeError occurs if they try.
Do you also want to create tests that ensure that the user can't create a Tree by passing it ten arguments? How about 11? 12? 13? 14? 15? 16? 17?
That said, if you're dead-set on testing that the initializer rejects an empty argument list, how about: self.assertRaises(TypeError, Tree)
 
@M_T Oops! I meant to say "it's rarely desirable (or necessary) to override __new__". Sorry about that.
 
Typos that completely reverse the meaning of a sentence are my favorite.
Gravitational waves detected by LIGO. Looks like DSM's rumor was accurate.
 
:) It's bad enough when the typo creates a legal word rather than garbage... and I wasn't even using a spell-checker...
 
I thought of intentionally writing "Typos that completely revere the meaning of a sentence are my favorite", but that's reaching a bit.
I guess "reverse" and "revere" could be antonyms if you interpret the latter as "enshrine something the way it is now, out of deep respect"
 
1:11 PM
It works for me. :)
@Kevin I hope so. I feel for the LIGO people. It must be unpleasant to invest so much time (& money) on a detector that hasn't been able to detect anything.
 
user559633
Of course there's gravitational waves -- how else would the Silver Surfer be able to shred in space?
 
There are some machines that we should be happy don't detect anything. The "how many times has the universe been catastrophically split in half by uncertainty paradoxes" indicator from Rick & Morty. Seismographs. The "to what extent has the timeline been altered by time travelers with nefarious agendas" detector from Steins: Gate.
 
We've had reasonably good indirect evidence of gravitational waves for decades, in the form of the decay of the orbital period of a pair of neutron stars: PSR B1913+16. But some direct evidence would be nice. Of course, there might be some other explanation for the orbital period decay, but loss of energy via gravitational radiation is the simplest explanation, and the measurements are a good match to what General Relativity predicts.
@Kevin If you like that theme, you should read Greg Egan's stories that feature the Qusp
Just before I started my current Discworld marathon I re-read all my Greg Egan books, plus a bunch of stuff I found online. Quantum uncertainty is a key element in his novel Quarantine, which has an interesting cyberpunk meets film noir feel to it.
 
1:29 PM
Friends there is any option to move a png file in make install to some other folder?
i am working a python project need a sound icon to move
 
There's a lot of dark humour in Egan's work. Eg, there's a scene in Quarantine where the detective protagonist is interviewing the sister of a missing woman that he's trying to track down. In the the background, her kids are playing the latest video game craze: Tibetan Zen Demons on Acid vs Haitian Voodoo Gods on Ice.
 
@PM2Ring Reminds me of Jason Shiga's Meanwhile, where the main character causes uncertain events to collapse the way he wants them to by employing a machine that kills all intelligent life in the universe if its detector doesn't meet some condition.
Then by the many worlds theory and the anthropic principle, the only universes containing intelligent life are the ones where the condition was met.
"destroy the universe unless this coin flip results in heads" -> in all observable universes, the coin flip results in heads
 
@Kevin Ok... I guess that's taking the old "Quantum suicide" idea to extremes.
 
kevin : Can you give a good resource of shutil.move
 
Eventually he opens an ice cream shop and uses it to improve his profit margins. "destroy the universe unless atoms happen to assemble themselves out of the vacuum in the form of an ice cream cone in my hand" is a valid condition for the machine.
@Anes I already did.
 
1:41 PM
@Kevin Hey, when you've got ω universe to select from, you can afford to be ruthless. :) Sucks to be in the destroyed universes, though.
 
You can't feel remorse for being in a dead universe if you're dead :-)
 
One of the oldest "destroy the universe" stories I read was a short story about a machine that took you to alternate universes. The protagonist couldn't figure out why he was unable to return to his home universe. It turned out that the machine propelled itself to an alternative world by annihilating the one it was currently in.
 
From certain moral standpoints, destroying all intelligent life is a morally superior method of forcing favorable waveform collapses than ordinary quantum suicide. "I'll kill myself if this coin results in tails" means that in half of all universes, your children become orphans and your mother cries etc etc. By using a universe destroyer, nobody becomes an orphan.
 
I'll grant you that it is clean. But it's still ruthless.
 
Main characters with cold analytical ability is a common theme throughout most of Shiga's works.
The protagonist of his current story Demon has probably caused the death of a couple thousand men women and children at this point
 
1:48 PM
I need help naming a thing. Anyone available for such a stupid task?
 
Naming things is hard. But you already know that. :)
 
That’s why I need help.
 
@Kevin I think you'd enjoy much of Egan's work.
 
>>> import wordlist
>>> import random
>>> "-".join(random.choice(wordlist.getWords()) for _ in range(2))
'solarizations-confectionaries'
 
Current working title is IdWithLabelViewModel which describes pretty well what it is. It is a view model that contains two properties: Id and Label. It is basically only for giving an id a label.
 
1:50 PM
There you go. Your thing is now named Solarizations Confectionaries.
 
How to write custom code in makefile for file copyinh?
i mean move image file
 
@Kevin I think that will just confuse my coworkers.
 
Well, I mean, I showed you how to move files using Python code. If Python code isn't suitable for your problem, you're going to have a hard time finding help in the Python room.
 
@poke LabeledIdViewModel ?
 
meh xD
 
1:52 PM
Acronyms are better LIVM.
 
@Anes 1). Why are you using a makefile with Python? 2). You do know you can put any normal shell command into a makefile, right?
 
@PM2Ring I think 2) gives a possible reason for 1)
 
what is the correct english phrase for "establishing my future at some place" or "this was my investment into my future at some place"? (or something like that... :P)
 
2:10 PM
Morning cabbage.
 
cbg
 
morning everyone
 
@PeterVaro Dunno, but I think you could use the phrase "stake my claim" there, somehow.
 
Could someone point me towards some reading material that would help me begin to understand what I'd need to do in a django application to track people that buy a product on my site, where they are when they buy it. As well as people who access the site but don't buy something
 
@PM2Ring nah, that means something else :P
 
2:16 PM
@clickhere You mean a payment system? stripe makes payment super easy, just save all identifying info you need in the metadata for each object
 
what I want to say is, I placed the foundations of my future there..
 
@clickhere As for people who don't buy things, check out some kind of web analytics.
 
@PeterVaro That was my place before I became a tyrant
 
Is this not really a django thing but a more general thing then?
 
It works on HTTP requests which are pretty independent of framework of choice. What's probably more important is the database you're using. Django uses Postgres, right?
 
2:18 PM
@BhargavRao :P well.. something like: this was a good decision, because that led to something great there
 
You want to track people that buy things, and you also want to track people that don't buy things. It's funny to me that you'd post your question like that. "How do I track people wearing hats, and also people that don't wear hats?" would have been equivalent.
(more charitable interpretation: he's saying "I want to track people that buy things. I also want to track people that don't buy things, but I recognize that tracking will necessarily be less precise for them since I don't have their payment information, and they are a secondary concern to me anyway so I'll still be mostly satisfied even if I can only track the first category")
 
@Kevin, I'd like metric related to the two though. Like how long they were on the page. If someone accesses the website and clicks away in 2 seconds they haven't digested enough to really formulate an opinion like "I don't want to buy this thing"
 
It's a tautology because you're tracking the set, and everything outside of the set
 
Use Google Analytics and send custom events.
 
Hi, i learn something about webscraping, but when i use requests.get it works good but on one site it does not work and raise_for_status prints error 404, not found for url. Anyone knows why on this site it does not work?
 
2:21 PM
@corvid If I’m collecting all good questions and all bad questions on SO, I am collecting all questions, but I still have them in separate sets. And that separateion makes it useful; not the summed result.
 
@znawca Maybe the site is analyzing your user agent data and rejecting you because you look like a robot.
 
@znawca No idea. Have you tried using the site's API?
 
@Kevin Not everybody gets treated like you are Kevin.
 
@corvid Not quite. I get the impression that clickhere is interested in the ratio of (visitors who buy) / (all visitors)
 
:-p
 
2:22 PM
poke, thanks, i'll look into that
 
not yet, it is normal site: www.transfermarkt.de
 
Alas, ich kann nicht deutsch sprechen weil bin ich ein Krähe :(
 
@znawca Even “normal” (not sure what’s the definition of normal here though) sites can reject bots.
@corvid move then “bin” to the end
 
From context it seems "normal" means "something that doesn't have an API"
 
I think it's nicht sprechen too, not nicht deutsch sprechen, right?
 
2:28 PM
Not sure what you’re saying now, but “ich kann nicht deutsch sprechen, weil ich eine Krähe bin” would be just fine
 
i'm just confused why it does not work only on this site, i thought there is simple reason
 
I was serious about my user agent suggestion, if that wasn't clear.
 
so what can i do with it? I am only learning about web scraping, can i do something simple to look not like a robot?
 
Let's see, how about:
import requests

url = 'http://www.ichangtou.com/#company:data_000008.html'
headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36'}

response = requests.get(url, headers=headers)
print(response.content)
I'm surprised that no fast guns answered How do i print certain line from a text file in python? with print open("input.txt").readlines()[line_number]
 
Thank you, now raise_for_status() doesn't print any error so i can go next
 
2:39 PM
Nice.
 
Hey
Could someone help me with something?
 
> You may ask your question without a preamble.
> For example, you do not need to say “anyone here know Django?” before asking a question about Django. Even if you do, the Django experts in the room might not step forward until hearing the actual question. They may not wish to commit themselves to help until they know how much effort it will entail.
 
Oh
It's fine my question was answered
:)
stackoverflow.com/questions/35342278/… May I know why this got two thumbs down? I know it's the users choice, but am I doing something wrong here?
 
I guess the downvotes would fall under "does not show research effort", since the documentation on percent-style formatting tells you exactly how to escape percent signs.
From printf-style String Formatting: "The conversion types are: [...] % - No argument is converted, results in a '%' character in the result."
 
Well thank you
 
2:52 PM
Yup, that would be why I downvoted. If you haven't read the docs first, you shouldn't be posting a question.
 
Which is that PEP that mentions the advent of format instead?
 
The documentation is a little muddy there so I wouldn't have downvoted on that basis, but I understand why others might.
 
@GauthamSK You might be interested in format
 
> Note: The formatting operations described here exhibit a variety of quirks that lead to a number of common errors (such as failing to display tuples and dictionaries correctly). Using the newer str.format() interface helps avoid these errors, and also provides a generally more powerful, flexible and extensible approach to formatting text.
Pretty damning that the documentation for printf-style formatting basically says it's inferior to format. :-)
 
Just got an email from a headhunter/recruiter with the following at the top:
> One of my friends has put together an interesting ranking of Stack Overflow users based on quality, not just quantity of their answers, using the Elo rating system and the Stack Overflow public API. Your profile comes out as one of the top rated answerers globally (given your reputation this may not come as a complete surprise, but it’s worth noting your rating ranks you significantly higher than your reputation!).
Finally my fake internet points are paying off!
 
2:56 PM
Not strictly inferior, mind you. Just less powerful, less flexible, and less extensible.
 
Is there a major difference syntax wise between Python 2.7 and 3?
 
@GauthamSK String formatting apparantly
 
just syntax specifically? print stopped being a keyword, you can't do lambda (a,b): expression any more, and nonlocal was invented.
 
Thank you
 
2:59 PM
@Kevin How isn't it strictly inferior?
 
Jeeze, if I knew that I could get job offers for having a good rep/answer ratio, I'd spend more time bugging clueless users to give me an accept already.
 
A lot of tutorials and courses online Python 2.7 based.
 
Yesterday I got a "this helps, thanks" comment from OP but nothing else. Maybe I should go harangue him so that headhunter will like me more.
 
The only downside to str.format I know if is that style of formatting requires a really OO approach to things, but that's just a requisite, and it's fulfilled so who cares?
 
3:00 PM
@QuestionC Well, I think it is ;-) but the documentation writers are very tactfully avoiding saying that outright.
 
@Ffisegydd Is that mail from Frank?
 
@Ffisegydd Here is the Elo-Rating based system for SO stackrating.com/list/byRating
And the stackapps post stackapps.com/questions/6298/…
 
@GauthamSK There isn't a big difference in syntax between the two versions. For beginners, the larger problem is that some functions got renamed (ex. raw_input became input, and 2.7's original input function was removed entirely), and some modules got renamed (ex. Tkinter became tkinter).
 
@poke Yep :D
 
I'm 460th :o
 
3:04 PM
For someone with less than, say, two weeks of experience, they're not going to be able to copy code from a 2.7 tutorial and paste it into a 3.X environment and get it to run. Expect many ImportErrors and NameErrors and AttributeErrors.
 
@Ffisegydd :D Got that one last month
 
He mustn't have gotten any replies and now he's dropping down the list :P
 
He missed me? :(
 
He hasn't dropped that far yet.
 
@Ffisegydd I did reply though
 
3:05 PM
But after the initial growing pains, it's pretty easy to convert between the two. "why isn't my program working? Oh yeah, it's because reduce got moved from the built-in module to functools. I'll add an import statement and it will work"
 
@poke yeah I always reply. Depending on the style of the recruiter it's either "Please take me off your mailing list immediately" or something more polite.
 
I'm 1,897. :/
 
This guy actually mentioned a few things in the email that are personal to me, so he must have taken at least 20 seconds to read up and type them in, thus putting him significantly ahead of a lot of other recruiters.
 
Nice! I'm 35th!
#Madeyoulook
 
@Ffisegydd Yeah, same. If they were nice, I will be nice. If they suck, I’ll tell them to go away.
 
3:07 PM
@Kevin Gotcha
 
@IntrepidBrit Without that hashtag I would have.
 
Lol ^^ Same here
 
I should start answering questions again.
 
Finally!
Congratulations @davidism
 
3:09 PM
Melons. No more retagging to python
 
I need to make the final push to get python-gold.
 
yep :-)
 
I really should start trying to answer questions than my usual lackadaisical answering to questions I'm actively seeking the solutions for.
 
now on to
 
12 more for fizzy then
 
3:10 PM
How many years have you all been coding?
 
I'm just a month into learning Python.
 
I wonder what the ratio is between "interviewers impressed by one's high reputation" and "interviewers turned off by the fact that you spent so much time on SO instead of doing something productive"
 
16…
 
@Kevin worked for Martijn. Or do you think he's just gone so far beyond answering that he's come out of the other side into high productivity?
 
3:11 PM
I’m old.
 
32 ...
 
This is probably a silly question, but if you have a regex like (?:\r|\n|\r\n|\n\r)+, and you have a string like Question?\n\r, will it match from the \n\r or the \n and \r separately?
 
@Kevin My response is "the quality of the Flask ecosystem is productive*.
 
@BhargavRao WOW
 
@GauthamSK he's lying. Or rather he's joking in 2**n.
 
3:12 PM
I just doubled poke's value as it was double of Fizzy's
 
Haha
 
@Ffisegydd Yeah, the second one.
 
@poke Impressive
 
@corvid With that order? Separately.
 
Kind of like Commander Vimes and Knurd.
 
3:13 PM
Just use [\r\n]+ though…
 
So the order does matter? Ie, you could put \n\r first in the non-capturing group and it will match that first?
 
This seems like implementation-dependent behavior.
In an academic sense, "(a|b)" and "(b|a)" are interchangeable.
I'm struggling to come up with an example where order of matching would matter and have an observable impact on program behavior.
Who cares whether it matches \r\n or \r followed by \n, if groups() returns the same value either way?
 
@corvid Parsers will always use the first matching thing first; and if they can match the full word while doing that, then yes, that’s what’s happening.
The alternative would be to backtrace although you already have a match to figure out whether you get a “better” match or not.
I.e. that would always test every possible combination.
Leading to non-terminating programs for infinite combinations.
In language parsing, you usually optimize your grammar so you find common prefixes. So a ab|ac would be changed to a(b|c) so there is only a single path to go for the a.
 
Closed with the wrong dupe
 
@BhargavRao Is the new dupe correct?
 
3:25 PM
Yep.
I went with the earlier dupe because it solved the complete problem of the OP. But the new dupe is better
 
DSM
Cabbage for all!
 
Cabbage DSM
 
How do I convert a bool to a string and change it to lower case?
 
str(var).lower()
 
'true' if b else 'false'
 
3:27 PM
Thanks @Kevin
 
poke's way is probably faster as it avoids 2 function calls.
rhubarb
 
('false', 'true')[b]
 
Rhubarb PM
 
Rbrb, PM
 
>>> x = True
>>> "ftarlusee"[x::2]
'true'
>>> x = False
>>> "ftarlusee"[x::2]
'false'
6
 
3:28 PM
I didn't understand poke's code
someone explain in simple terms. I'm new.
 
#`x = a if b else c` is a single line equivalent to:
if b:
    x = a
else:
    x = c
 
@GauthamSK It's a ternary expression
 
Oh.
^_^
 
DSM
@Kevin: that's mad crazy what you did there.
 
:-P
 
3:31 PM
from sys import argv
from os.path import exists

script, filename = argv

print "Program to check whether a file exists"
print str(exists(filename)).lower()
 
Not sure if you are aware, but print can be used with values that aren't strings.
>>> x = True
>>> print x
True
Tadaa, no conversion required
"But I really really want it to be lowercase", you hypothetically say? Ok then, carry on converting.
 
What I wanted to do was convert the bool that the program returns to lowercase so I can pass it through a if/else statement
 
>>> tests= ['''str(var).lower()''', """'true' if var else 'false'""", '''('false', 'true')[var]''', '''"ftarlusee"[var::2]''']
>>> for t in tests:
        print(t)
        timeit.timeit(t, setup='var=True', number=10**7)

str(var).lower()
2.0251760863469173
'true' if var else 'false'
0.1957775932758068
('false', 'true')[var]
0.2893688383524591
"ftarlusee"[var::2]
1.0433897286171714
I have to admit: I’m a bit surprised that the last one is that good.
 
"So I can pass it through a if/else statement". Not sure what you mean by that. bools can be used in an if/else statement just fine.
 
Lol. Nvm.
 
DSM
3:33 PM
In a sense that's the natural thing to use in an if/else..
 
In fact, converting to string before using in an if will give you weird results:
>>> x = False
>>> if str(x):
...     print "x is 'false' but somehow this executed anyway"
...
x is 'false' but somehow this executed anyway
 
x is 'false' but somehow this executed anyway -- x is false not False :P
 
(hint: it's because strings are "truthy" as long as they aren't empty)
 
((note that Kevin refers to empty as empty, not 'empty' :P))
 
3:36 PM
if 'empty':
    print('this still gets printed')
 
Must ... resist ... urge to triage PHP questions as unsalvageable.
 
Isnt this correct?
 
DSM
False is False, and False is false, but False is not 'False', and 'False' is not false.
 
answer = raw_input("Is your answer true/false?")
answer.lower()
if answer == true:
print "Correct answer"
else:
print "Better luck next time."
 
answer is a string, so you need to do if answer == 'true':
 
Morning. I am trying to write a client(python) which keeps an open connection with server. So planning to go web socket route(or if change my mind, go to autobahn). My server is nodejs. Do i need to use web socket there too or can i work around without doing too much.
 
Note that answer.lower() does nothing to answer. It returns a brand new string with some characters changed. You didn't assign it to anything, so it just gets discarded.
 
DSM
@GauthamSK: try print answer after answer.lower().
 
Also, when you post code, highlight it all and hit ctrl + K to retain the code formatting.
 
DSM
Aargh, Kevin'd! By the original!
 
3:39 PM
@AjGauravdeep You can only connect via websockets to something that hosts websockets, yes.
 
@poke Me too, actually. I guess str(var).lower() suffers due to attribute lookup overhead.
 
@davidism Did you go through the gist of to be delved questions again? (Many must have been deleted by now)
 
@poke Got it. Thank you.
 
Global tkinter entry box has no attribute 'get'. Duplicate that I can't hammer because it didn't originally have the python tag.
 
@BhargavRao yeah, thanks
 
3:50 PM
Nice. If you have the updated list, we can again ask for delv-votes on the remaining ones.
 
stackoverflow.com/questions/35343712/… Give me teh codez. Literally asks for people to finish their homework.
 
There's one that wan't deleted yet, and I need to go through the rest of with or .
 
stackoverflow.com/questions/35343486/… (C# question, but super opinion-based)
 
DSM
@MorganThrapp: the answer isn't even valid, because class is a keyword..
 
@DSM Good point, didn't even realize that.
 
3:53 PM
most of the ones are just overzealous tagging, the questions are usually just about pyramid
 
@davidism Does that really have to be deleted? The answer looks kind of valuable.
 
That's the only one left? That's good to hear
 
@poke hmm, I guess it could be edited to be just about drf, right now it's asking for recommendations
 
DSM
I know we've had this discussion before, so there's no point in rehashing it, but I really don't see why closing questions doesn't suffice.
 
the other answer is a recommendation though
 
3:56 PM
@davidism I’m just a bit hesitant to delete a question that gathered 9 upvotes, 4 stars, and an answer with 12 upvotes. Apparently it did help other people too, so leaving it there is likely more valuable that deleting it.
A question being closed does not imply it having to be deleted too imo.
 
@DSM for the ones I've been focusing on, it was a lot of opinion based stuff about "which framework is better" that was either wrong, outdated, or just opinion
the one poke pointed out probably should just be edited, now that you point it out
 
:)
 
@davidism We must ask Joncle to remove our delv-votes on it
 
DSM
Don't they expire or something anyway?
 
Searching meta for that
> Votes to delete or undelete never expire.
 
4:10 PM
well, we could just delete it and undelete it
let's start with reopening, since it's on topic now
 
If I use a file open and a read in a function call anonymously, can I be confident that it'll a) be GC'd, and b) be closed? i.e. func(open('fizzy.file', 'r').read())
Actually I don't really care about the GC, just the closing.
 
pretty sure it's closed when it's gc'd, but there's no guarantee when that happens
 
Yeah that was what I thought would happen.
That GC would close it I mean.
 
Yeah, GC will close it (technically, not really file.close() it but it will release the file handle)
 
If I understand correctly, CPython collects it once the reference count drops to zero. So... Once read completes executing, I guess?
But that's implementation dependent, I assume
 
DSM
Yeah, implementation dependent. pypy won't necessarily get around to closing them, for example.
 
@Kevin I was under the impression that CPython can collect it once the reference count drops to zero, but it wasn't guaranteed to be immediately.
 
DSM
>>>> for i in range(100000): b=open("defs.hh").read()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
IOError: [Errno 24] Too many open files: 'defs.hh'
 
@DSM are you gravitationally happy? (That was intended to be asking if you're happy with the gravity waves announcement, not that you are so gravitationally strong that it could be described as happy)
 
cabbage, all
 
DSM
4:29 PM
@Ffisegydd: it's awesome. Can't believe they picked up such a tiny strain.
 
@Ffisegydd I think it's guaranteed but I have nothing to back it up.
 
@Ffisegydd gravity waves?
 
4 hours ago, by Kevin
Gravitational waves detected by LIGO. Looks like DSM's rumor was accurate.
 
@Ffisegydd did you finish Bands? I read the Secret History short story after, but it felt too much like an info dump.
 
Rhubarb
 
4:37 PM
@davidism I did. I gave it a few days then started reading the secret history this morning.
 
in regex, what's the term called for negating an item in a set? Eg, \d without 9
 
I think Sanderson realizes he needs to get way more info about the Cosmere laid out if the 80's and sci-fi trilogies are going to make any sense.
 
> When an object's reference count becomes zero, the object is deallocated.
I think this supports my view.
 
@davidism Yeah definitely. I can see them being heavily dependant on Cosmere lore.
 
Thought you were talking about U.S. presidential candidate Bernie Sanders for a second there, was ver confused.
 
4:40 PM
I did see a cool explanation about how FTL works, and it's really obvious, we've already read about it. They jump to cognitive and emerge somewhere else.
No technology involved.
 
Yeah that sounds so cool
I need more Hoid in my life.
 
"Mr Sanders, in your opinion, what impact will the Alcubierre space drive have on immigration?"
Many Americans are worried about the diaspora occurring among the zognoids of Alpha Centauri. What sanctions, if any, should be imposed on zognoids seeking to become naturalized citizens?
I remind the candidates that zognoids share a single hive mind, and eat 90% of their young.
 
We need to build a space wall to stop the space refugees!
We must construct a Dyson sphere around Sol to prevent zognoid space refugees!
 
We all know that the Dyson sphere will require just as many space patrols as we have today
 
@DSM Wanted to reproduce that so I can check whether sleeping between helps (to give the GC time); but I can’t reproduce that on Windows.
 
4:49 PM
But dyson sphere construction has a detectable impact on the spectrum emission of its host star, which will attract the attention of every type II society within a hundred light years of us.
 
We will pay for the Dyson sphere by taxing super rich Mi-go from black Yuggoth.
 
Then we won't just have a zognoid problem, we'll have a ngngng problem and a ch!qrrk problem.
 
DSM
@poke: opening lots of files without closing them on pypy, d'you mean?
 
@corvid how do you even do that?
 
@holdenweb I haven't got the slightest idea
 
4:51 PM
Corvid doesn't know how he does anything. He works purely by instinct. If he thought about what he'd do then he'd suddenly realise he knows nothing and be rendered useless.
 
@DSM does it have to be pypy?
 
You can negate a set, but I've never heard of subtracting characters from a set, let alone a pre-defined one like \d
 
> My whole being exists in a formless void. My senses are idle. My spirit, free to work without plan, follows its own instinct. In short, my program writes itself.
 
@corvid It’s called explicitly listing the remaining items: [0-8]
 
Joking aside I usually do find that if I just don't think about it and instead let my fingers just type I write really truly awful code.
 
DSM
4:53 PM
@poke: well, CPython has different behaviour, so I think so. I brought it up in the context of implementation differences.
 
My instinctual code is akin to a hideous painting composed entirely of individually beautiful brush strokes.
 
@corvid I guess you could also do ((?!9)\d) except don’t do that.
@Ffisegydd Let me try that: ighawgwfaggf awoö gijawoögihawgoöiawhgöoaiwgnaiwögnvmölsdvima öoeifaowegijawöogeiasnöefivanw efgoöawga
You’re right.
 
I abruptly exhaled air from my nose. 8/10 would read again.
 
xD
 
brb, meeting
 
5:00 PM
@poke The only problem is I am after .+ without \r, so naming them all would take forever and space
 
@corvid Don’t enable the DOTALL flag then?
By default, . doesn’t match newlines
Anyway, heading home, rhubarb
 
Anybody here worked with Jupyter's widgets at all?
 
Hello!
 
5:23 PM
Ho hum, back to the salt mines. Rhubarb, all
 
6:15 PM
readies the omnidirectional cbg cannon
 
So if the dependency fails, it installs the dependency?
 
dabeaz actually implemented that in one of his talks, but never to be taken seriously
 
DSM
6:33 PM
@poke: wow.
 
02:00 - 19:0019:00 - 22:00

« first day (1944 days earlier)      last day (3002 days later) »