« first day (2316 days earlier)      last day (2617 days later) » 

3:49 AM
Interesting. Well, I don't support supporting browsers that don't support standards, but if SO wants to support it then I guess that's fine @rene. — Tiny Giant yesterday
I support this comment
 
4:13 AM
@AndrasDeak that's an interesting comparison. The x-axis appears to be the percentage of questions in that tag which are ask from a uni ISP.
Some other metrics would be interesting. Raw number of posts per tag. Percentage of all posts. Just to think of two.
 
4:57 AM
Worst thing: when you have a problem, and there are dozens of pages on google about it. But all end with just the question without a solution.
10
 
5:55 AM
cbg
 
 
1 hour later…
6:59 AM
cbg
 
aw
 
cbg
 
 
1 hour later…
8:24 AM
Cabbage
 
9:07 AM
recbg
 
hi
is here any body there ?
/there
i have a python question, i couldn't ask it in stackover flow
in the following code:


class sampleClass(object):
'''
% sample class %

'''


def __init__(self):
super(sampleClass, self).__init__()


my question is that why it used `super` while it's not inherited from any class and its a parent class itself.

i know using `super` in this way will call the parent's `__init__` , but here there is no parent, so what does `super` do ?
and plese answer me
i'm looking for answer :(
 
9:37 AM
@AnttiHaapala NameError: name 'cbg' is not defined
 
Cabbage!
 
@alone object is the parent class here. It will call the __init__ of object class
@poke cbg
 
@poke on time to work cabbage you mean?
 
huh?
 
= ~Late to work cabbage :D
 
9:43 AM
Late to chat cabbage
 
@MoinuddinQuadri remember to send him an email :D
 
@MoinuddinQuadri Now wait for half an hour till he gets pinged :P
 
Yeah, Can a RO trash the message with the mail id?
 
@alone Using super to call the parent is important for multiple inheritance to ensure that the whole chain works properly:
class A:
    def __init__ (self):
        print('A')
        super().__init__()
class B:
    def __init__ (self):
        print('B')
        super().__init__()
class C:
    def __init__ (self):
        print('C')

class BA(B, A):
    pass

BA() # prints B, A

class CA(C, A):
    pass

CA() # prints just C
:35709701 Now without scroll bars to make it easier for you :P
 
heh :D How did you remove the scroller? Deleted a line?
 
9:49 AM
Yeah, removed some whitespace in between the classes :P
@BhargavRao Couldn’t you just edit the message as a mod..?
@alone Please understand that we are not going to send you an email with the answer. If you want our help, you should stick around, or come back later when you have the time to actually stick around.
 
@poke Yeah, But I thought it'd be better to do that in the trash instead of here.
 
@BhargavRao I feel like removing that one line removes too much context though.
 
Deleted it.
 
derp
 
Ahem, deleted it, so can't do anything now. :(
 
9:52 AM
So I figured xD
I kind of beg to disagree with that statement, but I can see where you’re coming from :P
Good to see you “writing” stuff on Medium now though! :D
 
“PHP 7 was released over one year ago - is PHP finally a viable alternative for writing large web applications?” https://medium.com/@anttihaapala/php-7-was-released-over-one-year-ago-is-php-finally-a-viable-alternative-for-writing-large-web-cb87d8f272#.u84zbycuq
 
Now this reads like a multi threading synchronization problem…
 
@poke just tried how horribly broken everything is in PHP 7.0.13-0ubuntu0.16.10.1
 
It’s still PHP after all.
 
yes
JSON api that turns {} into [] on serialization; or alternatively turns each [] into {}
 
9:58 AM
It’s generally possible to write good applications with it though. Yes, it may require more discipline than other languages but that’s just the cruft that PHP has been carrying for years.
 
so, the people using PHP, they're suddenly more disciplined than developers writing in other languages.
 
That’s not what I was saying
 
:D
that is why I cannot recommend it.
 
I meant that other languages, well designed ones, make it harder to build stuff very badly. In PHP it’s dead simple to produce working garbage. So in order to end up with a properly designed application in PHP, it requires more discipline and developer guidelines than it does in other languages where a lot of good practices are already built into the language.
 
yes I agree with that statement :D
 
10:02 AM
oh I've seen python lasagne's too many times
I think its easy to screw up in every language
 
cbg guys
 
But there are examples of complex applications written in PHP that are really well designed and work well due to the developer team’s disciplines and the project’s general structure.
MediaWiki is one of my favorite examples. I do know that codebase pretty well, and it’s generally very well done.
 
@poke JS is the same
 
but the argument goes like: "one should use php because it is easier to find programmers who know php" (and these are more disciplined how?) "because the documentation is super" (and the interactive documentation examples are just promoting bad practices) or "there is so much code to reuse" (and most of it is shit)
I know wordpress somehow and it is utterly awful
 
@khajvah Yeah, there it’s the tooling that makes it a bit easier
 
10:06 AM
hi, anyone familiar with using jython in pycharm?
 
not me
 
number of frameworks in JS is so overwhelming
this makes everything lot more difficult, especially good practices
 
yeah I am so not going to use react anytime soon, I need some handholding so angular2 it will be :D
I believe I'd have finished an app on angular2 by the time I would have evaluated all possible libraries for react
 
I started recently angular2 and I've used starter from github, I would recommend this way
small example project with good practices in place
 
@AnttiHaapala The problem is mostly that PHP is so old and the better stuff (the OOP parts, and the new APIs) are still too new so there are far too many examples with the old stuff which still works and looks so much easier. So there’s a huge difference between PHP developer and PHP developer.
 
10:13 AM
too many exceptions everywhere. Like, I tried:
 
It’s like how you still find more examples for Python 2 than for Python 3, just that the difference isn’t that bad.
 
<?php echo(json_decode('{}'));
@poke without running, what does that print in PHP 7?
 
you told already that []
 
no
it doesn't
 
you lied
:D
 
10:15 AM
what does print(json.loads('{}')) print in Python?
 
dict right?
 
{} I guess
 
print(type(json.loads('{}'))) --> <type 'dict'>
 
@khajvah slap
 
10:16 AM
hehe
 
In PHP 7 the equivalent code doesn't print anything. It throws "Catchable fatal error: Object of class stdClass could not be converted to string in" - on line 1
see... it was a trick question
 
@AnttiHaapala That’s your echo
 
@poke of course
@poke tell me which Python object cannot be printed with print()?
 
>>> class CannotBePrinted:
        def __str__ (self):
            raise Exception('derp')

>>> print(CannotBePrinted())
Traceback (most recent call last):
  File "<pyshell#53>", line 1, in <module>
    print(CannotBePrinted())
  File "<pyshell#52>", line 3, in __str__
    raise Exception('derp')
Exception: derp
I win
xD
 
Lol. It is still printing :P
 
10:19 AM
it isn't
@MYGz could you stop being so confused please
 
waht?
 
My point is: PHP does not have concept of toString or __str__.
 
@poke my point is, it is unacceptable
 
That is your opinion
Printing that and expecting some “raw” output is not really useful for anything.
 
10:22 AM
(side note: I can’t believe I’m defending PHP here, lol)
 
that is why the No. there is. I am not even going to debate it in my blog, I could write an essay on that but I'd not get any good comments, only arguments about how this is the right thing to do.
@poke even Java has toString()
 
why "even"?
Java is good
 
And Java is a much more strict language that has a very very clear design. Often awkward, but it is very well designed.
 
"Dev Jalla has invited you to join Teenage Programmers Chatroom. See your invitations."
did anyone else get that one?
@BhargavRao you around?
 
@AnttiHaapala No, I am not a Teenage Programmer
 
10:23 AM
why is ther eno way of flagging an invite
@poke so 7th not-backward-compatible iteration and it still doesn't start getting things right?!
 
guys
there is toString in PHP :>
 
@AnttiHaapala It’s still Java. It being more complicated than it should be is considered a language feature by now.
 
@AnttiHaapala Yup
 
@BhargavRao ^
I do not know who this dev jalla is :D
 
@marxin Most built-in things do not use the OOP stuff though.
 
10:26 AM
@AnttiHaapala meh, ignore
 
Can I just highlight this?
> You cannot throw an exception from within a __toString() method. Doing so will result in a fatal error.
 
@poke but echo does
 
@poke this is a class
 
fatal error
fatality
 
Basically: If you throw an exception, we’ll throw a different exception.
 
10:27 AM
Object of class stdClass
 
@poke I thought the computer blows up
 
551
A: What is stdClass in PHP?

Alex MartellistdClass is PHP's generic empty class, kind of like Object in Java or object in Python (Edit: but not actually used as universal base class; thanks @Ciaran for pointing this out). It is useful for anonymous objects, dynamic properties, etc. See Dynamic Properties in PHP and StdClass for example.

 
I like the fact that PHP has (int), which isn't a combination of a casting syntax (), and a type int
It's a literal token
 
I would stop short of calling this "great" — Chris Baker Mar 28 '13 at 20:54
lol I had upvoted that before
 
I think we would need PHP expert to speak his opinion ;)
 
10:29 AM
5
A: What is stdClass in PHP?

SageActually I tried creating empty stdClass and compared the speed to empty class. class emp{} then proceeded creating 1000 stdClasses and emps... empty classes were done in around 1100 microseconds while stdClasses took over 1700 microseconds. So I guess its better to create your own dummy class...

WAT :D
apparently the difference is caused by the difference in name length. if you call the class "averylongclassnamefornoapparentreason", it will take a lot longer to create. so go figure. — Sage Mar 23 '13 at 15:06
$example = new Example();
$example = (object) ['name' => "some name", 'age' => 22];
wat?
ah it even doesn't work like that.
so apparently if you cast an associative array into (object) you get stdClass (that is not printable)
 
maybe its one of these rubbish examples you mentioned before
 
You could define a class that extends stdClass, but you would get no benefit, as stdClass does nothing.
 
"User Contributed Notes" is a nice feature.
 
hint: it isn't
 
:D It's glittering, but might not be gold though.
 
10:37 AM
til:
Betteridge's law of headlines is one name for an adage that states: "Any headline that ends in a question mark can be answered by the word no." It is named after Ian Betteridge, a British technology journalist, although the principle is much older. As with similar "laws" (e.g., Murphy's law), it is intended as a humorous adage rather than always being literally true. == History == The maxim has been cited by other names since as early as 1991, when a published compilation of Murphy's Law variants called it "Davis's law", a name that also crops up online, without any explanation of who Davis was...
 
10:53 AM
hmm for the record I am now ignoring dev jalla :P
 
guy is looking to form a community, nothing wrong with that
 
cbg
 
11:07 AM
@BhargavRao do you know why these chat users are not nuked: chat.stackoverflow.com/users/3797124/user3797124
 
@AnttiHaapala Gone now
 
How are you even finding these guys?
 
@IntrepidBrit they were on my ignore list
 
Ah, so you've encountered them before - fair enough
 
11:11 AM
I wish there were some proper cascades in the db ...
"delete this -> deletes everywhere"
 
@AnttiHaapala done
@AnttiHaapala It's there now
 
11:58 AM
@AnttiHaapala Maybe Dev jalla wanted to explain you the PHP internals in private :D
 
12:12 PM
I remember it clearly because, I had closed that :/
 
just nuke all the users involved with that post
 
Yeah, That's the best
 
Telepathy :D
That page has the Mutants! Don't start a war with them :P
 
That's.... an interesting use of super there: stackoverflow.com/a/42273594/100297
Yup, super.__getattr__ exists, so if you pass in self and a string, then you can uses that method to provide attribute access to your self.__dict__ mapping. That's a nice coincidence but not what you want to do.
 
12:27 PM
class ddict(dict)
 
@Gemtastic that's fine; the OP is mapping attributes to keys.
So ddict_instance.foo = 'bar' is really ddict_instance['foo'] = 'bar'.
 
Yeah, but it's extending dict, dict has a __getattr__
Unless I recall wrong
 
@Gemtastic if it does, then what would it return?
 
The answer is removed now however
You can laugh at my code when I make something I can show :D
In the meantime feel free to have at it on my spelling
 
The purpose of language is to be understood, As long as you are, why bother about those inclined to criticise your mode of expression?
 
12:40 PM
Actually I like being criticized because I'm not aware of all my flaws and if I don't know of them, then how can I improve upon them?
It goes for coding as well
 
Doesn't fasta wrap lines, so this would be incorrect anyway; and what do you expect the bash, awk and python tags to achieve here? — Antti Haapala 10 secs ago
 
Preferably it should be constructive criticism but I can sort it through
 
@Gemtastic what answer is removed?
 
Hello
 
@AnttiHaapala Never mind, I misread what happened, it's only grayed from having -3
 
12:43 PM
if you see it, it wasn't removed
 
It looked like it disappeared
 
deleted answers show up to readers with > 10k, they're not faded but they have pink background :D
 
28 secs ago, by Gemtastic
It looked like it disappeared
 
like so :D
 
I have a function with two args function(arg1, arg2), and I want to use with pool
pool = Pool(processes=len(arg1))
pool.map(function, arg1)
The problem is that pool works with one arg
 
12:45 PM
My screen resolution is ridicolously high and I was swapping tabs as it grayed out, which animated as if it disappeared for me
 
what can I do?
 
@IsabelCariod use a lambda/wrapper func
also, you wouldn't want to use Pool(processes=len(arg1))
just don't give anything and it is a better default already.
 
@IsabelCariod pool.map(function, (arg1, arg2))
 
1:06 PM
Not works "takes exactly 2 arguments (1 given)"
 
it's as if you've never been here before
then again I don't think marxin's suggestion would work
 
@IsabelCariod wait, if you want to use Pool.map, I assumed that you tried to process each argument in different process
if you want to pass all arguments to same function just call function(arg1, arg2) instead of having Pool
 
why your function passed to map expects two arguments?
 
1:22 PM
I need to use Pool
 
@marxin I think there's one input that's huge and expensive, and some other parameters that have to be set
Isabel probably wants to map a partial, in effect at least
I did something like this in the past and there was something about a simple lambda not working in python 3, and I had to define an auxiliary class to handle the parameters
right, because lambdas are not picklable
stuff like this
the problem might not have been related to python version, I don't remember
 
@Gemtastic No, the answer's still there.
 
where?
 
@AnttiHaapala hrmz.
I've narrowed down your question somewhat. Don't spam multiple tags for multiple tech stacks please. Ask a separate question for a Python solution (and include your own attempt for that). — Martijn Pieters ♦ 2 days ago
I removed the Python tags from those posts, off to check what else is going on.
 
wat ?D:
what happened to that post? :D
it was first about fasta :D
or is that another q?
I usually change the .fasta extension to .txt and then manipulate it with bash — Bio21 50 mins ago
picard.jpg
ah yeah another one
 
1:35 PM
on this lambda, where should I put arg1 and arg2?
p.map(lambda x: (lambda y:y**2)(x) + x, xrange(10))
 
anw the question and its answers are pretty much useless, unless the op is just replacing the sequence names on > lines
@IsabelCariod :D wat? :D
 
@AnttiHaapalan: different user even. But same pattern of asking for sed/awk/shell/python solutions without any attempts on their side.
Feel free to remove the Python tag from such posts and vote to close as too broad, it's all a bunch of gimme-the-codez anyway.
 
@IsabelCariod ok let's backtrack: what do you want the map...
ok :D
 
function(arg1,arg2)
 
and... its input is? list of tuples?
p.map(lambda pair: function(pair[0], pair[1]), list_of_pairs)
 
1:37 PM
fist is a list secound is just an id
 
or:
def unwrap(pair):
      return function(pair[0], pair[1])

p.map(unwrap, list_of_pairs)
or even within the unwrap/lambda: function(*pair) instead of function(pair[0], pair[1])
 
1:55 PM
I use lambda
pool.map(lambda pair: function(args1, arg2), args1)
 
good morning everyone
 
is good?
 
I feel like I never say anything in this room anymore except "good morning"?
 
or ask weird questions
 
if you can a program, how can you even not so that it can do?
 
1:58 PM
morningcbg
 
Has anyone really been far as decided to use even go want to do look more like?
 
Is SO down for anyone else?
@Kevin I see a lot of words...but cannot figure out what they mean
 
@Code-Apprentice just for a second or so
 
yah, I was in the middle of posting a comment ;-(
 
2:02 PM
I was in the middle of deleting a user
 
@Code-Apprentice I had a half-second down on the DIY one
cabbage all
 
yah, looks like it is back up.
 
@Kevin that made my head hurt. On first read, I thought I was going mental.
 
Yep that's its intended function
 
2:10 PM
@Kevin Do you remember by the way when you helped me sending a file through a chat? There is a problem with the code you offered me
 
Can't say I remember that, no
 
Deploying a large change to badges backend storage to Stack Overflow, site may be slow for a few minutes.
 
\o cbg
 
cbg @MooingRawr
stackoverflow.com/q/42220336/344286 anyone wanna reopen that? I mean it's not a great question, but it's not really unclear, unless you've literally never used Python.
the OP actually has input and expected output
maybe should be closed as dupe or MCVE, but it's not unclear
 
Eh, sure, voting.
 
2:19 PM
the only unclear part about that is: I have one json list and all he post is just a list of id....
 
Just noticed neither the input nor the output is syntactically correct. Mismatched curly brackets on both of them.
 
The accepted answer too...
 
2:42 PM
@MartijnPieters I worked on my question. Let me know. Anthony
@MartijnPieters Oh, right. This question. Cheers! stackoverflow.com/questions/42172228/…
 
I wonder why everyone love deploying changes on friday
 
Because if they do it on Monday, it ruins the rest of the week if something goes on. At least with Friday, people can deploy and just say screw it, that's for Monday to deal with
 
@WayneWerner for the record: don't reopen crap only to close it again as crap
and those code-only answers are hardly pearls in the sand
 
2:59 PM
The answers are certainly garbage.
 

« first day (2316 days earlier)      last day (2617 days later) »