Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×

Comment Re:Simple set of pipelined utilties! (Score 1) 385

If you really buy that principle and want to enforce it religiously, then please never use a web browser again (even Lynx!), not to mention any other complex program that isn't formed from a bunch of small "do one thing well!" utilities that are executed in a pipeline.

You seem to think that those hating on systemd like having to use bloated, slow, barely-configurable, GUI-only, privacy-hemorrhaging browsers just to access their {bank/email/news/etc.}.

The existence of some high-profile non-UNIX projects isn't an excuse to dismiss UNIX practices. In fact, popularity is often correlated with barely-adequate, lowest-common-denominator offerings (eg. pop music).

Comment Re:Hahahaha (Score 1) 405

Wait. You run with a crowd nerdy enough to regularly attend star parties, but none of them are nerdy enough to recognize an operating system?

How does one "recognize an operating system"? Even if there's a fanboi wallpaper, it can't be seen most of the time (assuming the machine is actually used for something). If I'm running a full-screen astronomy app, how would you know the OS?

Comment Ripple/Stellar? (Score 1) 134

Ripple is a payment network in direct competition with PayPal, which just-so-happens to use a Bitcoin-like internal currency for mediating incompatible transactions. Stellar is a fork of Ripple which has been generating some buzz recently.

I would bet that PayPal's venturing into BitCoin in order to close the gap these systems are trying to exploit: ie. using a purely virtual, unregulated currency to make transaction costs near-zero. Out of all the choices they could make, BitCoin seems the most logical as it's already well established.

Comment Python scope (Score 2) 729


def mkCounter():
        c = 0
        def counter():
                c = c + 1
                return c
        return counter

count = mkCounter()
print str(count())
print str(count())
print str(count())

You'd expect "1", "2" and "3", right? Wrong!


$ python test.py
Traceback (most recent call last):
    File "test.py", line 9, in
        print str(count())
    File "test.py", line 4, in counter
        c = c + 1
UnboundLocalError: local variable 'c' referenced before assignment

When Python parses the definition of "counter", it sees the assignment "c = ..." and assumes that we must be defining a local variable "c", so it creates a slot in "counter" to contain "c". This local slot shadows the "c" inherited from "mkCounter", so when we get to evaluating "c + 1" we get this "referenced before assignment" error.

Note that it's perfectly fine to *use* inherited variables, just not to *assign* them:


def mkPrinter(s):
        def printer():
                print s
        return printer

p = mkPrinter("hello world")
p()

This prints "hello world" as we'd expect.

Comment Re:Assignement in Python (Score 2) 729

Assigning a number or a list in Python and many other languages (Julia) is a different operation. Such as

>>> a = 2
>>> b = a
>>> a = 1
>>> b
2

>>> a = [2]
>>> b = a
>>> a[0] = 1
>>> b
[1]

Octave (Matlab) is more consistent on this point, every assignement is a memory copy.

I'd find it alarming if Python *didn't* act that way! In Python, everything is an object and objects are passed by reference; hence altering the contents of "a" in your second example is clearly going to alter the contents of "b", since they're references to the same object. In the first case, you're altering *which object* "a" points to. It's completely consistent.

The alternatives would be crazy (from an OO perspective).

To make your second example act like your first one, we would need to *pass* everything by value. This means we couldn't, for example, use a "Logger" to collect messages from different parts of the program. Instead, each method would end up with its own copy of the Logger, containing only those messages from function activations which are still on the stack. As soon as any method returns, its Logger would be lost, along with all of the messages, unless we bypassed the language via the filesystem or a DB. This is *exactly* the situation you describe, except with "Logger" instead of "List" and "message" instead of "number". Note that this is exactly the situation in Haskell, which is why it needs things like the Writer Monad.

To make your first example act like your second, we'd need to *assign* everything by reference, in which case your first example would replace the "2" object with the "1" object, which is a pretty bad idea ( http://everything2.com/title/C... )

Comment Re:it's not the ads it's the surveillance. (Score 1) 611

If I could be sure I could be surveillance free I'd pay $230. But I don't see how that is possible. How would I know?

Simple; every site you visit can use cookies, Flash supercookies, third-party Javascript, user-agent sniffing and mouse-movement tracking to identify and monitor everything you do, in order to make sure it's not being surveilled.

Of course, there's always the chance that such power will be abused. To prevent this, we can have an alliance of government spy agencies keep a look out by tapping undersea cables, collating the data in vast stores for data mining, purchase known security vulnerabilities, employ legions of crackers to find more, deliberately weaken security standards, disseminate malware and intercept datacentre traffic.

Of course, there's always the chance that such power will be abused. To prevent this, we can have secret courts hold secret sessions to make secret rulings based on secret interpretations of the law.

Of course, there's always the chance that such power will be abused. To prevent this, we can have oversight committees which publically state that none of this is going on, then when the details emerge they have the choice of either admitting that they completely failed in their job, or that they were lying.

Of course, there's always the chance that such power will be abused. To prevent this, we can hold democratic elections to choose which one of the two available crooks should get that power.

Comment Re:A rather simplistic hardware-centric view (Score 2) 145

A lot of the commodity software reached the point of 'good enough' years ago - look how long it's taken to get away from XP, and still many organisations continue to use it.

I find it hard to believe that operating systems became "good enough" with Windows XP. Rather, Vista took so long to come out that it disrupted the established upgrade cycle. If the previous 2-to-3-year cycle had continued, Vista would have come out in 2003 (without as many changes, obviously), Windows 7 in 2005 and Windows 8 in 2007. We'd be on something like Windows 12 by now.

It's good that consumers are more aware and critical of forced obsolecence, but I don't agree with the "XP is good enough" crowd. It makes sense to want the latest (eg. Windows 8); it makes sense to use something until it's no longer supported (eg. Vista); it makes sense to use something that's "good enough" (eg. Windows 95 for features, or 2000 for compatibility). XP is none of those: it's out of date, unsupported and a bloated resource hog.

Slashdot Top Deals

Those who can, do; those who can't, write. Those who can't write work for the Bell Labs Record.

Working...