« first day (1560 days earlier)      last day (3378 days later) » 

12:15 AM
This could do with a few upvotes:
2
A: How `eval()` is not 'dangerous' in this example

DunesThe code is not safe in the slightest. It's relatively easy to get access to the builtins module just by accessing attributes of literals. eg. result = eval("""[klass for klass in ''.__class__.__base__.__subclasses__() if klass.__name__ == "BuiltinImporter"][0].load_module("builtins...

 
 
1 hour later…
@ZeroPiraeus What are you giving as the reason? It's the worst question ever.
 
Actually I hadn't noticed that was the result of self-vandalism ...
So it was:
I'm voting to close this question as off-topic because it's gibberish. — Zero Piraeus 5 mins ago
... but I've now retracted the vote.
 
2:45 AM
For real this time :-) Who knows, maybe we can even do OP a favour and get it deleted per their wishes ...
 
3:02 AM
angular is so fast :o
 
 
1 hour later…
4:05 AM
I think I'm going to start making this a biannual present to myself - one edit in January and another in, say, October :-)
 
 
1 hour later…
5:17 AM
Eeeek! (or to put it another way, check out the meta tag ...)
 
6:05 AM
@ZeroPiraeus strong disagree on json, that is "not a common typographical error", but something that takes time to debug when you do it wrong; a good reference.
 
Was going more on "unable to reproduce" based on OP's banner:
> The problem described in this question was caused by a dumb mistake made while I was experimenting with ways to fix it, namely not reverting a change made after testing it -- however the site won't allow let me to delete it. So I suggest you save yourself some time better spent elsewhere by ignoring it.
... but it's late and I'm tired; you might very well be right.
 
Cbg
 
@ZeroPiraeus even I might do that bug and be like "???? happening" when out of coffee, tired at late night :D that is why it shouldn't be deleted, it wasn't a simple typographical error (calling cls = csl) or something.
 
@Antti ok, I'm convinced: if you edit the banner out (which is superfluous, given your argument) and vote to reopen I'll follow you.
 
6:18 AM
dunno about reopen but dunno about deleting either :D
given that it was answered then there is not much point in reopening either for more answers ...
 
Well, since you're saying that it's a useful question with an incorrect close reason, the combination of the "[on hold]" in the title and the explicit "don't read this" from the OP might discourage a future visitor from reading on and finding the solution to their problem.
 
Anyway, here's something maybe you can get behind:
cbg @RobertGrant :-)
 
6:53 AM
A really definitely this time "unable to reproduce" cv:
(tested with python2.6 + html5lib0.99 + bs4 per the question)
 
7:37 AM
@AnttiHaapala, I don't use with because I don't like the extra level of indenting. Having to write f.close is a small price to pay. — 7stud 31 mins ago
I guess no upvote then :d
@ZeroPiraeus delv:d
@ZeroPiraeus how many delete votes does it require though :d
 
cbg:)
 
downvoted the unable-to-reproduce
so it can be deleted by owner
though I doubt it would :D
 
Cbg
 
cbg
fizzy: stackoverflow.com/questions/4697615/… go use your newly found superpowers :d
 
7:45 AM
> The system will automatically delete closed (not as a duplicate), unlocked questions with zero or negative score having no upvoted or accepted answers or pending reopen votes, that were closed 9 or more days ago and haven't been edited in the past 9 days.
— http://meta.stackexchange.com/a/5222
 
Users with reputation >= 10k (more precisely, the “moderator tools” privilege; 2k on beta sites) can vote to delete questions that have been closed/on-hold for 48 hours. It takes three votes to delete; more if the question is popular, but ten votes at most.
deleted by mu 無, Mooseman, John Saunders, LittleBobbyTables, m-z, Yu Hao, Zero Piraeus, bummi, Antti Haapala, Soner Gönül 11 mins ago
:D:D:D
and gone
someones just lost kiloreps :S
 
cbg
 
ah no
Reputation changes from bounties and votes (both up and down) on deleted posts (including answers to a deleted question) are nullified. (Exception: Reputation earned for posts with a score of three or higher, and where the post has been visible on the site for at least 60 days, is retained).
hmm i dont have the disciplined badge :D
I go make it
2
A: Python : One else for multiple if

Antti HaapalaYou can use all() here if all([function_1(), function_2(), function_3()]) ... else: reboot all does short-circuit but all functions are evaluated here before all is called. On the other hand, you can reverse the condition and no else is needed, say: if not all([function_1(), functio...

damnit someone downvoted it :(((
it was at +3 yesterday
pls someone upvote it so I can delete it :D:D:D
 
@AnttiHaapala I guess it'd be good to have something in sopython.com/canon that explains the benefits of with contexts.
 
yeah
especially, it is not even guaranteed that files are properly flushed on exit (the exit might not even be a normal one)
even less on say jython...
 
8:00 AM
@AnttiHaapala Oh. I didn't know that. But before I started using with I always closed my files explicitly anyway.
 
some of the data is always buffered into internal buffers
if you don't close with .close or .flush it is never written...
now if python process crashes say, you lost that data
on normal exit it should be written...
but on jython/JVM, the finalizers are very much "best effort"
 
@AnttiHaapala Already upvoted earlier, but if you wanna delete because of the lack of short-circuiting, why not:
def f1(): print("f1")

def f2(): print("f2")

def f3(): print("f3")

>>> if all(f() for f in (f1, f2, f3)):
...     print("yep")
... else:
...     print("nope")
...
f1
nope
>>>
 
@ZeroPiraeus ofc wanna delete since op had added the comment that he wants short-circuiting logic... when the question at the time of that answer answered the "I want to evaluate all functions and if any of them is false..."
but I want the 1 upvote :D:D
bc I lack "discipline"
yesterday I noticed it had gotten upvote to 3 but ... I forgot to delete it :D
 
So it's an on-principle "I won't chase your chameleon question" thing then?
 
Bah, fine :)
 
8:08 AM
yes, it has better accepted answer already
and deleted :d
 
Noooo
 
thanks robert
 
Well, now you have the badge you can undelete and fix per my suggestion :-P
I think yours is better than the accepted one.
 
8:11 AM
how about just delete the whole question :d
voted to delete
it is like should reopen it and close it as a dupe :D
 
Voted to reopen; it's not particularly well-written but there's nothing unclear about it as edited.
Might even add my own answer if yours stays deleted :-P
 
:D:D
haha :D
now it has both a delete and reopen from me,
someone should edit the question into a coherent text :d
maybe I edit it too :D
or will it stop reopen flags?
 
Don't think so ... no reason why it should really; questions are closed for a reason, and you'd expect editing to be a part of getting them fit for reopening.
 
8:27 AM
ok edited :D
so zero go ahead and do your ans there :d
 
Sure you don't want it? All I'd do is my ^^^ tweak to yours.
(not that there's any rep in this exercise so long after the event)
 
well, let's see :d
 
Anyway, still closed for now ... which means I can't answer, but you can undelete and edit :-P
cbg @Roman :-)
1 message moved to recycle bin
@AjGauravdeep you've been told repeatedly not to do that.
 
I posted my 1 minute old question here once :D It wasn't removed tho
 
Sorry @ZeroPiraeus. I saw on many occasions people doing this recently hence i did it in rush.
 
8:43 AM
@AjGauravdeep just because you see others get away with it (and occasionally we might let it slide from people who are otherwise outstanding citizens here) is no excuse for repeatedly flouting a rule you've been told not to flout. Next time I'll kick-mute you.
 
i don't remember doing it last time by the way and i didn't aim to make same mistake repeatedly. it just happened so chill dude. I apologized and i also believe its not something huge. even after this please feel free to kick mute me if that makes you feel better. believe we are here to help each other not threaten.
 
AjGauravdeep, do you understand the reason why links like that to your own fresh question are not good etiquette?
 
@ZeroPiraeus What what?
I don't follow. Whom do I how much money?
 
yes and i am sorry i created a huge blunder guys
 
8:51 AM
It's not a huge blunder, just annoying. IMHO.
 
@RomanLuštrik good use of whom, there.
 
@RobertGrant True, pity about the missing verb, though.
 
@AjGauravdeep And you got -1 for your question because I noticed it thanks to you posting it here
 
Oh god, do I need to learn a new set of words just to talk? I'm too old for this excrement (there's no salad term for shit).
 
Is it okay to link a new question if the issue was resolved in the room (with a help of regulars) and I want to invite them to answer it?
 
8:54 AM
because your code looks horrible, please if you want to ask a question then format the code so that it resembles python.
 
@PM2Ring well, nobody perfect
 
i am sure someone got supper pissed. its okay.
i won't blame myself. i am working 15*7 from last 2nd december without christmas and new year holiday. i expected few crazy and frustration related symptoms from a normal human being.
 
@RomanLuštrik you can use the placeholder word "cabbage"
 
anw your code does not work because of that single if there, if you stepped through your code once in debugger, or even added some debug prints, there would not have been any case for a question.
 
i noticed, thanks.
 
8:57 AM
there are 3 cases of your file not being created with that code that are all pretty obvious: 1) the function is not called, 2) the file is created in a location other than you expected or 3) your if condition fails
 
well i was having bunch of other issues which is why i got confused. I don't have to go in detail. but yes you are right.
 
also at 15x7 you are actually getting negative marginal productivity ...
 
hmm.. no option... :(
 
no option??
 
Cbg.
 
9:02 AM
What you're saying is you've got no option but to produce less work than you would if you rested more?
 
negative marginal productivity means that in 1 hour you do 2 hours worth of damage :D
 
haha well thats not happening...i am being pretty productive enough to get $$$$$ as bonus for last month;s work.. or atleast* they think
 
cbg @ff :-)
 
Aj, FWIW, IMHO, your how to create a file in Mac cloud drive using python question is a good candidate to be closed due to the error being the result of a simple typo.
 
it is. please feel free to close it
can we get over with that question?
 
9:05 AM
and it is not usable for anyone else :D
 
thank you :)
 
What are we closing now? Yaaaaay! More closing!
 
-2
Q: how to create a file in Mac cloud drive using python

Aj GauravdeepI am trying to create a file in my cloud drive in a python code. When i create a file at this location"/Users/agauravdeep/Library/Mobile Documents/com~apple~CloudDocs/Untitled.rtf " using any app, it works but through code, i am unsuccessful so far(no errors though) even after trying through supe...

this one
and now some noob edited it to have syntax errors :D
 
What to flag link-only answer as?
 
9:16 AM
Yeah I did, wasn't sure if flagging was worth it too.
It's this if you feel like throwing away 1 rep.
 
flagged as very low quality
 
I rolled back that edit btw.
 
Same
 
Need 93 more flags to get the gold.
 
Pff, now my message is misleading
 
9:19 AM
@AnttiHaapala Okay so I went ahead and did it.
 
@ZeroPiraeus you could point out that you can make a list of the functions elsewhere
and then evaluate them there :D
 
@AnttiHaapala Good point, edited.
 
:D:D:D:D:D
 
Haha
 
9:24 AM
hohohohoohohoohohoh
 
@Ffisegydd we have a few hundred of these expressions -- I'm wondering if we should ask all of them on the site :)
 
imgur.com/gallery/GClrf for the related discussion
 
@Ffisegydd awesome discussion. And I like that phrase.
 
but I get a feeling that the saying is like ...
why beating the nettle, to stop it from growing or just for the fun of it? :d
 
I can't think of any strange English sayings (then again I don't think they're strange because I'm so used to them :/)
Actually I suppose there's a few. "Bob's your uncle" is a good one.
 
9:30 AM
If you go to Barnsley you'll hear the strange comparison, "As mad as a chair"
 
"Fall Arse Over Tit" is another good one
 
in finnish we have the seinähullu = wall mad... = so crazy that in asylum needs to be chained to the wall :D
 
"To Have A Butcher’s"
 
But hopefully you'll bite the bullet and take the nettle in both hands. Best foot forward! And break a leg.
 
And, of course, the single greatest British saying: "See A Man About a Dog"
 
9:33 AM
Sorry, you're right. And by hook or by crook, I'm willing to bury the hatchet over this.
 
It turns out this is so rare Google has no results for it, but the phrase "like a frog up a pipe" used to be used in South Yorkshire to describe unusual (often unwarranted) enthusiasm on someone's part.
 
(My Dad's from Yorkshire) and I love the names that people call each other, including "Flower", "Mucker", and "Cock"
Not in a nasty way, but it's common for my Uncle to say to my Dad "Hey up old cock."
And it's perfectly polite.
 
Yeah, that's pretty common.
 
sataa kuin Esterin perseestä = raining as if from Esther's ass = cats and dogs
 
I quite like "you make a better door than a window" ...
(to indicate that someone is blocking the view)
 
9:56 AM
@Ffisegydd I was pretty surprised the first time a big burly bus driver in Nottingham called me "love"
Ey oop, loov
It was shortly after that that I stopped wearing my Eddie Izzard ensembles in public
 
10:10 AM
cbg
 
cbg
 
cbg
 
Hi, Im having trouble sorting list of `lxml.etree.Element`'s. Some of them have attribute `isDefault` and some of them don't. When I try to sort the list I get `TypeError: unorderable types: str() < NoneType()`.

How to deal with it? Here's the code Im using: `media_content.sort(key=lambda mc: mc.get("isDefault"))`

Python 3
 
@r00m I'm only vaguely familiar with lxml. What's the type of the mc.isDefault attribute when it's not None?
 
10:19 AM
@PM2Ring Making Zero's answer the correct one.
 
@MartijnPieters Indeed. Feel free to upvote it. :)
 
@PM2Ring already did.
 
Voted
 
@PM2Ring Im not sure I understand your question. I just recently started learning python. mc doesnt have property "isDefault". It can be accessed only through get() because it is an attribute on Element object.
mc is parsed lxml.etree.Element object. For example '<media:content url="somewhere" medium="image" type="image/jpeg" width="940" height="627" isDefault="true"/>'
 
10:27 AM
@r00m Ok. But what does mc.get("isDefault") return when it doesn't return None? And for those elements where it is None do you want them in the sorted list?
 
@PM2Ring it returns string. I would like to sort any elements that have "isDefault" set to true, then any elements which have it as "false" and then elements who don't have it.
 
@r00m Ok that's not too hard. Do you want secondary sorting within those categories, too? Eg you could sort on the URL string.
 
@PM2Ring Cool! No, I just need to get that default image
 
Ok. Give me a minute to test something. I hate posting untested code in case I make a dumb mistake. :)
 
@PM2Ring Sure, thank you!
 
10:39 AM
My demo code just sorts a list of tuples, but I'm sure you can figure out how to adapt it. Also, it's in Python 2.
a = [('a', 'true'), ('b', 'false'), ('c', None),
    ('d', 'true'), ('e', 'false'), ('f', None),
    ('g', 'true'), ('h', 'false'), ('i', None),
]

print a
a.sort(key=lambda t:t[1] or '', reverse=True)
print a
output
[('a', 'true'), ('b', 'false'), ('c', None), ('d', 'true'), ('e', 'false'), ('f', None), ('g', 'true'), ('h', 'false'), ('i', None)]
[('a', 'true'), ('d', 'true'), ('g', 'true'), ('b', 'false'), ('e', 'false'), ('h', 'false'), ('c', None), ('f', None), ('i', None)]
t[1] or '' has the value of t[1] unless it's false-ish, i.e. False, None, 0, or an empty string, list or tuple. Etc, In which case t[1] or '' has the value of the empty string. So sort can than sort it properly with the other strings.
The empty string sorts alphabetically before 'false' which sorts before 'true' so setting reverse=True gets everything in the desired order.
 
@PM2Ring Wow, you rock! Works. Thanks!! :)
 
@r00m No worries.
 
11:35 AM
Cabbage folks
 
Cbg mucker.
 
I'm glad we have no h&s people in the building
I have a mug of boiling hot caustic soda sitting next to me. Near my cup of tea. What could go wrong?
 
I work with HF on a regular basis. It's good stuff.
I have to wear something like this while using it (except it's a one-piece) absolutely murder on a hot day.
 
Hydrogen Flouride is bloody nasty
Doesn't it just immediately turn into acid upon contact with liquid?
 
We use it to clean glassware. And by "clean" I mean we literally dissolve/etch the top few thousand layers of atoms off the glass.
We use it in acid form in general, typically 40%+
 
Them's some cleaning ability. Ah okay, can't work out if that's more or less dangerous?
Our caustic is 99%, but in pearl form. As long as I don't go around rubbing it in my eyes, I should survive
 
@cel cv why?
 
waaaaaaaaaaaaaaaaatttttttttttttttttt. 3D sandstone printing?
 
cel
too broad imo
 
11:45 AM
Well as a liquid it can get everywhere. The worst part is that if you get some on yourself you don't even feel it, and it looks like water.
@cel I agree it's too broad. As you say there's loads of parameters which need tweaking.
 
@cel not really
 
@Ffisegydd I bet it reacts differently than water...
 
cel
@AnttiHaapala well, feel free to answer then. :P
 
@Intrepid just a bit. It doesn't even hurt for the first few hours, mostly because as it soaks through the skin it kills nerve cells. It slowly works its way down through to the bone, at which point it begins to hurt like hell (and by this point it's usually too late to do anything about it). It begins to dissolve the bone and release calcium into the blood stream, which usually causes a heart attack.
 
@Ffisegydd Yikes. Respect!
 
11:51 AM
@Ffisegydd o0. I think I'd prefer to stick to accidentally drinking my caustic soda
 
@IntrepidBrit As an acid, hydrofluoric is milder than hydrochloric. But it has a voracious appetite for calcium..
 
We also use sulphuric, my GF spilt some of that on the desk and we sat there and watched it dissolve the metal plating :3
 
You guys should have etched a love heart into the desk
 
ah now that I read that I answered wrong .D
 
Fizzy <3 Mrs Fizzy
 
11:53 AM
@IntrepidBrit NaOH is non toxic. Sure it will burn you, dissolve fat, etc. But it's a toy compared to HF.
 
adsföljksdflkjasdf
I am so sleepy :d
 
@PM2Ring Exactly my thoughts. HF just sounds terrifying
You know you guys could always just use a sponge 'n' soap right? Jus' saying ;)
 
I read that question as "...but my data does not fit in memory" :D:D:D
 
@AnttiHaapala That looks like normal Finnish to me. :)
 
@Intrepid urgh, not for these. When you're taking £15,000 worth of isotopes and melting them in an evacuated ampoule, then dropping said ampoule into a bath of ice water to form a glass, you need to make sure the inside is really, really clean to prevent places where crystallisation could occur.
 
11:56 AM
Everyone likes crystal. I've seen all the shops. Make a cheeky side business ;)
 
Here's a classic example of hydrofluoric acid doing Bad Things™. FWIW, the technician in this story was a friend of a friend on a science forum I frequent. Hydrofluoric acid fatality
 
Another good one is Piranha solution
 
@PM2Ring nope, f is not part of standard Finnish orthography.
 
cel
are you guys planning to dissolve someone? :D
 
@cel ... this conversation never happened.
 
cel
11:58 AM
:)
 
@AnttiHaapala Ah, ok. I've forgotten most of the little I once knew the Finnish language, but I like the sound of it. :)
 
@PM2Ring Goodness. Sounds like he did everything he could, considering it spilled on him. (but should have worn the protective clothing)
 
@PM2Ring then you haven't heard me coding PHP :D
 
But one of my favourite guitarists is Finnish. Here's some Finnish rock and roll, featuring Erja Lyytinen on slide guitar.
@AnttiHaapala LOL
@IntrepidBrit Not quite. He should have had some calcium gel (or even just garden lime) handy to immediately apply to the splash.
 
12:04 PM
@Ffisegydd what're you doing that requires these inexpensive and delightful compounds?
 
SCIENCE.
 
@IntrepidBrit Some people eat caustic soda on purpose. en.wikipedia.org/wiki/Lutefisk
 
cel
How do you flag/close questions that do not make sense? E.g. I had a question today where someone asked how to convert php to a .exe file.
 
someone claimed in his a doctoral dissertation that in addition to the common indicative, imperative, conditional and potential verb moods, there is the special mood of aggressive in Finnish language, which grammatically uses a certain expletive in as a substitute place of ordinary negation word. Needless to say, whenever I happen to code in PHP most of my spoken output is rather like taken from the appendix of this dissertation.
 
@cel close with Unclear what you're asking
Or Too broad, whichever is more appropriate
 
12:14 PM
@AnttiHaapala I can believe that. IMO, the only good thing about PHP is that it makes JavaScript look like a well-designed language.
 
cel
@RobertGrant makes sense.
 
JavaScript is a well designed language, within the timebox...
if you look into Haskell say, hey they designed it for a decade or so?? :D
now PHP on the other hand, now lets count how many times it totally broke backward compatibility and it still is POS...
 
I mean, you can write well in JavaScript by simply avoiding the bad things (like with) and adopting sensible coding practices (like always terminating statement with semicolons, and minimizing use of globals, etc). But there's no escaping the insanity of PHP.
 
Yeah I prefer Javascript. There's no equivalent of Crockford for PHP. There's only the Fractal of Bad Design essay.
 
whatever features they implement in PHP, they are always wrong :D
in PHP in a closure one needs to say that "this variable is from the closure environment"
 
12:24 PM
@PM2Ring Well, people will eat anything ;)
@PM2Ring I'll nod and smile, assuming you're right!
 
I'd just like to confess to you all that I'm addicted to Shadows of Mordor. Or, as the characters pronounce it, Morrrrrrrrdorrrrrrrr.
 
@AnttiHaapala yeah already downvoted :)
 
Downvoted. It's 20k+ deleteable now
 
Cool :)
 

« first day (1560 days earlier)      last day (3378 days later) »