Forgot your password?
typodupeerror
User Journal

Journal: More mod abuse 1

Journal by morgan_greywolf

Well, Mr. 4-digit UID asshat: I now know who you are. Let's just say my spies are everywhere. Oh, no, I'm not going to call you out. I want you to sweat it: does he really know or not? Because you don't want a war. You really don't want to pick a fight with me. I've been on this system at least as long as you have. Think about what that means. Or are you too stupid? Better watch your back, pal.

Microsoft

Journal: Another Open Letter to Brad Smith

Journal by morgan_greywolf

This is another open letter to Brad Smith, Microsoft's general legal counsel, in regards to their thinly veiled Linux patent threats and related lawsuit against TomTom.

(Disclaimer: As I am a nobody as far as Microsoft is concerned, I don't honestly expect Brad Smith or anyone at Microsoft to read this, and I don't care. Mostly I'm just blowing off steam and getting my beefs out in the open).

So it's come to this, is it? Suing over an ancient filesystem developed from the the 1970s (FAT) and the assorted ugly hackish kluges that have been necessary to keep the decrepit pile of garbage on life support? The one that only became a defacto standard because at one time its use was all but mandated by some older versions of Microsoft Windows that didn't support anything else? You know, the one originally developed for floppy disks?

Why don't you just stop your lawsuit now before you get laughed out of the courtroom? Seriously, you guys are starting to look more and more like your old sock puppet, The SCO Group? Remember them? Yeah, they're basically on life support now thanks to IBM, Novell and Red Hat practically bankrupting them. Guess they chose the wrong opponents to pick a fight with, huh?

So you thought maybe TomTom would roll over and play dead, eh? I guess they didn't. Especially now that they're backed by the Open Invention Network.

So you have $20 billion in the bank? Wanna watch that money continue to slowly dwindle whilst you fight the Linux community? You don't get it do you? A lot of people with serious cash have a vested interest interest in watching Linux succeed in dwindling your market share. You think others in the industry aren't prepared to enter the melee between you and TomTom? Wrong.

Give it up before you embarrass yourself. Seriously.

The Internet

Journal: The Pirate Bay Undergoing DDoS attack

Journal by morgan_greywolf

Sys-Con.tv is reporting that The Pirate Bay is currently offline due to massive DDoS attack:

I just got word that "someone" is currently DDoS'ing the thepiratebay.org. Even more interesting it may be a hijacked botnet causing the problem. More details as they come in.

Interesting. Now we'll know if the theories about the BitTorrent network experiencing difficulties if/when The Pirate Bay gets taken down are true.

In related news Wired is reporting that the prosecutor and Hollywood are demanding prison sentences for the four defendants in The Pirate Bay case.

Data Storage

Journal: Three SSD Myths Busted: The Currently Definitive SSD Report

Journal by morgan_greywolf

Think SSDs are so much wickedly faster than top of the line mechanical drives like the Western Digital Velociraptor? Maybe not. Bill O'Brien has an article on his site debunking three common myths about solid state drives (SSDs):

Myth 1: A Solid State Disk will boot faster than mechanical hard drive.
This is true but it's partially smoke and mirrors as well. When SSDs first appeared, they were rather pathetic 8GB and 16GB devices. Not much fits in that size. Even at 32GB you'll still be somewhat cramped if you have hardware drivers and applications. But when you get to 64GB or 80GB or 128GB -and you have some room to feel confident about carrying the additional software you need around with you--you start to add time to the boot process.

Some of you may remember Bill O'Brien from his stint at Computer Shopper, where he co-wrote The Hard Edge with Alice Hill.

User Journal

Journal: Slashdot 2.0 1

Journal by morgan_greywolf

I've seen a bunch of complaints lately about the new beta index. Now, I know that it's been in a state of rapid flux in the past few weeks as they try different things -- sometimes the thing doesn't even render right. Of course, this is 'beta', so you take your lumps as they work out the bugs.

Other than the occasional rendering problem and associated weirdness, though, I have to say that I rather like the new interface.

Wha? Why are you all looking at me like that?

Seriously. Listen. Okay, I don't like the green "idle" look very much, either. I personally think it's a bit difficult to read. But, other than that, I think the changes improve the usefulness of the site. Firehose has become more integrated with the main page, for instance. The whole thing is more dynamic, more AJAXy and overall the feel is much faster and much easier to sort through to find what you're looking for.

If you don't like it, you can always use the RSS feeds.

I welcome your opinions and comments, especially opposing viewpoints.

Programming

Journal: Never write another configuration parser -- ever. 1

Journal by morgan_greywolf

Okay, so I'm a little slow at jumping on bandwagons. Having written code to parse everything from XML configuration files to Windows-style .INI files, I've always thought that writing code to create and parse configuration files sucked. And that things like ConfigParser and xml.dom.minidom in Python made it suck a little less.

So, having worked with XML, I had heard of JSON as an alternative to XML and always thought "Wow. I'm going to have to write ANOTHER parser? Ugh." Obviously I just didn't get it.

So I wrote a little proggie the other day and needed an object-oriented-type configuration file for it and thought, for some strange reason, they I should do something a little lighter weight than XML. Flat .INIs weren't going to work because, well, they're flat. ;) So I decided to give this JSON thing a try.

I looked at the JSON documentation for Python 2.6 (and simplejson for Python 2.5, which the Python 2.6 json module is based on) and went huh? That's it? That can't be it. I'll need to write more methods than that surely.

As I looked more and more at it, I realized uhhhh...a JSON file looks rather like a Python dictionary (like a hash table in Perl or C) with str and numeric values. And lists! (Values can be lists!) Perfect. And when you parse it, you get exactly that -- a big Python dictionary. Wow! *slaps forehead* How much easier can you make it than that?

So you can have


{
        "window": {
                "width": 150,
                "height": 200
        },
        "bookmarks": [
              {
                  "name": "Slashdot - News for Nerds. Stuff that Matters",
                  "url": "http://slashdot.org" },
              { "name": "Google Docs",
                  "url": "http://docs.google.com" },
        ]
}

(forgive me if Slashdot mangles the indentation as it usually does)

and then you can access the whole shebang via


>>> import json
>>> configFile=open('foo.rc','r')
>>> config=json.load(f)
>>> config['window']['height']
200
>>> for bookmark in config['bookmars']: print bookmark['url'] ...
http://slashdot.org
http://docs.google.com

And the JSON file can be entirely self-documenting: You can put literally anything you want for each of the key:value pairs.

And since writing out the JSON file is just easy (just in reverse), you can easily write a configuration GUI, with the same brand of direct access to the JSON structure.

Now that's easy.

User Journal

Journal: Oh, joy! Moderation abuse! 48

Journal by morgan_greywolf

This is an open letter to my friend, the personal troll.

Okay, this is getting old. Someone, who obviously has a couple of sock puppet accounts (and nothing better to do), went and modded a bunch of my posts as trolls today. They must really hate me, because they waited until two of their accounts got mod points, and then blew 8 of their 10 mod points on lil' ol' me.

Probably the same person who's been trolling me for the past couple of weeks.

Whoever you are, if you had some testicular fortitude, you wouldn't hide behind socket puppets and AC trolls. I'm asking you now, as a man (or woman as the case may be), to do the honorable thing and post, not AC, with your real account, right here. Then we can discuss your issue with me, one-on-one via e-mail if you prefer.

I seriously doubt you'll do the honorable thing because you've already shown that you're a coward with no honor.

User Journal

Journal: Slashdot known astroturfers list #2

Journal by morgan_greywolf

In the coming days I will be documenting known Microsoft astroturfers, together with evidence that paints them as such. Do what you will with this information. I will try to list only actual astroturfers, not fanboys, but I can't be 100% certain who-is-who. So, I will gladly accept any exceptions/modifications in the comments below. If you are the person in question, don't feel bad if I label you an astroturfer and you are not -- but you will be required to prove that you are not an astroturfer in order to be removed from the list.

Note: this list is hardly complete and will be issued in its entirety about once per week.

Update: thanks to those who have submitted updates and comments!

freddy_dreddy
Defcon79
ThinkFr33ly
Julie188 (her blog, linked in her sig currently), plus looking at her posting record, only posts in stories that are of interest to Microsoft.
Thaad.Isolas (to this date, this is his ONLY post, and the account is older than that)
PoiBoy evidence evidence

See this journal entry for evidence links for the other posters.

Programming

Journal: Python 3.0 Review 3

Journal by morgan_greywolf

(Also titled, 'Python 3.0: the good, the bad, and the ugly)

Here's my review of the changes in Python 3.0. I've been writing stuff in Python since 2.1 or so, and I tend to like Python's 'new' object system. I hate Lisp and I hate functional programming(*), so that makes me a bit of an oddball in the Python community I guess.

Good: The print statement has been replaced with a print() function, with keyword arguments to replace most of the special syntax of the old print statement (PEP 3105).

Maybe I just spent too many years writing C and Borland Pascal/Delphi code, but when I first started coding in Python, I often made the mistake of writing

print('Hello world')

rather than

print 'Hello world'

Now it's the way it should have been all along. Things are more consistent this way.

Additionally, the sep= keyword argument makes life easier. No longer do you have put the separator repeatedly in your quoted string especially if the separator is not a space!

Bad: The dict methods dict.keys(), dict.items() and dict.values() return "views" instead of lists. For example, this no longer works: k = d.keys(); k.sort(). Use k = sorted(d) instead (this works in Python 2.5 too and is just as efficient).

Why did they change this? I make use of dict.keys() rather a lot. *sniff*

Ugly: range() now behaves like xrange() used to behave, except it works with values of arbitrary size. The latter no longer exists.

It seems like they changed this just to be pedantic. Tell me what the improvement is in making range work like xrange and then removing xrange? Why not just keep both?

Bad: The ordering comparison operators (=, >) raise a TypeError exception when the operands don't have a meaningful natural ordering. Thus, expressions like 1 None or len are no longer valid, and e.g. None raises TypeError instead of returning False. A corollary is that sorting a heterogeneous list no longer makes sense - all the elements must be comparable to each other. Note that this does not apply to the == and != operators: objects of different incomparable types always compare unequal to each other.

Some of my favorite stupid Python tricks rely on the fact 'None' in fact does not raise a TypeError and instead causes an expression to return False. Oh well. Guess I'll be using a ton more exceptions. :-/

Ugly: PEP 0237: Essentially, long renamed to int. That is, there is only one built-in integral type, named int; but it behaves mostly like the old long type.

So if you're going to only have one type, instead of no longer accepting 'long', make 'long' an alias for 'int'. Now that wasn't too hard was it?

Good: PEP 0238: An expression like 1/2 returns a float

About fscking time. Damn, you have no idea how many times I looked at expressions like 1/2 and went "Huh? Whadya mean 0?"

Good, Bad and Ugly: Python 3.0 uses the concepts of text and (binary) data instead of Unicode strings and 8-bit strings. All text is Unicode; however encoded Unicode is represented as binary data. The type used to hold text is str, the type used to hold data is bytes. The biggest difference with the 2.x situation is that any attempt to mix text and data in Python 3.0 raises TypeError, whereas if you were to mix Unicode and 8-bit strings in Python 2.x, it would work if the 8-bit string happened to contain only 7-bit (ASCII) bytes, but you would get UnicodeDecodeError if it contained non-ASCII values. This value-specific behavior has caused numerous sad faces over the years.

I agree, but changing it is going to be a real pain for a WHOLE lot of programs. Specifically 2to3 and -3 isn't able to fix a lot of these differences.

Meh: PEP 3107: Function argument and return value annotations. This provides a standardized way of annotating a function's parameters and return value. There are no semantics attached to such annotations except that they can be introspected at runtime using the __annotations__ attribute. The intent is to encourage experimentation through metaclasses, decorators or frameworks.

Okay, but we're already doing this throw DOC strings. Why change it now?

Good: PEP 3102: Keyword-only arguments. Named parameters occurring after *args in the parameter list must be specified using keyword syntax in the call. You can also use a bare * in the parameter list to indicate that you don't accept a variable-length argument list, but you do have keyword-only arguments.

Okay, this is more consistent with how arguments work...

Meh: PEP 3104: nonlocal statement. Using nonlocal x you can now assign directly to a variable in an outer (but non-global) scope. nonlocal is a new reserved word.

If you're going to explicitly change the scope of a variable, you might as well make it global, huh? Some people are just too pedantical.

Good: PEP 3132: Extended Iterable Unpacking. You can now write things like a, b, *rest = some_sequence. And even *rest, a = stuff. The rest object is always a (possibly empty) list; the right-hand side may be any iterable. Example:

(a, *rest, b) = range(5)

This sets a to 0, b to 4, and *rest to [1, 2, 3].

Oh, goody! No more writing a, b, dummy1, dummy2 = function()

Good: Dictionary comprehensions: {k: v for k, v in stuff} means the same thing as dict(stuff) but is more flexible. (This is PEP 0274 vindicated. :-)

and ...

Set literals, e.g. {1, 2}. Note that {} is an empty dictionary; use set() for an empty set. Set comprehensions are also supported; e.g., {x for x in stuff} means the same thing as set(stuff) but is more flexible.

I always thought there should be a way to do this...

Ugly: New octal literals, e.g. 0o720 (already in 2.6). The old octal literals (0720) are gone.

But the old way was consistent with Unix...

Good: Change from except exc, var to except exc as var. See PEP 3110.

I hated the old way. To me, there isn't a lot of difference between except (exc, exc): and except exc, var: so I was always getting confused.

Ugly: PEP 3113: Tuple parameter unpacking removed. You can no longer write def foo(a, (b, c)): .... Use def foo(a, b_c): b, c = b_c instead.

Why? I mean, I read the PEP and understand the introspection issues, but um, if you don't like it, just don't use it.

This and the rest of the removed syntax: These seem like silly, pedantic political issues.

Bad: Library changes: why change the names of libraries without leaving aliases to the old names? You're just being pedantical again. Stop it.

Ugly: String template changes and the '%' string operator

I never saw anything wrong with the '%' operator.

The Rest

'file' is already an alias for 'open'. Again, why rename something in a destructive way? What's wrong with just leaving the damn alias there?

(*) More accurately, I hate programming purism. I tend to mix and match various techniques and metaphors and 'use what works' rather than get all uppity about things like how a function should never modify a global variable. Sometimes that's just the best way to do it.

The Media

Journal: PC Magazine calls it quits 1

Journal by morgan_greywolf

I just heard on Pacifica's "Democracy Now!" that PC Magazine is calling it quits after nearly 30 years. Kind of a sad day, really. I remember PC Magazine was one of the first publications to have an online presence -- they had their own BBS in the 1980s and by the 1990s they added PCMagNet, their own forum on CompuServe (or CI$ as it was known back then ;).

I used to look forward to PC Magazine for their new utilities every month, their "how to" and "tips and tricks" columns, Alfred Poor's computer fixes column, and, of course, my favorite, 'Abort, Retry, Fail?', which was a humor column that highlighted the funniest typos, goofy ads and PC-related photos from around the country. Even John C. Dvorak had a clue at one time -- when he first encountered Linux in the early 90s, he was flabbergasted that you could get the source code to an entire OS on a CD. And he even predicted that Linux would go places one day. Really. :)

Farewell, PC Mag!

What do you guys remember?

User Journal

Journal: Slashdot known Microsoft astroturfers list #1 5

Journal by morgan_greywolf

In the coming days I will be documenting known Microsoft astroturfers, together with evidence that paints them as such. Do what you will with this information. I will try to list only actual astroturfers, not fanboys, but I can't be 100% certain who-is-who. So, I will gladly accept any exceptions/modifications in the comments below. If you are the person in question, don't feel bad if I label you an astroturfer and you are not -- but you will be required to prove that you are not an astroturfer in order to be removed from the list.

Note: this list is hardly complete and will be issued in its entirety about once per week.

Update: thanks to those who have submitted updates and comments!

freddy_dreddy evidence
Defcon79 evidence
ThinkFr33ly evidence
Julie188 evidence (her blog, linked in her sig currently), plus looking at her posting record, only posts in stories that are of interest to Microsoft.
Thaad.Isolas evidence (to this date, this is his ONLY post, and the account is older than that)

Programming

Journal: Asynchronous (non-blocking) I/O for subprocesses in Python 1

Journal by morgan_greywolf

In case you're just immediately drooling to find the answer to this conundrum, I found it on ASPN: a module to allow asynchronous subprocess I/O through a pipe that works on both POSIX and Windows.

Anyway the full story: I started looking up the necessary pywin32 calls (along with their corresponding C Win32 API calls, since the pywin32 documentation sucks) to do it -- I knew I might need to create a pipe with CreatePipe and set it as FILE_FLAG_OVERLAPPED and then pass it CreateProcess via the startupinfo parameter. I then figured out that I could do most of this by subclassing subprocess.Popen. I also found PeekNamedPipe, which also might do what I needed ... and then, voila, after searching for some Python/Pywin32 examples that used a few of these API calls, I came across the above-linked recipe on ASPN.

(I already knew I could achieve what I wanted on Unix by subclassing Popen and using select and fcntl and knew how to do it. It was just convenient that the above happened to already be using the technique for POSIX OSes)

It would be really cool if that noah guy could add support for this technique in Pexpect, and in fact, it's the next logical step. I may, for my project, end up subclassing Pexpect to write my own implementation using asynchronous pipe I/O rather than a pty. This has several disadvantages, I know, but for most of what I use Expect or Pexpect for, it won't make one bit of difference.

One thing, though, is that I don't know if there is any problem with using code posted on ASPN in a GPL v2 or v3 application. Anyone know the details? And, there seem to be some disdvantages listed on the linked article, such as Cygwin's bash and sh not displaying prompts and problems with Python code on Windows. Anyone know how to fix those?

Programming

Journal: Win32 SetNamedPIpeHandleState for asynchronous I/O on a pipe 1

Journal by morgan_greywolf

Anyone know why SetNamedPipeHandleState should not be used for asynchronous I/O (i.e, 'overlapped' or 'non-blocking' I/O) on a named pipe? MSDN just says don't use it it's only here for Lan Manager 2.0 backward compatibility.

Just curious. Seems like you could use it to do non-blocking reads without setting up an OVERLAPPED structructure, etc.

Programming

Journal: The Tcl/Expect Rant

Journal by morgan_greywolf

First off, let me say that Expect is an awesome tool. It's great, especially, for writing GUI front-ends to CLI applications. Of course, if you want a nice-looking fully-modern GUI, you're not going going to be using Expectk. The Tk toolkit is ugly and ancient.

Now enters Python, PyGTKand Pexpect. Pexpect, for those who don't know, is a pure Python Expect-like module.

Pexpect is great -- right up until you need to run on Windows. After that, well, you seem to be pretty much out of luck with Pexpect, as it can't run on Windows, since it relies on Python's pty module, which is not available on Windows.

So, in looking around for other Expect implementations -- it seems none of those work on Windows, either -- with one exception: the Don Libes original Expect, which now runs on Windows.

Great! Only one problem: now I have to write my CLI handling code in Tcl.

Let me just say that Tcl sucks. It's horrible. Maybe you like functional programming, like Ruby or Lisp or Scheme. I hate it. I'm an OOP guy. I prefer OOP. Yes, I know about XOTcl, etc., but at the end of the day these extensions are like putting lipstick on a pig. (Ha! Thanks to the 2008 Presidential Election, I now LOVE this expression! ;)

For example, in GUI-front-end writing, you often need to build your command line from a list of arguments. With Pexpect, you just do something like this:


from pexpect import *

command="mycommand"
switches="%s -a %s" % (switches, argument_for_a) ....
cmdline='%s %s' % (command,switches)
child=spawn(cmdline)

With Tcl Expect, you'd think you could do something similar:


set command "mycommand"
append switches [format "-a %s" $argument_for_a] ...
set cmdline $command
append cmdline [format " %s" % $switches]
exp_spawn $cmdline $switches

But, nooooo. Expect passes $switches as one big-long fsckin' argument

Ok, fine. Pass it a list! Change everything to lappend, etc., and that should work right?

Nooooo. Then Expect mangles it even worse and passes the list like this:

"{arg 1} {arg 2} {arg 3}" -- literally. Braces and all.

Grrr.. Okay, looking closer, exp_spawn expects to see each argument to the program passed as a separate argument. Okay, there must be some way to break a list into separate args.

There is. In Tcl 8.5. It's called 'expand'. Never mind that ActiveTCL 8.5 doesn't come with Expect, and the only way, it seems, to get it is to pay for it. Fsck you, ActiveState.

So, I was working with ActiveTcl 8.4.19. Which doesn't have 'expand'. Nowhere in the docs is it mentioned what to do. I found a forum post, fortunately, and figured out that the 'eval' command will break a list passed to any command into separate arguments by forcing another round of expansion before calling the exp_spawn. It took me hours to find this little nibble of Tcl wisdom.

WTF? Why is Tcl so ..... friggin' bass-ackwards! If I wanted my programming to be this kludge-ridden and ugly, I'd've written the damned thing in bash! Or csh. Or DOS batch files!

Bleck. Tcl sucks.

Alternative viewpoints are welcome.

The Almighty Buck

Journal: The investment banking crisis for geeks 1

Journal by morgan_greywolf

Those of you with little business knowledge and reading lots of confusingly-written news articles might be confused by what caused the whole investment banking collapse, with financial legends such Lehman Brothers and Merryll Lynch tanking. So here it is in a nutshell, explained in geek language by a geek for geeks.

Newsweek finance columnist Robert Samuelson, in his latest article, (RTFA. Really. You'll enjoy it. ;) puts it this way:

Finally, investment banks rely heavily on borrowed money, called "leverage" in financial lingo. Lehman was typical. In late 2007, it held almost $700 billion in stocks, bonds and other securities. Meanwhile, its shareholders' investment (equity) was about $23 billion. All the rest was supported by borrowings. The "leverage ratio" was 30 to 1.

Leverage can create huge windfalls. Suppose you buy a stock for $100. It goes to $110. You made 10 percent, a decent return. Now suppose you borrowed $90 of the $100. If the price rises to $101, you've made 10 percent on your $10 investment. (Technically, the price has to exceed $101 slightly to cover interest payments.) If it goes to $110, you've doubled your money. Wow.

Note, however, the part that he leaves to the imagination of the reader: what happens if that stock tanks and drops to $90? Heh. Well, they still have to pay back the $90 they borrowed, plus they lost the $10. And if it really tanks bad and drops to $80, they lost $20 for a 200% loss. The risk cuts both ways.

Well, that doesn't seem so bad, though, right? It can't be that all these stocks, bonds and other securities can all go down at the same time, right? Right. Except that the same investment banks made a string of bad purchases. Again, Samuelson puts it this way:

Dubious mortgages were packaged into bonds, sold and traded. Investment houses had huge incentives to increase leverage. While the boom continued, government remained aloof. Congress resisted tougher regulation for Fannie and Freddie and permitted them to run leverage ratios that, by plausible calculations, exceeded 60 to 1.

Now wait a minute. What allowed all of this to happen?

Samuelson hints at it:

Merrill and other retail brokers, which once served individual clients, have ventured into investment banking. So have some commercial banks that were barred from doing so until the repeal in 1999 of the Glass-Steagall Act of 1933.

So, wait a minute. You mean all of this was caused by deregulation of the financial markets? You betcha! As David Lightman put it yesterday in that article I just linked:

In 1999, President Clinton signed the Financial Services Modernization Act, which tore down Glass-Steagall's reforms by removing the walls separating banks, securities firms and insurers.(emphasis added)

Isn't this kind of financial deregulation exactly what caused the Great Depression? Yeah. You should really ask Slashdot reader mcgrew about that, because he seems to know all about it.

Do the math. We're headed for a financial collapse of epic proportions. Pay no attention to the musings of McCain and Palin or Obama and Biden. They're just trying to get elected. Keep reading the articles by guys like Samuelson and mcgrew. These guys know what they're talking about.

Asynchronous inputs are at the root of our race problems. -- D. Winker and F. Prosser

Working...