Skip to main content

Ralsina.Me — Roberto Alsina's website

Posts about programming (old posts, page 74)

The Future of PyQt by Example

Three years ago, I start­ed a se­ries of long posts called "PyQt by Ex­am­ple". It reached five posts be­fore I aban­doned for a se­ries of rea­sons that don't mat­ter any­more. That se­ries is com­ing back start­ing next week, rewrit­ten, im­proved and ex­tend­ed.

It will do so in a new site, and the "old" posts will be re­tired to an ar­chive page. Why? Well, the tech­nolo­gies used in some of them are ob­so­lete or don't quite work nowa­days. So, the new ver­sions will be the pre­ferred ones.

And while I am not promis­ing any­thing, I have enough writ­ten to make this some­thing quite longer, more nice­ly lay­out­ed, more in­ter­est­ing and make it cov­er more ground. BUT, while do­ing some checks on the traf­fic sta­tis­tics for the old post­s, some things popped out.

This was very popular

About 60% of my site's traf­fic goes to those five post­s. Out of about 1200 posts over 12 years, 60% of the view­ers go to the 0.4% of the pages. That is a lot.

It's a long tail

The traf­fic has not de­creased in three years. If any­thing, it has in­creased

https://p.twimg.com/Aw0MHhoCAAAXmro.png:large

A long and tall tail.

So, all this means there is a de­sire for PyQt doc­u­men­ta­tion that is not sat­is­fied. I am not sur­prised: PyQt is great, and the rec­om­mend­ed book is not free, so there is bound to be a lot of de­mand.

And, here's the not-­so-rosy bit: I had un­ob­tru­sive, rel­e­van­t, out­-of-the-way-but-vis­i­ble ads in those pages for more than two years. Of the 70000 unique vis­i­tors, not even one clicked on an ad. Don't wor­ry, I was not ex­pect­ing to get mon­ey out of them (although I would love to some day col­lect a $100 check in­stead of hav­ing google hold my mon­ey for me ad eter­num).

But re­al­ly? Not even one ad click? In more than two years, thou­sands of peo­ple? I have to won­der if I just at­tract cheap peo­ple ;-)

Hack English Instead

Lots of noise re­cent­ly about Jeff At­wood's post about why you should not learn to code. I am here now telling you you should learn to code. But on­ly af­ter you learn a few oth­er things.

You should learn to speak. You should learn to write. You should learn to lis­ten. You should learn to read. You should learn to ex­press your­self.

Richard Feyn­man once de­scribed his prob­lem solv­ing al­go­rithm as fol­lows:

  1. Write down the prob­lem

  2. Think re­al hard

  3. Write down the so­lu­­tion

Most of us can­not do that be­cause we are not Richard Feyn­man and thus, sad­ly, can­not keep all the so­lu­tion in our head in step 2, so we need to it­er­ate a few times, think­ing (not as hard as he could) and writ­ing down a bit of the so­lu­tion on each loop.

And while we who code are un­usu­al­ly proud of our abil­i­ty to write down so­lu­tions in such a clear and un­for­giv­ing way that even a com­put­er can fol­low them, it's ten, maybe a hun­dred times more use­ful to know how to write it down, or say it, in such a way that a hu­man be­ing can un­der­stand it.

Ex­pla­na­tions fit for com­put­ers are bad for hu­mans and vicev­er­sa. Hu­mans ac­cept much more com­pact, am­bigu­ous, and ex­pres­sive code. You can trans­fer high lev­el con­cepts or de­sign to hu­mans much eas­i­er than to com­put­er­s, but al­go­rithms to com­put­ers much eas­i­er than to hu­man­s.

I have a dis­trust of peo­ple who are able to com­mu­ni­cate to com­put­ers eas­i­er than with fel­low hu­man­s, a sus­pi­cion that they sim­ply have a hole in their skillset, which they could eas­i­ly fix if they saw it as es­sen­tial.

And it is an es­sen­tial skil­l. Pro­gram­mers not on­ly run on cof­fee and sug­ar and sushi and dori­tos, they run on hap­pi­ness. They have a fi­nite en­dow­ment of hap­pi­ness and they spend it con­tin­u­ous­ly, like drunk­en sailors. They per­form an ac­tiv­i­ty where jok­ing­ly they mea­sure pro­duc­tiv­i­ty on curs­es per hour, a lone­ly en­deav­our that iso­lates them (us) from oth­er hu­man­s, from fam­i­ly and friend­s.

If a de­vel­op­er can­not com­mu­ni­cate he iso­lates. When he iso­lates he can't co­op­er­ate, he can­not del­e­gate. He can't give ideas to oth­er­s, he can't re­ceive them, he can't share.

And since lots of our com­mu­ni­ca­tion is via email, and chat, and bug re­port­s, and blogs, it's bet­ter if he can write. A de­vel­op­er who can­not write is at a se­ri­ous dis­ad­van­tage. A de­vel­op­er who can­not write to ex­press an idea can­not ex­plain, he does­n't make his fel­lows bet­ter. He's a knowl­edge black hole, where in­for­ma­tion goes to die be­hind the event hori­zon of his skul­l.

So, learn to write. Learn to speak. Learn to read and lis­ten. Then learn to code.

Shoreham: Blogging with Ubuntu One (a teaser)

At Canon­i­cal's On­line Ser­vices we can do cool stuff on fri­days. We do cool stuff all week, ac­tu­al­ly, but on fri­days we can do cra­zier cool stuff.

So, to­day, I ripped off a great ser­vice of­fered by http://­calepin.­co and im­ple­ment­ed a pro­to­type blog-through-Ubun­tu-One web ap­pli­ca­tion. Of course, it's pow­ered by Niko­la,

The code is ab­so­lute non­sense, and it needs to be looked at by some­one who un­der­stands Djan­go, OAu­th, OpenID, and pro­gram­ming in gen­er­al bet­ter than I do, but hey, it does work (for a very loose def­i­ni­tion of "work").

It's called Shore­ham and no, you can't have it yet.

As a teaser, here's a video. With a pony.

In the near fu­ture I will do a bet­ter post about this ex­plain­ing the code, etc.

Alva

Al­va is al­most the op­po­site of Niko­la. If Niko­la is about mak­ing stat­ic sites, Al­va is a dy­nam­ic site. How­ev­er, as Hegel sug­gest­s, from the the­sis and the an­tithe­sis comes the syn­the­sis.

So, Al­va is about dy­nam­i­cal­ly cre­at­ing stat­ic sites. If you want to have Niko­la in your serv­er in­stead of in your own com­put­er, and have the con­ve­nience of an on­line tool, that's the niche Al­va tries to fil­l.

So, you would in­stall Al­va, and use it like any oth­er we­b-based blog­ging tool. Yet, be­hind the sce­nes, you would have Niko­la, and all the per­for­mance and se­cu­ri­ty ben­e­fits of stat­ic sites.

And maybe some­day, I (or some­one) will put up a mul­ti­-us­er ver­sion of Al­va, and you will be able to get host­ed blogs, know­ing all the da­ta is yours and you can leave any­time and do your own thing.

This is very very ear­ly stages. So ear­ly it does not work yet. But here's a teaser:

//ralsina.me/galleries/random/nikola-admin3.thumbnail.png

There is no firm time­frame for this, it de­pends on a ton of oth­er stuff and may not even hap­pen.

Nikola Screencast

I did some work today to get Nikola properly packaged. This involves some minor changes on the workflow for site authors. I am not 100% sure I have it right yet, so here is a short video showing how it works right now in the packaging branch I am doing.

The new thing is the nikola init foldername command, the rest is all old stuff. Basically, you stop having a full copy of Nikola for each site and everything is in a centralized location.

You can still do your own themes by putting them in themes/themename and add new tasks, files, etc. The configuration dodo.py is unchanged except for the "magic bit" which is slightly different.

So, not re­al­ly in­va­sive, easy to mi­grate to, and en­ables much eas­i­er up­dates in the fu­ture, as long as we don't break any im­por­tant stuff in a non-­com­pat­i­ble way.

Here is the video:


Contents © 2000-2020 Roberto Alsina