« first day (2298 days earlier)      last day (2875 days later) » 

00:00
maybe I first make a list of all stocks, then retrieve them, and after I retrieve all information and saved it to files, I process them.
pool = GreenPool(10)
res = []
for result in pool.imap(main, chunker(stock_list, 1)):
    res.append(result)
print(res)
this will do 10 at a time
already changed..
much faster
But the list 'res' is getting filled with None
But I'm returning the results from main
Bye, I quit for today, bye, and thanks for help!!! )
:)
00:20
ooooooooh pupper's online!!!111234
daaaaamn this was hard
@AndrasDeak After I logged off and while was falling asleep last night, I realized that I said "Scully" when I meant "Sully"...you know the movie about the pilot played by Tom Hanks that landed in the Hudson River...no wonder I was confused by the X Files reference.
what's a pupper?
@Code-Apprentice a young doggo
what's a doggo
khajvah should link it in a moment
no, Wayne
Jan 23 at 19:13, by Wayne Werner
user image
I know. I'm just playing along
00:21
oh...:P
I don't like copying
anyway, I knew which movie you were talking about, I was just trying to be a smart-ass:P
and i totally missed the connection
oh man I can't believe I got the puppy to work
and all this without a monitor nor a TV in the apartment:D
sitting on the floor, typing on a foldable silicon USB keyboard to a computer blindly; I've never felt more 1337
huh? whatchya talkin' about?
I got a new computer, a proper PC. I'm installing puppy linux on it, which occasionally has its hiccups, and I don't have any visual feedback, because no monitor. And networking has been kicking my ass, so I couldn't even ssh in to work from my laptop. This is what I got working right now; I can ssh in to the puppy:)
I'm a special kind of lazy who'll rather try a few dozen times (transferring the bootable USB back and forth between PC and laptop) than walk three blocks with a lent monitor
cc @PM2Ring ^ :D
00:52
Never heard of puppy linux. Any good?
And why no monitor?
@Code-Apprentice I used to have one, but I gave it to my mom many years ago (I've been using a laptop for looong)
PM2Ring suggested puppy to me because it can happily live on a USB drive; in fact it lives in RAM and only saves the file system every once in a while and at shutdown
I am thinking about getting a laptop with my tax return. I need something to use for presentations for the Meetup I'm starting in my area.
I'm building a NAS, and it's perfect that I don't need an extra drive or partition beside my storage HDDs, only a thumb drive
oic...sounds like a fun project.
and it's convenient to set up on a laptop, then move over to the PC. And presto-chango-week_of_hard_work-it's working
00:55
so you set up the USB using your laptop and boot the PC directly off the USB?
It's very light-weight, and while it can be installed in a hard drive like other distros, it's "not recommended"
@Code-Apprentice yup
but now that ssh is working, I can fiddle with it (such as setting up RAID) in situ
I will have to look into that. I can see it being useful as a recovery tool.
but it has a lot of quirks; such as always running as root. There are some non-root users, but it's not really easy/possible to create new ones, and anyway it's not proper multiuser
@Code-Apprentice oh, very much
that's one typical use
lot of fans carry them around on their key chain, so that they can use their own system on untrusted/foreign computers
00:57
of course, my current HDD is fully encrypted, so booting from another OS won't be terribly helpful...
others use it for online banking, by nuking anything personal after each boot
@AndrasDeak that is an interesting idea, too
and for pr0n
of course you don't need puppy to have a live disk (I think DSM mentioned having a live linux on his keychain)
> grandpa-friendly certified
When I started playing with puppy, I bumped into a few obstacles (one was an ssh server: openssh-server wouldn't work, I had to find another one). I was going to give up, but after some googling around I couldn't find another distro that lived in RAM
but the lure of that, minimizing USB IO was just too tempting
I could install something lightweight on a USB, but then I'd have a USB bottleneck
01:03
I have Arch on a USB. I used it to install on my PC and haven't touched it since.
seems jinja is really focussed on html :(
rhubarb
@AndrasDeak Woof!
@AndrasDeak Wow, I didn't realise that you were running a headless Puppy. Well done!
01:42
I now don't know if I made something hideous or great.
t = [list(i[:2] for i in group) for key, group in itertools.groupby(inputlist, operator.itemgetter(2))]
@Code-Apprentice As Andras said it's a bit quirky, but if you know a little about Linux it's not too hard to pick up. And because it's so small there's less to learn. ;) Puppy's the only distro that I've done stuff like modifying initrd on. And if you screw up a clean installation is only a reboot away.
It has its own packaging systems but it can also use Ubuntu or Slack repos. Installing Wine is just a matter of dropping a .sfs file (filesystem in a file) into the same folder as your main Puppy files.
03:11
@Mitch Yeah, that is what I read as well. People generally want to slice rows most of the times so they kept df['x':'y'] as row syntax and d['x'] as column syntax. But I was trying to dig into source code and see where it's happening. I tried to read the __getitem__() implementation but couldn't get a good understanding from there.
@Mitch Wes Mckinney used to answer questions on StackOverflow previously.
03:34
@MYGz Ohh gotcha, I might venture a look then.
03:47
@MYGz Hmm, it doesn't look too bad I don't think? We check if the key is callable (which it isn't for a slice), then try and convert it to a sliceable with convert_to_index_sliceable which looks like it isinstance's whether the key is a slice object or not along with some more tricky things. So in the d['x'] case, the try-except doesn't raise anything and we just access by column w/ the shortcut. In the d['x':'y'] case key in self.columns will be false
... since our key is a slice object, and we end up in the indexer is not None condition.
And in the NDFrame _slice method the axis default parameter is 0, so the row dimension.
 
2 hours later…
05:35
I'm feeling crazy, but are iterators that hard to get to in python?
@Mitch Hmm. Makes much more sense after your explanation. Thanks. Actually my goal was to embed it into the answer that I wrote here: stackoverflow.com/questions/41922786/…
05:50
@MYGz btw, that is some gratuitous use of bold that even makes me jealous :-)
Hehe
Is there a flag for too much bold? :D
@MYGz there should be!
:D
@piRSquared I was trying to solve this with pandas. You can give it a try: stackoverflow.com/questions/41929351/…
Initial idea: Split the hybrid content on '|', make two columns and scan the columns for match.
06:18
looking at it now
06:29
Cabbage :-)
06:50
\o cbg
for closing it's tag:cv-pls, whats for reopen?
it's tag:reopen-pls !-)
done
@MYGz now close it again with the correct target
Thanks. Tried to search, can't find a dupe.
07:15
cbg
ok, seriously... "cbg"?
I'm not here very often so forgive me for not knowing what that is... please explain to the new guy
first rule of fight club.... don't talk about fight club. I get it.
You don't know the salad language?
javascript quiz :D
07:23
no... /hangs head in shame
I've been playing with sorting, in reference to stackoverflow.com/questions/41910430/… I wanted an efficient way to merge two sorted lists. I tried using heapq.merge, but it made my code 3 times slower than simply using TimSort. I guess that makes sense, since TimSort is very good at exploiting existing ordered subsequences in the list its sorting.
Oh you @AnttiHaapala
(() => { asdf: [ 1, 2, 3 ] })
from ilja
Speak like a native. Here is the tutorial to help you: sopython.com/salad
the return value of ^lambda function
07:24
To give it context: React component's setState accepts a callback as argument, like so:
this.setState((prevState, props) => { asdf: [ ...prevState.asdf, 1 ] });
And incidently that does nothing
No errors, no changes
@piRSquared Most of the salad language is rarely used. The main words you'll need to know are cabbage / cbg, rhubarb / rbrb, yam, and garlic. And occasionally, melon, pineapple, and laurel.
great... this is totally silly and I hate that I've seen it... cuz now I'm going to accidentally start saying this stuff irl...Yam
heh
@piRSquared this is IRL.
@AnttiHaapala sprouts
07:29
@AnttiHaapala IRL?
In Real Life?
Who are the founders and cofounders of salad language?
Ok it's mentioned there
0
Q: Should we have a canonical virtualenv question?

KevinI realize, of course, that virtualenv is a whole tag, and having a single question summarizing the whole topic is beyond the scope of the site. I want an introductory question that goes over enough of the basics to serve as a reasonable dupe target for questions about Python packaging where a vi...

lol kevin'd by martijn :D
:D
07:54
@AnttiHaapala note: different Kevin.
Yeah Kevin got green avatar. And he might be having some gold badges too.
08:39
@MYGz
0
A: How to read two lines from a file and create dynamics keys in a for-loop using python?

piRSquaredpandas setup from io import StringIO import pandas as pd import numpy as np txt = """pos M1 M2 M3 M4 M5 M6 M7 M8 hybrid_block S1 S2 S3 S4 S5 S6 S7 S8 1 A T T A A G A C A|C C G C T T A G A 2 T G C T G T ...

@piRSquared Cool!
09:08
@MartijnPieters in any case kevin'd by martijn
@paul23 If you're still having problems with iterators, maybe my PyData London 2016 talk will help (though I don't guarantee it): youtube.com/watch?v=iTwrF1DofCY "Iterables and Iterators: Going Loopy with Python"
@piRSquared Hi there: do your friends call you Area?
@holdenweb lol, I love it... but no.
cbg
09:24
@AnttiHaapala Explain 'kevin'd by martijn'. Few like me didn't get.
:D
@poke poke
Cabbage
:D. Cbg
@MYGz (to be) kevin’d (by so.) (adjective) When what you just wrote has been written just before sending your message by someone else. Possibly even in a more detailed way than you did. – See also: inb4.
Ah. Thanks :D
@poke perhaps add that to the salad language page
D:
:D
Cabbage
@poke Lol. :D
Wait, where did that Malevolent Editor for Life go?
09:56
sentry sucks
10:06
sentry as in [lookout, watch, watchman, patrol, picket]?
Argh. This page needs more "other languages have 'variables', Python has 'names'". softwareengineering.stackexchange.com/questions/341179/…
10:26
its more about mutability
he would be more confused with
`x = [[],[],[]]`
`for i in x:`
` i += [1]`
ok I cant make it look like a code
multi line breaks formatting :(
there is a way to do that but I dont remember it
and its not in docs or I cant find it
`x = [[],[],[]]
for i in x:
i += [1]`
Lol
x = [[],[],[]]
for i in x:
i += [1]
I know who knows -> @AnttiHaapala
Ok probably ctrl + k
for i in xrange(5):
    print i
works
shit can't downvote in software engineering
10:35
lol
l=[1,2,3]
for a in l:
    print a
ctrl+K is not working for some reason. The fixed font button works.
ctrl+shift+k works. Maybe cvim or textarea format plugin is messing somewhere.
11:11
@AnttiHaapala Yeah. I'm almost tempted to sign up & go do some edits to earn enough points to downvote. :)
11:30
Morning all. It's been a while
Mornin' captain.
Hi, JRS.
How's things in room 6?
I'm in here taking a break to ponder. I seem to have just lost 100+ people with an integration lecture. I'm wondering which bit was the hurdle that wasn't jump-able
Also - trying not to think about He Who Must Not Be Named across the pond.
cbg @antti
11:39
@JRichardSnape your fellow death eater Mr Voldetrump
We've had a few new faces appearing, but it's been very quiet here on the weekends.
We had a discussion yesterday about ways to test that every char in a string is an upper-case ASCII letter with a guy who's recently come to Python from Perl. After we pointed out the inefficiency in his current method (testing each char in a loop with in against a string literal), and recommending a set-based approach, he decided that using set.superset was too cryptic, and ended up using a regex... I guess it'll take a while to break him out of the Perl mindset. ;)
Hmm - set.superset is too cryptic, but a Regex isn't.........
A new definition of cryptic for me
11:54
hah
@PM2Ring how about:
def foo(s):
     try:
           s = s.encode('ascii').decode()
           return s.isalpha() and s.isupper()
     except:
           return False
:P
but nothing wrong with using a regex either.
after all, this is a test for a regular language with expression (A|B|...|Z)*
@JRichardSnape Weird. If they understand limits and can do simple derivatives, then you wouldn't expect there to be a big conceptual hurdle to integration. And in some ways, integrals are more tangible than derivatives, in the sense that the instantaneous velocity / slope of a tangent is a bit more esoteric than area.
what really pissed me off was that derivatives are lossy, so with integration you need to do the + C :(
that's not exact any more
12:00
@AnttiHaapala I guess that handles DSM's objection. :)
21 hours ago, by DSM
That's not quite the same, though, if there are non-ascii letters floating around (Ð or Ϧ or whatnot..)
@PM2Ring It's hard to really understand how the fundamental theory works but the idea of integrals is pretty straightforward
@PM2Ring Yes - I thought that. I think it might be the limits that is causing them trouble. I am also struck by how little visualisation they have - getting them to sketch curves is maybe what I need to have them practice.
@AnttiHaapala Exact, but not deterministic ;)
Although TBH, I was doing definite integrals today, so the +C wasn't even the trouble.
@JRichardSnape too much visualization can be a problem too. I had hard time picking up more advanced math subjects because I was used to picturing everything in my head
We did lots of curve sketching when I was in high school, but that was well before the era of graphing calculators.
@khajvah Mmmm - interesting point - in that case the jump to the abstract proves hard to make. I had your problem too - took me a while to "get" vector calculus because of that.
@PM2Ring Yeah - I wonder if that's it basically. They think I'm a magician if I sketch anything more complicated than y=x**2
Which, of course, I am - but I don't use my magic powers there...
12:03
:)
sketching in the head is the best part of calculus
Indeed - mind expansion without the need for psychoactive substances.
I remember I used to challenge myself to imagine the graphs without pen and paper
it was fun
meh now I just write stupid web apps
I guess it is a bit amazing that this "trick" you've learned for finding slopes can be turned around and used to compute areas. The thing that solidified it for me was the basic examples from physics, in particular, understanding the relationship between displacement, velocity, and acceleration.
12:09
Yes - I think a return to a -> v -> s is in order maybe. Nice to use time as the independent variable for a change too.
As an aside,I'm loving the star board at the moment
@JRichardSnape What kind of integration were you teaching?
Lebesgue integration, of course. Why waste time with that lame Riemann crap? :D
12:20
Very simple. Definite integrals between limits - areas between curves, that kind of thing
I wonder if the curriculum is a bit dry. There's a lot of fancy examples in the text of Integration by parts "tricks" and complicated trig functions.
Maybe that put them off (notes inherited from previous iterations of the course)
I did manage to hook one of my tutees with Fresnel integrals, when I think he thought he'd foxed me with an "impossible" substitution. He probably should be doing maths rather than engineering :)
I think sometimes it's best to just teach several different ways of doing the same thing
@MarcusS I love Feynman. In fact, thank you for that very link. I shall use that as the break in my lecture next week (I have to do 2 hours of maths at a stretch - even I struggle to maintain focus let alone the audience)
I think you're absolutely right about teaching different ways around a problem. I try to emphasise that. But as usual, Feynman puts it very nicely indeed.
12:36
It's one of my favorite videos of his, because it's a concept that never gets discussed too much despite the fact that it's probably a huge factor in how people learn
For me, integrals clicked best with the geometric interpretation en.wikipedia.org/wiki/…
(because I like to have pictures to help cut the weeds around things that run the risk of being too abstract)
Others will be different, etc
Yes, that's the interpretation that I like best and which cemented it for me. It's very hard to teach something that didn't "cut it" for oneself, but I'm going to give it a try. In particular - I know I like to be able to work from first principles for anything, from Maths to Python. Others prefer to memorise some stuff. I'll have to get the hang of that.
All this thinking sometimes makes me wish I'd done Maths instead of engineering. Ho hum.
BTW - marcus - is that you solving a Rubik's cube blindfold on those interwebs? If so - that's a hell of a trick. I'm not surprised you like visual interpretations!
Yeah -- that was over 10 years ago, though (I stopped shortly after that video actually)
The visual memory is phenomenal to me. I tend toward a more auditory memory, so it is just astounding for me to imagine.
In the case of blindfold solving it's actually more of a gimmick than anything
You'd probably be disappointed to see how easy it actually is, haha
The cube can be broken up into four sections: Corner orientation, corner permutation, edge orientation, and edge permutation. There are 8 corners and 12 edges. So a lot of the memorization can be done by making catered mnemonic systems for each section.
For instance, edge orientation -- four edges per layer, each edge is either flipped or not. So each layer can be represented from 0000 -> 1111. Since 0000 is solved, you can focus on 0001 -> 1111, or 'a' through 'o' (a being first letter, b being second, etc)
so you can condense edge orientation into three letters
I used a sort of "person-action-object" approach so if I had three letters like "g a f" I'd remember this as "garfield ate fish" or something
so when you reach the orientation phase, that little mnemonic is easy to recall and decode back into which edges need flipping, which only requires a small handful of pre-memorized algorithms to physically solve
I'm sure better methods to all this exist now but that's how I did it back then
12:52
I could never be bothered to learn a whole bunch of customised algorithms. To solve the last layer, I (mostly) just know 1 algorithm for each task and use simple brute-force moves to get the cubies into the "magic" positions that my algorithm works on, do the algorithm, then reverse the brute force moves. It's slow, but simple. :)
You might actually prefer blind-solving then -- you only need like ~7-8 algs (total)
The entire thing is based on that very principle of setting things up into "magic" positions, doing the algorithm, then reversing the setup moves
The algorithms in this case only affecting specific pieces in specific ways
Oh, ok. I guess that conjugation approach is pretty easy to apply to edge flipping & corner twisting in the last layer, so there's no point in having more specialised algorithms for those tasks.
There's a great old site that has a nice intro to group theory using Rubik's cube: dogschool.tripod.com It's a pity he never added more stuff, but what's there is still excellent, IMHO.
@PM2Ring Well - that's the clearest introduction of group theory I've read and I've only got to paragraph 5 of the first page. Adds to Snape's longlist of Things To Be Read
Right
Onto a lazy thing
Anyone know of / taught from resources for very, very basic programming principles using Python? I've been asked to give a 4 hour workshop / lab session on basic principles of programming.
Would like an online resource that has a few exercises for students to complete.
(tell me to P*ss off and do my own research if you're so inclined)
13:11
talent finland, solving rubik's cube blindfolded :D
@AnttiHaapala (a) worst camera angle ever, (b) blindfolded speed cubing is nothing new, and it’s kind of sad that people are going to that show for this now, and (c) that was rather slow.
@poke he didn't solve it :d
lol
I couldn’t even see that, the CAMERA WAS TOO BAD!
@AnttiHaapala I've seen one doing that blindfolded and under water without air supply once.
@poke in the next round he's shooting an apple on top of the head of a guy, blindfolded,
he first tries with a picture, shoots the arrow in the face :D
13:21
World record blindfolded is 18.50 seconds, in case anyone was wondering like me…
@JRichardSnape Not exactly, and although I think Python can make a good 1st language, I also have some reservations about using it as a general intro to programming if the students are likely to learn some other language first, due to the whole Other languages have "variables", Python has "names" thing.
But you may find some useful info in the classes that holdenweb designed that are linked on our tutorial page.
@poke actually idk where that video is from, it wasn't shown on the tv from that angle :D:D
At PyCon we once had a guy who solved cubes behind his back in amazingly short times after a quick (<5 second) examination of the cube.
I don't actually regard such achievements as a sign of intelligence
13:28
the Talent Finland is the shittiest reality TV in Finland because the prize for the winner is so low that no one with any real talent bothers to go there :d
@PM2Ring Ta PM2 - I should have thought of holdenweb's work. Thanks Steve!!
@holdenweb No - they're tricks rather than intelligence. Feats of memory, though (or not in the Finnish guy's case). Level's 1-3 of Bloom's taxonomy at best :)
I actually do think that memorizing tons of algorithms and then choosing the optimal ones based on the problem at hand (literally) is a sign of intelligence. Even more so for blindfolded solving, where you need to memorize everything up front and cannot make any changes during the solve.
– And of course adding to that are the motoric skills those people are capable of.
There's absolutely no doubt there's a lot of mental and physical skill involved.
I think it depends -- with enough algorithms memorized, it can actually be a fairly braindead sort of execution
And the 3D visualization skill is noteworthy too, not everyone can do that.
13:32
Depends on your definition of intelligence, I guess.
Solving a Rubik's cube doesn't demonstrate intelligence in the way that an ordinary person thinks of intelligence, which is something like "being able to solve novel problems with insightful deductions".
Although with the addition of "optimally" as the 5th word, maybe it does...
@MarcusS with enough algorithms memorized, the task to memorize and then choose the correct ones gets more difficult.
Not all things that are difficult to do require intelligence, though. Not even all things requiring mental capacity.
As Poke said, it does take a bit of insight to come up with an optimal solution, similar to the optimal way of solving an algebra problem (which is, after all, what it is, if you count group theory as algebra).
13:35
However, I'm a big fan of skill - often acquiring the skill through practice leads to a number of "penny drop" moments facilitating learning and I would argue that learning is the quintessential demonstration of intelligence.
@poke I think memorizing is the hard part -- knowing what to do in the moment is actually easier when you have more algorithms, IMO
I don’t think so
Solving something does not get easier if you throw more and more algorithms at it.
Which method do you use?
For example, if you know Fridrich OLL (one of the most common for speedsolving the last layer), the entire thing is completely braindead and requires next to zero guesswork because the algorithms cover each possible case exhaustively
You still need to do some pattern matching to be able to choose the correct ones.
Whereas if you had fewer algorithms (e.g. generic edge flipper, generic corner cycler), then you'd have to "intelligently" look ahead and figure out the shortest possible way to execute the cycles to close the loops
13:40
I think this might depend on how you remember stuff. If you systematise and have a system for "Retrieve algo X, which applies to situtation Y and execture steps X1->Xn", then once memorised application is easy. If you remember (as I do), I need to perform steps X1->Xn, retrieve an algo that does that, more algos is harder.
I think it's worth noting that the technique in question requires you to memorize 57 different sequences of moves which are each 6+ moves long
BTW - I'm not a Rubik's solver, but I'm thinking of maths problems in general.
To give the reader an idea of precisely how much braindead memorization is required ahead of time
I would find the task that Kevin describes excruciatingly hard.
right
13:42
Although to be fair some of those sequences are isomorphic to other sequences except you're holding the cube rotated 90*k degrees
memorizing is the hard part as you learn, but recognizing the cases on the fly (with some practice) is very easy and eventually becomes automatic
(so this is why I disagree that it's a greater sign of intelligence, per se, or that more algorithms necessarily implies greater difficulty in application)
Or, no, have they already accounted for that? At a glance I don't see any two sequences on that page that are reflections/rotations of one another.
They're counted separately
But if you're good at mirroring, you don't have to memorize an extra
I'm good at mirroring... too yamming good. So I tend to merge mirrored pathways together and lose track of which one I'm on. :)
That's ok when improvising a melody, but not so good when you're in the middle of solving a cube. :D
There are 24 different ways to hold a cube, distinguished by which center color is facing up and which center color is facing you. Can expert cubers regard each possible orientation and determine which one can be solved in the fewest moves, before actually executing any moves? Or do they just pick some standard, like "always yellow facing up and red facing me", because on average there isn't much difference?
13:51
Most solvers have a fixed orientation
Can't really determine ahead of time which orientation would result in the fewest number of moves (first stage with Fridrich is usually the cross-formation), but by the time you've created it, the rest of the layout has totally changed
Perhaps if a near-cross was already formed in a different color and a cuber adapted to that (as there's no guarantee that F2L or OLL/PLL would be any better in either case, you may as well go for it if you're able to switch color schemes)
Some try to do cross + first F2L pair at the same time
@PM2Ring thank you, but to be fair it's only headless in practice, it's still running an X server with ssh forwarding. I've come to realize that puppy relies a lot on GUIs, most solutions to many problems start with "find the menu icon"
brief cbg
@AndrasDeak I guess it does rely a fair bit on GUIs / menus, and the Puppy menu structure is rather good. OTOH, many of those GUI things are just a simple GUI wrapper for a CLI program that does the actual work.
14:06
Yeah, I managed to find the few which I need, only things like ppm elude me but I can manage without them:)
anyway, I think I'll keep the blind X running, it's very lightweight so it doesn't cause any harm
This morning I thought "it should be fairly simple to determine from first principles the formula for rotating a 2d point about the origin by N degrees". I looked it up and it turns out you need to know Euler's formula first and you need to know that it works for complex values of X. So it's simple, if "simple" means "requiring the combined effort of at least three brilliant mathematicians over the course of a hundred years"
Granted they probably weren't working on it the whole time
you mean the [cos, -sin; sin cos] rotation matrix?
Yeah.
14:09
well you "only" need to know the addition formulae
if that amounts to knowing Euler's formula, then yes
but I don't think it does
addition formulae are taught without complex numbers
yeah -- complex numbers aren't needed for that
and then geometry
I linked the latter here not so long ago
I hope Marcus didn't start writing it down again:P
Hahaha XD
I mean, I was able to work it out on paper by decomposing the vector (x1, y1) into (x1,0) and (0, y1) and rotating them separately and adding them back together. But that's not the nicest way to do it.
Not making that mistake twice
14:12
so you only need Euler's formula if you refuse to learn the addition formulae (or just forgot them)
I was trying to make the point last week but don't let the whole ~x00 years thing be a discouragement
A lot of results are easier to derive nowadays on your own with the aid of computers to quickly verify results, graphing tech to make things easy to visualize, easy lookup charts for trivial methods you've already encountered, etc etc etc
was a lot harder back then to do the same thing
Yeah I don't view "this took a century to derive the first time" as an impassable wall to me figuring it out on my own. I regard it as a steep hill to climb.
yeah
Which is a useful indicator of which direction I should be moving depending on whether my goal is to reach the highest peaks or have a relaxing stroll.
Is there any reason to use filter over a generator expression?
14:18
No, except that it’s written differently.
Both will create a generator.
@paul23 Guido isn't a big fan of filter or map, and many experienced Python coders tend to avoid using them. And those that do use them tend to only use them with "proper" functions (preferably ones that run at C speed) and not with lambdas.
Just for clarity?
@PM2Ring What does Guido prefer, out of curiosity? List comprehensions?
morning everyone
Mostly. It's more a style issue, rather than an efficiency issue. Or to turn the argument inside-out, why sacrifice readability with map or filter when you can do the same thing with equal efficiency with a list comp or gen exp?
14:28
map(this_function_exists, some_list) is more readable than (this_function_exists(x) for x in some_list) – at least in my opinion.
If you're using a lambda, there's no benefit to using map or filter. But if you're using a C function, then map or filter may be more efficient as well as more compact. Thus I'd use map(int, seq) rather than (int(u) for u in seq), but I wouldn't do map(lambda x:2*x+1, seq) instead of (2*x+1 for x in seq)
I thought map, under the hood, was just a list comprehension?
(could be wrong on that)
Note that map(lambda x:2*x+1, seq) has to do a function call for each item, and it's a crappy slow Python function call, not a fast C call, whereas (2*x+1 for x in seq) does no function calls.
@MarcusS map can do a few optimizing things, eg it only has to lookup the function once, whereas [some.stupid.func(x) for x in seq] has to resolve some.stupid.func(x) on every call.
But of course you can do myfunc = some.stupid.func outside the list comp.
I, too, use map if I can do so without employing lambdas
But it's quite a rare circumstance. I'm tempted to put it in the category of "things which are not themselves bad practice, but which may indicate a design problem at a higher level" although it's not the strongest member of that category
14:38
\o
I've been doing a Google search for answers or comments I've written that use map, but I'm mostly finding stuff that advises people not to use it. And they're mostly situations like my map(lambda x:2*x+1, seq) example that does unnecessary function calls.
\o cbg
morning cabbage all
how goes it wayne?
pretty good, no important emails over the weekend or yet this morning, so that means I have (currently) a straightforward day ahead of me
14:49
baggage
@MYGz is that from your new luggage language?
hehe
does it hold cabbages?
Yeah. 1 cabbage for each person in the room :D
14:52
great, now I really really want some cabbage soup
Never heard of cabbage soup. What else do you toss in it?
stone, and water, put it over a fire and stir.
That would be a lava soup :D

« first day (2298 days earlier)      last day (2875 days later) »