« first day (1962 days earlier)      last day (3210 days later) » 

20:00
Yeah I agree exactly with that
Ah, go on then @holdenweb, here's the tripe I was talking about. Link is to a pdf, most egregious phrases on first page of text tinyurl.com/gvemw7j Hashtag_D_M_U_G_l_o_b_a_l ...
DSM
DSM
@Ffisegydd: oh, I meant to ask the other day but got distracted trying to figure out if I have an accent. What got you into elliptic curves?
@DSM just general interest in crypto.
Originally I was reading about the suspected backdoor in some old crypto.
DSM
DSM
@Ffisegydd: ah, crypto. I was trying to figure out the application (I have #geeklove for number theory, so I know ECs from there.)
I should study more number theory as I don't know much about it.
20:06
have you guys read cryptonomicon?
@idjaw yes. My favourite book ever.
Hands down.
I re-read it about once per year.
It was my first neal stephenson book I read
Has one of the best explanations of the Enigma machine ever.
I love his work
Neal Stephenson in general is a legend.
20:07
Is that the one with Hiro Protagonist? I like the introduction of the guy with the obsidian knives.
No that's Snow Crash.
I haven't gotten around to Quicksilver. Have you read it?
I remember Kevin once trying to read Anathem and giving up, due to the necessary glossary IIRC.
I tried reading Anathem but couldn't get through the first fifty pages so I have a 50% success rate for Stephenson books.
@idjaw I've read 2.5 books of the Baroque Cycle. I got half way through Book 3 and got distracted.
It was just so lengthy I got lost in it.
To re-read it I'd have to start from scratch now.
20:10
I had that problem with the Illuminatus! trilogy.
I never re-read books. When I finish something, and know the main plot points, I am not interested in re-visiting.
I just don't have that attention span.
Once they got to the eighth parallel unresolved plot hook (this one involving a submarine that might be magic?), I ran out of stack space.
The Diamond Age is one of the most heartbreaking books ever. It's fantastic.
Seveneves is another great book of his. All his books are great.
(we are currently playing this at work between meetings: geoguessr.com/world/play)
good times
a significantly lighter book on the tech...it's quite fluffy, but it was enjoyable. I got through both books very quickly, were two from Daniel Suarez: First was Daemon, second was Freedom.
20:23
those are great books
I just noticed that there are two new ones
I'll have to start those ones!
Neal Stephenson however is my favorite ... SnowCrash was the book that really got me into scifi
@idjaw it looks like the other two books are not part of the Daemon-freedom ology
Oh the Daemon story was jsut those two books from my understanding. Unless there is a third planned?

The other two, yeah I see are standalones
I cant even remember how freedom ended but i thought it kinda set it up for some kind of expanded universe ... (hell with oculus rift or microsoft hololens they could probably make some kind of kick ass mmo type thing)
wow...come to think of it....I can't remember either.
20:33
Just finished watching "Cooked" on Netflix. I recommend it to anyone who enjoys cooking.
noted
mind of a chef and jiro dreams of sushi are great ones if you haven't seen them yet @Ffisegydd
I keep meaning to watch Jiro.
my wife and I would absolutely love the opportunity to go to that restaurant. Japan is on our list of places to travel to and eat all the things inside of it.
20:35
Mmmm, I want sushi now.
heh python's ranges are not inclusive endpoints, so they help avoid off-by-one errors - except when people unfamiliar with python assume they are inclusive :(
Would love to visit Japan but FizzyGirl is allergic to shellfish so she'd basically starve.
I watched "God of Cookery" last week. I recommend it to anyone that wants to see Steven Chow get assualted by a buddhist monk with a folding chair.
DSM
DSM
@Ffisegydd: now, now. I don't like fish at all and I don't starve on my visits. :-)
@enderland Just link them that Djikstra paper that conclusively settles why inclusive/exclusive endpoints are objectively the best choice.
20:36
that sounds familiar..
@Kevin it was me that had the problem :P
i in range(0,5)... why is this only running 4x? :P
@DSM true but can you guarantee that the cooking utensils won't have been used to cook shellfish at all recently? Plus a lot of sauces (even non-fish based) will use oyster/fish sauce as a kind of base IIRC.
DSM
DSM
Erm.. it should run five times..
this turned up on Google but I seem to remember it being a handwritten document... hmm.
DSM
DSM
@Kevin: click the upper right.
20:38
>>> for i in range(0, 5):
...  print(i)
...
0
1
2
3
4
>>>
looks like five to me.
oh yeah. That's the stuff.
@idjaw hockey is played on grass just like rugby. But I'm guessing you;d call the field hockey, being from the wrong side of the Atlantic
you mean FUN side......as I look outside at the hellish ice conditions and dreads the drive home
@DSM Mixins depend on inheritance
@idjaw yes, I mean more I assume it is <=5 than <5 :)
DSM
DSM
20:39
@holdenweb: I never did get over people saying "ice hockey" in England. Sounded so foreign, even though objectively I was the foreigner.
@JRichardSnape Worthy of Private Eye Pseuds' Corner #marketingspeak #drivel
DSM
DSM
@holdenweb: ehh. You can have a language which doesn't allow inheritance (you can't derive a class from another) but allows you to push methods from one class into another.
Or you can have KevinScript, which requires you to set up your last will and testament before allowing inheritance.
Wow that joke was bad. I got about half way through and knew I should abandon it, but I was just too committed D:
DSM
DSM
Go hard or go home.
@Ffisegydd I'd suggest you revert. Oops, too late
20:45
Come back with your stars or on them.
DSM
DSM
+1 classical reference
Huh, apparently KS does have inheritance. I forgot about that.
>>> class Fred{
...     function speak(self){
...             print("Yabba dabba doo!");
...     }
... }
>>> class Barney(Fred){
... }
>>> b = Barney();
>>> b.speak();
Yabba dabba doo!
@enderland: Python ranges and slices are the way they are to avoid all the subtle off-by-one errors that languages like Basic generate. For all i < len(s), s[:i]+s[i:] == s, for example. So one of Guido's (the inventor of Python) key insights was to use half-open ranges (one endpoint is included, the other is excluded)
I don't know if you can do super-like invocation of parent methods though.
Fred.speak(self) might do it or maybe not.
@Kevin That's because you are making it up as you go along, right?
20:49
Yeah pretty much :-)
I probably could implement super if I wanted... I give it a 3/10 on the difficulty scale. Requires some magic to peek at the state of the calling scope, but nothing requiring new infrastructure.
@holdenweb yeah it's actually nice, I like that, just was weird coming from languages that aren't that way
You aren't the first person to think so. The ones who don't get over the "it's weird" feeling we just feed to the crocodiles
DSM
DSM
Given that just this minute I typed "append" where I meant "emplace_back", I can agree switching between languages can cause problems..
@Kevin You think handling dumb inheritence patterns (admittedly Python's solution is well documented and probably copyable) would be easy?
(honest question)
Well I don't think I allow multiple inheritance, so that eliminates an entire class of tricky implementation issues
20:54
I'm not saying it'd be hard, but I dunno what 3 is on the difficulty scale.
Oct 21 '15 at 16:16, by Kevin
I give that a 6/10 on the difficulty scale
Oh, that does solve the problem I guess.
Aug 28 '15 at 20:04, by Kevin
From your description, I give it a 4/10 on the userscript creation difficulty scale.
Oct 27 '15 at 13:35, by Kevin
I give this userscript idea a 6.5/10 on the difficulty scale. Possible to do, but will require many swear words.
We now have 4 data points!
@holdenweb I just saw alligators at the zoo this weekend... crap!
And were they making alligations?
20:57
It would probably look something like
def super(scopes):
    calling_scope = scopes[-1]
    assert isinstance(calling_scope, class_method), "super can only be called from within a method"
    return calling_scope.class.parent
[famous quote from a Scottish trades union representative: "We've heard a lot of allegations; I'd just like to know who the allegators are"]
Voila. Now you can write class Barney(Fred){function speak(self){super().speak(); do_other_stuff();}}
@Kevin cool: totally incomprehensible in only one line!
That's KevinScript's flagship feature B-)
Built in obfuscation.
20:59
that's what happens when you incorporate semi colons and curly braces. You can't have nice things.
@holdenweb the python was eating them
DSM
DSM
My non-square avatar is a cat with tilted head. We support cats here.
guys i have a dictionary of the form
'itm1': [(3030, '14.20')],
'itm2': [(5145, '67.25'), (6860, '29.58'), (6045, '54.19'), (9526, '22.88')]
is it possible for me to access the individual list item ?
say i want to extract 3030 from itm1, how would i do it
Absolutely. d["itm1"][0]. There, you've accessed the first item of the first list.
21:05
but it would return the entre list right ?
d["itm1"][0][0] will get you the first item of the first item of the first list.
d["itm1"] would get you the entire list.
DSM
DSM
These things are worth experimenting with at the console to get a feel for.
Note the subtle difference between retrieving the list, which has only one item, and retrieving that item.
i get list index out of range
>>> d = {
... 'itm1': [(3030, '14.20')],
... 'itm2': [(5145, '67.25'), (6860, '29.58'), (6045, '54.19'), (9526, '22.88')]
... }
>>> d["itm1"]
[(3030, '14.20')]
>>> d["itm1"][0]
(3030, '14.20')
>>> d["itm1"][0][0]
3030
21:07
ah nevermind
should have tried
i was trying it as d[1][1]
thanks @Kevin
no problem.
I wish all programmers would get together and agree to refer to the first item in a list as the "zeroth" item but I doubt that's ever going to happen.
And it's not something you can unilaterally decide to do yourself; it's like deciding to drive on the left side of the road.
It's time to start a movement. That's the only logical decision. #Zeroth
I don't think the problem is programmers so much as a couple centuries worth of mathematicians.
21:18
I knew math was evil!
We didn't realize that thousands of years in the future it would be convenient to start indexing things from 0 because of memory addition.
0 is a relatively new feature of math.
@vaultah How come you deleted that golf answer? It seems to pass all the test cases.
At some point we should just push a new version of math that fixes issues like that and supports Unicode.
3
Ah ha, that's why some students struggle with math. They can't tell the difference between Σ and ∫ - they both look like □ to them
My small group bible study people were talking about some weird "dots" method they learned - I felt old :(
21:34
@MorganThrapp: I didn't check the characters preceded by @, my solution assumed that every ping was surrounded by whitespace
I'm genuinely curious about what the "dots" method is.
Dons his "Dot Product Saves!" hat and jersey
I didn't really understand it, and at this point I'm good enough at mental math I don't really "think" about math when I do it
@vaultah If you pass the test cases and it's not specified in the challenge, it's a valid answer.
Oh bother. It's probably some abacus crap.
Also, I saved you 14 bytes, if you're interested.
21:38
You're free to use my code in your answer :-)
Nah, I'd feel bad. It would mostly be a whole sail copy of yours.
Btw, is it okay to cw PPCG answers?
E.g. to let others edit it?
I mean, it's technically okay, but there's no reason to.
Most answers are at least a little collaborative anyway, but the person who put in most of the work to come up with the algorithm should gets the points.
@jayeshkv and just to twist your head as far as it will go, d["itm1"][0][1][2] gets you the character '.' - the third character of the second item of the first list indexed from the dict by "itm1" (because strings are also sequence containers)
@Ffisegydd related to the catapi.... reminded me of this hilarity, (nsfw for language) foaas.com
21:48
When you see [...], work out the value expression immediately preceding the brackets, then apply the indexing operation. In the expression above, there are four levels of indexing, applied one after the other (and recursively described in English starting with the last one, which may not be entirely helpful)
@MorganThrapp it would fail for "blah blah @someone.", because my solution recognizes "@someone." (with dot) as a valid mention. The question states that "A ping to another user is defined as an @ followed by 3 or more letters". My solution doesn't perform such checks. Is it really okay?
@JRichardSnape conclusion: they could open a tripe shop (or rather they have)
@vaultah Oh, hmm, I didn't notice those parts. Yeah, maybe not. The test cases should really be better.
DSM
DSM
BTW, vaultah, on the CW answer you haven't deleted, you can save a few characters using a trick Morgan's used in the past:
>>> [(c in'<>') == (c<'?') for c in "<>v^"]
[True, True, True, True]
@idjaw laughing my ass off at home
Or should that be my aas?
21:58
I think you are looking for Laughing my AaaS @holdenweb :P
@DSM: oh, that's cool
thanks, I'll update it in a few hours (:-/)
22:14
ok dumb question, I have a huge blob of text that comes in from subprocess with a bunch of \n characters - when I print this to stdout I see... a huge long string - is it nontrivial to print this via splitting somehow? I can't seem to get str().split() to work
it comes back as a tuple, so I have to cast as a string
did you try splitting on new line?
How exactly are you printing this huge blob of text?
>>> z = """
... sd;lfkj
... sdlkjf
... sdlkjf"""
>>> z
'\nsd;lfkj\nsdlkjf\nsdlkjf'
>>> print z

sd;lfkj
sdlkjf
sdlkjf
print str(dr.get_std_out(self._client)).split('\n')
that was what I was trying, where dr.get_std_out returns the result of subprocess.communicate
This will give you a list of all the separate lines. Also, I think splitlines() is preferred over split('\n').
>>> print str(z).split('\n')
['', 'sd;lfkj', 'sdlkjf', 'sdlkjf']
>>> print str(z).splitlines()
['', 'sd;lfkj', 'sdlkjf', 'sdlkjf']
If you want to print it out, why are you splitting on newlines anyway?
@PaulMcGuire subprocess.communicate returns a long string with lots of \n for the linebreaks
ah, I wonder if I'm getting stdout and stderror
22:20
Yes, but if you print out the string as-is, won't it break on the \n's?
@PaulMcGuire what is the difference between splitlines and split if you specify \n in split?
splitlines is OS-newline aware
@PaulMcGuire no, that's why I'm so confused - it literally prints the \n characters
@PaulMcGuire ah! cool. thanks
And I really really REALLY hate backslashes
22:20
:)
If you glance at my post above, you'll see that a string containing \n's will not print them as '\n' when using print.
ah. I was printing both stdout and stderr at the same time, which grouped them as a tuple, and then when printing didn't actually expand the \n
but if I print just stderr I get a normal output
Like this:
>>> print (z,z)
('\nsd;lfkj\nsdlkjf\nsdlkjf', '\nsd;lfkj\nsdlkjf\nsdlkjf')
yeah, but if you do:
>>> f = ('\nsd;lfkj\nsdlkjf\nsdlkjf', '\nsd;lfkj\nsdlkjf\nsdlkjf')
>>> print f
('\nsd;lfkj\nsdlkjf\nsdlkjf', '\nsd;lfkj\nsdlkjf\nsdlkjf')
it was effectively what I was doing
Ugh, this is why everyone needs to monitor the python-3.x tag too: stackoverflow.com/questions/35710872/…
22:25
"This text is here so stackoverflow will let me post this question"
that's a first for me.
@MartijnPieters I enjoy seeing your answers on Stack Overflow in by the way :-)
@enderland Glad you appreciate them! :-)
Python is weird, but I'm growing fond of it pretty quickly
@idjaw Stick around, you'll see it more often. I see it about once every two weeks.
it's considerably better than C++ that's for sure. lol
22:26
@enderland that's a low bar to reach though. ;-)
@MartijnPieters I think that I'm lucky that my programming journey started where it did. makes me appreciate a lot more things haa
Mine started in the early 80s... drops the mike
@enderland was is C?
@khajvah I did a ton of VBA (which really isn't bad - just most of the programmers are... not programmers) and lots of C++ too
VBA is considerably better than C++ imo, which is saying something about C++ craziness
I still can't get my debugger working and have given up, but it's a heck of a lot faster cycle with Python than C++
C++ isn't that bad
It's fine
22:30
I like being able to run my tests more quickly than every 20 minutes
and since C++ compiles like.... super slow.. :(
It does?
compared to stuff like Python?
yeah
btw @idjaw, here is a little dis output re: split('\n') vs. splitlines:
@holdenweb Pseuds corner was one of my first thoughts... keep your eye out for it...
>>> z1 = lambda s: s.split('\n')
>>> z2 = lambda s: s.splitlines()
>>> dis.dis(z1)
  1           0 LOAD_FAST                0 (s)
              3 LOAD_ATTR                0 (split)
              6 LOAD_CONST               1 ('\n')
              9 CALL_FUNCTION            1
             12 RETURN_VALUE
>>> dis.dis(z2)
  1           0 LOAD_FAST                0 (s)
              3 LOAD_ATTR                0 (splitlines)
              6 CALL_FUNCTION            0
              9 RETURN_VALUE
22:32
@enderland that's the least important of C++'s issues tbh
well yes. but it's one you feel very often
@PaulMcGuire Thanks!
But it's really the backslashes that give me a rash more than anything.
22:46
@enderland https://channel9.msdn.com/Events/GoingNative/GoingNative-2012/Keynote-Bjarne-Stroustrup-Cpp11-Style
C++ is a good language when you care about effective resource management.
@QuestionC Don't want to diss Bjarne but I don't find C++ useful for anything. If I want a "high-level" language with garbage collectors and stuff, I have no reason to pick C++ over Java. If I want to write low level code, why do I need garbage collectors that comes with C++?
cbg all
C++ comes with garbage collectors? what madness is this?
^
what garbage collectors?
why doesn't disconnecting an ethernet cable destroy all me socket connections?
22:53
I'm finally back. Did I miss anything?
@khajvah's post just now
@PaulMcGuire seg faults are kinda like garbage collection
@corvid because it's a hardware issue :p
@PaulMcGuire smart pointers
smart pointers != gc
22:54
ouch, I like that
@tzaman How so? How are they implemented?
@tzaman What do you mean?
oh reference counting.
still, my point holds :P
refcounting, but under your control
automatic GC is a different beast
and no, Java is horrendous :p
what does "under your control" mean?
22:57
It means explicit.
^
direct control over the lifetime of all objects and resources
look up RAII
C++ probably isn't good for most people until you start thinking of 1 million as not a lot of things.
DSM
DSM
My main work code is in C++. It's frustrating at times, but if you restrict yourself to the saner parts it can be handy.
@QuestionC would a start a new project in C++?
It depends on what you're doing.
23:00
my main issue with C++ is that there are too many ways for your code to be subtly wrong or broken
rephrasing: What kind of project would it be that would make you choose C++?
If you want to write a program that solves Advent of Code #6 in less than a second, you're probably best off using C++ for example.
DSM
DSM
Performance requirements which rule out Python and complexity which makes C and/or fortran difficult.
@QuestionC Why not C?
@DSM So is C++ much faster than, let's say, Java?
DSM
DSM
For some stuff, not for others. The JVM has gotten a lot of attention from very good developers. I just can't stand the verbosity of the language.
23:04
no kidding
hello world is what 1000 characters?
@DSM C++ is verbose too
Unless you're using classes/namespaces, the differences between C and C++ are mostly pedantic.
DSM
DSM
That's a pretty big exception, but I still don't know if I agree..
if you use templates, it becomes pretty damn verbose
C is almost a subset of C++. How about that?
To the bigger point, Python can't be a 'better' language than C++. They're too different. They solve and create different problems.
C++ vs Java is at least a meaningful comparison.
If you write a Raytracer in Python and I write a Raytracer in C++, I can pretty much guarantee the C++ one is going to be better because nobody wants to wait 10 minutes for a basic picture.
@QuestionC I suspect if you use the right modules, there is much less of a difference in speed than you are expecting
@enderland If you mean writing critical part in C then yes
23:47
Let's not get too down on smart pointers either - isn't that what Python's context managers are after all? There are more resources that you want to manage than just allocated memory.
23:59
is there a community of kind people like SO that will check my proofs to simple math problems?

« first day (1962 days earlier)      last day (3210 days later) »