« first day (2237 days earlier)      last day (2936 days later) » 

02:42
hey is there anyway to get the parameters of an object after its initialized?
similar to a tuple, you can unpack a tuple like this: x, y = tuple
can you do that to an object too?
such as
_root, _leaf = tree
i'd have to access the attributes right?
 
2 hours later…
05:11
@Theo yeah
@AndrasDeak ah the realism, someone commented this: In the game there was a thunderstorm. The land-line phone rings. Player goes to answer the call - it was a lightning ringing and he dies.
05:53
@AndrasDeak sounds like Hungary already: prime minister called the national broadcaster and silenced them from making news about his possible corruption.
 
2 hours later…
08:10
cbg
cabbage
How come there's no good documentation on PyQT5 ? :/
08:36
Morning cabbage, all
morning cbg y'all
@Theo you might also be interested in the named tuple - it allows you to use named access to individual attributes AND use tuple unpacking
Going off-net for an internal office move.
09:09
cbg
09:22
Cabbage!
cabbage is nice
re-cabbage from a new desk six metres from my old one
09:37
i work from home today :feelsgood:
licky
lucky*
working from home sucks
why?
I dont know, for me is like mixing environments
office is to work, home is to rest etc
sometimes I need a chane in environment
09:39
Yeah, true.
I get bored
my productivity at home is lower
because I get distracted easily
but some people claim that their productivity is better at home, so its probably person dependent
@khajvah Move your monitor from the left to the right of the desk
10:05
cabbage
10:19
morning cbg
in today's episode of 'comedy legacy code', I bring you:
if global_pc:
    check_for_murders(global_pc)
that's quite close to how I feel most days.
10:34
cbg
hi
Hello Everyone
Guys, require your input,
resource request stackoverflow.com/questions/40885915/… Some people are un-yamming-believable. Maybe the OP wants to write code that analyses the performance / behaviour of an existing the AI, but still...
@CodeIdenti please read the room rules
Don't post recently asked questions here.
10:46
@CodeIdenti please read the room rules at sopython.com/chatroom
delete your message before it is thrashed
I am sorry guys for the inconvenience!! I find a lot in internet I didn't get any solution about that. let me ask one questions here itself
Error is throwing at "load(cloudant_credentials['db_name'])" so is there any library I am missing to import?
@CodeIdenti you have asked the question on the main site
wait for an answer
@CodeIdenti The reason for our rule on not linking your fresh question here is so we don't get people here spending energy working on an answer independently from people doing the same thing on the main site, since that leads to pointless duplication of effort, and that effort should all be happening in the comments & answers on the main site.
11:00
@PM2Ring cool
@BhargavRao in case you want to weigh in meta.stackoverflow.com/q/338743/2301450
Hey @BhargavRao What do we do when an OP deletes a question and then re-posts it? stackoverflow.com/questions/40886504/…
11:16
php is such a pain
what did you think "p" stands for?
What the... he just deleted again
hahaha
@khajvah puke, poo, pestilence,... Need I go on? :)
oops
11:17
@PM2Ring Can we link the deleted question as the close reason? :P
Otherwise: Flag?
or undel-vote the old one and then close as duplicate?
git gud
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
@poke Sadly, we can't dupe-hammer to a deleted target. :) And he's just deleted the new one. So there's not much we can do. Presumably, if he keeps behaving like this he'll get a question ban.
Thanks, @poke. Now ps aux
11:22
@holdenweb 'ps' is not recognized as an internal or external command, operable program or batch file.
type "I got tired of Windows"
:D
I actually ran ps aux on PowerShell first, when attempting to get the error output..
Really am going to have to be more careful about switching windows
The problem is that PowerShell actually has a ps alias :P
I suppose what I should have done with that pydot question is to have posted my comment as an answer, so it could've been upvoted to prevent deletion. Oh well.
11:25
or maybe not
The question wasn't good, but it's conceivable that someone else will encounter the same bug. OTOH, I guess a better solution would've been to look for a suitable dupe target re Python 2.6 requiring a field name in format.
@vaultah Thanks, I've informed the mod who declined the flag.
I have an interview tomorrow for a company that doesn't do python at all
I dunno why I am even going
@PM2Ring If the other post is delv'd, then can't help. We need to cv based on that post. :/
@BhargavRao Well, we don't need to CV, since the OP's now deleted the duplicate. But I suspect that the OP will repeat this behaviour in the future if he doesn't like the response he gets to his question. Is there a standard way to alert the mods to this, or will the system track that sort of thing automatically?
11:37
Nope, Not really. I remember a meta post about that. But yep, the user will soon be que banned if they continue to do so. I'll try to fetch that meta post now.
11:50
I just accidentally wrote "cbg" to somebody on facebook
11
one of us, one of us, one of us
@khajvah Note that "cbg" is the ROT-13 encoding of "pot". :)
that makes more sence
I am officially a devops-meme engineer
13:00
pot
pan-pot
pot @Andras
pizza lunch, mhmmm
it's almost homemade, we ordered last night and I brought leftovers to work
but not homeborn
I think I'm missing a reference
(->segfault)
wtf 6 notifications on SO?
13:04
I had 23 notifs once
@AndrasDeak did you do smth naughty ?
no, just chatty little peopleses, it would seem
yeah, I know that one:P
@AnttiHaapala I'm glad you're following suit. Does that silencing work? Here we've evolved: they don't even need to call down, everybody censors themselves, it's encoded on a cellular level in many of my people
cbg back
13:11
cbg front
lool
13:34
@BhargavRao that one is photoshopped!
Lol, Nope.
the bottom edge is not smooth under the numbers
That's from a bot account, That's why ;)
that's why it has blurry edges?
Nope, That's why it's got 11k messages.
13:36
speaking of bots, @JonClements what have happened with R.A.B.B.I.T?
Today I wrote an answer saying "you need to do X", then researched some more and edited it to "you need to do X and also Y", then researched some more and edited it to "you need to do Y". Turns out X is neither necessary nor sufficient to do the needful, and yet the only upvote I got during this whole process was when my answer was wrong.
yeah, but this one has clear edges ;)
haxors
13:56
Not photoshopped btw.
I have a strong feeling python is subpar in consuming WDSL. Tried SOAPy and SUDS both are abondened. What do you guys think?
WSDL*
271
Q: What SOAP client libraries exist for Python, and where is the documentation for them?

blackrobotI've never used SOAP before and I'm sort of new to Python. I'm doing this to get myself acquainted with both technologies. I've installed SOAPlib and I've tried to read their Client documentation, but I don't understand it too well. Is there anything else I can look into which is more suited f...

morning everyone
pot @corvid
that's not for the morning
13:59
@khajvah Already read this ^^
2 hours ago, by PM 2Ring
@khajvah Note that "cbg" is the ROT-13 encoding of "pot". :)
@Rizzit then you should know about this
@khajvah oww.. k i gave up at SOAPpy
@poke which is funny, because in hungarian, we say "jo napot" (~have a nice day), and when you shorten it in real life conversations, you would say "'pot"
just sayin' you know.. :P
14:02
heh
whenever i solve a problem that took me hours i always feel like a god.
but then i run into another problem and im just like :l
Sounds like you should take more breaks between starting to solve a problem and actually solving it so you feel more often like a god.
When I solve a problem that took hours I typically think "why didn't I solve that faster?"
That's probably not a healthy viewpoint. I'm going to go up to Old Man Johnson's lake and skip stones contemplatively.
cabbage
@AndrasDeak the speech of PM in a nutshell: PM doesn't feel having done anything wrong, still believes in the management of national broadcaster (that silenced a journalist), he has the right to protect his family and relatives, because it has been so hard, and things move from facts to feelings...
14:10
I feel like whenever I fix something, 2 new problems occur
so fix nothing
@Kevin but why didn't you skip them farther?
@Rizzit time to refactor
@davidism Ran out of lake B-)
I would skip stones on the ocean but I don't want to be prosecuted for launching intercontinental ballistic missiles
@khajvah my boss says the same thing, Micheal is that you?
14:14
@Rizzit btw, you are fired
Yes, you already have enough to worry about with the Tea Cannon non-proliferation act.
@khajvah Noooo, whyyy
I don't want to proliferate Tea Cannons. I just want the one.
Letting me keep it is the best thing you can do for non-proliferation because I'll use it to vaporize any other cannons being constructed.
I'm not sure I trust a unipolar Tea Cannon Kevinpower
kevinpower
#Kevinpower
14:29
My reign will be beautiful and terrifying.
Does anyone have any mnemonic for how to remember which comes first the chicken or the egg the datestring or the format in strptime?
#KingKevin for the alliteration
#KevininsteadofTrump
well, of course. That's an easy choice ;)
I don't want actual executive power. I just want to own every corgi in north america.
My leasing terms will be very reasonable
@Kevin Works for me. I can come visit you, right?
14:35
Sure, what good is a palace with a thousand bedrooms if you don't invite guests?
@Theo This may not be relevant if your object is a tree, but you can get that behaviour by making the class iterable:
class Test:
    def __init__(self, a, b, c):
        self.a = a; self.b = b; self.c = c

    def __iter__(self):
        yield from (self.a, self.b, self.c)

t = Test('one', 'two', 'three')
a, b, c = t
print(a, b, c)
#output
one two three
@AndrasDeak cbg
@PeterVaro you would??:D
never heard that
@AndrasDeak really?
14:46
yup
then again I don't speak to people
and the ones I speak to say "hello" and "szia" and the like
@AndrasDeak lol
Rhubarb
@AndrasDeak bargh.. i can't find any reference -- but it is in several jokes, novels and standups
I don't give up to find one, but it won't happen in the next few hours..
ok:D take your time, I believe you;)
I just haven't seen it
14:54
well, it is not that common, you see, because it is not polite enough and when you want to go casual you would say other things..
cbg
@idjaw cbg
@wim as you wish master wim-du
@AnttiHaapala haha:D
15:02
"In an email sent to an Yle reporter late Friday evening, Sipilä said that his confidence in Yle was "zero". On Wednesday he said that "my confidence in Yle is quite ok"."
0K ~ zero
on wednesday = today
K = 1000
0 * K = 0
you dont play online games guys, thats why you get confused
i found out what k's were during my runescape time
How did you manage before that with only 25 letters?
15:12
:D
K is just C's understudy, we don't really need it.
Ocay Cevin.
yeap lol
it is useless tho :/
without google services
I think that may be bothering me more than it is you...
15:19
@Cevin say no more, Romans did need no kay!
Just spent three minutes trying to get a code block formatted correctly that ended with a backslash.
Shine on, you crazy OP.
hello @IsabelCariod. Welcome.
I have a function who seek 'href's from a web page
from HTMLParser import HTMLParser

class MyHTMLParser(HTMLParser):

def handle_starttag(self, tag, attrs):
# Only parse the 'anchor' tag.
if tag == "a":
# Check the list of defined attributes.
for name, value in attrs:
# If href is defined, print it.
if name == "href":
print name, "=", value


parser = MyHTMLParser()
parser.feed(your_html_string)
it is possible to set for search only in <head>here</head> tag?
@Kevin missed an opening backtick
oh that's not it
15:31
@IsabelCariod set your code in a separate message and hit ctrl-k to format it properly
I ran your code and recorded the result: here you go :-) — Kevin 47 secs ago
Ok, I should probably stop.
yes, you evil thing you
let the kiddies script themselves
they should just import virus btw
from HTMLParser import HTMLParser

class MyHTMLParser(HTMLParser):

    def handle_starttag(self, tag, attrs):
        # Only parse the 'anchor' tag.
        if tag == "a":
           # Check the list of defined attributes.
           for name, value in attrs:
               # If href is defined, print it.
               if name == "href":
                   print name, "=", value


parser = MyHTMLParser()
parser.feed(your_html_string)
is possible to make a inner tag?
@IsabelCariod You mean like allow <a><span>…</span></a> but not a <span> outside of the <a>?
15:36
@IsabelCariod You could write handlers for start and end tags that sets an attribute isInsideHeadTag to true or false, whenever a head tag starts or ends. Then you can change if tag == "a": to if tag == "a" and isInsideHeadTag:
Although if it's for tags other than head, it becomes trickier, because then you can have multiple nested tags...
A simple isInsideSpanTag bool won't suffice if a span can be inside another span
You'd need like, a spanDepth int to tell you how many spans you're inside.
class MyHTMLParser(HTMLParser):
    def __init__ (self):
        self.insideATags = 0

    def handle_starttag(self, tag, attrs):
        if tag == 'a':
            self.insideATags += 1

            # a-tag handling

        elif tag == 'span' and self.insideATags > 0:
            # span-tag inside a-tag handling

    def handle_endtag(self, tag):
        if tag == 'a':
            self.insideATags -= 1
Alternatively, you could install BeautifulSoup, which I'm willing to bet has a powerful enough selector syntax to allow you to easily query "all A tags inside a span tag"
basically, whenever you encounter an a tag, store that information (I’m using a counter here to make sure you can nest those tags multiple levels), and then check when you encounter a span whether you are inside a already. And whenever you see the closing tag, make sure to go “out” of the a tag again.
I endorse poke's answer.
I endorse Kevin’s suggestion to use BeautifulSoup.
15:40
You've got to be careful when you recommend a third party library, the question-asker might be running their code on an integrated environment with no internet access. Like a toaster. Well, some toasters have internet access.
I endorse Poke's suggestion.
yes, for ddosing other toasters ;)
Yeah, just saying that “anything more complex than this” might justify pulling in a library to handle all the edge cases that will ultimately come up (because HTML is messy).
javascript really needs an easy way to replace an item in an array in-place.
@corvid arr[n] = modify(arr[n])?
15:42
Heh, ambiguous meaning of "in-place"
@poke I mean on the array prototype, like Array.prototype.replace(findFunction, replacement), which is like a combination of findIndex and splice with a callback
I'm guessing he means "as part of a larger expression"
@Kevin I can only assume we have scared off @IsabelCariod with our extensive suggestions by now… :/
We're all part of a larger expression.
that's deep man
15:43
So you can do myThing.replaceInPlace(0, 23).replaceInPlace(1, 42) although why you would want that I can't guess
@poke have a little problem
def handle_endtag(self, tag):
^
IndentationError: expected an indented block
@corvid So, like map but without creating a new array?
If you ran poke's code exactly as it appears here, it's because there's no statements in the elif block. At the very least, you need a pass in there for it to parse.
@IsabelCariod The code poke provided is not fully functional. It's a main idea of what to do. There is no code in the elif in the previous method. That is why you are getting that error. Kevin'd....Kevin'd hard
@Isabel ^ what Kevin said. Basically, you still need to replace those # a-tag handling and # span-tag inside a-tag handling and fill in your actual code you want to run in these cases
15:46
@poke yeah, and also won't map go over every element of the array? A replace should stop at the first matching instance
@idjaw Even Kevin’d by Kevin…
@corvid So.. it’s more like a replaceFirst :P
It's good to repeat ourselves in the presence of outsiders. That way they know that our suggestions aren't handed out by lone crackpots.
we are collectively insane!
At the very least, they're handed out by a duo of crackpots, which I expect are much more well-adjusted than hermit crackpots.
Array.prototype.replaceFirst = function (find, replacement) {
    this[this.findIndex(find)] = replacement;
}
@corvid This?
15:48
Maybe add return this; for maximum method chaining shenanigans.
@Kevin like JQuery?
@Kevin Mutating methods usually don’t return the owner object
I think that's how Array.fill works, but I can't double-check because firebug updated and moved around all the GUI elements >:-(
I will be annoyed if fill is non-mutating.
You’re right:
> The fill method is a mutable method, it will change this object itself, and return it, not just return a copy of it.
Out-smarted in JavaScript by Kevin. That’s a first.
It's JS - there's a first for everything
15:52
It's thanks to the intensive training session I had in the javascript room a couple days back.
I learned all about Array methods, in fifty times earth's gravity.
@corvid Then I guess we’re done here :P
I just don't get why they don't include it by default
Because JS did not have a solid base base base standard library since its creation. It’s only very recently that it has been expanded with common use cases.
15:55
@poke Thank for code, but you're idea is wrong
… because?
your
will match a or span everywhere
DSM
DSM
Chagrined cabbage for all.
JS was written in like four days so it's understandable when there's weird gaps in its foundation
15:57
@DSM I'm sorry to hear that cabbage (incidentally, I first thought that "chagrined" was an haute cuisine reference)
Chagrined is a strange word. I wonder where it came from
charbroiled cabbage, DSM
== Français == === Étymologie === (Adjectif, Nom commun 1) (1389) Déverbal de chagriner [1] (1450) pour le substantif. Étant donné la rareté des adjectifs déverbaux de verbe, on peut aussi imaginer un composé de cha-, ca- et de l’ancien français grain (« chagrin, affligé, triste »). (Nom commun 2) (XVIe siècle) Première attestation sous la forme peau de sagrin ; du turc sağrı (« croupe d'un animal, la peau qu'on en prépare ») avec évolution de \s\ vers \ʃ\ sous l’influence du précédent. === Adjectif === chagrin \ʃa.ɡʁɛ̃\ Qui éprouve du déplaisir, de la tristesse. André est chagrin de l...
my guess ^
Correct
hope that article is SFW because I don't speak French
> 1. Qui éprouve du déplaisir, de la tristesse.
You bet your peut aussi it is
15:59
sounds close enough

« first day (2237 days earlier)      last day (2936 days later) »