Posts about Writing (old posts, page 3)

2007-08-11 23:15

Thinking about this blog.

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:

  1. Almost noone reads it. Really. It has less than 40 subscribers. That's pathetic for a blog that has content for over 7 years :-)

  2. Maybe I should post in spanish, or at least bilingually.

  3. Maybe I should write more features. When I write a longish piece and announce it, there is a respectable traffic surge.

  4. On the other hand, I enjoy writing it. And it's really very little effort (specially now, with BartleBlog ;-)

  5. Maybe it should be more focused in one area, make it a python programming blog, or a tutorials blog, or something like that.

  6. But I am not a focused person. I am a generalist. This week I have worked in the following things:

    • VoIP
    • Django
    • PyQt
    • Linux sysadmining
    • Firewall/Proxy integration with windows clients
    • Consulting in the most generic sense, sitting with a company's IT staff and thinking about their situation.
    • Learning PyGame

    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?

  7. Maybe it's just not interesting? Or badly done?

  8. Is it too nerdy? Is it not nerdy enough?

  9. I have had a blog with a small readership for 7 years, why is it bothering me now?

  10. 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 ;-)

2007-07-05 10:17

An experiment

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...

2007-05-15 12:44

BartleBlog change: Mako Templates

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:

from BartleBlog.backend.blog import Blog
Blog().renderFullBlog()

2007-05-11 12:01

New Bartleblog Feature: Menu Editor

Took a while to implement, but BartleBlog finally got a functional menu editor:

bartleblog12.png

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.

2007-05-10 14:07

Today's first hour of hacking...

... 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:

  1. Since those are PNG icons, you need to find the right size.
  2. Not all icons are there for all sizes!
  3. Because of 2, I need to check three or four folders to see all the icons.

So, I decided to cut my losses, and see what else could be done. And here it is:

bartleblog11.png

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! ;-)

2007-05-09 15:06

Today's two hours of hacking

  • Done with the main blog config dialog.
  • Fixed a dozen bugs
  • Generate the blog in a reasonable place
  • Fixed a lot of UI bugs (tab orders, sizes)

Still lots and lots of things to be done, tho.

2007-05-08 21:05

Making your QTextBrowser show remote images

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:

bartleblog10.png

It even has a primitive cache and everything ;-)

2007-05-05 18:29

Giving BartleBlog the push it needs

I found a couple of hours to hack, and decided to spend them on BartleBlog.

Here's what got done:

  • UI for blog preferences (still need to do maybe ten of these little modules).
  • Search for files in reasonable places (instead of using the DB in the current folder, for example).
  • Started work on a first-use wizard
  • Started working on a original and simple help system (resource files, yay! ;-).
  • Implemented (lamely) posting of "stories" which are static pages that are not part of the blog's flow.

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.

2007-04-12 17:35

New BartleBlog Feature: marketspeak!

Now, I don't know if this is useful, but I do think it's way neat.

Inspired by S5, rst2s5, and mootools I took an hour (or two) and hacked this neat little slide tool.

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):

<<   >>

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.

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?

.. 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?

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?

Contents © 2000-2018 Roberto Alsina