2009-10-13

directhex deleted my comments

I had two long running discussions with Microsoft apologist directhex, one about whether mono should be used for new applications and one about whether the BSD license is really more free than the GPL.

We agreed in some terms and disagreed in others but I respected his honesty, I really though he was being honest and seriously wanted to discuss the matters. Then he deleted my comments.

Way to loose my respect directhex, and yes I respected you even tough I thought you suffered a heavy case of double standarism. Now I know exactly what kind of person you are.

2009-10-09

Atheist clubs, where?

Where? Chicago Illinois, USA! Sam Harris reports that the Cardinal Francis George reports that Atheist clubs are appearing in high schools.

The spin is that they call us fundamentalist, evangelical and intolerant. Cool! We managed to turn fundamentalist and evangelical into bad words, a few decades ago they'll be proud of calling themselves fundamentalist or evangelicals.

What we are not is intolerant, we are not putting religious messages in your money, we are not forcing you to pledge "under god" nor are we forcing your kids to pray at what ever you think we worship. We just ask for equal treatment and we ask you to get your religion out of the science classroom.

2009-10-06

Miguel de Icaza, Microsoft Apologist

You know I read a lot and I mean a lot on MS corruption and the hypocrisy of Microsoft apologists. And I'm not only reading one side, I try to listen to them, resisting the pain, and it's simply clear they are out there just to spread disinformation in a concerted attempt to prop Microsoft and divert attention from the Free Software movement and if they can diss RMS in they process you can bet they'll try.

In the end it wasn't working so they flip floped and now pretend to be a bastion of idealism (sure...) with a new fake open source foundation/corporation.

I'm not making this up, Miguel himself comments that Microsoft actually founded two organizations with the same name, one comercial, one non-profit, both Microsoft Staffed.

Really I can't gather enough energy to recap all I read so I'll just link to this excelent article which condensates the whole matter in a couple pages of text: On Mono, Miguel, Stallman and Fusion with Microsoft

2009-09-14

Class Constructor Decorator

While Python is already very terse there are still some repetition that can be worked out. I'm going to talk about class constructors here. Many a class init method is little else but adding the init parameters as instance attributes, I have written a constructor that takes care of that, this preliminary version dumps everything as public attributes in the instance. IFF I need more customization, I'll write the full implementation I was meaning yesterday:

constructor.py

#!/usr/bin/env python
"""
@author rgz
A decorator for converting the constructor arguments into instance attributes automatically.
"""
import decorator
import inspect
@decorator.decorator
def constructor(init, *args, **kwargs):
"""Converts the constructor arguments into instance attributes automatically"""
names, args_name, kwargs_name, defaults = inspect.getargspec(init)
assert len(names) > 0, "Methods should have at least 1 argument!"
for i, name in enumerate(names):
if i:
setattr(self, name, args[i])
else:
self = args[i]
if args_name:
setattr(self, args_name, args[i + 1:])
if kwargs_name:
setattr(self, kwargs_name, kwargs)
init(*args, **kwargs)
__all__ = ['constructor']
if __name__ == '__main__':
class Spam(object):
@constructor
def __init__(
self,
positional_argument_1,
positional_argument_2,
default_argument = 'default value',
*variable_arguments,
**keyword_arguments
):
self.variable_arguments = list(self.variable_arguments) # Attributes already set
spam = Spam(
'first argument',
'second argument',
'non default value',
'first variable value',
'second variable value',
keyword_argument_1 = 'first keyword value',
keyword_argument_2 = 'second keyword value',
)
assert spam.positional_argument_1 == 'first argument'
assert spam.positional_argument_2 == 'second argument'
assert spam.default_argument == 'non default value'
assert type(spam.variable_arguments) is list
assert spam.variable_arguments[0] == 'first variable value'
assert spam.variable_arguments[1] == 'second variable value'
assert spam.keyword_arguments['keyword_argument_1'] == 'first keyword value'
assert spam.keyword_arguments['keyword_argument_2'] == 'second keyword value'

Update: I posted this on reddit because I wanted to know if someone needed something like that but apparently I must have done something really bad, I've been modded -1 and have received no comments.

2009-09-13

Misc stuff and Programmers day.

Today is programmers day! In Russia. Anyway I have not been commenting for a long time so I'm trying to get into it again.

Do you guys remember when I said I spend to much time reading atheist blogs? Well I find now I find myself watching to much atheist channels in youtube, the upside is that I watch them more for the humor than actual debating. Debating creationists is seems more and more with each day.

In the same spirit it feels like I'm always feeding the trolls in slashdot because the posts that deserve to be replied the most are almost always made by irrational people.

One interesting post I wanted to share: Interpolation surprise

And finally let's celebrate the apology from the British government to Alan Turing! This is just great really.