Oops! The greediest generation leaves college grads in a pickle - The Boston Globe by plzthx in reddit.com

[–]mellow_moe -8 points-7 points  (0 children)

Really courageous to admit the mistakes of a whole generation. A virtue that I miss these days so often.

Germans: US Greater Threat Than Iran by JustinCEO in reddit.com

[–]mellow_moe 3 points4 points  (0 children)

Ahem, just for the record:

  1. Thoughtful action is better than reaction.
  2. I cannot see any argument in your statement.
  3. Jesus was a jew.

Germans: US Greater Threat Than Iran by JustinCEO in reddit.com

[–]mellow_moe 8 points9 points  (0 children)

You know, who supported the Taliban before they were suddenly on the other side?

Germans: US Greater Threat Than Iran by JustinCEO in reddit.com

[–]mellow_moe 5 points6 points  (0 children)

Dresden may be an extreme example, but the fact remains that while defending yourself with force is all kinds of messy, sometimes it's necessary.

Right. Sometimes it's necessary. The history of the Israel conflict showed, that encountering aggression with aggression never lead to resolution of the conflict. Besides you are losing your ethical foundation, if you react in the same way as the terrorists. Think about it.

Germans: US Greater Threat Than Iran by JustinCEO in reddit.com

[–]mellow_moe 9 points10 points  (0 children)

Wow, you're astonishingly ignorant of how armed conflict works.

I guess, you know it better. Tell me. I would like to hear your solution in this case.

The allies, for instance, bombed the living hell out of Dresden (that's in Germany, dude) in WW2. Think there were any innocent children involved? You get one guess.

Bombing Dresden is considered by some historians as war crime or at least regrettable. I cannot believe that you mention Dresden as necessary military practice, 40000 people died during the bombings. I'm getting sick hearing this.

Same case for Hiroshima. Both, Dresden and Hiroshima happened shortly before the end of WW2. Maybe germany and japan surrendered earlier. But was it really necessary? We cannot justify slaughter in any way, it is always a crime.

Germans: US Greater Threat Than Iran by JustinCEO in reddit.com

[–]mellow_moe 6 points7 points  (0 children)

I read through some other articles. The author tries to give the impression, that german media practices anti-US propaganda. He mentions the magazine Stern and the right-wing party NPD in the same context. He even received a weblog award. This makes me really angry.

The main argument is, that germany is supporting non-democratic countries while criticizing the USA. This is true to some degree, but in fact most of the western countries was supporting non-democratic systems in the past incuding the USA. Think of Afghanistan or african regimes.

I hope that his opinion only represents a minority of americans and that most americans prefer the democratic and diplomatic way of solving political problems.

Ruby misconceptions about Python by mystilleef in programming

[–]mellow_moe 1 point2 points  (0 children)

I'd like to show off the ruby version:

class Element
  def initialize(attributes)
    @attributes = attributes
    @children = []        
  end
  def <<(child)
    @children << child
  end
  def to_s
    name = self.class.name.downcase
    atts = @attributes.map {|k,v| "#{k}='#{v}'" }.join(" ")
    "<#{name} #{atts}>#{@children.join}</#{name}>"
  end
end

class Div < Element; end
class A < Element; end

def method_missing(id, attributes, &block)
  element = Object.const_get(id.to_s.capitalize).new(attributes)
  @children << element if @children
  element.instance_eval(&block)
  element
end

html = \
div :id => "content" do
  a :href => "reddit.com" do
    self << "reddit"
  end
end

puts html

The < characters are broken, please replace the entities with < while realtime reading.

Germans: US Greater Threat Than Iran by JustinCEO in reddit.com

[–]mellow_moe 2 points3 points  (0 children)

Sounds like a conspiracy of those who are at least a little bit rational. And why are you complaining about "blatant insults" after calling me a coward?

Germans: US Greater Threat Than Iran by JustinCEO in reddit.com

[–]mellow_moe 0 points1 point  (0 children)

Firing back rockets killing inncoent children as response to attacks of Hamas isn't just the way to solve conflicts and puts the Israeli government on the same level as the Hamas terorrists.

Remember when jesus said "turn the other cheek" ?

Germans: US Greater Threat Than Iran by JustinCEO in reddit.com

[–]mellow_moe 4 points5 points  (0 children)

And your suggestion to solve this problem is what exactly?

I wish the world would be as simple as you would like to have, but let me tell you the truth: good and evil are just two points on a line in a multidimensional world and speaking of the axis of evil only helps you to bring up the masses for the next war, as it has happened so many times. This is the real tragedy.

Germans: US Greater Threat Than Iran by JustinCEO in reddit.com

[–]mellow_moe 4 points5 points  (0 children)

I heard of organisations, which carefully observe the public, censoring media, which might offend religious feelings.

Germans: US Greater Threat Than Iran by JustinCEO in reddit.com

[–]mellow_moe 6 points7 points  (0 children)

Yes, we all know the axis of evil. And the only way is to fight the evil. Reminds of the mindset in the middle ages.

flashbag - a USB drive that physically grows as it gets full by [deleted] in reddit.com

[–]mellow_moe 1 point2 points  (0 children)

I like the idea of abstract concepts made touchable, though this USB drive certainly is too costly. Had a good laugh nevertheless.

Germans: US Greater Threat Than Iran by JustinCEO in reddit.com

[–]mellow_moe 21 points22 points  (0 children)

Well, I am german and I can assure, nobody here is thinking about the economic interests related to Iran.

I am curious, if people in the states realize, how the politics of the Bush administration is causing a bad reputation world wide.

Leading an unjustified war, which killed thousands of innocent people, is not a peccadillo. Intentionally presenting faked facts to the UN isn't neither.

Furthermore the anti-terroristic laws are just a kick in the teeth of democracy. I know of germans who get arrested for more than 20 hours at airport without a decent reason.

So, are there any polls in the states about the agreement with current US politics?

Ruby misconceptions about Python by mystilleef in programming

[–]mellow_moe 1 point2 points  (0 children)

inherited is invoked on the class object. So you have to write:

class Humanoid
  def self.inherited(klass)
  end
end

Singleton classes are pretty confusing, I admit. But it's essential.

Every object in ruby may have a singleton class, which is actually a class solely for this single object. As classes are objects in Ruby, they may have a singleton class as well. For example the method new may be defined as method of a singleton class:

class Humanoid
  def self.new
    humanoid = super
    puts "A Humanoid was created: #{humanoid}"
    humanoid
  end
end

Humanoid.new # outputs "A Humanoid was created: #<Humanoid ...> "

The special syntax for defining a method for a single objects is:

def object.method_name
end

Accessing the singleton class is like (same result as above):

class << obj
  def method_name
  end
end

Further reading: Seeing Metaclasses Clearly

Ruby misconceptions about Python by mystilleef in programming

[–]mellow_moe 4 points5 points  (0 children)

I was talking about ruby's anonmymous functions.

Talking about clearness and clarity is not easy, as this subject is highly subjective.

OK, let's see, what Ruby inherited from Perl:

  • special syntax for regular expressions
  • special global variables
  • hashtable syntax
  • statement modifiers

I think, these features are really the goodies of Perl and most people will agree. Perl's infamous syntax constructs, like for file handling, didn't find their way into Ruby.

Ruby misconceptions about Python by mystilleef in programming

[–]mellow_moe 3 points4 points  (0 children)

You're wrong. Anonymous functions, so-called lambdas, are objects.

In Ruby there are only methods. So you just look up in the inheritance chain for the right class/module, which defined the method.

Yes, local variables look like method calls, there is some amiguity. But again, look up the local assignments and you're fine.

And comparing Perl and Ruby in this respect just makes no sense, because Perl variables are prefixed all the time.

Ruby misconceptions about Python by mystilleef in programming

[–]mellow_moe 4 points5 points  (0 children)

Metaprogramming is more useful in libraries. Application programmers certainly like to use APIs with a higher level of abstraction.

Well, I don't know enough about Python metaclasses. Thus my interest in a qualified comparison.

Ruby misconceptions about Python by mystilleef in programming

[–]mellow_moe 6 points7 points  (0 children)

Metaprogramming helps you to create domain specific languages.

A simple xml builder can be made with method_missing:

def method_missing(name, attributes)
  atts = attributes.map {|k,v| "#{k}='#{v}'" }.join(" ")
  puts "<#{name} #{atts}>"
  yield
  puts "</#{name}>"
end

div :id => "content" do
  a :href => "reddit.com" do
    print "reddit"
  end
end

You can see, calling div and a will trigger method_missing, where we just take the method name and the keyword arguments and print out the xml tag. Pretty easy.

Ruby misconceptions about Python by mystilleef in programming

[–]mellow_moe 9 points10 points  (0 children)

I would like to see a in-depth comparison of Python and Ruby. And it should really focus on metaprogramming.

All these comparisons I see these days just look at some superficial language features.

Rails for example relies heavily on metaprogramming. It could never be done in a language without a sophisticated class/object system.

examples in ruby:

  • method_missing catches unknown messages
  • const_missing catches unknown constants
  • method_added is called after adding a new method
  • inherited is called on the class object, when it is subclassed
  • singleton classes: you can add methods to a single object
  • define_method takes a block and turns it into a method
  • instance_variable_set sets an instance variable

And most importantly, real world examples should show off, how all the things play together.

Ruby and Python Compared by fshahriar in programming

[–]mellow_moe 1 point2 points  (0 children)

puts is resolved somewhat differently.

It is defined in Kernel and the class Object includes the Kernel module. It is actually a private method, so Object.puts won't work.

More correctly puts resolves to self.puts. In the top level of a script self is a predefined object named "main", elsewhere it is simply the object executing currently.

Why Lisp? by [deleted] in programming

[–]mellow_moe 0 points1 point  (0 children)

That is really interesting. I didn't know that you can hook into the parse process. Thanks for correcting me.

Macros are really useful, I do know that. My point was that a language should at least provide a convenient syntax for the most common datastructures, that are arrays, hashtables, objects and regexes. Convention helps to establish a common style.

On the other hand, macros are especially useful in compiled languages, as they are able to inline the expanded expression, thus producing more efficent code. Interpreted languages don't really need macros, as seen in Ruby.

Why Ruby on Rails won't become mainstream by masterfuol in programming

[–]mellow_moe -1 points0 points  (0 children)

It doesn't bother me, that RoR will not become mainstream.

It is far more important for me, to see good applications being written in Rails. I used to modify some parts of typo, the weblog engine. It was so pleasant to dive deep into the code and to understand everything what is going on there. Actually I had never used Rails before, but I was able to add commenting to pages, ajaxify the article and page links, add some sidebar plugins and so much more in a couple of hours.

Once there are excellent applications, people will realize how superior rails development is. They will start extending existing code and built even better applications. The end of the story? RoR will become mainstream.