Lucy's Tech Miscellanyhttps://lucy24.bitbucket.io/2018-11-17T00:00:00+01:00On nonsense and science2018-11-17T00:00:00+01:00Lucytag:lucy24.bitbucket.io,2018-11-17:on-nonsense-and-science.html<p>The modern scientific education is associated to rigor ; it extols the power of reason over feelings. Rising above other mere mortals, the scientist has a grand vision of what he should accomplish, and sets himself to work, wielding an impressive array of mathematical tools. In contrast, the poet seems to err without a definite goal, writing words after words in some everlasting quest for beauty.</p>
<p align="center" style="font-size:70%;"><a href="https://commons.wikimedia.org/wiki/File:James_Clerk_Maxwell.png#/media/File:James_Clerk_Maxwell.png"><img src="https://upload.wikimedia.org/wikipedia/commons/5/57/James_Clerk_Maxwell.png" alt="James Clerk Maxwell.png"></a><br>By <a href="https://www.wikidata.org/wiki/Q19832615" class="extiw" title="d:Q19832615">George J. Stodart</a> - Frontpiece in James Maxwell, The Scientific Papers of James Clerk Maxwell. Ed: <span class="caps">W. D.</span> Niven. New York: Dover, 1890., Public Domain, <a href="https://commons.wikimedia.org/w/index.php?curid=2311942">Link</a></p>
<p>I’m no poet. I’m more of a scientist by training. As such, I have a great admiration for James Clerk Maxwell. To defeat the stereotypes, he was an outstanding physicists who wrote poetry. His poems are little known gems. I recently found this one, entitled “Molecular Evolution”.</p>
<h2>Molecular Evolution, by <span class="caps">J.C.</span> Maxwell</h2>
<blockquote>
<p>At quite uncertain times and places,<br />
The atoms left their heavenly path,<br />
And by fortuitous embraces,<br />
Engendered all that being hath.<br />
And though they seem to cling together,<br />
And form “associations” here,<br />
Yet, soon or late, they burst their tether,<br />
And through the depths of space career.</p>
<p>So we who sat, oppressed with science,<br />
As British asses, wise and grave,<br />
Are now transformed to wild Red Lions,<br />
As round our prey we ramp and rave.<br />
Thus, by a swift metamorphosis,<br />
Wisdom turns wit, and science joke,<br />
Nonsense is incense to our noses,<br />
For when Red Lions speak, they smoke.</p>
<p>Hail, Nonsense! dry nurse of Red Lions,<br />
From thee the wise their wisdom learn,<br />
From thee they cull those truths of science,<br />
Which into thee again they turn.<br />
What combinations of ideas,<br />
Nonsense alone can wisely form!<br />
What sage has half the power that she has,<br />
To take the towers of Truth by storm? </p>
<p>Yield, then, ye rules of rigid reason!<br />
Dissolve, thou too, too solid sense!<br />
Melt into nonsense for a season,<br />
Then in some nobler form condense.<br />
Soon, all too soon, the chilly morning,<br />
This flow of soul will crystallize,<br />
Then those who Nonsense now are scorning,<br />
May learn, too late, where wisdom lies.</p>
</blockquote>
<p>Now, that’s a piece of philosophy of science. It got me thinking.</p>
<h2>Randomness in science</h2>
<p>This poem deals with the exploration/exploitation tradeoff and the necessity of having a fair share of exploration in science.
Which means that you may have to walk on paths forbidden by reason.
Of course, reason shouldn’t be entirely forgotten: for <em>nonsense</em> to <em>crystallize</em> into <em>some nobler form</em>, one needs to discern the emerging patterns in the outburst of ideas.
Indeed, what Maxwell say is to try random combinations of ideas. Take the risk to be ridiculed. Get creative.</p>
<p>Interestingly, this is also the conclusion of a 2015 paper from the British Journal for the Philosophy of Science, entitled <a href="https://academic.oup.com/bjps/article/67/4/1057/2526185/Conservatism-and-the-Scientific-State-of-Nature">Conservatism and the Scientific State of Nature</a>, in which the authors conclude:</p>
<blockquote>
<p>…that governments and foundations should reverse the general trend and intervene to encourage risky science beyond what would occur without their intervention.</p>
</blockquote>
<p>The authors modeled the scientists as <a href="https://en.wikipedia.org/wiki/Multi-armed_bandit">bandits</a>: a scientist can chose to work on the project that looks the most promising or to experiment with new, radical alternatives. It turns out that if all scientists have the same incentive to choose the safe path, it is detrimental to the progress of science, which involves following crazy ideas.</p>
<p align="center" style="font-size:70%;"><a href="https://commons.wikimedia.org/wiki/File:Las_Vegas_slot_machines.jpg#/media/File:Las_Vegas_slot_machines.jpg"><img src="https://upload.wikimedia.org/wikipedia/commons/8/82/Las_Vegas_slot_machines.jpg" alt="Las Vegas slot machines.jpg" width=300></a><br>By <a href="https://en.wikipedia.org/wiki/User:Yamaguchi%E5%85%88%E7%94%9F" class="extiw" title="en:User:Yamaguchi先生">Yamaguchi先生</a>, <a href="http://creativecommons.org/licenses/by-sa/3.0/" title="Creative Commons Attribution-Share Alike 3.0"><span class="caps">CC</span> <span class="caps">BY</span>-<span class="caps">SA</span> 3.0</a>, <a href="https://commons.wikimedia.org/w/index.php?curid=57295504">Link</a></p>
<p>A big question in Philosophy of Science is the demarcation between what is science and what is not. What are bandits, and how the demarcation question can be reinterpreted within a bandits framework is an interesting topic. I’ll try to write more about it in a sequel to this post. Meanwhile, I just want you to remember that randomness is good, because it allows exploration.</p>
<p>Quoting the same paper:</p>
<blockquote>
<p>The history of science is filled with stories of the crazy idea that turned out to be right.</p>
</blockquote>
<p>Let’s follow Maxwell the poet, and fill History of Science with more nonsense.</p>About Peopleware2015-02-01T00:00:00+01:00Lucytag:lucy24.bitbucket.io,2015-02-01:about-peopleware.html<p>The book <a href="http://en.wikipedia.org/wiki/Peopleware:_Productive_Projects_and_Teams"><em>Peopleware</em></a> by Tom DeMarco and Timothy Lister is a popular book on software project management. The first edition was from 1987 but the book has been revised in 2013. <em>Peopleware</em> addresses the issue of software developers management.</p>
<p align='center'><img src="https://lucy24.bitbucket.io/images/peopleware.jpg" width=200 align='center' /></p>
<p>This article is a short-list of what I take away from the book. The book is really easy to read and full of interesting insights, I recommend it to anyone working in software projects — even if you’re not into management.</p>
<p>The authors note that a lot of software projects fail, and that in their experience, most of the time the failure is “people-related”. The main thesis is stated in the first chapter and reads:</p>
<blockquote>
<p>The major problems of our work are not so much <em>technological</em> as <em>sociological</em> in nature.</p>
</blockquote>
<p>The book is divided into 5 parts, but I think we can extract 2 main ideas:</p>
<ol>
<li>Productivity in a software project is quite different than in a physical product assembly line (eg Cheeseburger production),</li>
<li>You will have better productivity by actually showing <em>respect</em> for and <em>trust</em> in your people.</li>
</ol>
<h1></h1>
<p>The authors explain the first point to support the second, and then expand on the multiple facets of what makes software developers work better.</p>
<h2>Productivity reassessed</h2>
<p>Software development is a work of the mind. It requires abstract thinking and creativity. On the opposite, making a Cheeseburger requires no novelty, and production can be standardized.</p>
<p>When you replace a developer, you find a person with a different experience each time. Turnover is more costly than you think. On the contrary, a Cheeseburger maker is quite interchangeable.</p>
<p>When developing software, quality matters a lot, because software is evolving and must be maintained. You can’t trade-off quality for productivity.</p>
<blockquote>
<p>What’s not so easy is keeping in mind an inconvenient truth like this one:</p>
<p><em>People under time pressure don’t work better — they just work faster.</em></p>
<p>In order to work faster, they may have to sacrifice the quality of the product and of their own work experience.</p>
</blockquote>
<h2>How to care for software developers</h2>
<p>If you want to know all about it, go read the book. Here I will keep 5 points that I found particularly interesting, considering my short experience of software development.</p>
<h3>Respect their work</h3>
<ul>
<li>Allow, even encourage errors: they will feel more free to try new things and will learn in the process.</li>
<li>People’s self-esteem is tied to the quality of the work they produce: strive for quality.</li>
<li>Be open to change.</li>
<li>Create an atmosphere of safety, remove competition inside a team.</li>
<li>Avoid unnecessary dress codes, Methodologies, and bureaucracy, which make people feel that their appearance, or a Method (with a big M), or the politically-correct, is more important than their actual work.</li>
</ul>
<h1></h1>
<p>Chris Lema selected that last point as one of the <a href="http://chrislema.com/three-reasons-why-high-performers-quit/">Three Reasons Why High Performers Quit</a>:</p>
<blockquote>
<p>Proper procedure is more valuable than high performance.</p>
</blockquote>
<h3>Respect their time</h3>
<ul>
<li>Sometimes a developer has to stop coding and think. That’s <span class="caps">OK</span>.</li>
<li>Avoid useless meetings, etc.</li>
<li>Avoid impossible deadlines: your developers also want the work done, they’ll do it even without a deadline.</li>
<li>Be aware that <em>working more</em> is not <em>being more productive</em>. Respect your people’s work/personal life balance.</li>
</ul>
<blockquote>
<p>Your people are very aware of the one short life that each person is allotted. And they know too well that there has got to be something more important than the silly job they’re working on.</p>
</blockquote>
<h3>Let them work in peace</h3>
<p>The main idea is that building software involves building abstract ideas. The developer is then in a fragile state of <em>flow</em>.</p>
<ul>
<li>Give them a nice, quiet place to think.</li>
<li>Don’t let them be interrupted in their work at any time (including with your own visits). Be mindful of the effect of meetings, telephone, emails, etc.</li>
</ul>
<h1></h1>
<p>The authors actually devote a full part of the book to the workspace. This is reinforced by Joel Spolsky, for instance in 2000 with <a href="http://www.joelonsoftware.com/articles/fog0000000068.html">Where do These People Get Their (Unoriginal) Ideas?</a> and in 2006 with <a href="http://www.joelonsoftware.com/articles/FieldGuidetoDevelopers.html">A Field Guide to Developers</a>.</p>
<h3>Help them make progress</h3>
<ul>
<li>Trust people: let them be autonomous after you’ve entrusted them with your job.</li>
<li>Use deadlines so they see the work progresses in the right direction.</li>
<li>Grow teams: when people inside the team feel safe, with no competition, they’ll naturally coach each other and share knowledge.</li>
<li>Facilitate learning.</li>
</ul>
<h3>Reward</h3>
<ul>
<li>Make people feel involved.</li>
<li>Make them see the work progressing with small part goals.</li>
<li>Use tests for private self-assessment.</li>
<li>Avoid creating competition through bonuses tied to performance.</li>
</ul>
<h2>Conclusion</h2>
<p>The authors tell some stories and give supporting data to make their point. I think they might go a bit too far at times, for instance when they insist on making the workplace a <em>community</em>: some people may like it, but some may not. In any case, I believe I would work better in the environment they detail along the pages.</p>
<p>If you’re still not convinced whether you should read the book, there’s a more classic review <a href="http://www.agilier.com/book-reviews/peopleware.html">here</a>, and thousands of reviews on <a href="https://www.goodreads.com/book/show/67825.Peopleware">goodreads</a>.</p>
<p>Please share your comments or relevant articles on <a href="http://www.reddit.com/r/programming/comments/2sk60r/about_peopleware_productivity_and_how_to_care_for/">Reddit</a>. I’d like to write a follow-up article with some practical examples, eg a company/project failure or success due to a specific sociological factor.</p>Andrew Ng about Deep Learning at Paris ML Meetup2014-06-21T00:00:00+02:00Lucytag:lucy24.bitbucket.io,2014-06-21:andrew-ng-about-deep-learning-at-paris-ml-meetup.html<p>The last <a href="http://www.meetup.com/Paris-Machine-learning-applications-group/events/159577492/">Paris Machine Learning meetup #12</a>, hosted at Google Paris, was actually held Europe wide, together with London, Berlin and Zurich <span class="caps">ML</span> meetups. <a href="https://twitter.com/AndrewYNg">Andrew Ng</a> was the guest star, available from San Francisco through Hangout. You can watch the video of the entire meetup, which is <a href="http://www.youtube.com/watch?v=DBD6pKY7kFo">available on YouTube</a>, but make yourself comfortable because it’s almost 3h30 long. Here I will only write about Andrew Ng’s talk and the first set of questions he was asked, that is only a bit more than half-an-hour.
<p align='center'><iframe width="560" height="315" src="//www.youtube.com/embed/DBD6pKY7kFo?start=2067" frameborder="0" allowfullscreen></iframe></p></p>
<h2>Talk summary</h2>
<p>Andrew Ng talked about <a href="http://en.wikipedia.org/wiki/Deep_learning">deep learning</a>, a subject on which he’s been involved a lot with his teams, and which he describes as “our best shot at progress towards real <span class="caps">AI</span>”.</p>
<p>In the traditional learning framework, there are 3 steps:</p>
<ul>
<li>take an input, </li>
<li>design <span class="amp">&</span> extract features, </li>
<li>feed a learning algorithm. </li>
</ul>
<h1></h1>
<p>The idea behind deep learning is driven by the “one learning algorithm” hypothesis, i.e. the idea that there must be somehow an algorithm that could learn to process almost any type of data. Our brain is capable of very impressive <a href="http://en.wikipedia.org/wiki/Cross_modal_plasticity">rewiring</a> to reuse areas of the cortex for different kinds of learning, when a sensor is disconnected. There must be something in common in the way our brain learns to process the different channels.</p>
<p>A way to implement that is with <a href="http://en.wikipedia.org/wiki/Representation_learning">representation learning</a>, that is try to learn the features. Andrew Ng described how sparse coding is a useful way to learn features, not only for images, but also applicable to audio. And you can repeat this to build feature hierarchies.</p>
<p>After observing that this kind of system worked ever better when increasing the number of features, the idea was to scale up, <em>really</em>. He started working on neural networks with millions of parameters, with the <a href="http://en.wikipedia.org/wiki/Google_Brain">Google Brain project</a>. They made it scale up to 1 billion parameters, and famously made the neural network watch YouTube for a week. It learnt the concepts of faces <span class="amp">&</span> <a href="www.nytimes.com/2012/06/26/technology/in-a-big-network-of-computers-evidence-of-machine-learning.html">cats</a>. They were able to ship new products with the same technology.</p>
<p>The next question was: how to make it more easily available, i.e. without needing the huge Google infrastucture ? In a word: <a href="http://cs.stanford.edu/people/ang/?portfolio=deep-learning-with-cots-hpc-systems">use GPUs</a>.</p>
<p>For future work, Andrew Ng explained that deep learning has been used in practical application mostly with <a href="http://en.wikipedia.org/wiki/Supervised_learning">supervised learning</a> — to exploit the large amount of available labeled data accompanying the digitization of our society. It is an interesting feature of deep learning algorithms that it keeps getting better and better with more data.
He pointed to the fact that there’s been an underinvestment on unsupervised learning. The obvious reason is that it is hard. However, this is probably nearer to how we learn. He gave the example of how we teach a child to recognize a car: you won’t point to him tens of thousands of cars, however loving a parent you are! A few labeled examples are enough. Most of the learning is unsupervised.</p>
<p>About his own future work, Andrew Ng explained that, after Coursera, he wants to spend more time working on machine learning, GPUs and <span class="caps">AI</span>, which is what he’ll be doing at Baidu.</p>
<h2>Questions</h2>
<p>Andrew Ng then proceeded to answer the questions asked on <a href="http://www.google.com/moderator/#16/e=216d98">Google moderator</a>.</p>
<p><strong> 1. “Could you give your top 3 most promising topics in machine learning ?”</strong>
The first answer was, “unsupervised learning”. Then, about supervised learning, he mentioned the importance of giving tools and making infrastructures easily available to teams, and then listed “speech recognition” and “language embedding”.</p>
<p><strong> 2. “Your introductory course to <span class="caps">ML</span> at coursera was really great. Will you teach an advanced <span class="caps">ML</span> course at coursera with latest techniques around Convolutional Neural Networks, Deep Learning etc. ?”</strong>
He’s not sure how he’ll find the time to do it, but he thinks about it and wishes to do so.</p>
<p><strong> 3. “How do you see the job of a Data Scientist in the future?”</strong>
The increase in digital activities that create data and the rapid drop in computational cost are at the origin of the “big data” trend. As long as these two phenomena continue, the demand for data scientists will grow, and don’t worry, deep learning won’t replace them any time soon. This is an exciting discipline. Data science creates value.</p>
<p><strong> 4. “What are common use-cases where re-sampling (e.g. bootstrapping) is not sufficient for estimating distributions and considering the whole (Big)Data set is a real advantage?”</strong>
Large neural networks need lots of data. When you have a lot of parameters, with a lot of flexibility in the model, booststrapping doesn’t help. With high <span class="caps">VC</span>-dimension, it is simply better to increase the size of the data set.</p>
<p><strong> 5. “What will be the next “killer application” of Deep Learning after visual object recognition and speech recognition?”</strong>
Thinks that’s speech recognition. Vision <span class="amp">&</span> language are still to come.</p>
<p><strong> 6. “How do you see the gap between the research and practical implementation of <span class="caps">ML</span> algorithms?”</strong>
You should minimize this gap. Have researcher for the innovative ideas, but avoid steps between researchers and production implementation. The same person does the research <span class="amp">&</span> works with the product team.</p>
<p><strong> 7. “What is it that you find most difficult in machine learning?”</strong>
Innovation. Innovation requires teamwork. This entails employee development and teaching, to empower people to innovate “like crazy”.</p>
<p>I’m partial to question n°7 since I’m the one who asked it. I really like his answer, now it’s no wonder why he founded Coursera.</p>
<h1>Take-away</h1>
<ul>
<li>
<p>Deep learning is not a new fad. The theory behind it is decades old, it’s the result of years of research, and it’s booming due to hardware improvements. It’s not pure chance that it works so well. And there’s still research to do to make it even better.</p>
</li>
<li>
<p>More data <span class="amp">&</span> more computational power make for better performance. <span class="caps">OK</span>. No intelligence required? It seems it’s not that obvious.</p>
</li>
<li>
<p>Keep in mind that innovation is at the core of a researcher’s work. And <em>that</em> is the most difficult. Choose/educate your team well. Share knowledge.</p>
</li>
<li>
<p><a href="https://twitter.com/ylecun">Yann LeCun</a> had a different approach to introducing deep learning for his talk at <span class="caps">ESIEE</span> a few days before Andrew Ng. Maybe I’ll write about it later.</p>
</li>
</ul>
<p>Please share your thoughts about this post and the talk on <a href="http://www.reddit.com/r/MachineLearning/comments/293dps/andrew_ng_about_deep_learning_at_paris_ml_meetup/">Reddit</a>.</p>On survey bias2014-04-27T00:00:00+02:00Lucytag:lucy24.bitbucket.io,2014-04-27:on-survey-bias.html<p>How do you bias a survey to get just the result you want?</p>
<h2>Bias the device</h2>
<p>Here’s how <span class="caps">SNCF</span> does it. They put some kind of device in the new renovated Saint-Lazare station. The display invites passers-by to tell how much they love the new station (of course, it <em>is</em> beautiful, it’s brand new, full of natural light, and though we suffered a lot with years of works, it was worth the pain). You have two choices : either click on a pink button with a big heart shape (saying, I love it), or take a picture of a <span class="caps">QR</span> code “to explain why you don’t love it”.</p>
<p align='center'><img src="https://lucy24.bitbucket.io/images/sncf_love.jpg" width=300 align='center' /></p>
<p>The surest way to get more than 90% approval.</p>
<h2>Bias the questionnaire</h2>
<p>But it gets better. After clicking a few times on the button (ok, maybe they handle that kind of childish behavior), I scanned the <span class="caps">QR</span> code. There, after waiting for long seconds, I was retargeted to a page saying “3221 people love the new station, and you?” with… a button to say “I love it”, and a smaller one to go to a new page to enter a message. All in a positive tone (help us improve!) So cute.</p>
<p>I left a message saying something about statistics and fiability. For now, I have just received the standard reply, with a thank you.</p>
<p align='center'><img src="https://lucy24.bitbucket.io/images/sncf_reply1.png" width=500 align='center' /></p>
<h2>What is it good for?</h2>
<p>From the url linked by the <span class="caps">QR</span> code, I found their campaign was using <a href="http://www.myfeelback.com/en">MyFeelBack</a> solutions. So there are some customer feedback professionals making this kind of survey, and there are people making money. Well, I can only hope they take into account the bias introduced in their procedure when they analyze the result. How can they do this?</p>
<ul>
<li>compare the number of clicks with the number of people coming to the station everyday (or, if they have the figure, the number that can pass near the device),</li>
<li>add a new device with a random question and estimate how much people want to click on it,</li>
<li>count the number of customers from which you can expect feedback with a button vs. a <span class="caps">QR</span> code and a form,</li>
<li>only take the written feedback into account.</li>
</ul>
<p>Maybe the device is not entirely useless, after all? What do you think?</p>Introduction à Python super-facile2013-11-30T00:00:00+01:00Lucytag:lucy24.bitbucket.io,2013-11-30:introduction-a-python-super-facile.html<h1>Premiers pas</h1>
<p><em>Remarque : J’ai écris ce tuto il y a très longtemps, et je ne l’ai jamais publié… mais il peut servir alors je le mets là.</em></p>
<h2>1. Installer Python</h2>
<p>Pour commencer, nous allons installer le minimum vital, installer uniquement des outils basiques. Nous verrons plus tard qu’il est possible d’utiliser des outils plus performants, et plus pratiques, mais pour faire ses premiers pas en programmation, c’est un peu compliqué.</p>
<p>Je suppose que vous êtes sous Windows, et mes exemples utiliseront Windows 7.</p>
<p>Nous allons donc commencer par installer Python : c’est bien le minimum nécessaire pour utiliser ce langage de programmation, la librairie standard, l’interpréteur. Nous allons donc pour commencer sur la page <a href="http://www.python.org/download/">www.python.org/download/</a>. Il y a plein de versions disponibles :
<p align='center'><img src="https://lucy24.bitbucket.io/images/easy_python/DownloadPythonPage.png" width=1000 align='center' /></p></p>
<p>Je vous conseille de prendre la dernière version (3.3.3 au moment où j’écris), avec un installeur <span class="caps">MSI</span> (pour Windows, donc) 64bits (si vous n’êtes pas sûr d’avoir une machine 64bits, prenez la version X86 tout court).</p>
<p align='center'><img src="https://lucy24.bitbucket.io/images/easy_python/DownloadPythonAsk.png" align='center' /></p>
<p>Cliquez sur le lien, puis sur enregistrer.
Exécutez l’installeur en double-cliquant sur le fichier <code>python-3.3.3.amd64.msi</code>.
<p align='center'><img src="https://lucy24.bitbucket.io/images/easy_python/InstallPythonAsk.png" align='center' /></p>
Windows demande confirmation avant d’éxécuter, par sécurité : on fait confiance à la Python Software Foundation, et le fichier a été téléchargé directement depuis www.python.org, donc on peut l’éxécuter en toute confiance : cliquez sur <code>Exécuter</code>.</p>
<p>Windows demandera une seconde fois de confirmer après la configuration de l’installation. Pour l’instant, il n’y a qu’à suivre les instruction d’installations :</p>
<ul>
<li>installer pour tous les utilisateurs ou non ? Choisissez seulement votre utilisateur si vous n’êtes pas sur votre propre ordinateur.
<p align='center'><img src="https://lucy24.bitbucket.io/images/easy_python/InstallPython1AskUser.jpg" align='center' /></p></li>
<li>emplacement par défaut : c’est le répertoire où l’installeur va copier tous les fichiers nécessaires au fonctionnement de Python. Pas besoin de changer.
<p align='center'><img src="https://lucy24.bitbucket.io/images/easy_python/InstallPython2Place.jpg" align='center' /></p></li>
<li>Personnalisation de l’installation : cocher en plus la seule option qui n’est pas mise par défaut, pour ajouter python.exe à votre path.
<p align='center'><img src="https://lucy24.bitbucket.io/images/easy_python/InstallPython3Custom.jpg" align='center' /></p>
<p align='center'><img src="https://lucy24.bitbucket.io/images/easy_python/InstallPython4Custom.jpg" align='center' /></p></li>
<li>Puis plus rien à faire, juste attendre un peu et cliquer sur <code>Finish</code>.
<p align='center'><img src="https://lucy24.bitbucket.io/images/easy_python/InstallPython5Wait.jpg" align='center' /></p>
<p align='center'><img src="https://lucy24.bitbucket.io/images/easy_python/InstallPython5Finish.jpg" align='center' /></p></li>
</ul>
<h2>2. Utiliser la console Python</h2>
<p>Une fois Python installé, la première chose est de tester que ça fonctionne !
Aller dans le menu démarrer, chercher et cliquer sur <code>Python (command line)</code>.
<p align='center'><img src="https://lucy24.bitbucket.io/images/easy_python/StartPythonCmdLine.png" align='center' /></p></p>
<p>La console Python démarre : la première ligne affiche la version de Python installée (donc ici Python 3.3.3, version 64 bits).
<p align='center'><img src="https://lucy24.bitbucket.io/images/easy_python/StartPythonCmdLine2.png" align='center' /></p></p>
<p>Tester une première commande, selon la tradition des tutoriaux de programmation, nous allons saluer le monde (mais en français), et plus précisément le monde de Python : taper <code>print("Bonjour, Python !")</code>.</p>
<p align='center'><img src="https://lucy24.bitbucket.io/images/easy_python/StartPythonCmdLine3.png" align='center' /></p>
<p>Bravo, vous avez installé Python avec succès ! Nous allons pouvoir passer aux choses sérieuses et apprendre à programmer !</p>
<h3>Pour jouer avec :</h3>
<ul>
<li>Remplacez les guillemets doubles par des guillemets simples : c’est pareil !</li>
<li>Ecrivez une autre phrase.</li>
<li>Essayez d’enlever les guillemets : <code>print(Bonjour, Python !)</code> : cela fait une erreur au niveau du point d’exclamation : <code>SyntaxError: invalid syntax</code>. Et si on enlève le point d’exclamation ? Une autre erreur : <code>NameError: 'Bonjour' is not defined</code>. On pourrait expliquer dans les détaills mais pour commencer, il faut retenir que si on ne met pas les guillemets, Python cherche à interpréter autrement les caractères que l’on écrit.</li>
<li>Essayez en commençant avec un guillemet double et en terminant avec un guillemet simple, que se passe-t-il ?</li>
<li>Essayez avec des caractères spéciaux</li>
<li>Essayez en écrivant ‘Bonjour,\nmonde’, ‘Bonjour\tmonde’ : à quoi servent ‘\n’ et ‘\t’ ?</li>
</ul>
<h3>Pour comprendre : quelques explications.</h3>
<p><code>print</code> est une fonction standard de Python, qui prend une chaîne de caractères et l’affiche dans la console. Une chaîne de caractères en Python est signalée par des guillemets simples (touche 4 <code>'</code>) ou doubles (touche 3 <code>"</code>).
On appelle caractère tout ce qu’on utilise quand on écrit : les lettres (abcdefghijklmnop…), les chiffres (0123456789), les signes de ponctuation (,?:!;), les symboles mathématiques (+-*/), par exemple, mais il en existe beaucoup plus (%ùàç€&$…). Si vous êtes curieux, vous pouvez lire l’article de <a href="http://fr.wikipedia.org/wiki/Caract%C3%A8re_%28informatique%29">Wikipédia sur les caractères informatiques</a>.</p>
<p>La plupart du temps, on n’utilise pas un caractère tout seul, mais plutôt un mot ou une phrase. Pour dire à Python qu’on veut un mot ou une phrase, c’est-à-dire une “chaîne de caractères”, on les met ensemble entre guillemets, comme dans notre exemple : “Bonjour, Python !”. L’interpréteur Python sait alors que cette chose qu’on lui fait lire est une chaîne de caractères, et pas autre chose.</p>
<h2>3. Un premier script</h2>
<p>Pour écrire des scripts de façon très simple, il y a un éditeur qui est fourni avec l’installeur de Python : <span class="caps">IDLE</span> (Python <span class="caps">GUI</span>).</p>
<ul>
<li><span class="caps">GUI</span>, ça veut dire quoi ? C’est de l’anglais pour “Graphical User Interface”, en français on dit une “interface graphique”. En fait, quand on a pas d’interface graphique, ça veut dire qu’on est dans une console. Sous Windows, vous utilisez l’écrasante majorité des logiciels avec une interface graphique.</li>
</ul>
<p>Créez un répertoire sur votre ordinateur dans lequel vous allez mettre tous les fichiers liés à ce tutoriel (par exemple dans Mes Documents, un répertoire “IntroPython”).</p>
<p>Dans la fenêtre ‘Python 3.3.3 Shell’, cliquer sur File->New File, cela ouvre une autre fenêtre dans laquelle vous allez pouvoir écrire votre premier script. Tapez : print(“Bonjour, monde !”), puis sauvegardez le fichier en sélectionnant bien votre répertoire de travail (“IntroPython”).</p>
<p>Il faut maintenant exécuter le script. Pour cela, dans le menu de l’éditeur, cliquez sur ‘Run’, puis ‘Run Module’. Ou alors, encore plus simple, appuyez sur la touche F5. Voilà ce qui doit s’afficher dans la fenêtre “Shell” :</p>
<div class="highlight"><pre><span class="o">>>></span> <span class="o">================================</span> <span class="n">RESTART</span> <span class="o">================================</span>
<span class="o">>>></span>
<span class="n">Bonjour</span><span class="p">,</span> <span class="n">monde</span> <span class="err">!</span>
</pre></div>
<p>On va essayer de faire un peu mieux. Effacez la ligne déjà écrites et copiez à la place les lignes suivantes :</p>
<div class="highlight"><pre><span class="k">print</span><span class="p">(</span><span class="s">"Bonjour, comment t'appelles-tu ?"</span><span class="p">)</span>
<span class="n">chaine1</span> <span class="o">=</span> <span class="nb">input</span><span class="p">()</span>
<span class="k">print</span><span class="p">(</span><span class="n">chaine1</span><span class="p">,</span> <span class="s">", quel joli nom !"</span><span class="p">,</span> <span class="n">sep</span><span class="o">=</span><span class="s">''</span><span class="p">)</span>
</pre></div>
<h3>Pour comprendre :</h3>
<p><code>print</code> est une <strong>fonction</strong> python, jusqu’à présent on lui passait en argument juste un chaîne de caractères, mais ici, à la troisième ligne, on voit qu’on peut lui en passer plusieurs. Chaque chaîne passée est affichée, en les séparants par la chaîne indiquée par <code>sep=''</code>, ici, une chaîne vide, donc les chaînes sont collées. <code>input</code> est aussi une fonction, et comme elle ne prend pas de paramètres, on l’appelle avec des parenthèses vides : <code>input()</code>.</p>
<p><code>chaine1</code> est une <strong>variable</strong>, elle permet d’enregistrer une valeur et de la réutiliser plus loin. Ici, on l’initialise avec ce que nous renvoie la fonction <code>input</code>, c’est-à-dire une chaîne entrée par l’utilisateur dans la console. Ensuite, on l’utilise pour afficher cette chaîne.</p>
<h2>4. Un premier jeu</h2>
<p>A partir du premier script, il est très facile de faire un quizz. Posez une question, vérifiez si la réponse est bonne, et comptez les points.</p>
<p>Par exemple :</p>
<div class="highlight"><pre><span class="sd">"""</span>
<span class="sd">Un jeu de quizz</span>
<span class="sd">Le programme pose des questions,</span>
<span class="sd">l'utilisateur répond dans la console,</span>
<span class="sd">le programme compare sa réponse avec la bonne réponse</span>
<span class="sd">le programme ajoute 1 point par bonne réponse.</span>
<span class="sd">"""</span>
<span class="c"># On commence avec aucun point</span>
<span class="n">points</span> <span class="o">=</span> <span class="mi">0</span>
<span class="c"># Question 1</span>
<span class="c"># Affiche la question</span>
<span class="k">print</span><span class="p">(</span><span class="s">"1. Quelle est la capitale de la France ?"</span><span class="p">)</span>
<span class="c"># Récupère la réponse entrée par l'utilisateur dans une variable appelée capitale</span>
<span class="n">capitale</span> <span class="o">=</span> <span class="nb">input</span><span class="p">()</span>
<span class="c"># Compare la réponse de l'utilisateur avec la bonne réponse, "Paris"</span>
<span class="k">if</span> <span class="n">capitale</span> <span class="o">==</span> <span class="s">"Paris"</span><span class="p">:</span>
<span class="c"># Donne un point si la réponse est bonne</span>
<span class="n">points</span> <span class="o">=</span> <span class="n">points</span> <span class="o">+</span> <span class="mi">1</span>
<span class="k">print</span><span class="p">(</span><span class="s">"Bravo, bonne réponse !"</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">print</span><span class="p">(</span><span class="s">"Erreur ! La bonne réponse est : Paris."</span><span class="p">)</span>
<span class="k">if</span> <span class="n">points</span> <span class="o">></span> <span class="mi">1</span><span class="p">:</span>
<span class="k">print</span><span class="p">(</span><span class="s">"Score :"</span><span class="p">,</span> <span class="n">points</span><span class="p">,</span> <span class="s">"points"</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">print</span><span class="p">(</span><span class="s">"Score :"</span><span class="p">,</span> <span class="n">points</span><span class="p">,</span> <span class="s">"point"</span><span class="p">)</span>
</pre></div>
<h4>Pour comprendre</h4>
<p>On apprend plusieurs choses avec ce tout petit bout de programme.</p>
<ul>
<li>En Python, il y a deux façons de faire des <strong>commentaires</strong> dans son code :<ul>
<li>pour faire un commentaire sur plusieurs lignes, on utilise des triples guillemets <code>"""</code> pour indiquer le début et la fin d’un commentaire,</li>
<li>pour faire un commentaire sur une seule ligne, il suffit de commencer la ligne par le symbole dièse : <code>#</code> (touches <code>Alt Gr</code> + <code>3</code>).</li>
</ul>
</li>
<li>On utilise deux <strong>variables</strong> :<ul>
<li>une variable pour stocker la réponse donnée par l’utilisateur. Ici, on l’appelle <code>capitale</code>. On aurait pu l’appeler <code>reponse1</code>. Ce qui est important, c’est de donner un nom qui permet de comprendre à quoi sert cette variable. Comme on y met une chaine de caractères (la réponse de l’utilisateur entrée dans la console), cette variable est de type “chaîne”. </li>
<li>une variable pour stocker le nombre de points accumulés par le joueur, autrement dit, son score. Au départ, c’est zéro, et on l’augmente de 1 point à chaque fois qu’il répond bien. Les scores possibles sont donc 0, 1, 2, … mais jamais 0,5 ou 1,75. Notre score est forcément un nombre entier. La variable <code>points</code> est donc de type entier, en anglais on dit <em>integer</em>, et en programmation on écrit souvent <code>int</code>.</li>
</ul>
</li>
<li>On fait un <strong>test avec le mot-clé <code>if</code></strong>, en écrivant une “condition”, et en terminant le test par un double point <code>:</code>. <ul>
<li>Les lignes à exécuter dans le cas où la condition est vraie sont écrites sur les lignes suivantes, avec une tabulation. Cette tabulation est importante, et c’est une des caractéristiques de Python. Vous pouvez utiliser des tabulations ou des espaces, mais vous devez respecter toujours le même alignement. Si vous vous trompez d’un espace, vous aurez une erreur (essayez !). On parle aussi d’<strong>indentation</strong></li>
<li>Ici la condition est une comparaison avec <code>==</code> : Python va comparer le contenu de <code>capitale</code> avec la chaîne <code>"Paris"</code>, et renvoyer <code>True</code> si capitale contient exactement la chaîne <code>"Paris"</code> (il ne faut pas se tromper sur la majuscule !).</li>
<li>Si la condition est fausse (elle vaut <code>False</code>), c’est ce qui est après <code>else:</code> qui est exécuté (toujours avec la nécessité de bien aligner les lignes d’instructions).</li>
</ul>
</li>
<li>On peut <strong>changer la valeur</strong> de la variable <code>points</code> très facilement : il suffit d’écrire <code>points = <autre chose></code><ul>
<li>en écrivant <code>points = points + 1</code>, on prend la valeur de <code>point</code> (<code>0</code>, dans notre programme), on y ajoute 1, et on met cette nouvelle valeur dans <code>point</code>.</li>
</ul>
</li>
</ul>
<h4>Pour jouer avec</h4>
<p>Que se passe-t-il si au lieu de répondre exactement “Paris”, quelqu’un répond, “<span class="caps">PARIS</span>” ? Est-ce que c’est faux ? Non, il a juste utilisé des majuscules. Il connaît la capitale de la France. Mais notre programme lui dit qu’il se trompe. Pour changer ça, il faudrait pouvoir faire en sorte de comparer les lettres sans tenir compte du fait que ce sont des majuscules ou des minuscules. Une idée ? Une façon de faire ça, c’est de convertir <code>capitale</code> en majuscules avant de faire la comparaison :</p>
<div class="highlight"><pre><span class="k">if</span> <span class="n">capitale</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> <span class="o">==</span> <span class="s">"PARIS"</span><span class="p">:</span>
<span class="c"># Donne un point si la réponse est bonne</span>
<span class="n">points</span> <span class="o">=</span> <span class="n">points</span> <span class="o">+</span> <span class="mi">1</span>
<span class="k">print</span><span class="p">(</span><span class="s">"Bravo, bonne réponse !"</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">print</span><span class="p">(</span><span class="s">"Erreur ! La bonne réponse est : Paris."</span><span class="p">)</span>
</pre></div>
<p>Pratique : la fonction <code>upper</code>, appliquée à une chaîne de caractères, la convertit tout en majuscules ! Et pareil, il existe <code>lower</code> qui convertit tout en minuscules.</p>
<p>Mais, si quelqu’un est un peu bavard et répond : “C’est Paris !”, notre programme va encore lui dire qu’il se trompe. Comment faire ? Deux solutions : soit on précise à l’utilisateur qu’on ne veut que la réponse, et pas une phrase (on précise la consigne), soit on modifie notre programme pour qu’il comprenne la réponse. S’il trouve le mot “Paris” dans la réponse, c’est bon ! Python nous permet d’exprimer très facilement cette condition :</p>
<div class="highlight"><pre><span class="k">if</span> <span class="s">"PARIS"</span> <span class="ow">in</span> <span class="n">capitale</span><span class="o">.</span><span class="n">upper</span><span class="p">():</span>
<span class="c"># Donne un point si la réponse est bonne</span>
<span class="n">points</span> <span class="o">=</span> <span class="n">points</span> <span class="o">+</span> <span class="mi">1</span>
<span class="k">print</span><span class="p">(</span><span class="s">"Bravo, bonne réponse !"</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">print</span><span class="p">(</span><span class="s">"Erreur ! La bonne réponse est : Paris."</span><span class="p">)</span>
</pre></div>
<p>On peut presque lire en traduisant littéralement : Si <code>"PARIS"</code> est dans <code>capitale.upper()</code>, alors…</p>
<p>Et si je teste avec une réponse de bavard :</p>
<div class="highlight"><pre><span class="o">>>></span>
<span class="mf">1.</span> <span class="n">Quelle</span> <span class="n">est</span> <span class="n">la</span> <span class="n">capitale</span> <span class="n">de</span> <span class="n">la</span> <span class="n">France</span> <span class="err">?</span>
<span class="n">c</span><span class="s">'est paris</span>
<span class="n">Bravo</span><span class="p">,</span> <span class="n">bonne</span> <span class="n">réponse</span> <span class="err">!</span>
<span class="n">Score</span> <span class="p">:</span> <span class="mi">1</span> <span class="n">point</span>
</pre></div>
<p>Il est facile d’ajouter de nouvelles questions, à vous d’être inventif ! Faites attention à bien compter les points, vérifiez en affichant le score après chaque réponse.</p>
<h4>Pour aller plus loin</h4>
<p>Pour ajouter des nouvelles questions, on peut copier-coller le code et changer les questions. Très vite, le code va être très très long, alors que, finalement, on fait toujours la même chose : afficher une question, récupérer la réponse, comparer avec la vraie réponse, compter les points.
Un des grands principes en programmation, c’est de <strong>ne pas se répéter</strong>. En anglais, <em>don’t repeat yourself</em>, c’est-à-dire : <span class="caps">DRY</span>.</p>
<p>Comment faire ici ?</p>
<p>D’abord on voudrait pouvoir représenter une paire question-réponse. Une paire, c’est une liste de longueur fixe égale à 2. En Python, on peut représenter ça par ce qu’on appelle un tuple : un certain nombre de valeurs, séparées par des virgules, forment un tuple. On peut mettre des parenthèses autour pour mettre en évidence le fait que ces objets vont ensemble. Par exemple :</p>
<div class="highlight"><pre><span class="s">"Quelle est la capitale de la France ?"</span><span class="p">,</span> <span class="s">"Paris"</span>
</pre></div>
<p>peut aussi se noter :</p>
<div class="highlight"><pre><span class="p">(</span><span class="s">"Quelle est la capitale de la France ?"</span><span class="p">,</span> <span class="s">"Paris"</span><span class="p">)</span>
</pre></div>
<p>On peut maintenant représenter une paire question-réponse, mais dans un quizz, on voudrait en avoir plusieurs. Nous allons donc utiliser une autre structure de Python, la liste. Une liste regroupe un ensemble de variables qui ont le même type. Nous reviendrons plus tard sur ce qu’on peut faire avec des listes. Pour l’instant, nous allons juste faire une liste de questions-réponses :</p>
<div class="highlight"><pre><span class="n">question_reponses</span> <span class="o">=</span> <span class="p">[(</span><span class="s">"Quelle est la capitale de la France ?"</span><span class="p">,</span> <span class="s">"Paris"</span><span class="p">),</span>
<span class="p">(</span><span class="s">"Quelle est la monnaie du Japon ?"</span><span class="p">,</span> <span class="s">"Yen"</span><span class="p">),</span>
<span class="p">(</span><span class="s">"Dans quelle ville ont eu lieu les Jeux Olympiques d'été en 2012 ?"</span><span class="p">,</span> <span class="s">"Londres"</span><span class="p">),</span>
<span class="p">]</span>
</pre></div>
<p>Une fois qu’on a cette liste de questions, on veut exécuter notre programme pour chaque paire de questions réponses. Pour afficher la liste des questions et des réponses, on peut faire :</p>
<div class="highlight"><pre><span class="k">for</span> <span class="n">question</span><span class="p">,</span> <span class="n">vraie_reponse</span> <span class="ow">in</span> <span class="n">question_reponses</span><span class="p">:</span>
<span class="c"># Affiche la question</span>
<span class="k">print</span><span class="p">(</span><span class="n">question</span><span class="p">)</span>
<span class="c"># Affiche la réponse</span>
<span class="k">print</span><span class="p">(</span><span class="n">vraie_reponse</span><span class="p">)</span>
</pre></div>
<p>Et voilà, vous avez fait votre première boucle <code>for</code> ! Comme on sait que notre liste contient des tuples (des paires), on peut récupérer directement chaque élément sous forme de paire <code>question, vraie_reponse</code> (on crée directement deux variables).
Une “boucle”, comme son nom l’indique, consiste à répéter les mêmes instructions un certain nombre de fois (en boucle). Ici, avec la boucle <code>for</code> (<em>pour</em>, en français), on répète les instructions <em>pour chaque</em> élément de la liste <code>question_reponses</code>. Le double point <code>:</code>, et l’indentation, c’est exactement comme avec le test <code>if</code>.</p>
<p>On peut maintenant réécrire le programme pour qu’il pose plus de questions. C’est encore plus facile de poser des questions !</p>
<p>Encore quelques petites améliorations :</p>
<ul>
<li>pour faire plus joli, j’ai ajouté une numérotation. La fonction <code>enumerate</code> permet de renvoyer l’indice de la position de chaque élément de la liste, en plus de l’élément…</li>
<li>au lieu d’écrire <code>points = points + 1</code>, ce qui est bien trop long, on peut écrire <code>points += 1</code> :-).</li>
</ul>
<p>Nous avons donc pour terminer le script suivant :</p>
<div class="highlight"><pre><span class="sd">"""</span>
<span class="sd">Un jeu de quizz</span>
<span class="sd">Le programme pose des questions,</span>
<span class="sd">l'utilisateur répond dans la console,</span>
<span class="sd">le programme compare sa réponse avec la bonne réponse</span>
<span class="sd">le programme ajoute 1 point par bonne réponse</span>
<span class="sd">"""</span>
<span class="c"># On commence avec aucun point</span>
<span class="n">points</span> <span class="o">=</span> <span class="mi">0</span>
<span class="n">question_reponses</span> <span class="o">=</span> <span class="p">[(</span><span class="s">"Quelle est la capitale de la France ?"</span><span class="p">,</span> <span class="s">"Paris"</span><span class="p">),</span>
<span class="p">(</span><span class="s">"Quelle est la monnaie du Japon ?"</span><span class="p">,</span> <span class="s">"Yen"</span><span class="p">),</span>
<span class="p">(</span><span class="s">"Dans quelle ville ont eu lieu les Jeux Olympiques d'été en 2012 ?"</span><span class="p">,</span> <span class="s">"Londres"</span><span class="p">),</span>
<span class="p">]</span>
<span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="p">(</span><span class="n">question</span><span class="p">,</span> <span class="n">vraie_reponse</span><span class="p">)</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">question_reponses</span><span class="p">):</span>
<span class="c"># Affiche la question</span>
<span class="k">print</span><span class="p">(</span><span class="n">i</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="s">"-"</span><span class="p">,</span> <span class="n">question</span><span class="p">)</span>
<span class="c"># Récupère la réponse entrée par l'utilisateur dans une variable appelée capitale</span>
<span class="n">reponse</span> <span class="o">=</span> <span class="nb">input</span><span class="p">()</span>
<span class="c"># Compare la réponse de l'utilisateur avec la bonne réponse, "Paris"</span>
<span class="k">if</span> <span class="n">vraie_reponse</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> <span class="ow">in</span> <span class="n">reponse</span><span class="o">.</span><span class="n">upper</span><span class="p">():</span>
<span class="c"># Donne un point si la réponse est bonne</span>
<span class="n">points</span> <span class="o">+=</span> <span class="mi">1</span>
<span class="k">print</span><span class="p">(</span><span class="s">"Bravo, bonne réponse !"</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">print</span><span class="p">(</span><span class="s">"Erreur ! La bonne réponse est :"</span><span class="p">,</span> <span class="n">vraie_reponse</span><span class="p">)</span>
<span class="k">if</span> <span class="n">points</span> <span class="o">></span> <span class="mi">1</span><span class="p">:</span>
<span class="k">print</span><span class="p">(</span><span class="s">"Score :"</span><span class="p">,</span> <span class="n">points</span><span class="p">,</span> <span class="s">"points"</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">print</span><span class="p">(</span><span class="s">"Score :"</span><span class="p">,</span> <span class="n">points</span><span class="p">,</span> <span class="s">"point"</span><span class="p">)</span>
</pre></div>
<p>You can download it <a href="https://bitbucket.org/snippets/lucy24/peb5Gz/script-facile-un-quizz">here</a>.</p>On recruiting in computer programming2013-11-20T00:00:00+01:00Lucytag:lucy24.bitbucket.io,2013-11-20:on-recruiting-in-computer-programming.html<p>When looking for some specific technical positions, finding the right candidate can become a nightmare. You want someone who can code right, of course. You also want someone with decent knowledge.
Conversely, if you’re looking for a job, you have probably noticed it’s quite difficult to convey all the depth and breadth of your knowledge in a classic resume.</p>
<p>Enter the Internet era: there’s plenty way to show off your skills <span class="amp">&</span> knowledge there. Here’s the idea: start a blog, answer questions on stackoverflow, become influent on twitter ; if you write open source code, you can show your Github account. Then give all that information to recruiters. If you’re the recruiter, ask the candidates to show you their Github account.</p>
<p>James Coglan wrote an interesting <a href="http://blog.jcoglan.com/2013/11/15/why-github-is-not-your-cv/">blog post</a> on why using Github as a Resume is not a good idea.
What he says is you will exclude people that may be competent programmers, but simply don’t have their code on Github :</p>
<blockquote>
<p>we’re creating a filter that means only people with copious leisure time and no other hobbies or commitments will end up in these jobs.
People have plenty of valid reasons not to spend their spare time on their job, and certainly most of the great programmers I’ve worked with aren’t big-time GitHubbers.</p>
</blockquote>
<p>Sure. Yet, hiring is difficult because one wants to see the candidate’s coding abilities. Coglan has some good advice there too:</p>
<blockquote>
<p>Fine, but how are we supposed to hire people?</p>
<p>The hard way. Sorry everyone, but it’s the best we’ve got. People’s problem-solving ability and reasoning can’t be surmised from reading the end result of those processes, you have to talk to them.
…
If you want to choose wisely, and fairly, stop demanding free work from people.</p>
</blockquote>
<p>Ironically, a few days after reading this, I saw a link to <a href="resume.github.io">resume.github.io</a> on Twitter. A lot of people were enthusiastically tweeting and linking to it. Obviously there exists a debate about about how to do hiring properly for computer programming positions.</p>
<p>In the same vein: looking at stackoverflow points. Personnally, I use <span class="caps">SO</span> a lot, and often find my answers there. I wish I’d have the time to answer more of them, but often answering a question needs quite a bit of digging, so I just can’t give more than a few hints.</p>
<p>Anyway, when recruiting, I’m sticking to the “hard way”… test people. For code, that’s point 11 in the <a href="http://www.joelonsoftware.com/articles/fog0000000043.html">Joel Test</a>, by the way.</p>Why “Miscellany”?2013-06-08T00:00:00+02:00Lucytag:lucy24.bitbucket.io,2013-06-08:why-miscellany.html<p>The idea of a “commonplace” is not new. I’ve taken the title “Miscellany” from Faraday. Here’s an excerpt from a <a href="http://books.google.fr/books?id=04xk5M168nEC&lpg=PA26&ots=R-mJeY6nw-&dq=By%20a%20great%20good%20fortune%2C%20in%201809%20he%20lighted%20on%20a%20book%20that%20had%20just%20been%20reprinted&hl=fr&pg=PA26#v=onepage&q=By%20a%20great%20good%20fortune,%20in%201809%20he%20lighted%20on%20a%20book%20that%20had%20just%20been%20reprinted&f=false">biography of Michael Faraday by Colin A. Russell</a>.</p>
<p align='center'><img src="https://lucy24.bitbucket.io/images/Faraday_book.jpg" width=200 align='center' /></p>
<blockquote>
<p>By a great good fortune, in 1809 he (Michael Faraday) lighted on a book that had just been reprinted […] Its title could not have been more appropriate: <em>The Improvement of the Mind</em>. It was a famous work by a man well known not as a philosopher or scientist but as a writer of hymn. […] Among this book’s recommendations were assiduous reading, attendance at lectures, correspondence with others of similar mind, formation of discussion groups, and the keeping of a “commonplace” book in which to record facts and opinions that might otherwise be forgotten. Within a few weeks the industrious Faraday had begun a commonplace book of his own, formidably entitled <em>The Philosophical Miscellany</em>.</p>
</blockquote>
<p>Let’s try this experiment, and see what we can learn on the way.</p>