« first day (1377 days earlier)      last day (3796 days later) » 

00:21
0
Q: IPython %edit command: Temporary text document it opens is read only

aliteralmindThis is cross-posted from super-user. I'm not sure where it belongs. I just installed IPython, and am beginning with Python. I'm trying to use the %edit command. It opens my text editor (TextPad, Windows 7), but the document is read only. I can't type anything. I unchecked the read-only flag,...

Regarding this comment from this afternoon, it seems I've uncovered a bug in IPython.
 
2 hours later…
01:53
@DSM it turned out that the idiomatic solution is that the argument has to be a simple void* which will be casted into a void** inside the function body. Because that is the only type (an incomplete one) in C which can point to any object, and actually void** is a pointer to this incomplete pointer, not a pointer to pointer to any object. However it makes perfect sense now, it feels a bit unintuitive..
but at least I learned something today ;)
02:52
Is using try: except; else actually encouraged?
the else part seems like it harms readability
what i mean is: "If i ever have code that can be moved from the try into an else block, should I?"
I guess part of my issue is that it means moving code all the way over to the other side of the exception handling (or do I not have to?)
try:
    # something that might raise
except Exception:
    # will only run on raise
else:
    # will only run on no raise

# will run either way
yes, I get how it work. let me explain more.
So else is useful for knowing that something happened successfully without having to set any flags or check the state of what was run in the try block.
putting code strictly after is fine in most cases, but you can't know that no exception happened that was caught and suppressed
to answer your question, don't move code into the else block unless it specifically requires knowing that no exception occurred
what i am getting at is:

try:
# something that might raise
# somethat that will only run on no raise on previous line (That (today) i don't expect to throw this exception)
except Exception:
# will only run on raise
do not put other code in the try block. only put in code that you want to catch an exception from
03:06
Yes that was what i was getting at.
code that does not directly concern the set of exceptions you are catching belongs after the block
in an else block, if it is dependent on no execption being raise?
It seems really akward to have my "happy path" logic split up into the single exception throwing function call in the try block then a big chunk of code to handle the exception, then the rest of the happy path.
it is not, it's the way it's supposed to be
03:10
While it is the way it is supposed to be (by the designers intent), that in and of itself does not make it less akward.
You can obviously do it however you want, but it is not best practice to put more than the minimal amount of code necessary in the try block.
try:
    function_that_can_raise()
    other_function()
except KeyError:
    print 'function_that_can_raise failed'
but what if it turns out other_function (perhaps written by a library you don't control and don't know the nuances of) can raise a KeyError too?
if the second key error requires some other logic to handle, or the second keyerror is unrecoverable and should be propagated, you've just unintentionally masked a bug
Indeed.
Today it seems unlikely that other_function will raise this precise error the first one will. But tommorrow, who knows.
and good habbits.
thanks
04:14
@davidism What happened to our useful comments page?
Ah, It has been moved to a different location. Sorry about that ping :p
04:40
cbg all
 
1 hour later…
05:53
When would str function throw an exception?
Trying to convert bytes that contain invalid unicode code points?
cbg
@davidism Let me try that now. @Jerry Cbg
b = '\x01\x02'
print(str(b))
It still works fine :(
ain't \x01 and \x02 valid code points?
I get some kind of smiley with both
this doesn't change the fact that they're valid code points, but it should be b'' for a bytes type
06:05
cbg all
Cbg all
@thefourtheye You might consider this cheating, but:
>>> str(b'x', encoding="invalid")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
LookupError: unknown encoding: invalid
x = bytes(random.randint(0, 255) for _ in range(256))
str(x, 'utf-8')
the doc say it will return __str__ or __repr__ if an encoding is not specified, so it just returns the repr of the bytes when no encoding is given
@Ffisegydd nothing changed, but I installed 1.0 on sopython
Ah OK cool. I saw your dev guidelines too.
@ZeroPiraeus In Python 2.7? ;)
06:14
Different exception :-P
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> str(b'x', encoding="invalid")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: str() takes at most 1 argument (2 given)
unicode -> str error in Python 2.7:
str(u'/人◕ ‿‿ ◕人\')
>>> class X: __str__ = None
...
>>> str(X())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'NoneType' object is not callable
Same exception across 2.x and 3.x ;-)
06:36
@davidism Ya, that gives UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-2: ordinal not in range(128)
@ZeroPiraeus And this counts as cheating :D
07:12
Should it be flagged?
07:24
Flagged it and now it's deleted
Wow, now the whole question is deleted
the user was deleted apparently
Morning all :)
cabbage
@Jerry you've seen the comment?
yes
07:33
cabbage ....
Cbg @AvinashRaj :)
Hi! Everybody
@Jerry
@AvinashRaj That's because you don't have \n at the end. — Jerry 1 min ago
Op's mistake...
and you said it works fine
he failed to put the input as two seperate lines.
07:38
that's obviously a sample input...
人◕ ‿‿ ◕人
the ears were... torn apart?
@user3620828 nice pic. Oh it's not.
that's the original: /人◕ ‿‿ ◕人\
07:41
it's kyubey, from the anime madoka magica
oh, it misaligned...
Morning
Afternoon
08:04
cbg again
08:38
again cbg
Lix
Lix
I'm looking to add a key:value to dicts within some list comprehension. This is what I have got so far:
[ dict( newKey = True, **m ) for m in some_list ]
Does anyone have any readability comments for that line?
That will create a list full of dicts, is that what you want?
Lix
Lix
Am I overdoing things with this one-liner?
@Ffisegydd - yes.
Any ideas why this query is causing an error in SQLAlchemy 0.9.6 while working fine in 0.9.1? gist.github.com/ThiefMaster/4b886b1e77efb13fbfbe
@Lix what is some_list filled with?
Lix
Lix
08:44
@Ffisegydd - It is a list of dicts that is missing newKey. I just want to add this flag to each one in the list.
My first guess would have been to use m.update({"new":"stuff"}), but update doesn't return the modified dict.
I personally wouldn't use a LC in this case as it'll cause you to make a new list. I'd just iterate over your existing list using for d in my_list: and then update them.
Lix
Lix
@Ffisegydd - thanks for your feedback.. Looks like I was striving too hard for brevity :)
Rhubarb and Melon!
09:11
never seen someone write variables as such contours_, thresh_
09:24
cbg
cabbage you merry bunch of reprobates
I'm confused; why exactly did this question deserve upvoting?
/me voted to close it as OT instead.
09:39
@MartijnPieters There are strange people in this world.
@MartijnPieters Maybe he has a second account, and that one is his "where I ask really stupid questions" account? :P
@IntrepidBrit Roight, and then you sock-puppet it up.
@ThiefMaster Oi, no promotion of your fresh questions here! Not even if you are a moderator, you sneaky b'strd.
5
@ThiefMaster: Or as we normally put it: Can I invite you to take a look at the chatroom rules, specifically the section on posting a question link?
@ThiefMaster Looks like there has been some work done on 0.9.4. I'm no SQLAlchemy guy though
@MartijnPieters To be honest, when I see something that weird, I'm starting to think "bot" more than "non native English speaker"
09:59
@IntrepidBrit yeah i've read something vaguely related in the changelog, but the code modifications didn't contain anything obvious to someone not working on SA itself ;x
@ThiefMaster Yeah, all_columns was mentioned. Maybe they fiddled with that and broke it? I've they've not fixed it in the newest version, then it might be worth flagging with them
10:26
Wheee, that was a fun one.
Tracing a hanging exception hook to a faulty abrt automatic bug reporting tool.
10:44
Ah prioritisation failures abound here today
@MartijnPieters Got to love it when your support tools actually create problems
@IntrepidBrit I'm glad I don't have to further debug why their socket is hanging.
The Mozilla bug report was interesting; good call on the one that realised it could be the network card firmware.
@IntrepidBrit Hah! The Mozilla report is about a problem in the support tool supporting a support tool. :-P
Reported in a support tool, of course. Turtles, all the way down!
> *funny note: this is a crash report (abrt) issues for our crash reporting service (socorro) o_O
11:00
@MartijnPieters It's not the usual first port of call
@MartijnPieters Aaah Pratchett
Pratchett popularised the expression; but he was just paraphrasing Stephen Hawking. :-)
But yeah, I got it from Pterry.
@MartijnPieters Ha! I learned something new today :)
11:24
@PeterVaro No, but I read the book
12:02
Is there any official source recommending the use of _ as a name for unused variables? I ask because of this question.
Oh great... another plane that's vanished.... is the Bermuda triangle moving about a lot recently?
@Kevin It's a convention, I haven't found any actual documentation though.
Closest I've come is Lexical analysis 2.3.2, "When not in interactive mode, _ has no special meaning and is not defined."
With a footnote about special usage in the gettext module, which doesn't seem relevant here.
yup, which is what I have used it for most.
12:16
@JonClements Or people may have just started paying attention to the missing planes.
or are there some portals created by aliens and the planes are going to a different world altogether
@JonClements If the Bermuda Triangle can make things inside itself vanish and reappear elsewhere, does that mean it can make itself vanish and reappear elsewhere?
Can we say "the Bermuda Triangle is inside the Bermuda Triangle"? Is this a tautology?
Does the set of all sets contain itself?
Thinking about KevinScript today... I would like all of my objects to have a attributes attribute, which is a dictionary containing all attribute name/values.
But the attributes dict is also an object, so it too must have an attributes attribute... And so on. It's dicts all the way down.
12:33
Although - Aliens is probably more feasible than the Bermuda Triangle...
@Kevin JavaScript's prototype model works like that only ;)
I confess I don't know much about js prototypes.
That's nice - DO issued a 7c credit due to an outage... I don't recall an outage :)
I was thinking of a dynamic solution where attributes doesn't exist until the moment the user tries to access it. Not that my interpreter currently has the capability to execute code in response to a get request
@Kevin Every object's internal __proto__ property will have its Parent prototype object.
12:38
@JonClements Now you know what you must do - create an automated system that crashes the power grid every night shortly after you fall asleep.
Free credits!
Me and my friend are trying to work out how you can encode a watermark into an image using Fourier theory.
@Ffisegydd wow - you know how to party!
Darn tooting I do!
You're just so darned rock'n'roll - might have to learn how to reign yourself in now and then :)
Can't stop the signal!
12:39
Ah, steganography, the concealment of hidden information in an image.
Somewhat less interesting than stegosaurusography, the concealment of hidden information in dinosaurs.
13:00
Ah, Python blanket, anyone interested?
Nope - I only like Boa Constrictors to keep me warm...
Careful puppy, they can eat us....
They wouldn't do that... just give you a nice firm hug....
@Kevin some say it was better than the film -- as it used to be -- but then nvm, probably the book is more detailed than a 2 hours film can ever be ;)
Yeah, I have heard reviews of the film that say something similar.
Neat.
these amateur shots always amazes me..
how much time did s/he spend to take that few seconds animation..
moin cbg
opinion poll: nested named tuples aren't wise
I'll go with "False".
I'll have to agree
13:58
What will happen if I don't receive any answers on a question where I set a bounty?
No refunds, sorry
you set bigger bounties until you get an answer
50k bounty
I think if you want to next time, the bounty range doubles...
14:22
@thefourtheye Then your question still got the attention you paid for.
Bounties are not a guarantee-you-get-an-answer service.
They are advertisement.
good morning everyone
gmorning
cbg
@thefourtheye where q?
@AnttiHaapala cbg, and afternoon
you moved to the other side of the frosty pond, have you?
??
nope :D
cbg
14:30
still here, only barely awake :D
It's afternoon where I am standing, with Finland being later, not earlier.
I am having 5 o'clock beer here at a pub yes.
Time for afternoon tea, not breakfast!
Yeah, or that.
Microsoft CEO Satya Nadella has said that his company will be working to combine all Windows versions into a unified release by next year.
Bye bye windows, you will not be missed...
@MartijnPieters Thanks :) Got the idea
14:35
@thefourtheye Have you tried to look for answers on ServerFault yet?
Gah the plural for species is species! My brain...it melts...
Just learned how to bypass the character limit in comments
although server fault does demand a professional mindset.
@MartijnPieters I tried only google and I was thinking about searching in Unix SE
Yeah, Unix / Linux SE is the other one I was thinking of.
14:37
But this is more of a programming question, I want to know if we can enable it with socket options.
Is there anyway we can advertise this question in Unix SE?
@MartijnPieters hardly serverfault
No, I have to retract that advice.
The plural for status will blow your mind
I don't think they'd be too happy about that question.
@IntrepidBrit Wow, I didn't know the plural was "bomb". Mind == blown.
14:40
ipcomp 108 IPCOMP # IP Payload Compression Protocol
ip payload compression protocol is a separate protocol yes
@AnttiHaapala But thats normally used with IPSec protocol it seems.
the question is:
Each IP datagram is compressed and decompressed by itself without any
relation to other datagrams ("stateless compression"), as IP
datagrams may arrive out of order or not arrive at all. Each
compressed IP datagram encapsulates a single IP payload.
:P
@davidism your welcome ;)
so question is how you suppose you can compress it any more...
from 128 bytes
it is datagram wise compression
Yup, that is why I wonder if this will have any impact on the actual performance of the network. Still we need to measure it :(
14:43
@IntrepidBrit alternatively "wind"
@thefourtheye basically none, as as far as I understand,
it would do mtusplitting at 128
and only then compress each packet, trying to go below 128 - if not, then the packet is sent uncompressed.
Someone kill me. I just used your in the wrong context
from __future__ import grammar.terminator as arnie

arnie.execute(@IntrepidBrit)
@AnttiHaapala I read it one of the old RFCs that, if the Payload is lesser than 90 then compression will not be performed it seems.
it goes so that, it can do compression whenever, but
as it is datagramwise, the datagrams need to be split before...
anw, in such a case, the question is why to use ip at all
why not something like can
that is something else for layer 3
But can cannot support HTTP, right?
14:51
hnnhnhn
hmhmh
:D
so you have like in the OQ, a separate network with nodes with low mtu, and they talk with each other only, and must use tcp and gasp http :D
but that then on compressed sockets
Yup :)
That is why I set bounty on that question ;) It describes what exactly I want.
cbg @Johnston
How's it going @JonClements
going good thank you @Johnston - yourself?
15:03
Great! Walked out the door at 4:30am this morning to drive to work. Normally work from the couch.
heya @Benjamin
How do you get the line number from beautifulSoup
It said you can get it from html5lib.
Hey @JonClements how are you?
Everyone who'd like to contribute I've asked a new meta question and I'd like your opinion/input.
@Benjamin definitely interesting :/ I didn't realise people were doing that.
Me neither :/
15:09
Is it multiple people you've noticed this from or just this particular user?
​​​​​​I did that a few times :|
I've deleted answers where I had it wrong and wanted to fix it without getting downvoted while I was doing it, but never deleted it just to get the "1st answer" spot
@BenjaminGruenbaum seen the new sopython yet?
I meant, I posted answers with contents like "The place for my answer" when I saw that the CV count is quickly rising
That's probably even worse :D
@JonClements looks nice :)
@Benjamin good old @Ffisegydd and @davidism
I think pineapples are in order for everyone involved.
Pssh I wrote some sentences and messed up the commits :P davidism did most of it.
15:25
@davidism pina coladas surely? :p
Sheesh, my grammar is still horrendous
My VTC instincts are kicking in outside SO: github.com/mitsuhiko/flask-sqlalchemy/issues/211
user559633
that's amazing
user559633
^^ my favorite twitter exchange by the way
15:37
Do you guys get updates when you get upvotes?
What updates?
anyone use flask-openid? I'm not entirely sure if I am doing it right
The green color box in the top bar which used to appear when someone upvotes you?
Leonard is an intern at an experimental laboratory complex situated on the sea floor. Due to a series of improbable accidents, the water pumps have failed and the lab is flooding. Leonard's only hope is to restart the generators. Frantically, he tweets to the chief engineer, Guido, "HOW DO I USE GENERATORS". Unfortunately, he got Guido's twitter handle wrong...
10
@thefourtheye Usually yes
15:40
Please let me know if you still get it, I dont seem to get it now.
user559633
bra-frickin-vo @Kevin
Coming to theaters near you.
python 3.5, finally they remove the fsckup time.__bool__
user559633
IM NOT FRICKING KIDDO GUIDO HELP
user559633
@AnttiHaapala what do you mean? was time.__bool__ a py3 feature?
15:43
@AnttiHaapala wow, thought they had already fixed that
@tristan nope, it is python 2 feature from when datetime was implemented...
user559633
>>> datetime.time.__bool__
<slot wrapper '__bool__' of 'datetime.time' objects>
user559633
python 2.7.8
AttributeError: type object 'datetime.time' has no attribute '__bool__'
it would be __nonzero__ in 2
Are we talking about the weirdness where if time: executes only when time is not midnight, or however it works?
15:44
namely if time is naive or it is aware AND TZ has positive UTC offset, the UTC 00:00 is false
yeah
clients are so weird :|
@Kevin yeah, sort of ... but not quite
user559633
that's kind of awesome
the whole datetime is a fsckup
15:45
I thought it applied to all datetime things, but they just mention time
user559633
nothing you do at exactly midnight UTC happened
@davidism nope, datetime does not even have bool...
cbg @Jerry
>>> datetime.datetime.__nonzero__
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: type object 'datetime.datetime' has no attribute '__nonzero__'
>>> datetime.time.__nonzero__
<slot wrapper '__nonzero__' of 'datetime.time' objects>
cbg @JonClements
15:46
it is so funny
how so many people there in the bug thread debate how it is so that many people rely on this :D
100 % of people who I surveyed did not even know what is the behaviour
I learned it in last month...
I only wish datetime wasn't simultaneously the name of a module and class. If only because ill-informed SO users will "helpfully" remove the import statements from their code, so you don't know if they're doing import datetime or from datetime import datetime
I wish it was CamelCase
as per most new classes now
but now gotta go
That would help, yeah
Whew... I wrote an answer assuming sort was stable, but wasn't totally sure until I looked it up now.
LIVING ON THE EDGE! radical guitar solo plays
@Kevin Python's sort is stable, right?
@thefourtheye yeah... it's guaranteed to be stable :)
15:54
Ya, I always confuse Python's sort with JavaScript's sort. Sigh :(
In JS, it is implementation dependent
javascript's sort is slightly awkward imo
Cabbage all!
Wow, a 5th gen iPod Nano (used) sells for 40 quid or so.
On a totally unrelated topic, does anyone want to buy a used 5th generation iPod Nano? :D
iPods still exist?
They do indeed.
But seriously, I am selling my iPod Nano 5th gen in blue, any takers before it goes on eBay? :P
No thanks brah. I've got a shuffle.
16:07
@Ffisegydd Aw :c
I'm also selling a Bamboo Pen and Touch tablet for you arty people.
So, what's everyone up to?
I'm selling the souls of the innocents. Any takers?
What are the specs? xD
Is there much point? Cthulhu will take them all eventually @Crow
cbg @DSM
DSM
DSM
Noonish cabbage to all.
Coobage, @DSM.
16:22
Instructions unclear; 40 squid have been deployed to your shipping address.
on a form, is it better to have a field for first_name and a field for last_name, or just a field for fullname?
full name
DSM
DSM
You might not have two names, after all.
Yes
then can't someone put in "Jeff" and that would be acceptable? How do you confirm it is a real name that can be validated?
16:26
Cabbage!
Or you might have two names, but not ones that have a "first" or "last" order
Or you might come from a culture where your family name comes first and your personal name comes last
@Crow what's a "real" name?
luckily, this app is for murickah.
DSM
DSM
Even in the Python community, there's Aahz. I think he's used a second name on some published work, but I'm pretty sure he said once that's his legal name.
"americans all have ordinary names". maximum lulz
@Kevin I have four names :l
16:28
I just want to avoid the possibility of someone putting in a partial name, like "alex" or something. Am I overthinking?
'Harry Christopher Anthony Cockburn' where 'cockburn' is pronounced 'coburn'.
Ok, "How do I make sure the user puts in his whole name" is a valid problem
Threaten to murder their family if they don't?
No good. Users will read the bare minimum amount of text to complete their task, so they'll ignore the death threat.
I spent years writing software to do name/address matching/correction and such... but had information to other DBs to support/confirm info etc... etc... not a very straight forward subject :)
DSM
DSM
16:30
The only long name I can think of at the moment is "Carmen Elizabeth Juanita de Costa-Brava Cortez", which is from Spy Kids, of all places.
I have a boring name. So boring that forgery_py generates it a few times just by random
DSM
DSM
My pet peeve is capitalization. If my name is Angus MacArthur, don't send me mail spelling it Macarthur!
@DSM we had a huge amount of look ups, we had someone called "Machin"....
@DSM I was thinking of The Animaniacs' "Angelina Contessa Louisa Francesca Banana Fanna Bo Besca the Third"
Oh. My. God. The piano black HP Chromebook 11 is SEXY.
16:33
@DSM think he got tired of it getting "corrected" as "MacHin"
DSM
DSM
Heh.
So the ruleset we built up over about 3 billion records after a couple of years, was quite phenomal
A coworker of mine has an irish last name containing an O-apostrophe. He says it's a nightmare signing up for email addresses and such
I was thinking of 'Polly' from Mr. Gum at "Jammy Grammy Lammy F'Huppa F'Huppa Berlin Stereo Eo Eo Lebb C'Yepp Nermonica Le Straypek De Grespin De Crespin De Spespin De Vespin De Whoop De Loop De Brunkle Merry Christmas Lenoir de Polly", however, her friends call her Polly.
DSM
DSM
When I was a student at school they gave us email addresses using the last two digits of our year of enrollment and the first six letters of our last name. But if the name was already taken, instead of adding a numerical suffix they BUMPED THE LETTER. So (hypothetically) instead of being 88macart I was 88macaru. Drove me CRAZY.
16:35
Work automatically assigned him an email, firstname.o'[email protected], and it never works. all his email just disappears into the void.
I think that Polly wins the longest name, to be honest.
I dimly recall a children's book where the main character has a ludicrously long name. It takes a full page to describe.
DSM
DSM
I saw a rakugo performance where one of the jokes was about how long the kid's name was. Took about thirty seconds to say, so for obvious reasons I can't remember it all.
Admittedly, a full page in a children's book isn't that long, especially accounting for illustrations, but still.
@Kevin 'Twas Andy Stratton's Mr. Gum then, I believe. Did it feature a Garden Fairy, a dog and a man in the woods?
16:39
I remember it rhymed
What rhymed to what?
Ah, and how could we forget Monty Python's Johann Gambolputty de von Ausfern- schplenden- schlitter- crasscrenbon- fried- digger- dingle- dangle- dongle- dungle- burstein- von- knacker- thrasher- apple- banger- horowitz- ticolensic- grander- knotty- spelltinkle- grandlich- grumblemeyer...
- spelterwasser- kurstlich- himbleeisen- bahnwagen- gutenabend- bitte- ein- nürnburger- bratwustle- gerspurten- mitz- weimache- luber- hundsfut- gumberaber- shönedanker- kalbsfleisch- mittler- aucher von Hautkopft of Ulm
?
Jeez...
@Iplodman The name of the main character in the children's novel. It rhymed with itself.
Ah, I getcha'.
16:42
I don't think your Mr Gum is the one, then. The cadence isn't the same.
Mr. Gum feels rejected.
@Kevin OH, the Biscuit Billionaire? :D
DSM
DSM
C++ + Swig -> (Python, Java, C#), + Java + JS + CSS + XML -> clicky.
@Kevin, you there? :P
Hi all
16:56
@Raoul Haiya! :D
Rhubarb all! Time for Gmod! :D

« first day (1377 days earlier)      last day (3796 days later) »