The power of duck typing and linear algrebra
CC Attribution 2.0 Belgium:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor.
Tayon, Julien
Algebraic operator are every where in python. + = * / Dict are every where inpython. What can we achieve by combining both of them? [Slides](#/init) are here ## Introduction Algebra is a wonderful abstraction that make the infamous 2D point example ofa class or nameddict useless when you have complex data type (that is HWaccelerated on Intel CPU). ## I Algebra 101 : it is all about consistency between symbol and behaviour Simple: Is something consistent with linear algebra? it requires 17 simpleunit tests suffice to say so So just let makes a test this rules are followed, and then a class thatapplies these behaviours and we have implemented it. ## II I have linear algebra behaviour. How useful can it be? Well, you have basic data type like { x: 1, y :2, z :3 } that is actuallybehaving like an euclidean vector. If an object is a MutableMapping thus we can create a universal operator forsaying how much an object «looks like» another one. Practical use : * finding doublons in database; * text matching (after a pass of ntlk + word counters); * pattern fitting; ... That is the basis of Textual indexation and profiling (it is not only for evilpurpose) _iction/blob/master/example/cos_demo.py ## III State of the art of 2 working POC how to use MutableMapping (dict) andsuper Most of the operation tested here_iction/ Implementation as a trait here Basically it works BUT : 1. it is hard : with archery I stumbled on super 2. with VectorDict (obsolete) it lacks of genericity and the code is clumsy 3. python 2 div behaviour was screwing this (and since these library were relying on base operator, I got biten) Prepare to throw 2 away ## IV the future A chain is as strong as its weakest link : if a lib is based on composing thepython based operator, the algebra will be as consistent as the CORE behaviourof the operator in the language. ## Conclusion Algebra is a powerful abstraction that is still underused. Possible development : \- Rieman/Hermitian algebra: using the power of themath used in Quantum Mechanics/relativity and python in the same fashion \-Using Quaternion to have quirkless rotation in euclidean 3D...
 Hello. Nice to meet you. There are two types of free software developers, the one that are famous and people like me. I'm not really famous to be honest. Free, like in free software, the capacity for a person like me and others to present what they do and not who they are. I really like it. So thank you first them. That's my first thank you of the day. And here is a story. And every nice story, where is my slide? Yay. Every story begins with too much time on your end and a book. Sorry for the English speaker, but anyway, remember that in mathematics we don't care about what is written. So you will have mathematics books that is written in French, but all the formula in English. Don't worry. They are translated. So this book is called the deep shoot linear algebra. And I was like, oh, fine. It's looking fun, this book. For definition and fun that only me understand. Basically what my book was saying is that it was a cool project manager. It was saying, I will not tell you how to implement stuff. I will just tell you how it's working, the rules. And then once you implement, once you follow the rules, you have metrics. This one is a little bit capillot-racted, as we say in French. And then you've got list surprises. I will come on it later because I love to have list surprises. Ah, shit. You know what I mean. Basically, as you see, we've got associativity, new element of addition, a neutral element of addition, multiplication, and so on. And I want to point, is it this one? Yeah. I want to point that one is not one. You will see it later. Zero is not zero. Computer int are no integers and real numbers are not float. But good enough lies made a good enough truth. And I will try to prove it to you with code. We don't know. It can work. So once you've got these rules, you code. So I've coded a kind of unit test that is testing for the basic stuff like A plus B equals B plus A and stuff like that, which is not very interesting. But I was like, why not do it? If we can, we do. So basically, I began with a normal basic type of what? We don't see a thing. Ah, shit. So basically, I began with a basic type of Python. There is no way to put in full screen. So basically, complex time is following the linear algebra rule. Oh, that's nice. Okay. Over scale. Oh, control one. It exists. So for fun, I tried an impure race. They are behaving like they should not like they should behave like the theorem of linear algebra saying the floats are doing the same. The ints are doing the same. I was pretty surprised with the decimal. But if the test are saying no, but it's no, that's the way it is. Complex. I love complex. And at least no, obviously, least are not following the linear algebra. You can try, but no. Here, I'm going to introduce, sorry for the stuff. So if you can go on the Internet, you will have the full information. There is a small theorem that I created. I don't think it's a theorem. I don't know what it is. If you take intricated, multi-table mappings that are implemented in dicts that we all know, you can take a path to a key and transform it into a tuple. And it's equivalent form. So there is a canonical form of intricate dict that are making them like a dict. So I can reason on one level dict, but in fact, I can think of intricate dict. And the other way around is working because it's a b-jection. It's an isomorphism. Great stuff, isomorphism. Believe me. Oh, not everybody believes in isomorphism. I will prove it to you later. Don't worry. So like an obnoxious project manager, the math book is trying to tell me how to do stuff. I can tell you I don't like it. I just prefer when I'm given the rules to check. Anyway, you've got u plus u plus v. Oh. V plus v. That is supposed to look like this. And the multiplication by a scalar that is looking like this. And this one. This one is important. You will see I'm going to cheat in the implementation. Yoo-hoo. How do we do an implementation that is very naive, which I am. I'm very naive, in fact. So what I did is I propagated the plus on the right side, like it's written in the books. But since I was at it, I was like, why not use the idea of duck typing? Yes, we're coming to it. Duck typing is a little bit like linear algebra. It quacks like a duck, and it flies like a duck, and it's good like a Maghreb canal. Then it's a duck. And I was like, well, why not use both? At the point where you are, you're trying to do something silly. Be silly to the top. You're never winning anything by doing it with, you know, warm water. You go hot. So what I did is that I overloaded the operator. Since I'm dyslexic and I don't know my right in my life, I have plugged everything on the immediate addition, subtraction, multiplication, division. So it's not very fast. I'm sorry. And then I implemented neg this way so that I'm consistent with the stuff I show you. And well, it was very, it was quite easy to do. The stuff you're not seeing there is that I'm saying that basically you can probably do it in any kind of language to be honest. At least in Perl. The joke. So does it pass my own test? Yes. I love it. When you pass your own test, you can be proud. So I did implement, actually, I didn't see this code. I think I stole it on the Internet, and it was made by a dude person whose name was Guido from something, I guess. But anyway, it's my code now. Three software, you know? So now we've got this, which is, I didn't put a joke. So I got this, which is, so my multiplication, I forgot to say that there is a little twist in the multiplication. When you're taking A, that is a scalar and you're multiplying it, you're putting to every leaf. But when you've got a dictionary, like when you've got a vector, when you're adding, if you've got the same key, you're adding the same key side by side. But if the key doesn't exist, I create it. On the other side, when you've got multiplication, it's very complex. You're going to see it when it's going to be working with the IPaiffen notebooks that we don't have because my computer is not showing it. Don't worry, I had a backup plan. So, excuse me, I've got to go back. Yes, yes, I've got new rules that I forgot to implement in my test, but I passed it, I checked. So we've got the dot product that I use with the perderoiter that is making the isomorphism. So basically, I'm taking, I'm not even talking about 3D geometry, I'm just taking random name of keys for my dict. And when I'm doing my dot product, I've got exactly the result of the Euclidean geometry without even trying to implement the Euclidean geometry. So far, it's working, it's working for dimensions that are even higher than three or two. I'm too much into geometry, I'm sorry, I love it. Yeah, it was intended to be fun. You have the right to laugh from time to time. It's very hard to be there. Oh, Calimero effect, you don't know, you're not on my side. So, dot product is one step away from distance. Thank you. So this is the definition of absolute, up, up, up. No, no, no, but distance is an absolute value of u minus v. So, and when, yeah, no, I'm not a sign, but geometrical pun have acute angle. I tried very hard to make jokes for you. So anyway, so I took a random definition that was in the book and I was like, oh, can it work? Now, you've got this data stuff that I don't really understand what it says and you just have to pay attention that it should be non-null. But anyway, then you implement it this way. I know people hate the one-liner, but I was a pearl coder, so I've got the right to do it. Once again, we're taking random example two dimensions. It's doing what it's supposed to do. We are checking and then we're trying with a 3D, 4D vector. It's doing the same thing. And when we're dividing by a null vector, it's doing exactly what it's supposed to do, which is an exception of a division by zero. Yes, it's working. Aren't we proud? We didn't even did a lot of code. Yeah, I'm focusing too much on geometry. I know it already. That's the part where I don't have my, where is Stefan? Oh, I'm deep shit. Normally, I'm supposed to show you some code. No, I'm joking. When you know that everything can go wrong, you prepare a backup plan. And the backup plan was to have a, normally I was supposed to have a, I hope I've got a good memory. Please help me, God, please. Yes. Normally, if I had an IPython notebook, I would have made it, you know, like magic and make stuff appear like a magician. And so how it is. Sorry, I'm coding in Python 2 right now. I'm sorry. I intend to go in Python 3, but right now I'm doing my sider. So here is a normal vector I've taken globally the example in the named collection of std3 of Python, which is a point in the color space. Nothing new under the sun. It's a classical one. Then if you check, when you're adding with, I said that zero is not zero. Look at it. This is not zero. But if you look at it, it's the same. So this is, should be true. And this should be equal. That it's just we're not in a geometrical space. There is a lot of stuff that are not geometry. We're not living in the world of the little marmot that are, you know, we're in the world of computers. They're working the way they are. This normally zero is equal to minus one plus one or one plus minus one. It should be true. Yeah, of course, it's kidding the joke. So what happened? So when I was saying that integers are not int, are not integers, and floats are not real numbers, the computer is not exactly liking the real geometry of the algebra books. You have to live with the fact that the world is imperfect. It's called the hell of the floats. Which is a norm that we use in electronic to represent the number in memory. And that's the reason why we have got so much bug. It's non-commutative. And non-commutativity is breaking a lot of assumptions of a linear algebra. So it's not my fault. It's not Python fault. It's a fault of IBM. So you've got this unit vector, a neutral amount of multiplication. I remember it's called in, excuse me, in fact, I was not good at school. So we've got this stuff that when you multiply by itself, it doesn't move. It doesn't move. Yes. Then we've got this one. Why did I wrote this one? Because it's giving the same result. It's another way to write one. And then, what is doing this? I'm multiplying itself by itself and I'm dividing it by itself. I still have almost the same result. So actually it's working. The fact of propagating the multiplication to the keys and then just thinking it should work like addition in vectors with a few tricks that I will not devolay because it's an open source and you cannot read it, it's making that I've got a unit vector, in fact. And A over A is a unit vector and it has a weird shape that you will see later. I'm very proud of this one which is a conservation. A plus A is equal to 2A. And it's true. It's amazing. Why are my coordinates so conveniently non-null? I saw people noticing it. No, it's a joke. No, no one. Really not a good public. I'm sorry. You could help me a little bit from time to time. Yeah, it's not a bug. It's really like it should behave. When you've got a number, you divide by 0. It's making a 0, a division by 0 exception. And if you look at it correctly, every number are in fact an implicit one dimension vector. My brain is burning on this one. Believe me. It's not too tough. I'm really sorry. So since I used to solve equations without posing them because I was doing something called physics and not mathematics, I used to be working with intuition. The important part is can we build an intuition of what this stuff would be meaning? The fact that A plus 0 is equal to A, giving that we are calling plus a translation, it's meaning that if you move yourself from nothing, you will not move. Same thing is going with the multiplication by one. If you stretch yourself from your own size, it's not going to change. And I wanted to show you what is a unit vector. It has more than because of the definition and made of the multiplication. And I say that I don't like project manager telling me how to do stuff as long as I'm having the theorems that are being respected. I mean, my stuff are working. So obviously, it's a project manager that is wrong, not me. So my multiplication is giving results that are pretty interesting is that we've got the unique vector by dividing the vector by itself, which is going in every direction, but it's also this and this. And you will see that maybe it's not totally stupid. Maybe. This is well known. So addition and multiplication should be related by this. It's very important that you have to understand that when you're multiplying something by a scalar, you're changing the direction. The scalar is the direction or the number of time of the vector. So when you're going in your direction and then going back from your direction, you're going back to where you were. So it's pretty having an intuition that plus and omotesia are working. Excuse me. I'm scared. How much minute do I have? Thank you. I'm rushing to leave you five minutes. So this is a translation of one and I'm applying only on P and it's working like it should exit equal to two, y to two, and that to two. So kind of multiplying in my context with this is kind of saying that we are subselecting the dict and this dict is looking like a vector. So this multiple mappings to be a net because I didn't use for the implementation as traits. I never used the word dict. I'm using mutable mappings. It's duct typing. It's just a stuff with square bracket, items, itter, len and stuff like that. It's not actually dict I'm using. You could do it with other stuff. So it's a kind of subselection of a space that could be in a space. And I remember that I got, I had a stuff in my book saying that maybe it's a subvectorial space. I really don't like math seriously. I love to implement them but the rest is not funny. Just because I could, I went on the Internet and took a random formula, this one, and I decided to implement it to see if it's working. So I made a word counter which is a normal way for people that are doing text indexation to represent the text. And I decided without any bias to give me point one, to give how much of anything it would be. And then I tried to see if the direction of my topic with Python for them was working. And also cosine, it's for knowing if two vectors are pointing in the same direction. And cosine similarity, it's in the case you've got a base that is infinite and sometimes maybe it's important to know about the one that are there and not there. I will go on the Wikipedia page. I don't understand it but there was a nice formula so I used it and I got the intuition that I'm right. So basically, what is the direction of first them, Python first them and this thing? Yes, PEP 8. I don't respect PEP 8 all the time. So basically the results are that concerning this topic, I'm a little bit of topic but concerning first them, I'm totally in topic which is I'm very proud of myself. So it's different. So it's very true to algebra is non-algebraic type. I don't have a lot of time. I can go back on it later one day. But I thought of it. It's possible. You can, there are times where you cannot define plus but in the context of a distance you can define minus to know how far an object is from another object or a dict, excuse me, a dict. Thank you. In fact, I had another backup plan. I always have a backup plan. I used to be a C-Satmin. So actual use, text indexation. In fact, it's because of my first mission as a she's a merchant that I knew about it. Lock passing. It's special. Dic manipulation. And oh, oh, fuck another geometrical joke. I hate the class point 2D when you've got your complex type. We eventually have the quaternions that are more efficient for doing rotation. I want to say that I really don't like this. I like the 2D point class as much as I like the yellow word example. Yeah, another geometrical parallelism. You catch it. No. So when you've got a dict, you can add it. Mutable mapping like bigger cache and dock pile cache are putting the region like a dict but in fact they are not dict. It's just an abstraction. It's a view. Mutable mapping doesn't have to be a real mutable mapping. Nothing prevents you for taking the keys, shard them on the hash and then send it to another computer. If the network is always working and stuff like that, it will work. It will do parallelism. And since every key is a distinct dimension, it's without side effects. So you can do it. So it's, I mean, what I'm doing is very nice, guys. Now, should you use my library? Yeah, we are going there to the question and answer. Basically, I'm doing bagel inside right now. I'm a little bit overwhelmed with time. I will push the modifications that I saw. And the last time I tried to make my module pass Python 3 was a long time ago when it was a pain. And I will make some effort for you. I've got a library which has a lot more funny stuff in it, but I don't encourage it. I'm using archery right now. The naming is a pain is a pain. The puns are not a good idea. Don't use my convention for naming stuff. It's really not a good idea. I'm a bad coder on this one. Yes, I've got a lot of math scientists project because when you've got two dimension and vectors, you can build matrix. I already did it, but it's non-commutative. So it's, I'm not in peace with myself. The other algebra I like, I would like to work with a commutator algebra because we've got the float problem and I would like to know how much we are making mistakes when we are using some stuff like floats. The close to operators that we could implement on objects so that we could always know we've got profile like psychometric profile or if I'm Donald Trump and I want to know about people. If people are matching a profile, matching a profile, I know it's very utopian use of computers. No, I'm joking much more for in meds since you can use it to know if people are going to have a disease or not. You can also use computer for good stuff, you know. And there is a set algebra that can be implemented in the same fashion. I've been working on it a little bit. Yes, I'm very bad at communicating ideas. I proposed it to Python ideas. It was a flop and it's because my communication skills are below average and that's when we are coming to the, yeah, really if you're not laughing, I'm not redoing my job correctly. So a lot of thanks to Stefan, a lot of thanks to Pierre Parizot who learned me about text indexation. All the guy had for them. I'm very glad that you're there. It's really putting a lot of a bomb in my heart. The guy who did the imprest of because it's not me who is doing this kind of stuff in JavaScript. And McGrawill for making this book which was cheap and publication. They didn't give me anything but I love them so I don't have. And so normally it's, do I have time for any questions? How much? Not a lot? So did I annoyed you? Did I bothered you? Do you have any questions? Are you happy in life? Okay, I have one question. Who wants a beer? The bar is just open. Open the door. I think that you will come back because we have another speaker. But please, you can go. That's free. Really free. It has in free beer. Okay. And the first one is just for you. Thank you.
 Hello. Nice to meet you. There are two types of free software developers, the one that  are famous and people like me. I'm not really famous to be honest. Free, like in free software,  the capacity for a person like me and others to present what they do and not who they are.  I really like it. So thank you first them. That's my first thank you of the day. And here is a story.  And every nice story, where is my slide? Yay. Every story begins with too much time on your  end and a book. Sorry for the English speaker, but anyway, remember that in mathematics we  don't care about what is written. So you will have mathematics books that is written in French,  but all the formula in English. Don't worry. They are translated. So this book is called  the deep shoot linear algebra. And I was like, oh, fine. It's looking fun, this book. For definition  and fun that only me understand. Basically what my book was saying is that it was a cool project  manager. It was saying, I will not tell you how to implement stuff. I will just tell you how it's  working, the rules. And then once you implement, once you follow the rules, you have metrics. This  one is a little bit capillot-racted, as we say in French. And then you've got list surprises. I will  come on it later because I love to have list surprises. Ah, shit. You know what I mean.  Basically, as you see, we've got associativity, new element of addition, a neutral element of  addition, multiplication, and so on. And I want to point, is it this one? Yeah. I want to point  that one is not one. You will see it later. Zero is not zero. Computer int are no integers and  real numbers are not float. But good enough lies made a good enough truth. And I will try to prove  it to you with code. We don't know. It can work. So once you've got these rules, you code. So I've  coded a kind of unit test that is testing for the basic stuff like A plus B equals B plus A and  stuff like that, which is not very interesting. But I was like, why not do it? If we can, we do.  So basically, I began with a normal basic type of what? We don't see a thing. Ah,  shit. So basically, I began with a basic type of Python. There is no way to put in full  screen. So basically, complex time is following the linear algebra rule. Oh, that's nice.  Okay. Over scale. Oh, control one. It exists. So for fun, I tried an impure race. They are  behaving like they should not like they should behave like the theorem of linear algebra saying  the floats are doing the same. The ints are doing the same. I was pretty surprised with the decimal.  But if the test are saying no, but it's no, that's the way it is. Complex. I love complex. And  at least no, obviously, least are not following the linear algebra. You can try, but no. Here,  I'm going to introduce, sorry for the stuff. So if you can go on the Internet, you will have the  full information. There is a small theorem that I created. I don't think it's a theorem. I don't  know what it is. If you take intricated, multi-table mappings that are implemented in dicts that we  all know, you can take a path to a key and transform it into a tuple. And it's equivalent form. So  there is a canonical form of intricate dict that are making them like a dict. So I can reason on  one level dict, but in fact, I can think of intricate dict. And the other way around is  working because it's a b-jection. It's an isomorphism. Great stuff, isomorphism. Believe me. Oh,  not everybody believes in isomorphism. I will prove it to you later. Don't worry. So like an  obnoxious project manager, the math book is trying to tell me how to do stuff. I can tell you I  don't like it. I just prefer when I'm given the rules to check. Anyway, you've got u plus u plus  v. Oh. V plus v. That is supposed to look like this. And the multiplication by a scalar that is  looking like this. And this one. This one is important. You will see I'm going to cheat in  the implementation. Yoo-hoo. How do we do an implementation that is very naive, which I am.  I'm very naive, in fact. So what I did is I propagated the plus on the right side, like it's  written in the books. But since I was at it, I was like, why not use the idea of duck typing? Yes,  we're coming to it. Duck typing is a little bit like linear algebra. It quacks like a duck,  and it flies like a duck, and it's good like a Maghreb canal. Then it's a duck. And I was like,  well, why not use both? At the point where you are, you're trying to do something silly. Be silly  to the top. You're never winning anything by doing it with, you know, warm water. You go hot.  So what I did is that I overloaded the operator. Since I'm dyslexic and I don't know my right  in my life, I have plugged everything on the immediate addition, subtraction, multiplication,  division. So it's not very fast. I'm sorry. And then I implemented neg this way so that I'm  consistent with the stuff I show you. And well, it was very, it was quite easy to do. The stuff  you're not seeing there is that I'm saying that basically you can probably do it in any kind of  language to be honest. At least in Perl. The joke. So does it pass my own test? Yes. I love it.  When you pass your own test, you can be proud. So I did implement, actually, I didn't see this  code. I think I stole it on the Internet, and it was made by a dude person whose name was Guido  from something, I guess. But anyway, it's my code now. Three software, you know? So now we've got  this, which is, I didn't put a joke. So I got this, which is, so my multiplication, I forgot to say  that there is a little twist in the multiplication. When you're taking A, that is a scalar and you're  multiplying it, you're putting to every leaf. But when you've got a dictionary, like when you've got  a vector, when you're adding, if you've got the same key, you're adding the same key side by side.  But if the key doesn't exist, I create it. On the other side, when you've got multiplication,  it's very complex. You're going to see it when it's going to be working with the  IPaiffen notebooks that we don't have because my computer is not showing it. Don't worry,  I had a backup plan. So, excuse me, I've got to go back. Yes, yes, I've got new rules that I forgot  to implement in my test, but I passed it, I checked. So we've got the dot product that I use with the  perderoiter that is making the isomorphism. So basically, I'm taking, I'm not even talking  about 3D geometry, I'm just taking random name of keys for my dict. And when I'm doing my dot  product, I've got exactly the result of the Euclidean geometry without even trying to implement  the Euclidean geometry. So far, it's working, it's working for dimensions that are even higher than  three or two. I'm too much into geometry, I'm sorry, I love it. Yeah, it was intended to be fun.  You have the right to laugh from time to time. It's very hard to be there. Oh, Calimero effect,  you don't know, you're not on my side. So, dot product is one step away from distance.  Thank you. So this is the definition of absolute, up, up, up. No, no, no, but distance is an absolute  value of u minus v. So, and when, yeah, no, I'm not a sign, but geometrical pun have acute angle.  I tried very hard to make jokes for you. So anyway, so I took a random definition that was in the  book and I was like, oh, can it work? Now, you've got this data stuff that I don't really understand  what it says and you just have to pay attention that it should be non-null. But anyway, then you  implement it this way. I know people hate the one-liner, but I was a pearl coder, so I've got the  right to do it. Once again, we're taking random example two dimensions. It's doing what it's  supposed to do. We are checking and then we're trying with a 3D, 4D vector. It's doing the same  thing. And when we're dividing by a null vector, it's doing exactly what it's supposed to do,  which is an exception of a division by zero. Yes, it's working. Aren't we proud? We didn't even  did a lot of code. Yeah, I'm focusing too much on geometry. I know it already. That's the part where  I don't have my, where is Stefan? Oh, I'm deep shit. Normally, I'm supposed to show you some code.  No, I'm joking. When you know that everything can go wrong, you prepare a backup plan. And the  backup plan was to have a, normally I was supposed to have a, I hope I've got a good memory. Please  help me, God, please. Yes. Normally, if I had an IPython notebook, I would have made it, you know,  like magic and make stuff appear like a magician. And so how it is. Sorry, I'm coding in Python 2  right now. I'm sorry. I intend to go in Python 3, but right now I'm doing my sider.  So here is a normal vector I've taken globally the example in the named collection of std3  of Python, which is a point in the color space. Nothing new under the sun. It's a classical one.  Then if you check, when you're adding with, I said that zero is not zero. Look at it. This is not  zero. But if you look at it, it's the same. So this is, should be true. And this should be equal.  That it's just we're not in a geometrical space. There is a lot of stuff that are not  geometry. We're not living in the world of the little marmot that are, you know,  we're in the world of computers. They're working the way they are. This normally zero is equal to  minus one plus one or one plus minus one. It should be true. Yeah, of course, it's kidding the joke.  So what happened? So when I was saying that integers are not int, are not integers, and floats  are not real numbers, the computer is not exactly liking the real geometry of the algebra books.  You have to live with the fact that the world is imperfect. It's called the hell of the floats.  Which is a norm that we use in electronic to represent the number in memory. And that's the  reason why we have got so much bug. It's non-commutative. And non-commutativity is breaking  a lot of assumptions of a linear algebra. So it's not my fault. It's not Python fault. It's a fault of IBM.  So you've got this unit vector, a neutral amount of multiplication. I remember it's called in,  excuse me, in fact, I was not good at school. So we've got this stuff that when you multiply by  itself, it doesn't move. It doesn't move. Yes. Then we've got this one. Why did I  wrote this one? Because it's giving the same result. It's another way to write one. And then,  what is doing this? I'm multiplying itself by itself and I'm dividing it by itself.  I still have almost the same result. So actually it's working. The fact of propagating the  multiplication to the keys and then just thinking it should work like addition in vectors with a  few tricks that I will not devolay because it's an open source and you cannot read it,  it's making that I've got a unit vector, in fact. And A over A is a unit vector and it has a weird  shape that you will see later. I'm very proud of this one which is a conservation. A plus A is  equal to 2A. And it's true. It's amazing. Why are my coordinates so conveniently non-null? I saw  people noticing it. No, it's a joke. No, no one. Really not a good public. I'm sorry. You could  help me a little bit from time to time. Yeah, it's not a bug. It's really like it should behave.  When you've got a number, you divide by 0. It's making a 0, a division by 0 exception. And if  you look at it correctly, every number are in fact an implicit one dimension vector.  My brain is burning on this one. Believe me. It's not too tough. I'm really sorry.  So since I used to solve equations without posing them because I was doing something called physics  and not mathematics, I used to be working with intuition. The important part is can we build  an intuition of what this stuff would be meaning? The fact that A plus 0 is equal to A, giving that  we are calling plus a translation, it's meaning that if you move yourself from nothing, you will  not move. Same thing is going with the multiplication by one. If you stretch yourself from your own  size, it's not going to change. And I wanted to show you what is a unit vector. It has more than  because of the definition and made of the multiplication. And I say that I don't like  project manager telling me how to do stuff as long as I'm having the theorems that are being  respected. I mean, my stuff are working. So obviously, it's a project manager that is wrong,  not me. So my multiplication is giving results that are pretty interesting is that we've got the  unique vector by dividing the vector by itself, which is going in every direction, but it's also  this and this. And you will see that maybe it's not totally stupid. Maybe. This is well known.  So addition and multiplication should be related by this. It's very important that you have to  understand that when you're multiplying something by a scalar, you're changing the direction.  The scalar is the direction or the number of time of the vector. So when you're going in your  direction and then going back from your direction, you're going back to where you were. So it's  pretty having an intuition that plus and omotesia are working. Excuse me. I'm scared. How much  minute do I have? Thank you. I'm rushing to leave you five minutes. So this is a translation of one  and I'm applying only on P and it's working like it should exit equal to two, y to two,  and that to two. So kind of multiplying in my context with this is kind of saying that we are  subselecting the dict and this dict is looking like a vector. So this multiple mappings to be  a net because I didn't use for the implementation as traits. I never used the word dict. I'm using  mutable mappings. It's duct typing. It's just a stuff with square bracket, items, itter,  len and stuff like that. It's not actually dict I'm using. You could do it with other stuff.  So it's a kind of subselection of a space that could be in a space. And I remember that I got,  I had a stuff in my book saying that maybe it's a subvectorial space. I really don't like math  seriously. I love to implement them but the rest is not funny. Just because I could, I went on the  Internet and took a random formula, this one, and I decided to implement it to see if it's working.  So I made a word counter which is a normal way for people that are doing text indexation to  represent the text. And I decided without any bias to give me point one, to give how much of  anything it would be. And then I tried to see if the direction of my topic with Python for them  was working. And also cosine, it's for knowing if two vectors are pointing in the same direction.  And cosine similarity, it's in the case you've got a base that is infinite and sometimes maybe  it's important to know about the one that are there and not there. I will go on the Wikipedia page.  I don't understand it but there was a nice formula so I used it and I got the intuition that I'm  right. So basically, what is the direction of first them, Python first them and this thing?  Yes, PEP 8. I don't respect PEP 8 all the time. So basically the results are that concerning this  topic, I'm a little bit of topic but concerning first them, I'm totally in topic which is I'm  very proud of myself. So it's different. So it's very true to algebra is non-algebraic type.  I don't have a lot of time. I can go back on it later one day. But I thought of it. It's possible.  You can, there are times where you cannot define plus but in the context of a distance you can  define minus to know how far an object is from another object or a dict, excuse me, a dict.  Thank you. In fact, I had another backup plan. I always have a backup plan. I used to be a C-Satmin.  So actual use, text indexation. In fact, it's because of my first mission as a  she's a merchant that I knew about it. Lock passing. It's special. Dic manipulation.  And oh, oh, fuck another geometrical joke. I hate the class point 2D when you've got  your complex type. We eventually have the quaternions that are more efficient for doing  rotation. I want to say that I really don't like this. I like the 2D point class as much as I like  the yellow word example. Yeah, another geometrical parallelism. You catch it. No.  So when you've got a dict, you can add it. Mutable mapping like bigger cache and dock pile  cache are putting the region like a dict but in fact they are not dict. It's just an abstraction.  It's a view. Mutable mapping doesn't have to be a real mutable mapping. Nothing prevents you for  taking the keys, shard them on the hash and then send it to another computer. If the network is  always working and stuff like that, it will work. It will do parallelism. And since every key is a  distinct dimension, it's without side effects. So you can do it. So it's, I mean, what I'm doing is  very nice, guys. Now, should you use my library? Yeah, we are going there to the question and answer.  Basically, I'm doing bagel inside right now. I'm a little bit overwhelmed with time. I will push the  modifications that I saw. And the last time I tried to make my module pass Python 3 was a long time  ago when it was a pain. And I will make some effort for you. I've got a library which has a lot more  funny stuff in it, but I don't encourage it. I'm using archery right now. The naming is a pain  is a pain. The puns are not a good idea. Don't use my convention for naming stuff. It's really not  a good idea. I'm a bad coder on this one. Yes, I've got a lot of math scientists project because  when you've got two dimension and vectors, you can build matrix. I already did it, but it's  non-commutative. So it's, I'm not in peace with myself. The other algebra I like, I would like to  work with a commutator algebra because we've got the float problem and I would like to know how much  we are making mistakes when we are using some stuff like floats. The close to operators that we  could implement on objects so that we could always know we've got profile like psychometric  profile or if I'm Donald Trump and I want to know about people. If people are matching a  profile, matching a profile, I know it's very utopian use of computers. No, I'm joking much more  for in meds since you can use it to know if people are going to have a disease or not. You can also  use computer for good stuff, you know. And there is a set algebra that can be implemented in the  same fashion. I've been working on it a little bit. Yes, I'm very bad at communicating ideas. I  proposed it to Python ideas. It was a flop and it's because my communication skills are below  average and that's when we are coming to the, yeah, really if you're not laughing, I'm not redoing  my job correctly. So a lot of thanks to Stefan, a lot of thanks to Pierre Parizot who learned me  about text indexation. All the guy had for them. I'm very glad that you're there. It's really putting  a lot of a bomb in my heart. The guy who did the imprest of because it's not me who is doing this  kind of stuff in JavaScript. And McGrawill for making this book which was cheap and publication.  They didn't give me anything but I love them so I don't have. And so normally it's,  do I have time for any questions? How much? Not a lot?  So did I annoyed you? Did I bothered you? Do you have any questions? Are you happy in life?  Okay, I have one question. Who wants a beer? The bar is just open. Open the door. I think that you  will come back because we have another speaker. But please, you can go. That's free. Really free.  It has in free beer. Okay. And the first one is just for you. Thank you.
The_power_of_duck_typing_and_linear_algrebra_How_linear_algebra_and_python_make_a_good_fit_0_47.png The_power_of_duck_typing_and_linear_algrebra_How_linear_algebra_and_python_make_a_good_fit_48_95.png The_power_of_duck_typing_and_linear_algrebra_How_linear_algebra_and_python_make_a_good_fit_96_935.png The_power_of_duck_typing_and_linear_algrebra_How_linear_algebra_and_python_make_a_good_fit_936_4523.png The_power_of_duck_typing_and_linear_algrebra_How_linear_algebra_and_python_make_a_good_fit_4524_4643.png The_power_of_duck_typing_and_linear_algrebra_How_linear_algebra_and_python_make_a_good_fit_4644_4787.png The_power_of_duck_typing_and_linear_algrebra_How_linear_algebra_and_python_make_a_good_fit_4788_9719.png The_power_of_duck_typing_and_linear_algrebra_How_linear_algebra_and_python_make_a_good_fit_9720_10403.png The_power_of_duck_typing_and_linear_algrebra_How_linear_algebra_and_python_make_a_good_fit_10404_11531.png The_power_of_duck_typing_and_linear_algrebra_How_linear_algebra_and_python_make_a_good_fit_11532_15227.png The_power_of_duck_typing_and_linear_algrebra_How_linear_algebra_and_python_make_a_good_fit_15228_15539.png The_power_of_duck_typing_and_linear_algrebra_How_linear_algebra_and_python_make_a_good_fit_15540_17147.png The_power_of_duck_typing_and_linear_algrebra_How_linear_algebra_and_python_make_a_good_fit_17148_21263.png The_power_of_duck_typing_and_linear_algrebra_How_linear_algebra_and_python_make_a_good_fit_21264_21539.png The_power_of_duck_typing_and_linear_algrebra_How_linear_algebra_and_python_make_a_good_fit_21540_21971.png The_power_of_duck_typing_and_linear_algrebra_How_linear_algebra_and_python_make_a_good_fit_21972_27815.png The_power_of_duck_typing_and_linear_algrebra_How_linear_algebra_and_python_make_a_good_fit_27816_31619.png The_power_of_duck_typing_and_linear_algrebra_How_linear_algebra_and_python_make_a_good_fit_31620_33155.png The_power_of_duck_typing_and_linear_algrebra_How_linear_algebra_and_python_make_a_good_fit_33156_33539.png The_power_of_duck_typing_and_linear_algrebra_How_linear_algebra_and_python_make_a_good_fit_33540_34355.png The_power_of_duck_typing_and_linear_algrebra_How_linear_algebra_and_python_make_a_good_fit_34356_35639.png The_power_of_duck_typing_and_linear_algrebra_How_linear_algebra_and_python_make_a_good_fit_35640_35711.png The_power_of_duck_typing_and_linear_algrebra_How_linear_algebra_and_python_make_a_good_fit_35712_35763.png