Michel Vuijlsteke's weblog

Tales of Drudgery & Boredom.

Tag: python

Links van 24 november 2016 tot 11 december 2016

A boy wonder from the 1780s shows us where school maths gets it wrong – Medium
School maths lets students frisk around the edges of problem solving, but keeps them firmly rooted in the rote acquisition of disjointed knowledge.

The Dominance of Google and Facebook in One Chart
Over the next couple years, digital advertising is expected to pass television to become the largest ad market in existence. One would think that this simple fact should translate to a bright future for many publishers, but the reality seems to be quite different. That’s because digital advertising is increasingly dominated by just two players, and everyone else is just begging for scraps.

Geen links gespuis op de buis – De Standaard
‘Waarom bestijgt u nu zelf de kansel om de goegemeente te waarschuwen voor het gevaar van de PVDA, Gwendolyn? Hoe kunt u een pleidooi voor rechtvaardigheid en herverdeling van de maatschappelijke rijkdom gelijk stellen met extreemrechts racisme? Wat is er zo gevaarlijk aan de 30 urenweek, een minimum aan belasting voor multinationals, eerstelijnsgezondheidszorg of een miljonairstaks?’ De voorzitter antwoordde niet, tenzij u het kermen als een zieke labrador een vorm van antwoorden vindt. ‘Waarom maakt u zich niet druk over het Kazachgate-schandaal, of over het miljoenenverlies bij Merit Capital waar Open VLD’ers belangrijke functies hebben? Zoals Karel De Gucht, die twee jaar na zijn afscheid als Europees commissaris nog altijd 125.000 euro per jaar opstrijkt, plus nog eens 144.000 euro als bestuurslid voor ArcelorMittal. Zeg eens, Gwendolyn?’

Startup Growth Calculator
This tool calculates how much funding your startup needs. Assuming your expenses are constant and your revenue is growing, it shows when you'll reach profitability and how much capital you'll burn through before then. Once you're profitable, you control your destiny: you can raise more to grow faster if you want.

A Rebuttal For Python 3 / fuzzy notepad
Zed Shaw, your behavior here is fucking reprehensible. Half of what’s written here is irrelevant nonsense backed by a vague appeal to “mathematics”. Instead of having even the shred of humility required to step back and wonder if there are complicating factors beyond whether something is theoretically possible, you have invented a variety of conflicting and malicious motivations to ascribe to the Python project.

Links van 29 juli 2015 tot 7 augustus 2015

DUNE: The Insanely Complete 3-Hour Fan Cut
You think you’re a fan of Dune? Michael Warren has you beat. He put together this massive super-cut of David Lynch’s cult-classic 1984 film adaptation of Frank Herbert’s Dune comprised of footage from the original theatrical cut, the extended TV cut, and deleted scenes. This labor of fan love resulted in the following three-hour version. Originally done two years ago, an update earlier this year improved sound and video quality of the TV cut insertions.

The Five Characteristics of An Ideal SaaS Company – Redpoint Ventures
With more than 80% of venture capital investments occurring in enterprise and with the public markets disproportionately rewarding SaaS companies with huge enterprise value-to-revenue multiples (median is 7.6), it’s no surprise that interest Software-as-a-Service is booming. After meeting quite a few SaaS companies, I’ve compiled a list of my ideal characteristics for a SaaS business below.

Trello CSS Guide
Writing CSS is hard. Even if you know all the intricacies of position and float and overflow and z-index, it’s easy to end up with spaghetti code where you need inline styles, !important rules, unused cruft, and general confusion. This guide provides some architecture for writing CSS so it stays clean and maintainable for generations to come.

Why write Python in Visual Studio? – The Visual Studio Blog – Site Home – MSDN Blogs
Recently, Visual Studio 2015 was released with support for Python. Python Tools for Visual Studio (PTVS) are available to help throughout Visual Studio in all the places you’d expect, from editing and IntelliSense, to debugging, profiling, and publishing to Azure. You can find all the details and some video walkthroughs, documentation, and other resources on visualstudio.com, and the post announcing Python Tools 2.1 and Python Tools 2.2 beta. In this post I want to talk about some of the reasons to consider using Visual Studio next time you are working in Python.

Doing Terrible Things To Your Code
believe a key turning point in every professional programmer's working life is when you realize you are your own worst enemy, and the only way to mitigate that threat is to embrace it. Act like your own worst enemy. Break your UI. Break your code. Do terrible things to your software. This means programmers need a good working knowledge of at least the common mistakes, the frequent cases that average programmers tend to miss, to work against. You are tester zero. This is your responsibility.

Catholic-Hierarchy: Its Bishops and Dioceses, Current and Past
Current and historical information about its bishops and dioceses — heerlijke website

Links van 31 juli 2014 tot 9 augustus 2014

The War Photo No One Would Publish – The Atlantic
“It was one picture after another of a sunset with camels and a tank.”

An Empire of Stars » Lapsed Historian
As the V-2 disappeared into the distance the men of the AVKO couldn’t help but smile and cheer. Their delight was catching, and soon the rest of the soldiers and officers around the launchpad were cheering as well. British officers and soldiers. Because this was Operation Backfire, the beginning of something that most people don’t even know existed – the British Space Programme.

Python web scraping resource
If you need to extract data from a web page, then the chances are you looked for their API. Unfortunately this isn't always available and you sometimes have to fall back to web scraping. In this article I'm going to cover a lot of the things that apply to all web scraping projects and how to overcome some common gotchas.

I Refuse | Irwin E. Blank | Ops & Blogs | The Times of Israel
Erm, yeah. "I feel no need to apologize for refusing to allow myself to retain lands that were mine before your countries were born by imperialist wars and rivers of blood. When your ancestors were worshiping rocks and committing human sacrifice to please stone idols, mine were priests in the Temple of Solomon."

‘World stands disgraced’ as Israeli shelling of school kills at least 15 | World news | The Guardian
Fuckers. "The US, which has been at odds with Israel's prime minister, Binyamin Netanyahu, over efforts to secure a ceasefire, condemned the school shelling but did not specifically blame Israel."

Links van 10 april 2014 tot 13 april 2014

Amazon.com to Acquire comiXology | comiXology Unbound
Amazon.com today announced that it has reached an agreement to acquire comiXology, the company that revolutionized the digital comics reading experience with their immersive Guided View technology and makes discovering, buying, and reading comic books and graphic novels easier and more fun than ever before.

2048 Variants | Semi-long Blog
Here is a list of online variants scouted from github. For the record, that means that there are very few apps on this list, and only those that you can compile yourself. The majority of these links are intended to be accessed from the Internet.

Unpythonic Python – skien.cc
Warning: Very Unpythonic Python ahead. However, all code should work (with Python 2.7.5).

Homemade Toast: How to Make a Leak Proof Water Blob (without tape!)
Doen! Doen!

Tambora eruption caused the year without a summer: Cholera, opium, famine, and Arctic exploration.
As it turns out, however, the indirect ripple effects of Tambora—what climate scientists call “teleconnections”—were even more historically significant. Cholera, opium, and the Panic of 1819 are three examples; another is Arctic exploration.

Links van 24 februari 2014 tot 27 februari 2014

Depixelizing Pixel Art
Naïve upsampling of pixel art images leads to unsatisfactory results. Our algorithm extracts a smooth, resolution-independent vector representation from the image which is suitable for high-resolution display device

High Scalability – High Scalability – The WhatsApp Architecture Facebook Bought For $19 Billion
How do you support 450 million active users with only 32 engineers? Let’s find out…

The audacious rescue plan that might have saved space shuttle Columbia | Ars Technica
The untold story of the rescue mission that could have been NASA's finest hour.

Josh Haberman: On “The Future of JavaScript MVC Frameworks”
The article starts by noting that the React/Om library (which the author also wrote) is 2-4x faster than Backbone in "Benchmark 1" of TodoMVC, and about 800x faster than Backbone for Benchmark 2. This is followed with a profiling graph that shows Backbone making a ton of short-running function calls, where React/Om make many fewer calls that run longer.

Have you ever stared at a text file on the screen, hoping it would have been a database so you could ask anything you want about it? I had that feeling many times, and I've finally understood that it's not the database that I want. It's the language – SQL.

Links van 14 december 2011 tot 17 december 2011

Dirty Signs – I Want to Eat Your Lesbian Vagina – YouTube
Dirty Signs with Kristin! Today, we've got one for the ladies with the phrase, "I want to eat your lesbian vagina." Have a great night!

Bfxr. Make sound effects for your games.
Bfxr is an elaboration of the glorious Sfxr, the program of choice for many people looking to make sound effects for computer games.

Battlestar’s "Daybreak:" The worst ending in the history of on-screen science fiction | Brad Ideas
Battlestar Galactica attracted a lot of fans and a lot of kudos during its run, and engendered this sub blog about it. Here, in my final post on the ending, I present the case that its final hour was the worst ending in the history of science fiction on the screen. This is a condemnation of course, but also praise, because my message is not simply that the ending was poor, but that the show rose so high that it was able to fall so very far. I mean it was the most disappointing ending ever.

asada’s memorandum (The Day I Saw Van Gogh’s Genius in a New Light)
Of course, the premise of this guess may be wrong. Regardless of whether this hypothesis is correct or incorrect, the fact that his work is wonderful and appeals to many people does not change a bit. Still, it is enjoyable to imagine and see his works thinking that we share his eyes.

The Hard Way Is Easier — Learn Python The Hard Way, 2nd Edition
This simple book is meant to get you started in programming. The title says it's the hard way to learn to write code; but it's actually not. It's only the "hard" way because it's the way people used to teach things.

Spelletje (ii)

Bijna geen tijd voor niets gehad, vandaag, maar in de rapte toch nog aan de slag gegaan met pygame.

Typisch, natuurlijk: ik zou eigenlijk moeten de computer moves programmeren, maar ik heb mij eerst op het grafische en op de distributie gegooid.

Nu ja, gegooid: eens uitgeprobeerd wat het allemaal doet. Ik heb een achtergrond en ik heb beeldjes voor de pionnen en zo. Qua teaserachtig, de beeldjes om aan te duiden dat het aan speler A of speler B is (de pionnen en zo zelf zullen niet zo irritant bewegen, natuurlijk):


En ik ben erin geslaagd om het in een executable te gooien. Nu ja, niet dat dat moeilijk was of zo, maar toch. Het voelt altijd fijn aan als iets gecompileerd kan worden.

Morgen verder!

(tussen het leeghalen van de keuken door, that is)

Spelletje (i)

Vanalles gedaan vandaag, en pas vanavond aan mijn spelletje begonnen. Het is Python geworden, de programmeertaal. Omdat ik er veel goed van gehoord heb, en omdat ik zin had om eens een taal te leren waar ik nog nooit in gewerkt had.

Het is een beetje objectgeoriënteerd, mijn spelletje, omdat dat nu eenmaal kan in Python. Het had ook niet-OO gekund, maar hey, zo is het nu eenmaal.

Het spelbord zit in een class, met een paar methodes eraan vast: eentje om het bord te tekenen, eentje om een zet te doen, en eentje om te kijken of er een winnaar is. En het bord zelf, de vakjes, zitten allemaal in één string van 25 karakters, haha.

Ik heb voorlopig enkel de hoofdloop van het spel staan: een nieuw bord maken, en zolang er geen winnaar is, de speler doen spelen. Uiteindelijk komen daar twee spelers in, nu heb ik alleen nog maar een functie voor menselijke speler (teken bord, vraag zet en zorg ervoor dat hij geldig is, doe zet).

En dit is wat het tot nog toe doet:

Turn 1

     a b c d e
 1 |           |
 2 |           |
 3 |           |
 4 |           |
 5 |           |
Player O, enter your move (a-e or 1-5):

Er zijn twee spelers, O en M. Het speelbord is 5×5, en spelers kunnen om beurten een zet doen aan de linkerkant of langs boven. Nu is speler O aan zet. Stel dat hij een pion op B binnenschuift, dan wordt dit de situatie:

     a b c d e
 1 |   O       |
 2 |           |
 3 |           |
 4 |           |
 5 |           |
Player M, enter your move (a-e or 1-5):

M zet een pion op 1, en daarmee verschuift de pion van O naar rechts:

Turn 2

     a b c d e
 1 | M   O     |
 2 |           |
 3 |           |
 4 |           |
 5 |           |
Player O, enter your move (a-e or 1-5):

…en zo dus verder. Het is niet compleet evident spelen, omdat het spelbord voortdurend verschuift, maar het is ook geen schaken natuurlijk. En na de negende zet kan het er bijvoorbeeld zo uitzien:

Turn 10

     a b c d e
 1 | M O M M   |
 2 | M O O     |
 3 | M M O O M |
 4 | O M O   M |
 5 |     O O   |
Player O, enter your move (a-e or 1-5):

Zo. Next up: de computer doen bewegen. Ik denk eerst eens random om te zien wat het doet, en dan eens brute kracht, drie ply of zo. En dan pas slimmer werken.

En dáárna: grafisch verzorgen.

© 2017 Michel Vuijlsteke's weblog

Thema gemaakt door Anders NorenBoven ↑