Posts about qt (old posts, page 5)

2010-06-18 15:42

Free software is good for me.

I make a living working with free software (BTW, if you need sysadmins that know what they do, contact us: http://www.netmanagers.com.ar)

But that's not that big a deal, I could make a living doing something else. I am sure I would be competent at something else, even if I have no idea what that would be right now.

It does, however give me freedom to play, which is much more important. Therefore, this post is sort of a status update on things I play with. Not games, those are not really my thing, but things that I do for fun.

Yes, some of these may mean I am a very strange person.

I'll limit myself to the last couple of weeks or so.

There's been sort of a bump in interest in Marave, my distraction free editor and it's because it has been reviewed in Linux Journal!

I have read the article (sadly I can't link to it) and it was a super positive review, here are some choice quotes:

"marave makes the dull world of text editing romantic and immersive with beautiful minimalism"

"... it doesn't just have minimalism and simplicity, it has minimalism and simplicity combined with beauty and a palpable design ethic. marave has soul, and I love that."

So thanks for the kind words to the author, and something I noticed: you ran into a big bug in marave and didn't notice :-)

The "cricket bat" icon (it's a screwdriver ;-) should show you the config dialog. However, it seems in Ubuntu (and maybe in other distros, I don't know) the config is not visible,and all you see is the text move around a bit. This is what he should have seen:

marave15

I have never been able to reproduce it, but I am going to install a Ubuntu VM just for this, so maybe soon.

On related news, marave was also reviewed in a german magazine a couple of months ago, and I have not been able to get a copy of the article. (BTW, isn't it reasonable to send a copy of these to the author of the program you are reviewing? Neither magazine even mentioned it to me!)

In any case, if anyone has this magazine and can tell me what the article about distraction-free editors say, you will make my day:

Here's the article teaser

And this seems to be the magazine issue:

https://shop.linuxnewmedia.de/store/eh01/EH10165/de/product_image/variant/bounding_product

On new projects (yes, I always have new projects), I ran into this awesome blog post by Roger Alsing about approaching Mona Lisa with just 50 polygons <http://rogeralsing.com/2008/12/07/genetic-programming-evolution-of-mona-lisa/ > and being a nerd and having awesome programming tools at my command... I wrote a framework to test that kind of algorithms.

I called it evoluto and it's at http://evoluto.googlecode.com.

I only did a very simple algorithm, based on transluscent triangles, but it did work... for some definition of work!

You can even see the local minimum that doesn't let her right eye form right :-)

Evoluto has a library of algorithms (currently empty) and you can edit and reapply on-the-fly the one you want, and see the generations change on-screen.

It would take some work to make it a polished program, but it does work.

I folled around a bit with creating a nice PDF presentation player but it's still very early:

109301062

In what's perhaps my most established project, rst2pdf. I have fixed a bunch of bugs, and a release is a bit overdue:

Issue 186: Text not wrapping around images when specified
I fixed this by adding a new CLI option, so behaviour was not changed, but now you can have images with text flowing beside it. It will not look great but it works.
Issue 307: Replace directive doesn't replace text in header/footer in some cases
This was an interesting problem! It was very entertaining.
Made it work with Sphinx 1.*
There is a piece broken still, but what I fixed was not terribly hard.
Unbroken bookrest
I need to work much more with this, but at least what worked before works again. If you don't know what bookrest is, it's a rst2pdf graphical frontend / word processor, here's a taste:

I also made several releases for my AUR packages

Plus I worked, and some other stuff. All in all, not a bad stretch.

2010-05-12 20:08

What's wrong with this dialog?

I am writing a book. And I am writing a chapter about UI design. And why not use the Internet?

So, go ahead and tell me all that's wrong with this dialog!

radio-14

For example, I don't like the dead space at the bottom-left, the different-size of the "Close" button, and the misalignment of the icons.

Are those valid concerns? Are there many more? Would you do it completely different?

The book is open source, and available at http://nomuerde.netmanagers.com.ar (In spanish, sorry!)

2010-04-11 05:12

I am posting very little because I am writing a lot.

I am just not writing here. I am writing a book instead.

What book am I writing? A book about python programming, of course! It's called "Python No Muerde" (Python Doesn't Bite) and it's in spanish.

Now, I am the first to admin: I am not a great programmer. And I am not a great writer. But I have lots of things to say. If I can organize them correctly, they even make sense sometimes!

So, I am giving this write-long-stuff thing a try.

Of course since I am an open source nerd, I can't do things the usual way, therefore, the book is under Creative Commons. And because I am a programmer, I hacked together a (if I may say so myself) decent structure to handle book-writing.

  1. I write in restructured text
  2. I use rst2pdf to create PDFs both of individual chapters and the whole thing.
  3. I use rest2web to create a website
  4. I use mercurial (at googlecode) to handle revision control and history.
  5. I use make to control rebuilding of chapters when code changes, or images get updated, etc.

Of course it's more complicated than that, the PDFs are in the site, the site is uploaded via rsync, the uploads and rebuilds are triggered by hg push, and so on.

In any case, I may post a few times about how this whole thing works, here is the output of the machinery:

http://nomuerde.netmanagers.com.ar

2010-03-03 19:28

Hacked on kuatia for a couple of hours...

As mentioned previously, I am hacking a bit on a proof-of-concept word processor. Right now, it's hosted on googlecode and called kuatia.

Now, it is far from being useful for anything, but... it can do nested itemized and bulleted lists.

Here's a screenie of the editor and the PDF output it produces via reStructured Text:

editando2

Personally I think that's not too bad.

2010-02-25 11:16

Marave 0.7 released

I just uploaded version 0.7 of Marave, my fullscreen text editor to http://marave.googlecode.com

Marave is a "relaxing" text editor inspired by ommwriter, DarkRoom and many others. It combines a spartan fullscreen UI with a vanishing UI, which gets out of the way of your text.

It supports syntax highlighting, inine spellchecking, background music, audible keyboard feedback, themes, is extensible via plugins, and much more.

Here's a screenshot:

marave18

There are no major new features in 0.7, but there are important internal changes and some major bugs fixed:

  • Fixed bug that broke opening files if you had no spellchecker
  • Implemented basic RTL language support
  • Several other minor fixes
  • Refactored the editor component so it can be reused

2010-02-24 14:13

A teaser for an idea

I have been thinking on what I really really want in a word processor. And then what would it take to create such a thing.

A few minutes of playing have led me the way of this teaser (video here if you can't see it):

Could something come out of it? Who knows.

2010-02-23 14:23

Editor: a better QTextEdit

Writing an editor is reinventing the wheel. I know that. I tell myself Marave is a fine wheel, with distinct features, and I think that is true, but, if you are reinventing the wheel, there's no need to reinvent the axle and the spoke, too.

So, I refactored the stuff that I think a text editor must provide into a nice library, so the next time someone must invent a wheel, he can use Marave's neat spokes and axles:

So, introducing Editor, the most-obviously named class ever! It's a text editing widget for PyQt with extra features, which you can use as a drop-in replacement for a QTextEdit or QPlainTextEdit.

Right now, it lives inside Marave's SVN but it may even move out someday.

Here are its features:

  • Syntax highlighting

    And I don't mean "in theory", like QTextEdit and company do! Editor can highlight a bunch of languages, because it uses GNU source highlight via Lorenzo Bettini's Source Highlight Qt.

  • Spell checking

    If you have PyEnchant installed and the right dictionaries, it will do online spellchecking.

  • Search and Search+Replace widgets

    The Editor class can give you nice widgets for search or search and replace already hooked with the editor widget, so you can add them to your app's UI easily.

  • new/open/save/saveas methods:

    Don't implement opening/saving, etc yourself! That's always the same code!

Hopefully this will be helpful for someone else :-)

2010-02-22 00:54

Are we really this clueless about software costs?

Here's what Ohloh has to say about the cost of developing Marave

Really, Marave is maybe a month of part-time programming. How could that possible be U$S71355, or "1 Person Years"?

Is this garbage the best we have to estimate costs? If that's the case, then whenever you see something about "Open source program X would take Y years and cost Z dollars to write", cut it down by a factor of 10 or more.

Here's what Marave really costed to develop:

  • Nothing.

Ok, here's what it would have costed if I had charged for it:

I am guessing about 100 hours of my time. At my "I hope they pay me this much" rate of U$S 40/hour , that's U$S 4000, which means Ohloh is off by 1600%.

OTOH, for that much freelance work I would not charge you the full rate, I would probably end charging you more like U$S20/hour which would make Ohloh's guess over 3000% too high.

In conclusion: if you like my code (and hey, you can see it for yourself), hire me, I am incredibly cheap, or amazingly fast!

2010-02-21 21:49

Marave 0.6 is out

Version 0.6 of Marave, my peaceful, fullscreen text editor is now available at the usual place: http://marave.googlecode.com

New stuff:

  • Syntax highlighter
  • Plugins
  • Bugs fixed
  • Nicer animations
  • Code cleanup

Gratuitous screenshot:

2010-02-19 22:07

The aha! moment

I had a small task today in Marave. The goal was:

  1. Fade in a widget
  2. Set a variable
  3. Fade in another one

It's important that things are done in that order and it's also important that the app remains interactive.

And here's the code to do that (simplified):

def fadein(thing, target=1., thendo=None):
    """
    * thing is a QWidget
    * thing.proxy is a QGraphicsWidget
    * thendo is callable
    * target is the desired opacity
    """

    thing.anim=QtCore.QPropertyAnimation(thing.proxy, "opacity")
    thing.anim.setDuration(200)
    thing.anim.setStartValue(thing.proxy.opacity())
    thing.anim.setEndValue(target)
    thing.anim.start()
    thing.anim.finished.connect(thing.anim.deleteLater)
    if thendo:
        thing.anim.finished.connect(thendo)

And this is how you use it:

def later():
    avar=avalue
    fadein(widget2)

fadein(widget1, thendo=later)

Isn't that lovely? Having functions as first class objects means I can just take later as a closure, along with widget2 and avar, which need only be defined in the local scope, and the call chain will work just as I wanted!

Yes, many other languages can do this, and in Javascript it's one of the most common tricks, but consider that PyQt is a wrapper for a C++ library!

I think this kind of usage shows the real added value PyQt brings to the table, it's not just that python avoids the boring compiles, or that you have the awesome standard library to use, but that the language itself enables you to do things that are not practical in C++.

In C++ the only way I can think of is creating a slot that's the equivalent of later, then chaining the signals... which means that this throwaway later becomes part of the interface of a class!

I would have to define later somewhere else on the file, separate from its only usage (maybe even inlined in the header file).

Even then, that's not equivalent: avalue may be something that was only avalable before the first call to fadein, (for example, the time of the first fadein): I would have to create a place to store it, make it reachable by later... and wht happens if you try to do this again while the first fadein is in progress?... it gets hairy.

Programming is like a slap in the face sometimes... you realize that things you use without even noticing are far from trivial.

So, remember young padawan: you can choose you tools. Choose wisely.

Contents © 2000-2018 Roberto Alsina