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


Forgot your password?
Last Chance - Get 15% off sitewide on Slashdot Deals with coupon code "BLACKFRIDAY" (some exclusions apply)". ×

Comment My low tech, DIY solution (Score 2) 340

I work from home a few days a week, and I've now had a standing workstation at home for about 2 months. I really can't justify (or afford) the cost of a commercial, height-adjustable rig, and they don't look substantial enough for me. I'm in my late forties, so after 2 and a half decades of sitting work, resulting in frequent, though minor, back pain at the end of the day, and particularly after the 1+hour commute to/from the office, so I thought I ought to try standing, and see if it helped. I certainly didn't want to invest £1,000 to just to try it out...

I had an old wooden computer desk in the garage, gathering dust, so I basically cut the legs down so can sit atop my normal work table, braced with some spare planks and G cramps. The work top is at my elbow height, and it's wide enough to accommodate two 24" LCD's. It's ugly and hackish, but functional and stable. I didn't buy any materials specifically for it, though - I just used wood and screws I had on hand.

So far, I've found that my back pain is far better, and I feel more flexible. The first week was less comfortable, as I obviously wasn't used to so much standing - I requisitioned one of the bar stools from the kitchen breakfast bar so I can sit or lean if I want to, but I'm doing that less and less these days. I'm now finding that the days in the office, where I have a standard, sitting workstation, are getting to be less and less comfortable.

Comment Re:That's what you'd call an anti-pattern! (Score 1) 486

It's even worse - they had to rig the code badly to make their point - and the original is still in the comments!

catString = addString + concatString # modified: concatString = concatString + addString

Here, they are *prepending* catString with addString, which means that catString has to be re-allocated and re-copied every single iteration (EXPENSIVE!)

If you revert the code to the original, it runs about twice as fast as the naive straight-to-disk writer. This is due to a cPython optimization that actually extends the memory the string is stored in, and pastes the second string into it, without re-allocating and copying it, thus preventing the quadratic performance of the anti-pattern.

in-memory: String took 0.17798614502, file took 0.00357103347778
disk-only: file took 0.225710868835

When I re-wrote it using a string join, it came out like this:
in-memory: done properly 0.169091939926, file took 0.00345587730408

Comment That's what you'd call an anti-pattern! (Score 1) 486


for i in range(0, numIter):
    concatString = addString + concatString # modified: concatString = concatString + addString ...from the in-memory part of the experiment. Any Python programmer knows you don't do it this way. Strings in Python are immutable, so this re-allocates concatString every time round the loop, most likely causing multiple garbage collection cycles. It's obvious that this is not written by a Pythonista, as it's not "Pythonic" code. No wonder it's slow.

Better (maybe not the best, tho. Call me lame... )

concatList = []
for i in range( numiter ):
    concatList.insert( addString )
concatString = "".join( concatList )

Comment Re:The Selfish Gene (Score 1) 249

I'm actually reading that at the moment, and this point is made multiple times; charity towards others that almost certainly contain some of the same /genes/ as yourself, is at its basic level, just your genes being selfish. Dawkins also talks about game theory, saying it backs up his theory (I don't have the book with me right now, so I can't quote the researchers he quoted, nor their theories, sorry).

Comment Re:Not interesting (Score 1) 85

Bacteria have NOT stopped evolving (nor has anything else). Evolution is a constant process anyway, but for specific proof, new strains of infectious bacterial diseases are constantly appearing - this is evolution. For a specific example, the use of Penecillin and similar anti-biotics has been an evolutionary selector for microbes that are capable of surviving these drugs - where we now have certain "superbugs" which have evolved from "normal" bacteria. In this case, humans have influenced the process of natural selection, and the result is that only those fit to survive Penecillin have survived in these environments. That's how evolution works.

Comment Re:What? My 8y/o Peugeot 307 does about 60MPG (Score 1) 717

However, whilst answering another post above, I realised I'd made an incorrect assumption: American Gallons not the same volume as Imperial (UK) Gallons, so the American figure is deflated in our eyes.

What Americans call 54MPG the we in the UK would call 64.8MPG.

That probably puts it into perspective for us in the UK. But my 8y/o Peugeot still has a book rating of 62MPG "extended urban cycle".

Comment What? My 8y/o Peugeot 307 does about 60MPG (Score 1) 717

I guess they must be talking about getting traditional US gas guzzler sedans and MPV's to do 54MPG.

Here in the UK, with fuel prices at an all time high, I'm buying diesel at about £6.50 a gallon (£1.43/litre). That's about $10.40 a gallon ($2.29/litre), and most of the difference between UK and US is made up for by tax.

That and a higher population density is probably why we tend to buy smaller, more economical cars here in the UK. I have just switched cars from a 12 year old 1.4 litre petrol (i.e. gasoline) engine to a turbo diesel engine of the same size, and slashed my fuel bill by almost 50% - it was costing me about £300 ($480) per month on fuel, as I commute for 1 hour each way to and from work. So now it's down to about £155 per month. The only reason I didn't do it sooner is because I had to save up two and a half grand to buy a newer car. Over the next two years, I'll recoup the cost of this newer car in fuel savings alone!

So it seems to me that the most obvious way for the US to achieve this goal is to go the same route as we have - tax fuel at a similar rate. But we all know that's not going to happen...

Comment Nearly 20 years worth of Linux! (Score 2) 867

I've been using Linux for nearly 20 years, and have used whatever seemed most useful at the time or whatever was dictated by the organisation I worked at. I used Ubuntu on my desktop/laptop for about 5 years, until Unity came along, then hopped about for a while looking for an alternative to Gnome 3, even trying Fedora 13 with KDE for a while. On servers, I have historically favoured CentOS/Red Hat based systems, but in latter years have moved over to pure Debian.

1993 Yggdrasil - floppy disk install
1994 Slackware
1995 Red Hat 2 - CDROM install
1999 Red Hat 9
2000 Mandrake
2005 Ubuntu 5.04| Fedora Core 4
2006 Ubuntu 6.x|Fedora Core 6|CentOS 4.x
2008 Ubuntu 8.x|CentOS 4.x|Red Hat Enterprise Linux 5.x
2009 Ubuntu 9.x|CentOS 5.x|Red Hat Enterprise Linux 5.x|Slackware 9(?)|Fedora Core 8
2010 Ubuntu 10.10|CentOS 5.x|Red Hat Enterprise Linux 5.x|Fedora Core 8!|Proxmox VE 1.x|Debian Lenny
2011 Fedora Core 13 KDE|Linux Mint 11(?) Debian Edition|CentOS 5.x|Red Hat Enterprise Linux 5.x|Debian Lenny|Proxmox VE 1.8
2012 CrunchBang Statler|CentOS 5.x|Red Hat Enterprise Linux 5.x|Debian Squeeze|Proxmox VE 2.1|Scientific Linux 6.x

Comment Misdirection or smear campaign (Score 1) 343

Sounds like some kind of warped attempt to discredit FOSS to me. It just doesn't sound like the sort of thing that "the community" would do. It's rather counter-productive if someone thinks it will make people start to take FOSS more seriously. I can't help thinking that this is only part of the story.

Comment Back it up and nuke it! Then scan the backup. (Score 2) 320

Back up all the data and then re-install the OS from scratch. Before restoring the data, do a thorough threat scan on it, to make sure there are no nasties lurking in there. If the machine has been rooted, then you simply can't guarantee that anything else you do to clean it up will get rid of all threats. Hope that helps! (I missed a chance there to evangelise on Linux!)

"Consider a spherical bear, in simple harmonic motion..." -- Professor in the UCB physics department