EuroPython 2018 - Lightning talks on Wednesday, July 25
CC Attribution - NonCommercial - ShareAlike 3.0 Unported:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal and non-commercial purpose as long as the work is attributed to the author in the manner specified by the author or licensor and the work or content is shared also in adapted form only under the conditions of this
Hoffmann, Peter
Dopieralski, Radomir
Witowski, Sebastian
Simpson, Tony
Fundinger, Andy
et al.
Lightning talks License: This video is licensed under the CC BY-NC-SA 3.0 license:-nc-sa/3.0/ Please see our speaker release agreement for details:-release-agreement/
 I will hand over to our first lightning talk speaker who is Peter Hoffman. He's going to give us a pitch for Picon DE so Stop so we have only one minute. So let's go I want to invite you to Germany the southern part of Germany a nice city of Karlsruhe We have the Picon and the pie data there last year. We are doing this this time for the second time Let's give you some impressions We have a really nice venue with the center for art in media in Karlsruhe last year. We had a great Talks about how the universe and the structure and everything fits together. We had keynotes from Matthew Rocklin So I just want you to invite to come to Karlsruhe talk to us. We are the organizers There's the many more organizers here And one small announcement. We have the first keynote speaker confirmed So West McKinney will be in Germany. So if you ever want to rant about pandas or ask him some Questions why the indexing works like it works. This is your chance. So see you in Germany Thank you, Peter Oh, you're ready to go. Okay. I'll let you go All right. Thank you So I'm Nicholas I'm the chair for Python Ireland and we organize Yourly conference about Python to Picon IE So this year will be the 10th and 11th of November Lots of hashtags email link so you can find me around. We're looking for more speakers, of course sponsorships is still available and an extra news about Ireland and Python and we have 40 pilots called Starting Python in high school now and there will be a first sitting exam in Python for living sort in 2020. So that's something interesting So if you have experience in teaching computer science and want to help that You know settled properly in Ireland and come to me as well. I'll be around all week. Thank you. Thank you very much Yes So hi, I'm running the Praski and I'm going to try to convince you that Zen of Python is actually harmful for the Python community and Python programming So yeah the you know Zen is the Japanese philosophical thing there is a competition to that called Tao which is Chinese and and one of the Translations of one of the parts of Tao is when the way is forgotten duty and justice appear then knowledge and wisdom aboard and along with hypocrisy and the thing is You know what's actually is enough Python. So it's it was an email posted by Team petters on the Python developers mailing list quite a bit ago there wasn't Python 3 yet and It was actually a summary of some rules of time that he Observed being used when when deciding whether to put something into Python or not and whether how to design it and It was humorous. It was actually a joke Unfortunately, not everybody got it So it got added to Python as an Easter egg you can actually type import this to get it displayed and it is actually used sometimes not that often but As a weapon to you know cut discussion and I'm said, okay, this is against them of Python We won't have it or you know a part of it is gets quoted as an argument against something Which is very strange because the way it is structured the way why it's called Zen Is because every other sentence is a negation of the previous one so you can pretty much say anything you want with this Anyway, so so here are some examples of of how the Python developers themselves don't don't actually follow it So first it's simply is better than complex and that's obviously excellent advice. So recently there was a new implementation of a dict in Python that is obviously much better than the previous one it uses less memory. It's faster however, it makes the dict sorted and Because of that the definition of Python as a language is was changed to include that into dict that dicts are sorted and one of the features of complexity is that you entwine the implementation with the definition with with your API and in this case That's actually damaged a little bit the micro Python which doesn't can't use this particular implementation because of memory limits and Now it has a problem because Micro-Python's dicts are not sorted and will not be so it's not Python anymore Explicit is better than implicit. You know this super call that everybody complained about in Python 3 that has been shortened to implicitly take all the arguments that that it needs from from your local scope and Yeah, that breaks this advice obviously Flat is better than nested but recently in Python 3 we see a lot more Use of the with statement it gets into the standard library a lot. We've seen it in the keynote today morning It's getting used a lot and what it does it lets you do your custom nested things in Python Errors should never pass silently so the recently fixed actually this is a fixed bug so kudos to that I was this there would silently ignore all files. It couldn't convert to unicode on in your local file system without raising any errors Yeah, there should be one and preferably only one of his way to do it So we have now three or four ways of formatting strings in Python Admittedly it next to each next one is better than the previous but you still have to learn or three to to understand code Yay Namespaces are one honking great idea. This is the last point and actually It I'm shocked because there was no namespace added to Python since that was published And it says let's do more of those Even even things like the type annotations with like back for a separate Namespace you don't want to use the same names for types for type Notations as you have in your code because you know don't use them in your code anywhere You don't need them in the same namespace. No, they are in the global namespace so yeah The thing is once things are written down you forget about them You you get them out of your head on top of the paper and they become dogma and you can only use them as you know Love advocates and and as a weapon, but what's important is the process that actually produces Produced those rules We we can reuse the same process again to produce new rules when the situation changes and this way the language and the community will be alive so so don't be a you know like a Language lawyer don't be a Zen of Python lawyer don't follow the rules strictly Just just think about what actually how they were actually came up to how they were produced and and Okay, right a minute. Thank you very much. Thank you a round of applause, please run in Okay Hi, my name is Sebastian and I would like to talk with you about keyboards those beautiful creatures that are so Perfect design that after hours and hours of using them every day They leave us with nothing less but the feeling of ultimate satisfaction, right? Well, except that they are not perfectly designed, but it actually took me a couple of years to notice it I Remember when I first discovered that some people are swapping the escape key and caps and I thought well It's actually amazing. I mean when you think about it the capsule keys one of the biggest keys out there and You only really use it when you need to argue with someone on Facebook while the escape key use it way more often even if you're not a vim programmer, but it's Way smaller and it's quite in conveniently located So I swapped those two together and I was very happy until I got this guy So apparently Apple decided that you won't be able to swap the escape key from the touch bar with any other key So I was stuck with two escape keys one on the touch bar one on the caps lock and no caps lock key Which was bad. I mean what if someone is wrong on the internet? How can I keep my discussions to a typical internet level if I cannot turn on the cap stock? So I had to I had to find a solution and I did a bit of reading and I found something that is I think the most clever Solution I have seen in my life. You see someone came up with an idea to map pressing both shift keys at the same time to Activating caps lock. So you press both shift keys you activate a cap song you press you press both shift keys again You deactivated again once I saw it I thought this is brilliant and it works only not with not only with the Mac books. It works with any keyboard and it's It's really nice trick So that made me think about productivity like are there any other ways that I can improve the way I work So I did a bit of reading and I found this getting things done book by David Allen. It was Mentioned on many websites related with productivity and had a lot of reviews. So I thought it has to be good It wasn't I Mean the book is okay, but it talks mostly about creating this and if you have been working for a while You probably already figure out that making lists of things that you have to do will help you So I was a bit disappointed and I tried to find other ways And what I found is that what really works well for me are all small tips that I can start using right away Not like whole methodologies that will require me to change the way I work But those tips are not easy to find I mean people don't write books about productivity tips people write books about methodologies and Sometimes you don't even know that something is possible. So you don't try to improve it Like I didn't know that you can actually remap keys on your keyboard So I'm gonna share with you a couple of things that I found and maybe someone some some some of you will find it useful Most of you probably already heard about the dot files like if not then you should really check them out Those are basically like configuration files for your computers So we can store them on github and you can download them on each new machine That you will be using and that way you will immediately have all your settings or your commas or your shortcuts back I'll actually have a link to the slide so we can check the source. Don't take pictures The same applies to beam you can configure all your shortcuts or your plugins or your mappings by editing just one file and It also applies to get I mean you can define some one or two letter shortcuts for the most common commands that you're using But you can actually write some more advanced functions Like I have a function that will squash together last end comets or I have a different function that will check out the pull request from GitHub to a separate branch so I can view the code there and there is no way I would remember how to do this from the top of my head without taking stag for flow But once you put it in this git config, it's super easy to use Coming back to beam for a moment. I don't use beam very often, but I found a very useful tip uses spacebar as a leader key It's much bigger. It's centrally located. You can reach it with both hands So it's gonna be way easier to use than default backslash and One thing that I noticed is that each time I log into I Python the production machines to do some debugging I always have to use I quite often use the same commands and that requires me to type from full import bar each time so that's annoying and Apparently there's a way to configure I Python so each time you started it will execute some arbitrary code. So this is pretty nice And speaking of typing the same stuff over and over again There are some phrases that you probably type quite often like your full name your home address your email or whatever your signature of your email And so you can use a text expander that will take like a small block of text and expand it to pre-defined Sentences so it's basically like code snippets in real life So here are just few of my productivity tips and I know that there is a lot of people here who have their own shortcuts their own mappings their own Settings that might make their life much easier. So I would really love to talk with you guys So if you can find me I will be here until Friday or if you can't find me just being on Twitter and the slides with the links to those files are available there. Thank you Okay, thanks very much Sebastian run close Are you ready to go okay go? Hello everyone. So I'm Tony. I'm gonna talk about point break So I don't know what I'm doing my life, but I seem to spend an awful lot of time in GDP and other debuggers I found that using a debugger is especially with a complicated program is Is a tedious process using a debugger manually quite often? I'll get to the point. I want to debug and then I'll do the wrong thing and then I have to redo it all Particularly when you're debugging a complicated program something unexpected might happen and again you have to redo everything. It's really annoying And also quite often I want to not necessarily directly debug something but monitor something or investigate something my program They might be log something or just fight use something like a debugger to find out what's going on So this is point break. It was a film the tagline was a hundred percent adrenaline So my term tagline is a hundred percent pure Python This is what we have at the moment if you want to extend your debugging with something that's scriptable So you have something like GDP which is a command line debugger with a Python Interface in there and an API that lets you write code, but it's all embedded in the debugger and you have to use their API what I would like instead is Like a debugger that's just a library and Python that I can write programs against because then I can build other tools on top of that So if I had a debugging library, I could build an analyzer that used the debugger to collect information Then you are to present it to myself or someone else So what we have at the moment, I think it's okay, but I think that my idea would be way more awesome So you could do something like you could write a simple program that just looked at put breakpoints on two methods to collect some information Then like graph the number of things So this is like create for you destroy food and you've got a number of account of that the calls total number of foods that exist at any one time or you could create something really complicated with like, you know crazy logic and like reactive breakpoints and Investing in all kinds of stuff that would tell you exactly what you've done wrong. That might be too hard, but it's a possibility So simple demo. Okay, right with the power of name shell So here's a really simple C program It doesn't do anything other than call a function 10 times in a loop doesn't print anything. There shouldn't be any output So if I make that Then I run it unsurprisingly. It does nothing Then this is a How do I make things small? That that one. Oh, okay So this is a little script written against point break my debugger So I had a breakpoint which is just a Python function. It's gonna print boo each time it hits that That C function. There is a ghost So if we Run that it prints boot 10 times that simple So it's really early days spent about two weeks developing this At the moment, it's line it's 64 bit only API is still developing It doesn't yet read dwarf symbols, which will be really useful because that will give you line debugging information and other information about types The reason it doesn't do that is the parser is too slow. So I'm working on that. It's missing many common debugging features But yeah, so I'll probably be sticking around for the sprints and maybe working on this But if you like the idea or you hate the idea come and say hello Thank you very much Big round of applause for Andy, please What to do with the flock of lambdas Library and talk by Andy funnier. That's me. There's my email. I'm a senior engineer at Bloomberg I'll get one thing out of the way right off the top What is flock good for? Usually that's a question at the end right at the beginning. It's fun. It's kind of an effect like a spreadsheet it's good for dealing with poorly defined mathematical systems like say taxes or role-playing games and I'm really looking for more uses out of this So if you find something that you think this would be useful for tell me after I'd really like to know So let's just look at some fairly normal functions. There's a function. There's a function declared with the lambda There's the lambda declared With no arguments. Hey, look, it does what you expect Here's some closures. There's a perfectly normal closure with list inside it. It also does what you'd expect If we change the list even though it's already inside a closure It's going to return based on the list. That's already enclosed Even though we edited the list. That's just a reminder that that Does what it's supposed to do enough of that. Let's take a look at dictionaries. We're gonna make some closures We're gonna put them in the same dictionary that's inside the closure That's inside That they're inside of they're all references so we can totally do this Let's just pretend we're putting up a bill of sale. So we'll put 30 of something. These are all zero argument lambdas Price a hundred The subtotal is going to be the quantity times the price call each of them as we pull them out We'll take the New York City sales tax put that on Calculate the tax calculate the subtotal and Then if we call each of those and pull it out We're just evaluating closures and we're getting the values All of this just calls the things inside Pulse it out and gets it evaluated The tax line we can just pull out the tax line now We're in Edinburgh so Let's say we're just gonna say the Tax here is seven percent. That's a little more complicated So we changed just the tax rate to seven percent And we just want to see the tax and we just want to see the total We don't have to go back and do everything else We can just pull out these two values and that's really what we've been going for here So it's a neat trick if we clean this up Let's hit three things to clean it up soaring a constant should not require creating these constant lambdas We know anytime we pull it out. We want to call it and We may want to do some caching eventually so we'll prepare for that So now it looks like this we can just put values in We create a flock dict out of the flock library And when we put a constant in it notices and deals with that We still create our lambdas just the same way, but We don't have to say we're going to call it flock knows when we pull it out That we're going to be calling it to pull out the value And our subtotals all work out the same way that functionality is preserved But we're here so we can add some more tricks because we know what we're doing So I've created something called an aggregator We'll make our bill of sale have five different items on it each with its own quantity each with its own price Then I can create a flock aggregator say I'm going to have some parallel maps and here's the properties to go across them Again, we'll calculate those when they're needed And here's a function in this case of two argue in this case taking a tuple of the things going in That'll calculate across it I can go ahead and see what's the price on line three I can go ahead and change the price each on line three and then just go look at the total line And it just comes dropping right Out the bottom of the function now if I have a flock I should be able to share my flock So shearing the flock just removes all this special functionality and gives me Kind of a final answer for every value of every lambda in the entire thing Calculates it out like this So here we see the prices the price each is the quantities the same The sub totals the taxes the tax rates the total everything dropped out once I sheared my flock It's up on my github. There's my email There's the corporate twitter and as I said, what's it good for? I'm really looking for the question of what is this good for? It's fun I It's fun and let me know So hello, my name is Leo and I'm from Israel and when I'm working in a startup and when we started to to be large We decided about security rules, right? One of the security rules is you have to lock your Computer every time that you go to coffee or something now for me two things happened One I always forgot it and the second thing all of my friends knew that I always forgot it and Started to look and start to hack my computer when I'm not near it. How many people it happened for them? Ah, cool. So it's not just Israeli thing So I tried to think what can I do and Best idea that I came came for came with Is I have a Bluetooth in my phone if I'm leaving I can check it So I tried to think if there is something like this for Mac users There is something like 10 applications that that is what they are doing for Windows There is a windows feature for that In windows. It's weird for Mac. There is this application, but it's old and for me personally it didn't work So I started to look and found this blog That explains how you can without pinging Check what is your connection? Okay And we just write it This is a script best script from the blog that is doing that. Okay, and if I will run it You'll see that it's trying to connect RSI is the connection. Okay, so if I'm Minus three Minus six Okay, it means that I'm not near my computer, right And then on top of that We created a small python script that check it Every time that it's More less than minus one. It's added it to a queue And check the queue. Okay, so if I run it And go with my Telephone to drink coffee or something Two issues Thank you two issues One issue is If your office is narrow And with multiple Places that you can go And you can run it And you can run it And you can run it And you can run it And you can run it And you can run it Places that you can go Maybe your computer suddenly will get up and down up and down when you are not in In your room And the second thing is now all my friends are trying to steal my computer my telephone Thank you Okay over to you. Okay. So hi, I'm thomas And this talk is about something I noticed for many years It's not about python even if it looks like But you'll see So I guess most of you Know the dog strings Dunder dog They are pronounced so not underscore underscore dog underscore underscore just say dunder that means the same And you all know you can use them to interactively get help Or to generate documentation using Sphinx or some other toolkit and you can also access it from The code so the code basically Knows about its documentation And this is how you do it. You just have a class and a dog string in there And if you are on the interactive Python interpreter, you can just use the help function to access that kind of documentation So you don't need a browser. You can just use the python interpreter And why do we do this because so we don't have to wonder about what is this class doing? We document our stuff and everybody can use it that way. So the class self documents itself So this was the technical part of my talk And now to something different we also have some sort of documentation issue in real life So a lot of you hang around on conferences like this one Maybe some of you also visit a hacker space or in general just the place with a lot of people And if there are a thousand people like here, you maybe don't know a lot of them. Maybe most of them But all of them are maybe working on some interesting project, but you don't know it And why do you not know it because there's no documentation It looks like this for example, you see just a lot of people doing things on their laptops But you don't know what More people doing things But you don't know either So everybody's doing something, but you don't know what So okay, you can just go to them and say hey, what are you doing? But maybe you are shy. Maybe you don't want to do that And even if you would do that it does not scale. I can't walk to thousand people and say hey, what are you doing? It's just taking a lot of time So we can use doc strings So the idea is just document yourself and if a lot of people do that, they can just read other people's doc strings basically So you can use just a piece of paper But in that case you need to prepare it Just print a few of your projects on it in big letters so you can read it from two meters distance at least And if it's not totally clear what it means maybe add some explanation below it in a bit smaller font Some nice graphics is also nice and don't write too much only a few words. You don't want to Take an hour to read it So put on the paper what interests you what you laugh what you work on Maybe what you did work on in the past you can use a piece of paper You can also use your laptop screen, but that's a bit problematic if you want to work on it at the same time You can use a beamer With a second screen and just beam it somewhere a projector. I mean You can use a poster or you can just use a t-shirt and Write something about python on it, but it's not great for a python conference because everybody does python, of course And this is an example And this is an example how it could look like so left the example right the explanation Maybe just put your name on it the projects you love a short line under it explaining what it is some keywords Maybe add some color or your homepage or whatever And then just put it besides you if you are sitting somewhere and hacking on your laptop Just put it besides you so people can just read it. They don't need to say hello to a thousand people And then you have a dog string basically You can use these slides for whatever you want You know this license Do what the fuck you want public license. It basically says do what the fuck you want So, yeah distributed Thank you very much for coming. I guess we kick off at 9 a.m. Tomorrow. Yep. Okay. Bye everybody
 I will hand over to our first lightning talk speaker who is Peter Hoffman. He's going to give us a pitch for Picon DE  so  Stop so we have only one minute. So let's go  I want to invite you to Germany the southern part of Germany a nice city of Karlsruhe  We have the Picon and the pie data there last year. We are doing this this time for the second time  Let's give you some impressions  We have a really nice venue with the center for art in media in Karlsruhe last year. We had a great  Talks about how the universe and the structure and everything fits together. We had keynotes from Matthew Rocklin  So I just want you to invite to come to Karlsruhe talk to us. We are the organizers  There's the many more organizers here  And one small announcement. We have the first keynote speaker confirmed  So West McKinney will be in Germany. So if you ever want to rant about pandas or ask him some  Questions why the indexing works like it works. This is your chance. So see you in Germany  Thank you, Peter  Oh, you're ready to go. Okay. I'll let you go  All right. Thank you  So I'm Nicholas I'm the chair for Python Ireland and we organize  Yourly conference about Python to Picon IE  So this year will be the 10th and 11th of November  Lots of hashtags email link so you can find me around. We're looking for more speakers, of course  sponsorships is still available and an extra news about  Ireland and Python and we have 40 pilots called  Starting Python in high school now and there will be a first sitting exam in Python for living sort in 2020. So that's  something interesting  So if you have experience in teaching computer science and want to help that  You know settled properly in Ireland and come to me as well. I'll be around all week. Thank you. Thank you very much  Yes  So hi, I'm running the Praski and I'm going to try to convince you that Zen of Python is actually harmful for the Python community and Python programming  So yeah  the you know Zen is the Japanese  philosophical thing there is a  competition to that called Tao which is Chinese and  and one of the  Translations of one of the parts of Tao is when the way is forgotten duty and justice appear then knowledge and wisdom aboard and  along with hypocrisy and  the thing is  You know what's actually is enough Python. So it's it was an  email posted by  Team petters on the Python developers mailing list quite a bit ago  there wasn't Python 3 yet and  It was actually a summary of some rules of time that he  Observed being used when when deciding whether to put something into Python or not and whether how to design it and  It was humorous. It was actually a joke  Unfortunately, not everybody got it  So it got added to Python as an Easter egg  you can actually type import this to get it displayed and it is actually used sometimes  not that often but  As a weapon to you know cut discussion and I'm said, okay, this is against them of Python  We won't have it or you know a part of it is gets quoted as an argument against something  Which is very strange because the way it is structured the way why it's called Zen  Is because every other sentence is a negation of the previous one so you can pretty much say anything you want with this  Anyway, so so here are some examples of of how the Python developers themselves don't don't actually follow it  So first it's simply is better than complex and that's obviously excellent advice. So recently there was a new implementation of a dict  in  Python that is obviously much better than the previous one it uses less memory. It's faster  however, it makes the dict sorted and  Because of that the definition of Python as a language is was changed to include that into dict that dicts are sorted and  one of the  features of complexity is that you entwine the implementation with the definition with with your API and in this case  That's actually damaged a little bit the micro Python which doesn't can't use this particular implementation because of memory limits and  Now it has a problem because  Micro-Python's dicts are not sorted and will not be so it's not Python anymore  Explicit is better than implicit. You know this super call that everybody complained about in Python 3 that has been shortened  to  implicitly take all the arguments that that it needs from from your local scope and  Yeah, that breaks this advice obviously  Flat is better than nested but recently in Python 3 we see a lot more  Use of the with statement it gets into the standard library a lot. We've seen it in the keynote today morning  It's getting used a lot and what it does it lets you do your custom nested things in Python  Errors should never pass silently so the recently fixed actually this is a fixed bug so kudos to that  I was this there would silently ignore all files. It couldn't convert to unicode on in your local file system without  raising any errors  Yeah, there should be one and preferably only one of his way to do it  So we have now three or four ways of formatting strings in Python  Admittedly it next to each next one is better than the previous but you still have to learn or three to to understand code  Yay  Namespaces are one honking great idea. This is the last point and actually  It I'm shocked because there was no namespace added to Python since that was published  And it says let's do more of those  Even even things like the type annotations with like back for a separate  Namespace you don't want to use the same names for types for type  Notations as you have in your code because you know don't use them in your code anywhere  You don't need them in the same namespace. No, they are in the global namespace  so yeah  The thing is once things are written down you forget about them  You you get them out of your head on top of the paper and they become dogma and you can only use them as you know  Love advocates and and as a weapon, but what's important is the process that actually produces  Produced those rules  We we can reuse the same process again to produce new rules when the situation changes and this way the language and the community will  be alive  so so don't be a you know like a  Language lawyer don't be a Zen of Python lawyer don't follow the rules strictly  Just just think about what actually how they were actually came up to how they were produced and and  Okay, right a minute. Thank you very much. Thank you a round of applause, please run in  Okay  Hi, my name is Sebastian and I would like to talk with you about keyboards those beautiful creatures that are so  Perfect design that after hours and hours of using them every day  They leave us with nothing less but the feeling of ultimate satisfaction, right?  Well, except that they are not perfectly designed, but it actually took me a couple of years to notice it I  Remember when I first discovered that some people are swapping the escape key and caps and I thought well  It's actually amazing. I mean when you think about it the capsule keys one of the biggest keys out there and  You only really use it when you need to argue with someone on Facebook  while the escape key use it way more often even if you're not a vim programmer, but it's  Way smaller and it's quite in conveniently located  So I swapped those two together and I was very happy until I got this guy  So apparently Apple decided that you won't be able to swap the escape key from the touch bar with any other key  So I was stuck with two escape keys one on the touch bar one on the caps lock and no caps lock key  Which was bad. I mean what if someone is wrong on the internet?  How can I keep my discussions to a typical internet level if I cannot turn on the cap stock?  So I had to I had to find a solution and I did a bit of reading and I found something that is I think the most clever  Solution I have seen in my life. You see someone came up with an idea to map pressing both shift keys at the same time to  Activating caps lock. So you press both shift keys you activate a cap song you press you press both shift keys again  You deactivated again once I saw it  I thought this is brilliant and it works only not with not only with the Mac books. It works with any keyboard and it's  It's really nice trick  So that made me think about productivity like are there any other ways that I can improve the way I work  So I did a bit of reading and I found this getting things done book by David Allen. It was  Mentioned on many websites related with productivity and had a lot of reviews. So I thought it has to be good  It wasn't I  Mean the book is okay, but it talks mostly about creating this and if you have been working for a while  You probably already figure out that making lists of things that you have to do will help you  So I was a bit disappointed and I tried to find other ways  And what I found is that what really works well for me are all small tips that I can start using right away  Not like whole methodologies that will require me to change the way I work  But those tips are not easy to find  I mean people don't write books about productivity tips people write books about methodologies and  Sometimes you don't even know that something is possible. So you don't try to improve it  Like I didn't know that you can actually remap keys on your keyboard  So I'm gonna share with you a couple of things that I found and maybe someone some some some of you will find it useful  Most of you probably already heard about the dot files like if not then you should really check them out  Those are basically like configuration files for your computers  So we can store them on github and you can download them on each new machine  That you will be using and that way you will immediately have all your settings or your commas or your shortcuts back  I'll actually have a link to the slide so we can check the source. Don't take pictures  The same applies to beam you can configure all your shortcuts or your plugins or your mappings by editing just one file and  It also applies to get I mean you can define some one or two letter shortcuts for the most common commands that you're using  But you can actually write some more advanced functions  Like I have a function that will squash together last end comets or I have a different function that will check out the pull request from  GitHub to a separate branch so I can view the code there and there is no way  I would remember how to do this from the top of my head without taking stag for flow  But once you put it in this git config, it's super easy to use  Coming back to beam for a moment. I don't use beam very often, but I found a very useful tip uses spacebar as a leader key  It's much bigger. It's centrally located. You can reach it with both hands  So it's gonna be way easier to use than default backslash  and  One thing that I noticed is that each time I log into I Python the production machines to do some debugging  I always have to use I quite often use the same commands and that requires me to type from full import bar each time  so that's annoying and  Apparently there's a way to configure I Python so each time you started it will execute some arbitrary code. So this is pretty nice  And speaking of typing the same stuff over and over again  There are some phrases that you probably type quite often like your full name your home address your email or whatever your signature of your email  And so you can use a text expander that will take like a small block of text and expand it to pre-defined  Sentences so it's basically like code snippets in real life  So here are just few of my productivity tips and I know that there is a lot of people here who have their own shortcuts their own mappings their own  Settings that might make their life much easier. So I would really love to talk with you guys  So if you can find me I will be here until  Friday or if you can't find me just being on Twitter and the slides with the links to those files are available there. Thank you  Okay, thanks very much Sebastian run close  Are you ready to go okay go?  Hello everyone. So I'm Tony. I'm gonna talk about point break  So I don't know what I'm doing my life, but I seem to spend an awful lot of time in GDP and other debuggers  I found that using a debugger is  especially with a complicated program is  Is a tedious process using a debugger manually quite often?  I'll get to the point. I want to debug and then I'll do the wrong thing and then I have to redo it all  Particularly when you're debugging a complicated program something unexpected might happen and again you have to redo everything. It's really annoying  And also quite often I want to not necessarily directly debug something but monitor something or investigate something my program  They might be log something or just fight use something like a debugger to find out what's going on  So this is point break. It was a film the tagline was a hundred percent adrenaline  So my term tagline is a hundred percent pure Python  This is what we have at the moment if you want to extend your debugging with something that's scriptable  So you have something like GDP which is a command line debugger with a Python  Interface in there and an API that lets you write code, but it's all embedded in the debugger and you have to use their API  what I would like instead is  Like a debugger that's just a library and Python that I can write programs against because then I can build other tools on top of that  So if I had a debugging library, I could build an analyzer that used the debugger to collect information  Then you are to present it to myself or someone else  So what we have at the moment, I think it's okay, but I think that my idea would be way more awesome  So you could do something like you could write a simple program that just looked at put breakpoints on two methods to collect some information  Then like graph the number of things  So this is like create for you destroy food and you've got a number of account of that the calls total number of foods that exist at  any one time or you could create something really complicated with like, you know crazy logic and like reactive breakpoints and  Investing in all kinds of stuff that would tell you exactly what you've done wrong. That might be too hard, but it's a possibility  So simple demo. Okay, right with the power of name shell  So here's a really simple C program  It doesn't do anything other than call a function 10 times in a loop doesn't print anything. There shouldn't be any output  So if I make that  Then I run it unsurprisingly. It does nothing  Then this is a  How do I make things small?  That that one. Oh, okay  So this is a little script written against point break my debugger  So I had a breakpoint which is just a Python function. It's gonna print boo each time it hits that  That C function. There is a ghost  So if we  Run that it prints boot 10 times that simple  So it's really early days spent about two weeks developing this  At the moment, it's line it's 64 bit only  API is still developing  It doesn't yet read dwarf symbols, which will be really useful because that will give you line debugging information and other information about types  The reason it doesn't do that is the parser is too slow. So I'm working on that. It's missing many common debugging features  But yeah, so I'll probably be sticking around for the sprints and maybe working on this  But if you like the idea or you hate the idea come and say hello  Thank you very much  Big round of applause for Andy, please  What to do with the flock of lambdas  Library and talk by Andy funnier. That's me. There's my email. I'm a senior engineer at Bloomberg  I'll get one thing out of the way right off the top  What is flock good for?  Usually that's a question at the end right at the beginning. It's fun. It's kind of an effect like a spreadsheet  it's good for dealing with poorly defined mathematical systems like say taxes or role-playing games and  I'm really looking for more uses out of this  So if you find something that you think this would be useful for tell me after I'd really like to know  So let's just look at some fairly normal functions. There's a function. There's a function declared with the lambda  There's the lambda declared  With no arguments. Hey, look, it does what you expect  Here's some closures. There's a perfectly normal closure with list inside it. It also does what you'd expect  If we change the list even though it's already inside a closure  It's going to return based on the list. That's already enclosed  Even though we edited the list. That's just a reminder that that  Does what it's supposed to do enough of that. Let's take a look at dictionaries. We're gonna make some closures  We're gonna put them in the same dictionary that's inside the closure  That's inside  That they're inside of they're all references so we can totally do this  Let's just pretend we're putting up a bill of sale. So we'll put 30 of something. These are all zero argument lambdas  Price a hundred  The subtotal is going to be the quantity times the price call each of them as we pull them out  We'll take the New York City sales tax put that on  Calculate the tax calculate the subtotal and  Then if we call each of those and pull it out  We're just evaluating closures and we're getting the values  All of this just calls the things inside  Pulse it out and gets it evaluated  The tax line we can just pull out the tax line  now  We're in Edinburgh  so  Let's say we're just gonna say the  Tax here is seven percent. That's a little more complicated  So we changed just the tax rate to seven percent  And we just want to see the tax and we just want to see the total  We don't have to go back and do everything else  We can just pull out these two values and that's really what we've been going for here  So it's a neat trick if we clean this up  Let's hit three things to clean it up soaring a constant should not require creating these constant lambdas  We know anytime we pull it out. We want to call it and  We may want to do some caching eventually so we'll prepare for that  So now it looks like this we can just put values in  We create a flock dict out of the flock library  And when we put a constant in it notices and deals with that  We still create our lambdas just the same way, but  We don't have to say we're going to call it flock knows when we pull it out  That we're going to be calling it to pull out the value  And our subtotals all work out the same way that functionality is preserved  But we're here so we can add some more tricks because we know what we're doing  So I've created something called an aggregator  We'll make our bill of sale have five different items on it each with its own quantity each with its own price  Then I can create a flock aggregator say I'm going to have some parallel maps and here's the properties to go across them  Again, we'll calculate those when they're needed  And here's a function in this case of two argue in this case taking a tuple of the things going in  That'll calculate across it  I can go ahead and see what's the price on line three  I can go ahead and change the price each on line three and then just go look at the total line  And it just comes dropping right  Out the bottom of the function now if I have a flock I should be able to share my flock  So shearing the flock just removes all this special functionality and gives me  Kind of a final answer for every value of every lambda in the entire thing  Calculates it out like this  So here we see the prices the price each is the quantities the same  The sub totals the taxes the tax rates the total everything dropped out once I sheared my flock  It's up on my github. There's my email  There's the corporate twitter and as I said, what's it good for?  I'm really looking for the question of what is this good for?  It's fun  I  It's fun and let me know  So hello, my name is Leo and I'm from Israel and when  I'm working in a startup and when we started to to be large  We decided about security rules, right? One of the security rules is you have to lock your  Computer every time that you go to coffee or something now for me two things happened  One I always forgot it  and the second thing  all of my friends knew that I always forgot it and  Started to look and start to hack my computer when I'm not near it. How many people it happened for them?  Ah, cool. So it's not just Israeli thing  So I tried to think what can I do and  Best idea that I came came for came with  Is I have a Bluetooth in my phone if I'm leaving I can check it  So I tried to think if there is something like this for Mac users  There is something like 10 applications that that is what they are doing  for Windows  There is a windows feature for that  In windows. It's weird for Mac. There is this application, but it's old and for me personally it didn't work  So I started to look and found this  blog  That explains how you can without pinging  Check what is your connection?  Okay  And we just write it  This is a script best script from the blog that is doing that. Okay, and if I will run it  You'll see that it's trying to connect  RSI is the connection. Okay, so if I'm  Minus three  Minus six  Okay, it means that  I'm not near my computer, right  And then on top of that  We created a small python script that check it  Every time that it's  More less than minus one. It's added it to a queue  And check the queue. Okay, so if I run it  And go with my  Telephone to drink coffee or something  Two issues  Thank you  two issues  One issue is  If your office is narrow  And with multiple  Places that you can go  And you can run it  And you can run it  And you can run it  And you can run it  And you can run it  And you can run it  Places that you can go  Maybe your computer suddenly will get up and down up and down when you are not in  In your room  And the second thing is now all my friends are trying to steal my computer my telephone  Thank you  Okay over to you. Okay. So hi, I'm thomas  And this talk is about something I noticed for many years  It's not about python even if it looks like  But you'll see  So I guess most of you  Know the dog strings  Dunder dog  They are pronounced so not underscore underscore dog underscore underscore just say dunder that means the same  And you all know you can use them to interactively get help  Or to generate documentation using Sphinx or some other toolkit and you can also access it from  The code so the code basically  Knows about its documentation  And this is how you do it. You just have a class and a dog string in there  And if you are on the interactive  Python interpreter, you can just use the help function to access that kind of documentation  So you don't need a browser. You can just use the python interpreter  And why do we do this because so we don't have to wonder about what is this class doing?  We document our stuff and everybody can use it that way. So the class self documents  itself  So this was the technical part of my talk  And now to something different we also have some sort of documentation issue in real life  So a lot of you hang around on conferences like this one  Maybe some of you also visit a hacker space or in general just the place with a lot of people  And if there are a thousand people like here, you maybe don't know a lot of them. Maybe most of them  But all of them are maybe working on some interesting project, but you don't know it  And why do you not know it because there's no documentation  It looks like this for example, you see just a lot of people doing things on their laptops  But you don't know what  More people doing things  But you don't know either  So everybody's doing something, but you don't know what  So okay, you can just go to them and say hey, what are you doing?  But maybe you are shy. Maybe you don't want to do that  And even if you would do that it does not scale. I can't walk to thousand people and say hey, what are you doing?  It's just taking a lot of time  So we can use doc strings  So the idea is just document yourself and if a lot of people do that, they can just read other people's  doc strings basically  So you can use just a piece of paper  But in that case you need to prepare it  Just print a few of your projects on it in big letters so you can read it from two meters distance at least  And if it's not totally clear what it means maybe add some explanation below it in a bit smaller font  Some nice graphics is also nice and don't write too much only a few words. You don't want to  Take an hour to read it  So put on the paper what interests you what you laugh what you work on  Maybe what you did work on in the past you can use a piece of paper  You can also use your laptop screen, but that's a bit problematic if you want to work on it at the same time  You can use a beamer  With a second screen and just beam it somewhere a projector. I mean  You can use a poster or you can just use a t-shirt and  Write something about python on it, but it's not great for a python conference because everybody does python, of course  And this is an example  And this is an example how it could look like so left the example right the explanation  Maybe just put your name on it the projects you love a short line under it explaining what it is some keywords  Maybe add some color or your homepage or whatever  And then just put it besides you if you are sitting somewhere and hacking on your laptop  Just put it besides you so people can just read it. They don't need to say hello to a thousand people  And then you have a dog string basically  You can use these slides for whatever you want  You know this license  Do what the fuck you want public license. It basically says do what the fuck you want  So, yeah distributed  Thank you very much for coming. I guess we kick off at 9 a.m. Tomorrow. Yep. Okay. Bye everybody
EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_0_131.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_132_599.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_600_791.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_792_1115.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_1116_1271.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_1272_1655.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_1656_1847.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_1848_2483.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_2484_2759.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_2760_3323.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_3324_4583.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_4584_5603.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_5604_6419.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_6420_7307.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_7308_8039.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_8040_8747.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_8748_12443.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_12444_13115.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_13116_13835.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_13836_15947.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_15948_16751.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_16752_17015.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_17016_20231.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_20232_20315.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_20316_21467.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_21468_21935.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_21936_22619.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_22620_23003.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_23004_23411.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_23412_23663.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_23664_24563.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_24564_25259.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_25260_25463.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_25464_25595.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_25596_26771.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_26772_33167.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_33168_33623.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_33624_35363.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_35364_35603.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_35604_35723.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_35724_36071.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_36072_38039.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_38040_38735.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_38736_41675.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_41676_41927.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_41928_42071.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_42072_46043.png EuroPython_2018_-_Lightning_talks_on_Wednesday__July_25_hgPH19nBlrk_46044_46450.png