Monday, November 24, 2008

I hate python - part deux

Did you know Python doesn't support these common C++ features?

* Passing variable references to methods (I know, you should return a list so that's not necessary, but what if I pass a reference to a function (you know, like, for a callback)?

* Static class methods. You have to emulate that behavior by using some weird wrapper. And you call yourself an OOP language?

* Static function variables. No, you have to use something called generator functions. WTF?

Monday, November 17, 2008

Pidgin development and author negligence

Today I'll talk about the development of the (in)famous chat client, Pidgin.

Specifically, I'll talk about a bug: You can't save animated smileys.

http://developer.pidgin.im/ticket/2067

Here's a snippet of the conversation:


Description

It would be nice if animated gifs were supported and users could see the animations in their buddy icons instead of a png

Changed 16 months ago by rez

I agree. Seeing there is a "Enable buddy icon animation" under Preferences -> Conversations, I would think this would be supported, but seems its never worked even in older Gaim versions.
Changed 16 months ago by datallah

* status changed from new to closed
* resolution set to wontfix

You can use animated gifs for the protocols that support them (xmpp, aim, icq, silc, yahoo).

The problem is that if the image needs to be scaled to be sent, it will be converted to a png because gtk+ doesn't include a gif writer (for legal reasons). There isn't anything we can do about this.
Changed 4 weeks ago by datallah

Ticket #7292 has been marked as a duplicate of this ticket.
Changed 4 weeks ago by datallah

Ticket #7314 has been marked as a duplicate of this ticket.
Changed 4 weeks ago by IlRazziatore

MSN can send custom emoticons. Now pidgin can to. Sand, save and reuse it. If they are static all was okay. But if i try to save a animated emoticons pidgin say

Unknow file type Will be using the default PNG format

and it save only the first frame of the emoticons. Why it recived correcty the GIF, why it show correctly the gif ( all the frames ) but don't save it as GIF?

I attach an example of GIF emotiocons.
in reply to: ↑ 1 Changed 4 weeks ago by IlRazziatore

Replying to rez:

I agree. Seeing there is a "Enable buddy icon animation" under Preferences -> Conversations, I would think this would be supported, but seems its never worked even in older Gaim versions.

I have this settings enabled. I see the animations incomming but i cant save or use it.
Changed 4 weeks ago by QuLogic

Ticket #5892 has been marked as a duplicate of this ticket.
Changed 4 weeks ago by IlRazziatore

PS: Why this ticket is closed?
Changed 4 weeks ago by IlRazziatore

If the problem is GIF files why Pidgin don't use Animated Portable Network Graphics (APNG) file format or Multiple-image Network Graphics file format?

This is an example of APNG ( .png ): http://upload.wikimedia.org/wikipedia/commons/1/14/Animated_PNG_example_bouncing_beach_ball.png
Changed 4 weeks ago by datallah

gdk-pixbuf doesn't support APNG (and it wouldn't be all that useful anyway if other clients can't read them either).

This is closed because, as I indicated in #comment:2 it isn't a Pidgin issue - the GTK+ library that deals with manipulating images doesn't support writing gifs.
follow-up: ↓ 12 Changed 4 weeks ago by IlRazziatore

I read the comment ( and i post the comment about the Animated PNG ).

1] Read and save gif. You nead GTK write/read the file for you? Why? Pidgin can't use other library? If GTK can't sand message pidgin don't send message? Pidgin ins't a front end of GTK, GTK is only one of library Pidgin use. If GKT don't read/write GIF file okay you can use an other library or read/wirte file your-self.

Legaly you can't read the gif as image but no-one can say nothing to you if you semply read the byte and copy it.

When Pidgin recived an gif animated it display it, why not save it? You can't write a simply dump file rutine?

If you want i do it for you ( and i will do that myself but i don't understend wher put it in the pidgin source structure... )

You say isn't a Pidgin problem, I do not agree.

2] The animated emotions how are send? As File ( all the file in raw mode, with header ... ) or as an uncompressed animation?

If animated emotiocns are sand as raw file, you don't need decopress it you don't need "read" it. You don't need a library ( GTK ) read it for you. You nead only read the file ( and the file system do that for you ) and sand byte by byte the file.

If animated emoticons are sand as uncompressed animations... why don't use APNG localy?

3] You say "APNG wouldn't be all that useful anyway if other clients can't read them either".

I'm not agree again. I use Pidgin, my sister use Pidgin, a lot of my friend use Pidgin. Why we can't use APNG between us?

eMule extend the eDonkey protocol, at the begin no-one have eMule but this did not important. If two people had eMule they used the new feature otherwise no, patience. We don't must run after someone sometimes you can even overcome.

---

There are 3 tickets duplicate of this so the user want this features... You are always convinced that it isn't a Pidgin problem?
in reply to: ↑ 11 ; follow-up: ↓ 13 Changed 4 weeks ago by datallah

Replying to IlRazziatore:

I read the comment ( and i post the comment about the Animated PNG ).

APNG isn't really relevant to this ticket. If you want to add support for APNG, the right place to do so is in gdk-pixbuf.

1] Read and save gif. You nead GTK write/read the file for you? Why? Pidgin can't use other library? If GTK can't sand message pidgin don't send message? Pidgin ins't a front end of GTK, GTK is only one of library Pidgin use. If GKT don't read/write GIF file okay you can use an other library or read/wirte file your-self.

What is displayed in the IMHtml is a GdkPixbuf - that is what is being saved, not the original file; consequently the library needs to support saving whatever format we would like it to save as. Of course it is theoretically possible to change how this works, but IMO it isn't worth complicating life just so you can save animated gifs from the IM buffer.

Legaly you can't read the gif as image but no-one can say nothing to you if you semply read the byte and copy it.

Actually, I don't think there are any more legal issues, it is just a matter of historical reasons that gdk-pixbuf doesn't support it, perhaps they would accept a patch to do so if it was reasonable.

When Pidgin recived an gif animated it display it, why not save it? You can't write a simply dump file rutine?

We actually do, incoming animated gifs will be stored in the icon cache in ~\.purple\icons. Perhaps it would be reasonable to support copying the file from the cache, if present instead of saving the GdkPixbuf that is displayed.

If you want i do it for you ( and i will do that myself but i don't understend wher put it in the pidgin source structure... )

If you feel like working on making the saving of images from the IM history copy the cached file as a preferred method of saving, I think such a patch would be accepted (assuming it is done correctly).

You say isn't a Pidgin problem, I do not agree. 2] The animated emotions how are send? As File ( all the file in raw mode, with header ... ) or as an uncompressed animation? If animated emotiocns are sand as raw file, you don't need decopress it you don't need "read" it. You don't need a library ( GTK ) read it for you. You nead only read the file ( and the file system do that for you ) and sand byte by byte the file. If animated emoticons are sand as uncompressed animations... why don't use APNG localy?

As I mentioned - if the gif you're trying to use doesn't need to be scaled (to fit the constraints of what the protocol accepts) to be sent, it will work as a buddy icon (this may not be the case for custom emoticons, I haven't tested it). If it does need to be scaled, then gdk-pixbuf needs to be able to do that for us to be able to send it.

3] You say "APNG wouldn't be all that useful anyway if other clients can't read them either". I'm not agree again. I use Pidgin, my sister use Pidgin, a lot of my friend use Pidgin. Why we can't use APNG between us? eMule extend the eDonkey protocol, at the begin no-one have eMule but this did not important. If two people had eMule they used the new feature otherwise no, patience.

Your eMule analogy doesn't quite fit - in most cases, the server is involved and only certain image formats (and sizes of images) are supported by the IM protocol; we can't just send whatever we want. Perhaps for some protocols we could do this, but once again, we need gdk-pixbuf support.

There are 3 tickets duplicate of this so the user want this features... You are always convinced that it isn't a Pidgin problem?

Just because people don't like it doesn't mean it is a problem. As always, good patches that do something reasonable (adding a direct dependency to something like a gif library isn't something I would consider reasonable) are welcome.



The author fails to provide interested users what they need to help fix this bug.

He doesn't say:

"In file xxxxxx.cpp, in function yyyyyyy, we call the zzzzzzzzzzz library function wwwwwwww:

(code snip)

No, he just says "this library can't support that". Now my question is - has the bug been filed? Just because you do an open source project doesn't mean you're free from obligations to fix a bug. At least you should do whatever you can to help.

I'm tired of developers playing dumb because a project is "free" and "you get what you pay for". Yeah, yeah, I know, patches welcome, but how am I supposed to work on a patch if you don't at least give us some hint?

The reason people don't post patches is because they're not given enough information. Fixing a couple of lines in a program is much easier than trying to decipher a huge project to learn how it works.

So, Pidgin developer, if you can read this:

Paste the damn code!
Thank you.

Saturday, November 15, 2008

Pretty cool Anime blogs

In another stochastic inspiration, here's two great blogs about anime:

http://www.japanator.com/ - Everything about Anime and the japanese culture. With podcasts, too!

http://www.epicwin.org/
- 100% anime. Very good recommendations, too!

Latest pidgin adds custom smileys! :)

Finally, the day has come. I added the Mepis community repository to my distro's sources list, and saw that pidgin 2.5.2 has added support for custom emoticons.

When a friend shows you an emoticon, you can right click on it and add the custom smiley to your list or to save it.

Hurray! ^_^

Now I can use my old MSN smileys on pidgin.

Update: Apparently, this doesn't work with animated smileys. You'd need to get them from elsewhere (the web), and add them manually. Let's hope that's fixed soon.

Friday, November 14, 2008

The Matrix Runs on Windows (comedy video)

I've found this hilarious video done by college humor. What would happen if the Matrix ran on Windows XP?

http://www.youtube.com/watch?v=yX8yrOAjfKM

Friday, November 7, 2008

Frets on Fire: A love-hate relationship

Hello everyone. My name's Rick and I'm here to post my random randomness.

One thing I'd been wanting to say for a long time is that Python sucks. Or actually, Python programs suck. Maybe it's that it's relatively easy to learn Python, that python programs reek of newbiness. And the program I'll use to demonstrate this is... Frets on Fire. Regarding code quality, Frets on Fire sucks.

Don't get me wrong, I *LOVE* Frets on Fire. I even purchased my own Playstation 2 guitar controller to play with it (for only $49.99 + the PS2-USB adapter). But still, the game is a crashing/hanging mess.

So what are the problems I've seen so far?

* Video support. I tried to run the program on a 1024x768 LCD screen and all I got was blank video. I needed to search in the forums and edit the .ini file manually, add a [Video] section, and on the [Video] section I had to add a line saying: "Fullscreen = Off".

* Next, sometimes (I'm using version 1.2.512) the whole program hangs when I happen to press "esc" because I realized I didn't want to change an option. What kind of programmer doesn't take into account the ESC button?

* Next comes the handling of the song packs. I happened to download a song pack from the internet so I could play my favorite songs. I unpacked the rar files according to the description, and guess what happened? I got a python exception!

C'MON! Just because you couldn't read the title doesn't mean you have to crash the WHOLE PROGRAM!
Ok, let's calm down, and try to find out which song title has weird characters on it. One by one of the 179 songs. Finally, after a whole day of searching, I finally... gave up. I decided to move the songs out of the songs directory and copy them one by one to see which ones DID work. This is much safer. But seriously, it's frustrating to get an error just because you didn't find a file.

* Also, some of the songs came with a "guitar.ogg" file instead of a "song.ogg" file. So whenever I try to hear a preview and the song doesn't exist, I get another exception. ARGH! How hard is it to say "if there's no song.ogg, search for guitar.ogg instead"? It's a damn "IF" instruction.

Now I have to copy them manually.

* Next comes the fact that the programmer for Frets on Fire didn't program for GNU/Linux, but Windows only (note that I'm using a debian distro). So now I have to deal with not one, but TWO directories: /usr/share/games/fretsonfire/data/songs and ~/.fretsonfire/songs. Guess what happens when the game can't find the corresponding file to a song directory. I ended up wiping out ~/.fretsonfire/songs completely and turn it into a symlink pointing to the other directory.

If that wasn't frustrating enough, then come the mods. The fretsonfire.net website has a link to (GNU/)linux builds of fretsonfire, but guess what? It sends me to the same page than the windows file. What am I supposed to do with a friggin' .exe file? One of the virtues of python is that it's SUPPOSED to be cross-platform. So here comes a Windows amateur coder, and starts imposing this "it's my way or the highway" philosophy of installing programs.

So I finally got a GNU/Linux install of the FoFiX (formerly MFH mod) modified version of frets on fire, which I had to patch manually by decompressing the patch file - on another folder, ugh. And unfortunately, it doesn't support the ORIGINAL option "enable key tapping". I have carpal tunnel syndrome, and having the keys pressed for a long time hurts. I guess we should rename the mod from "MyFingersHurt" mod to "MyCarpalTunnelHurts" mod.

Why do I have to cope with all these amateurs delivering defective code... WHICH IS NOT MAINTAINED!!?? I'm still waiting for the next update of Frets of Fire.

* About some recent bugs in 1.2.512, guess what the author said: "Oh, that bug belongs to one of the libraries we use, and it's out of our control". In C++, you could just copy the current version and embed it in your own program.

So why do Python programs keep giving me headaches, while C++ programs don't?
Sigh. I miss the "configure / make / sudo make install" ritual. It made things so easy.

If you agree with me that Python Sucks, and/or that Frets on Fire needs a remake, please visit this thread: http://cboard.cprogramming.com/showthread.php?p=795950#post795950 . There's a guy wanting to do a Frets Fire clone in C++. Go give him a hand.