Or at least my article about it.
Also, check it out at reddit.
Or at least my article about it.
Also, check it out at reddit.
I suppose it happens to everyone once in a while, and it has happened to me often in the past, but I am thinking if I should keep on writing this blog, or if some large change is needed.
Here are some random things from my head:
Almost noone reads it. Really. It has less than 40 subscribers. That's pathetic for a blog that has content for over 7 years :-)
Maybe I should post in spanish, or at least bilingually.
Maybe I should write more features. When I write a longish piece and announce it, there is a respectable traffic surge.
On the other hand, I enjoy writing it. And it's really very little effort (specially now, with BartleBlog ;-)
Maybe it should be more focused in one area, make it a python programming blog, or a tutorials blog, or something like that.
But I am not a focused person. I am a generalist. This week I have worked in the following things:
And this was in 5 days of work. If I listed what I have done this year, it would take me 500 items. I am broad, how could my blog be narrow?
Maybe it's just not interesting? Or badly done?
Is it too nerdy? Is it not nerdy enough?
I have had a blog with a small readership for 7 years, why is it bothering me now?
If I stop, it doesn't matter, I can always pick it up again later when I feel like writing.
So, there. You, the 40 guys, comment on it if you want ;-)
I stumboed onto a site where you write and they are supposed to share the advertising revenue with you.
So, I decided to do an experiment. I created an account and am posting there using a character.
This character is the most annoying, cranky, acid guy I can be. It's my evil side. For example, my first post was about how everything on the site is garbage. My second one is a specious argument about how noone is special.
Let's see where it leads...
Since the very beginning, BartleBlog has been using CherryTemplate for its output formatting needs. I like it, because it's very simple.
However, it had grown rather cumbersome.
Specifically, most pages in a blog are sort of a page template with a body template inside (the main content).
To do that on CherryTemplate, I used a two-pass approach: generate the body, then pass it as parameter to the page template.
Which is a pain in some cases because you end basically having to do a rendering function for each kind of page, or some crazy-evil function (what I did).
Exploring the different python template engines, I ran into Mako and decided to give it a whirl. It looks good.
The approach is a bit different, it is much more powerful, but you can still use it simply if you can.
And the main feature was template inheritance. Using that, no more inner and outer templates, baby!
Oh, and performance is better:
Cherry real 31m44.732s user 21m18.336s sys 2m7.628s Mako real 24m54.472s user 19m9.508s sys 1m56.375s
This is for completely rerendering the whole 7 years, 574 posts, 40 static articles, 14 category blog, and there is tons of optimizations to be done.
BTW: this is how you rerender the whole blog:
Took a while to implement, but BartleBlog finally got a functional menu editor:
Right now, it only works with the mootools-based menu gadget, but I will start working on the yahoo menu version in a moment.
The only thing not working is the preview button, because it needs more support on the backend side.
... has been all about UI.
I have always had a problem when writing PyQt apps: stock icons.
Which ones should I use? Where are they?
I usually fished through the crystalsvg icon set until I found one that seemed to be what I needed, and then copied it to my app.
Sadly, that's annoying in several ways:
So, I decided to cut my losses, and see what else could be done. And here it is:
I am now using all SVG icons, from the reinhardt set that will look equally out of place in all OSs, but which I like (and I think look awesome with this relaxed Domino theme). And because they are all SVG, I don't care about sizes, and they are all in the same place, and all is good.
And whenever Oxygen is released, all I need to do is switch the files around and that's that. Which is nice, too.
Of course there is a catch... it does look out of place, and I expect many to find it ugly. So what, since I am the only user of this app! ;-)
Still lots and lots of things to be done, tho.
It's remarkably easy to turn your QTextBrowser into a limited web browser, at least good enough to show images from the web.
Here's all the code:
from PyQt4 import QtCore,QtGui import urllib, os, md5 class PBrowser(QtGui.QTextBrowser): def loadResource(self, type, name): url=unicode(name.toString()) ret=QtCore.QVariant() if url.startswith('http://'): dn=os.path.expanduser('~/.bartleblog/cache/') if not os.path.isdir(dn): os.mkdir(dn) m=md5.new() m.update(url) fn=os.path.join(dn,m.hexdigest()) if not os.path.isfile(fn): urllib.urlretrieve(url, fn) ret=QtGui.QTextBrowser.loadResource(self, type, QtCore.QUrl(fn)) else: ret=QtGui.QTextBrowser.loadResource(self, type, name) return ret
And here's bartleblog taking advantage of it:
It even has a primitive cache and everything ;-)
I found a couple of hours to hack, and decided to spend them on BartleBlog.
Here's what got done:
I intend to spend a couple of hours on it every day for the next ten days or so. After that, who knows, maybe a release will be reasonable.
Now, I don't know if this is useful, but I do think it's way neat.
The goals differ from S5 in that I intend to write a frontend, so that you have a sort of very-poor-man's powerpoint, but also in that the output should be simple to embed in other pages so that I can eventually make this a part of bartleblog.
Check it out (click to go to next slide, move mouse to the top of the slideshow for controls):
|Author:||Roberto Alsina <[email protected]>|
It's trivial to display source code, with proper syntax highlighting.
from base64 import * def myFirstFunction(): print b64decode ('YnllIHdvcmxkIQ==')
Even for things like shell sessions. Dammit, I am a nerd, I will try to add every nerd feature I deem cool.
Wanna show a flickr photo?
.. flickr:: myPhotoTitle
How about using openomy.com to share your files? And whatever else you can think of, it probably can be done.
Really. It's simple python code.
If there is a python module or web service to do what you want, hooking it into BartleBlog is simple.
Like online, embedded, animated slideshows! Like this one! Done with 65 lines of simple almost-plain-text markup! Ok, it's not fully implemented yet, because it needs some manual code, but the hard part is done!
Or automatic SVN changelog display ( I admit that's somewhat niche ;-))
Now, who else has that kind of thing?
There may be an artifact when you slide out the syntax-highlighted boxes, but I have no idea how to fix it.
Also, I have not tested it at all in IE, so if it fails there, don't worry, that's to be expected!
Next time I speak in public, I may use this :-)
And, as a teaser... this is the source for the presentation you just saw:
Why use BartleBlog ================== (If you are a nerd) ~~~~~~~~~~~~~~~~~~~ :author: Roberto Alsina <[email protected]> It's nerd-oriented ------------------ It's trivial to display source code, with proper syntax highlighting. .. code-block:: python from base64 import * def myFirstFunction(): print b64decode ('YnllIHdvcmxkIQ==') Even for things like shell sessions. Dammit, I am a nerd, I will try to add every nerd feature I deem cool. It does things simply --------------------- Wanna show a flickr photo? .. code-block:: rst .. flickr:: myPhotoTitle How about using openomy.com to share your files? And whatever else you can think of, it probably **can** be done. It's very easy to extend ------------------------ Really. It's simple python code. * The module to do syntax highlighting has 41 lines. * The module to do dynamic animated menus has 103. * The module to do calendars has 72. If there is a python module or web service to do what you want, hooking it into BartleBlog is simple. And it has kickass features --------------------------- Like online, embedded, animated slideshows! Like this one! Done with 65 lines of simple almost-plain-text markup! Ok, it's not fully implemented yet, because it needs some manual code, but the hard part is done! Or automatic SVN changelog display ( I admit that's *somewhat niche* ;-)) Now, who else has that kind of thing?