« first day (2004 days earlier)      last day (2927 days later) » 

12:55 AM
anybody here?
ok bye!
 
 
1 hour later…
2:17 AM
@tzaman please join my chat room
 
 
3 hours later…
5:41 AM
utterly unclear XYZ problem
 
very very early morning cabbage
 
cbg
@AndrasDeak ^@Ilja got 3 upvotes and accept in the above q and said he does not understand a sh*t about what the guy is actually asking :D
ah now I understand
finally :D
@Ilja so there were multiple lines with "bag" = set of words.
and the guy is comparing the lines... :d
lol
 
6:00 AM
yeah, post information rules
 
I think we've sunk too much time into analyzing this: analysis
my math is right, right?
haven't posted that as a response yet
@AnttiHaapala I need validation about my rant :-)
 
well, I believe the difference is there, the question is is it significant
@davidism doesn't itsdangerous support python 3?
 
yeah
 
I mean the difference is significant as such, if this is the bottleneck of the application it should be changed :D
but I doubt it
 
yeah, exactly
 
6:12 AM
my take is: forget it.
instead, on Python 3 one gets bigger gains by actually using (1).to_bytes for the whole shit
 
It does use that, see the PY2 detection at the top.
Of course, it uses it through methodcaller, which is probably slower...
 
no it does not
it just uses single bytes
though ofc there is the leading zeros thing...
:&
 
Ah, I see what you mean.
 
but unfortunately there is no "use the smallest amount of bytes possible" for Python 3.
 
What does mean the transparent and non-transparent user avatars?
 
6:23 AM
seems that the now has "write your linked list" week
@davidism that 10^78 does not look right tho :D
 
hmm, math
 
>>> 30 * 60 / (5e-7)
3600000000.0
 
also your benchmark is not valid - it has assert and time.time in the loop itself
 
it's the same without it, I checked
 
6:29 AM
hmm
I'd make another python3 code :P
 
wait, is e-7 the same as 10**-7 for notation?
we need @Ffisegydd, I'm not hip with scientific notation
 
In [2]: %timeit x.int_to_bytes_python3()
The slowest run took 6.86 times longer than the fastest. This could mean that an intermediate result is being cached
1000000 loops, best of 3: 987 ns per loop

In [3]: %timeit x.int_to_bytes_slice()
The slowest run took 4.56 times longer than the fastest. This could mean that an intermediate result is being cached
100000 loops, best of 3: 2.23 µs per loop
@davidism exactly
 
see, this is why I posted here :d
 
now you calculated (5*10^10)^-7
 
Yeah it is
 
6:33 AM
def int_to_bytes_python3():
    num = int(time.time() - EPOCH)
    assert num >= 0
    byte_count = 0
    while num:
        num >>= 8
        byte_count += 1

    return num.to_bytes(byte_count, 'big')
that is significantly better
or was it 'little' that the code was producing?
ah no, big.
 
def int_to_bytes_native(num):
    assert num >= 0
    d, m = divmod(num.bit_length(), 8)
    return num.to_bytes(d + bool(m), 'big')
 
:P
forgot that
 
timeit int_to_bytes_native(ts)
The slowest run took 11.60 times longer than the fastest. This could mean that an intermediate result is being cached.
1000000 loops, best of 3: 775 ns per loop
moral is we should just define the entire function in the if PY2 block
and I guess use slicing in py2
 
actually just do +7 with flooring division
 
micro optimizing the micro optimizations
558 ns
 
6:36 AM
also assert is wrong
 
assert is in the original function
 
it is still wrong
assert is wrong when you test an api, it should throw valueerror instead
 
given that it's only called with a timestamp, which will always be greater than zero, it can probably go
 
unless this is wholly internal
def int_to_bytes_native(num):
    return num.to_bytes((num.bit_length() + 7) // 8, 'big')
 
hmm, is there a better solution for py2?
I feel like we should at least construct the bytes in the right order to begin with
maybe struct.pack?
 
6:44 AM
I have read that 'module' object has no attribute 'thread' is received as an AttributeError when coincidently you call your file threading.py. However, this is not my case. What can be the problem?
 
timeit struct.pack('>I', ts)
1000000 loops, best of 3: 268 ns per loop
 
struct.pack using big endian Q, then lstrip(b'\0')
 
Will time.time() ever produce an extended int?
 
I will break at y2k38
 
Oh, right, that. :-)
 
6:47 AM
The Year 2038 problem is an issue for computing and data storage situations in which time values are stored or calculated as a signed 32-bit integer, and this number is interpreted as the number of seconds since 00:00:00 UTC on 1 January 1970 ("the epoch"). Such implementations cannot encode times after 03:14:07 UTC on 19 January 2038 (21 years from now), a problem similar to but not entirely analogous to the "Y2K problem" (also known as the "Millennium Bug"), in which 2-digit values representing the number of years since 1900 could not encode the year 2000 or later. Most 32-bit Unix-like systems...
 
Only Windows still uses 32bit python, right?
 
I is 32-bit
and also int on linux is 32-bit
so just use Q and lstrip('\0')
it should work identically.
 
timeit struct.pack('>Q', ts).lstrip(b'\x00')
1000000 loops, best of 3: 348 ns per loop
beats to_bytes and works the same on py2 and py3
I think this one wins.
 
yeah
how are the vlaues
seems to be ok
 
yeah, returns the right result
 
6:52 AM
I shaved 100 ns more :d
to_int64 = struct.Struct('>Q').pack
to_int64(0x12345678).lstrip(b'\x00')
 
:D
 
cannot think of any way of getting it neater :d
so...
we started at how to shave 20 % of 3ms and now we've shaved off more than 90%
and the code is cleaner
additionally: int_to_byte is not needed any longer
@davidism ^that is wtf too
constant_time_compare = getattr(hmac, 'compare_digest', constant_time_compare)
 
there are a lot of "clever" things in the pallets code, I think it just accumulates over the years
 
it should be this, or try get compare_digest from hmac; on attribute error define the function
I believe "and the Django Software Foundation." is a major reason for that sucking :d
 
haha
hmm, I thought inlining the objects would make it faster, but it seems to behave slower

def pack(num, _to_int64=to_int64, _lstrip=bytes.lstrip):
    return _lstrip(_to_int64(num), b'\x00)
this is getting into the realm of "too silly" though
In [1]: timeit pack_old(ts)
1000000 loops, best of 3: 363 ns per loop
In [2]: timeit pack(ts)
1000000 loops, best of 3: 398 ns per loop
 
7:10 AM
@davidism dude go to bed.
 
Oh wow it's after 12. :-/
 
:P
How am I meant to sleep when someone is wrong on the internet!?
 
7:45 AM
Cbg
 
Yo
 
turnips
 
@AnttiHaapala does that mean it's not an autopromoting int?
(Will Pypy save us?)
 
cbg
 
@Ilja +1 for the mentalist badge
 
7:58 AM
Cabbage!
 
@PeterVaro @PM2Ring pretty good soundtrack
 
:sigh: Two answers to the same question, both recommending recursion instead of a simple while loop. stackoverflow.com/questions/36532887/… Why does this crop up so often? It seems to be rather popular in codes for games, and I guess that could just be confirmation bias, but I suspect that there's some crappy book / tutorial that recommends this. OTOH, I guess people could simply be discovering this "clever" recursive solution independently.
 
I think it’s that many tutorials don’t realize that Python has no tail recursion elimination…
But yeah, it seems very common for those interactive command line games
 
@JohanLarsson I just had a brief listen, and it's a bit too techno for my tastes, but I'll give it a longer go later.
 
ok, I only listened a couple of minutes but it sounded pretty good
 
8:02 AM
@poke I suppose so, but people who don't know that have no business mentioning recursion in a Python tutorial, IMHO.
 
@AndrasDeak you lost me, what badge where what? :D
 
clairvoyant, mentalist, omniscient
 
@Ilja yeah, that ^
answering an utterly unclear question with an accept
usually the sign of psychic powers
where other people only understand the question from the answer:D
(not an actual badge:( )
 
I'd rather have a "fast-hammering"
"dupe hammered a question in 30 seconds, and it stayed closed for 2 months with no reopen votes"
"this badge can be earned multiple times"
 
@AnttiHaapala heh
 
8:08 AM
:D
 
@PM2Ring eek. I've DVed the two recursion answers
 
@RobertGrant I was going to DV, but I thought I'd better give them time to repair them first.
@AnttiHaapala The Super Duper badge. :)
 
I just think, especially for the shorter answer, that recursion is pretty much the entire answer
Perhaps I should post an answer that uses recursion and for each one it does sys.setrecursionlimit(sys.getrecursionlimit()+1)
 
@RobertGrant LOL. :) FWIW, I saw that question just before I logged off last night, while I was on my Android, so I didn't have time / patience to comment. And I guess neither of those guys have seen my comments yet, so I'll give them a bit more time to change their answers.
 
Slightly different topic: I reckon Python should just consume available memory and not have an artificial limit
 
8:16 AM
Someome please tell me this guy isn't converting a list to its repr and then uses string operations to remove an item from it <-<
 
Why have wonky little rules to remember when you can just have an obvious thing like OOM
 
@ThiefMaster I hope there's eval involved
 
brief morning cbg
 
morning
 
@ThiefMaster That's pretty weird code. They're doing that dumb string stuff, but they've also got that fancy get_number function that returns a lambda that they're using in map. I get the feeling that they don't really know what they're doing and that lambda / map stuff is just cargo-cult coding.
 
8:37 AM
wait, I think OP is removing only the [{}],' characters from the repr
not actual elements
it's still silly
but a different kind
I think they are trying to get a copypastable string from their input, where values are gathered across same Names in the list of dicts
 
Mondays... Answering the same old "why aren't I seeing the data I thought I should see" questions ower and ower, when the answer is: your collector is misconfigured, you don't have that data.
 
How the hell did this get onto the HNQ list? math.stackexchange.com/questions/1735126/… How can someone have even a glimmer of interest in geometry and not realize that a triangle with sides a + b = c is degenerate?
 
heh...triangle inequality
 
@Ilja Sadly, we don't have "OP has CHDS" as a close reason.
 
I guess it's just the usual bikeshedding
 
8:42 AM
CHDS = Coital Hint Deficit Syndrome. I.e., they don't have a fucking clue.
7
 
people understand both the question and the answer:P
 
@AndrasDeak I guess so.
 
@PM2Ring also sadly I can't close vote colleagues
 
@Ilja :D
 
@Ilja Ah, the political dimension.
rbrb
 
8:44 AM
My colleagues know I've got a fair chunk of rep but have yet to deduce that "Hey, Fizzy could help to re-open our terrible closed questions!" is a thing.
 
@Ffisegydd I don’t think my colleagues have a Stack Overflow account. When I see them browse SO, there are lots of ads
 
what? there are people in tech world who dont use an ad blocker?
 
lol
 
Not everyone has the permissions to install them.
 
nice
 
8:51 AM
lol:D
 
@khajvah I don't hate free websites
 
that's why you don't call your table TABLICE
(and why you sanitize your input)
 
@RobertGrant except they hate you
 
I'd be surprised though if that worked
 
They can't hate me; I choose to consume their free content or I don't use them
 
8:52 AM
who doesn't assume that the length of license plates is known?:P
 
@RobertGrant when they put Google's trackware, they pretty much hate you
 
@AndrasDeak I do? They can be different lengths.
 
Morning all.
 
@Ffisegydd well, but there's a max length, right?
(where I live, it's fixed btw)
 
Hey up buttercup.
 
8:53 AM
I have just read I must "Dockerize my data science" and felt old.
 
@AndrasDeak I think there might be a maximum length of 7 but they can be less for customised versions.
@JRichardSnape You're not that old.
 
So kind of you, flower.
 
@khajvah no, they honestly are just trying to make money. If you don't like it, don't look at their content.
It's like saying you hate the concept of money, so that's why you steal from shops
 
@RobertGrant You can't simply not use their content as most websites put Google's scripts
 
8:55 AM
Then don't use those websites
 
@khajvah yes you can. Deactivate Javascript.
 
or I could go full Stallman
 
Or don't use those websites.
 
@Ffisegydd one consistent message to the kids, dear
 
8:55 AM
@Ffisegydd I block those scripts which is analogous of deactivating JS
kind of
 
GO STALLMAN GO!
 
@khajvah this is identical to saying "I can't afford everything I want, so that's why I steal"
 
@RobertGrant Consistency is overrated!
 
If they gave me the option, I would pay for good websites but they dont
 
@khajvah also irrelevant
 
8:56 AM
I thought you were paying with yourself. If you can't see the product, you're the product.
 
@RobertGrant Sound anarchist principles, shurely ;)
 
@khajvah That's like saying "If shops accepted oranges as payment I'd gladly pay them in oranges. Seeing as they don't, I steal from them."
 
they're not making money
 
@RobertGrant If you block your website for adblock users I will not use it. But I am afraid of executing malicious JS.
 
they're after power
 
8:57 AM
@AndrasDeak yes, and therefore deactivating the only method by which they make money to produce the content you're happy to consume is stealing
 
yeah I know
 
so I allow only the scripts that I trust
 
@khajvah so you go through every script on every website?
 
There are number of websites like 4chan who have nice ads (simple gifs), so I don't block them but most of the time, ads are malicious
 
Nice generalisation there.
 
8:59 AM
I've never heard 4chan be mentioned as an example of a safe site:D
 
@RobertGrant I block scripts coming from other domains
 
Wait. 4chan has ads?
 
@AndrasDeak its ads are pretty good. simple gif animations with links
 
This 4chan sounds like a neat place, I should go there on my work comp - OH GOD WHAT THE EFFING HELL!?
 
9:00 AM
lol
 
@khajvah seriously, that's a red herring. If you don't want to use a site in the way that's intended, for whatever reason then you don't use it. Any other consideration is basically meaningless and weasel-wording your way into thinking parasitical behaviour is legitimate.
 
@AndrasDeak I think there are some tiny places on 4chan that actually would be SFW.
 
Oh, nasty. Robert said "herring".
@poke I guess?:D
 
Not that I like tracking, but I also don't like paying for things and I still do that.
 
9:03 AM
/pretty-flowers maybe
 
@RobertGrant If the website publisher decides to block adblock users, I will not use the website but he is letting me block them and execute whatever I like. I don't see a problem.
 
and do you see a problem with adblock whitelisting sites?
 
@khajvah Because you're putting the onus on them to keep track of that, and that's obviously wrong.
Making every content producer continue in an arms race with every ad blocker is dumb, unless you (again) want to just have an easy get-out to carry on leeching free content.
 
well, I don't trust any website. Nor I trust google or facebook with my IP on every websiite I visit.
 
what's facebook?
 
9:06 AM
If your content is not meant to be consumed in some special way(by blocking ads), then simply don't allow it.
or post a message that you don't want me to use your website with adblocker
 
do you have SO whitelisted in adblock?
 
and your favourite sites?
 
You're getting basic stuff wrong here. You're basically saying a shop should be stolen from unless it a) has a sign up saying stealing is wrong, and b) doesn't catch you.
 
why'd I whitelist SO?
 
9:07 AM
@AndrasDeak I block google stuff
 
I am the product they're selling.
 
__product__ is not a valid dunder method.
 
@AnttiHaapala because SO somewhere asked, maybe:P
 
product
I never do dunder
**product** is what I use
 
@RobertGrant If the shop advertised poisonous apples and told you that you have to eat the poisonous apple in order to enter, I wouldn't enter.
but if the shop just advertises it, I would ignore it.
 
9:10 AM
Yeah but that's not an accurate analogy, obviously.
You're saying you don't want to pay for things, but still get the things.
 
I wouldn't enter a shop advertising poisonous apples
 
That's like saying, you can't go to toilet during TV commercials
 
No it's not.
 
@RobertGrant I am saying, give me the option to pay for content, I will pay.
 
well actually I could, because I am an a******, but I certainly wouldn't buy anything from them
 
9:11 AM
@khajvah you ARE paying for the content, by allowing the ads.
 
"Oh but I don't want to pay in that way". Okay, therefore:
 
who of you ever bought anything from online ads?
 
15 mins ago, by Robert Grant
@khajvah That's like saying "If shops accepted oranges as payment I'd gladly pay them in oranges. Seeing as they don't, I steal from them."
 
@RobertGrant I consider those ads malicious. If you want me to not use your website without them, block me.
 
9:12 AM
me, never.
 
@AnttiHaapala I already have 2 Asian wives, third one is in the mail.
 
@AnttiHaapala What if you were the Queen from Snow White?
 
7 mins ago, by Robert Grant
Making every content producer continue in an arms race with every ad blocker is dumb, unless you (again) want to just have an easy get-out to carry on leeching free content.
 
If I am googling for some information, and visit a random website, I obviously can't trust its scirpts
 
@AndrasDeak I have just one, but I didn't find her from a google ad.
 
9:13 AM
so I block them
 
@AnttiHaapala lame
 
@khajvah no, then you don't visit it
 
I sense a cultural rift
 
"I'd love a Porsche but I don't want to pay for it, so instead of not buying it, of course I should steal it."
No - you just don't get a Porsche.
 
@RobertGrant does the publisher want me to leave the website ?
@RobertGrant that's not a true analogy
 
9:14 AM
@khajvah Implicitly, always does
some are nice and say "please consider turning off adblock"
 
@AndrasDeak no that's not true
 
but they mean "turn off the fucking adblock"
you don't get money for having ads on your site, you get money for getting ads loaded, and occasinally clicked on
nobody would want to have ads and tell their audience to avoid those
 
This issue is so basic it's scary we're still talking about it
 
because that's equivalent to not having ads at all
 
@AnttiHaapala Not directly, but I would say that ads do get me interesting in some thing sometimes.
 
9:16 AM
@RobertGrant I agree.
 
@khajvah you can safely assume that if there are ads on the site, the maintainer wants you to see them
 
Yeah same. I've never clicked on an ad and bought something, but they have brought things to my attention (consciously, and undoubtedly unconsciously too)
 
@AndrasDeak If you tell the publisher that he has two choices, either he loses a visitor or lets him block the ads
he might choose the latter
 
Depends on what they are publishing.
 
The issue is not the ads. The issue is malicious ads
see, I don't find the tracking ads ethical
 
9:18 AM
that's not an ethical issue
especially that you should be able to opt out from any tracking
 
it is, you are saying that it's unethical to block ads, I am saying having those ads are unethical themselves
 
yes, I'm saying that ads are not unethical
neither are tracking ads
there might be problematic from many perspectives, but ethics or morals is not involved in my opinion
your blocking them, on the other hand, is a moral issue
 
I don't see it as stealing
I see it as protecting myself
 
others do, apparently:)
 
then block me
 
9:20 AM
and morals are a crowd-sourced concept
you can be moral and self-protective: by not using those sites, as Robert suggested
 
If I loved the publisher more than my privacy or protection, I would not block ads
 
it's not a matter of self-preservation for you to see those sites, is it?
 
@AndrasDeak not every publisher sees it as stealing
 
I have no problem with ads showing relevant ads to something I might actually like or something near me instead of some store in china selling lipstick.
 
you want to see the sites, but don't want to pay any cost
 
9:21 AM
having a visitor is still good for many
 
how many?:D
I'm mostly playing devil's advocate here, btw
I don't have a very strong opinion, but I agree that your point of view is...controversial
 
You can't claim that a website publisher doesn't want visitors who block ads
 
I was hoping we'd be over this once I got back with my coffee.
 
:D
have a good coffee
I'm already tired
so I think I'll pass
(I've been tired since I got up in the morning)
 
they want visitors to allow ads but if you tell them that they will lose the visitor, he might choose to allow
 
9:23 AM
so how any emails have you sent to webmaster@domain.name?
 
if he doesn't, he can note the user or block them like some websites do.
 
So, cats.
 
@Ffisegydd More coffee
 
Where has all the coffee gone?
 
9:24 AM
long time passing...
 
It was stolen by the cats.
 
 
straight out of uncatny valley
5
 
 
talk about helpful edit...
 
9:30 AM
@khajvah what are you talking about? "I want people to drive Porsches, whether they steal them from me or buy them from me" is the equivalent attitude.
You can easily tell a website that doesn't want to serve you ads: they don't have any.
 
9:42 AM
On the SO question list, did they increase the contrast of the question separator line?
 
yes?
never would've noticed it
old vs new
where's my minimarkdown?
no wait
I might be imagining things
damn you, priming!
 
@AndrasDeak amazing.
@poke right out of the uncaninely valley
 
@AndrasDeak Hmm, #eaebec to #d9d9d9. Glad I wasn’t imagining things.
 
OK, you've got me entirely confused now:P
I mean I understand what you're saying, but first I saw it, then I didn't
nothing is true anymore
 
9:51 AM
huh?
 
I don't listen to fancy color codes, I listen to my eyes, been using them for a while with no problems;)
 
heh
well, I’m super sensitive for such changes
 
I took that one before, and I have a calibrated monitor so that’s not too difficult :P
 
oh, fancy
 
9:54 AM
If you like such things, then Blendoku is a cool puzzle game about ordering colors.
 
yeah, I'd suck at that a lot:D
thanks for the tip though
 
:D
I played the first part of the game like crazy..
Hmm, I was invited to the Intel Developer Conference..
 
that sounds posh
 

« first day (2004 days earlier)      last day (2927 days later) »