1. Small, simple associative arrays. foreach helps too. I've found IronPython at least can do that: Yes. See also collections.defaultdict, which pretty much takes care of every other Perlism that you could want.
2. Small, simple, self-contained regular expressions, with variable replacement. I haven't seen another language yet that can do this in one command:
$str =~ s/(foo|bar)/$arr{$1}/g; I'm not that crazy about putting this on one line, but here it is
s = re.sub(r'(foo|bar)', lambda m: arr[m.group(0)], s)
This particular example fits Perl's chunking a little better. For the other side of the story, consider
$str =~ s/($foo[bar]/$arr{$1}/g;
which no real person understands. (What kind of variable is 'foo'? Is 'bar' are bareword?...)
3. Small, simple standard I/O. Many languages write to STDOUT easily. Few read from STDIN *or* a file this easily:
"while(<>) { &foobar $_; }" for line in fileinput.input(): foobar(line)
Fewer still let you slurp STDIN, too:
"{local $/; $_ = <>;}" That's either sys.stdin.readline(), sys.stdin.read(), or sys.stdin.readlines(). My Perl is rusty from lack of use.:-)
That was my first reaction, too, but if you're associating the way Python deals with whitespace with FORTRAN, you're completely misunderstanding the situation. They have nothing to do with each other at all.
A better way to look at the situation would be to ask yourself, "In properly formatted code, what purpose do braces serve?"
If you consider this a while, you may decide that the answer is "None.".
I'm mainly a C hacker, but I don't get why people would prefer Python over Java. Dynamic typing where you can create new identifiers implicitly is pretty scary to me. I'm not even sure what Python offers over the dozens of other languages that preceded it. I can relate. I felt nervous back in 1982 when someone showed me the first program I'd ever see that didn't line numbers (i.e., at the beginning of every line of source code). How could that even work? Needless to say, I got over it, and I only use line numbers now when there seems to be a real benefit, which is rarely.
Take my word for it: Python is worth learning. It may not always be the right tool for the job, but in my experience, more and more it is.
If all drug dealers, runners, growers were shot on site... that too would end the "war". Sure, just like it's working with al Queda in Iraq.
Pardon my ignorance. I pardon thee.;-)
You seemed to have missed the point of my original post. I didn't say that (say) rehab center workers would be upset by legalization--I was referring to those who make large profits from the illegal drug trade.
This involvement has allowed the end to end quality of FLOSS to skyrocket in the past few years I'm not sure what you mean by end to end here. Obviously FLOSS has moved into different domains at different times--some areas decades ago, while other areas may never see FLOSS.
One pattern does seem clear: once FLOSS gets a start in an area, it appears to attain supremacy within about five to ten years. And once FLOSS takes a niche, proprietary software never takes it back.
There will probably always be proprietary software, but days of Microsoft's primary niches are numbered.
The purpose of the War on Drugs is to support the price of illegal drugs. If these drugs were legalized, the price would instantly collapse, and lot of powerful people would be very upset. (credit to Doonesbury or Outland (?) for pointing this out)
It also helps politicians pander to ignorant members of the right.
If I recall correctly from my undergraduate days, it's possible (i.e., I did it) to write a knight's traversal algorithm that finds its solution with no backtracking, for reasonably small boards (including 8x8). No stack required.
It's easy for us to get caught up in our own little corner of the world, but there are people who don't have the luxury. My personal feeling is that when I have money to donate, half goes to the poorest of the poor, right off the top. The other half I split out (think "diversification") across 5-10 organizations that I think will produce the best long-term benefit for humanity and are overlooked by most people (e.g., The Free Software Foundation).
If you want to read something on this subject that will turn your head around and maybe tear it right off, check out Peter Singer's essay The Singer Solution to World Poverty and also the book by Peter Unger, Living High and Letting Die referenced within.
My multi-decade experience in the world of large bureaucracies has taught me this: If you get stressed every time your organization does something insanely stupid, the only effect will be to make yourself miserable.Throw not your pearls before swine. Organizations are incapable of learning by being told--if they ever learn, it is only from catastrophe.
Your play is to do whatever is in your own personal interest (which would include the interest of your family and friends, and perhaps innocent bystanders).
"Linux will set your computer on fire."And if you have an attached printer, it could burst into flames too! Surely you've heard of the famous "lp1 on fire" bug! And if your attached printer runs Linux, it could explode in a double-bad pool of flames!!! (Oh, my head hurts just thinking about it...)
Without patent protection, you'd have a free rider problem. Sure, but trade that against all of the societal problems that IP causes. We already deal with "free riders" when it comes to national defense, fire+police protection, hospitals, etc. It's not that we cannot live without patents--the question is whether we have the collective will to change our current system.
I agree that if there are patents involved, that changes everything. To the degree that Sun is using patents against Free Software, the situation is no longer benign, and I'd consider them evil.
Right. I know exactly what RMS's goal is--he's been completely consistent for decades. Sun, on the other hand, well, I'm not sure what they're up to...
...which I learned from my mother: Fill your mouth with cold water and sit on a hot stove. When the water boils, the toothache will be gone. Did she learn that at the Condi Rice school of Home Dentistry?
I think it's fair to ask whether Sun has an agenda in choosing one license when they could have chosen another. That's not the same as saying that they don't have the right to choose any license they like.
Personally I don't really care. Solaris is about where Perforce is--they can still make money, but the leading edge has passed them by, probably forever. The thought of using an OS/distribution with which I couldn't install (say) callgrind in 90 seconds is just about unthinkable at this point.
s = re.sub(r'(foo|bar)', lambda m: arr[m.group(0)], s)
This particular example fits Perl's chunking a little better. For the other side of the story, consider
$str =~ s/($foo[bar]/$arr{$1}/g;
which no real person understands. (What kind of variable is 'foo'? Is 'bar' are bareword? ...)
3. Small, simple standard I/O. Many languages write to STDOUT easily. Few read from STDIN *or* a file this easily: "while(<>) { &foobar $_; }" for line in fileinput.input(): foobar(line) Fewer still let you slurp STDIN, too: "{local $/; $_ = <>;}" That's either sys.stdin.readline(), sys.stdin.read(), or sys.stdin.readlines(). My Perl is rusty from lack of use.A better way to look at the situation would be to ask yourself, "In properly formatted code, what purpose do braces serve?"
If you consider this a while, you may decide that the answer is "None.".
Take my word for it: Python is worth learning. It may not always be the right tool for the job, but in my experience, more and more it is.
You seemed to have missed the point of my original post. I didn't say that (say) rehab center workers would be upset by legalization--I was referring to those who make large profits from the illegal drug trade.
One pattern does seem clear: once FLOSS gets a start in an area, it appears to attain supremacy within about five to ten years. And once FLOSS takes a niche, proprietary software never takes it back.
There will probably always be proprietary software, but days of Microsoft's primary niches are numbered.
It also helps politicians pander to ignorant members of the right.
If I recall correctly from my undergraduate days, it's possible (i.e., I did it) to write a knight's traversal algorithm that finds its solution with no backtracking, for reasonably small boards (including 8x8). No stack required.
If you want to read something on this subject that will turn your head around and maybe tear it right off, check out Peter Singer's essay The Singer Solution to World Poverty and also the book by Peter Unger, Living High and Letting Die referenced within.
Your play is to do whatever is in your own personal interest (which would include the interest of your family and friends, and perhaps innocent bystanders).
and insert the enclosed CD-ROM into a PC... :-)
If it was up to me, yes. But in reality I barely have one myself...
Once again, Microsoft demonstrates that they cannot compete with technical excellence--their only chance is to win by cheating...
Actually, I'm running my current project with 800+ processes, split across 100 8-way CPUs. I'm lucky in that it's a very parallelizeable problem.
I agree that if there are patents involved, that changes everything. To the degree that Sun is using patents against Free Software, the situation is no longer benign, and I'd consider them evil.
Right. I know exactly what RMS's goal is--he's been completely consistent for decades. Sun, on the other hand, well, I'm not sure what they're up to...
Just wait until you find out what Solaris uses for its root shell...
I'm pretty sure I saw this in a movie (se7en aka Seven). The guy in the movie didn't look too good after 12 months...
but not with the DRM.
...which I learned from my mother: Fill your mouth with cold water and sit on a hot stove. When the water boils, the toothache will be gone. Did she learn that at the Condi Rice school of Home Dentistry?Personally I don't really care. Solaris is about where Perforce is--they can still make money, but the leading edge has passed them by, probably forever. The thought of using an OS/distribution with which I couldn't install (say) callgrind in 90 seconds is just about unthinkable at this point.