Slashdot Mirror


User: david.given

david.given's activity in the archive.

Stories
0
Comments
1,291
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 1,291

  1. Re:The Absolute Minimum..." on CJKV Information Processing 2nd ed. · · Score: 1

    Actually, I do it mostly in C --- I picked Java for that example because it has a really simple example of getting it wrong.

    And when you say Perl supports random access of Unicode strings, are you sure it's not just giving you random access to an array of Unicode code points --- which is also wrong? Remember that a single Unicode glyph can be made up of an arbitrary number of code points.

    Even in European languages, trying to split a string between the combining accent code point and the base character code point will have really weird results. In Asian languages things just get worse. The only sensible thing to do is to treat the each glyph as an atomic substring of variable length. Which, of course, means you don't know where they are in the string...

  2. Re:The Absolute Minimum..." on CJKV Information Processing 2nd ed. · · Score: 2, Interesting

    I liked this: "There Ain't No Such Thing As Plain Text. If you have a string, in memory, in a file, or in an email message, you have to know what encoding it is in or you cannot interpret it or display it to users correctly."

    My Unicode mantra is:

    "You can't do random access on strings. No, not even if you turn it into UCS-2. Or UCS-4. Yes, Java is lying to you."

    This is because a Unicode printable thing can span multiple bytes and multiple code points. You can't find the nth character in a string, firstly because Unicode doesn't really have such a concept as a character, and secondly because you don't know where it is. This Java code:

    char c = s.charAt(4);

    ...doesn't do what people think it does --- it returns the 4th UTF-16 sequence thingamajig that may actually contain only part of a code point, and that code point may actually only contain part of a glyph, and trying to string slice without first checking you're at the end of a glyph is going to cause people from countries that use combining characters to hate you, because your app will break.

    So in essence, in order to manipulate strings, you need to step through them from one glyph to the next, each of which may occupy an arbitrary number of bytes. So you might as well use UTF-8.

    A while back I wrote a word processor using this technique: WordGrinder. It worked surprisingly well; the whole thing is 6300 lines of code and the first version took a month to write. I'll admit that I chickened out with RTL and entry and display of combining characters, but the text storage core can cope with them just fine.

    But it does require a rather different philosophy for managing text than in the good old ASCII days, which is a pain in the arse sometimes...

  3. Re:In real units... on Bugatti's Latest Veyron, Most Ridiculous Car on the Planet? · · Score: 1
    Fair enough --- I had a lot of trouble finding figures for the 'average' wind turbine. Mostly they just quote them in the mythical 'power X homes' terms.

    The business park where I work has a single turbine as a landscape feature, an Enercon E-70. Now I look, I see someone's updated the wikipedia page with a power output figure --- 2MW.

  4. Re:All cars use a lot of energy on Bugatti's Latest Veyron, Most Ridiculous Car on the Planet? · · Score: 1

    A 4 cylinder, 1.6 liter engine running at 3500rpm will give you 30kw of power and thus power an average house no problem.

    I gather that if you live in the kind of climate where you need heating, you can scavenge the waste heat from the engine; the resulting heat-and-power combination apparently beats the pants off most other systems for efficiency.

    Pity about the noise, really; I once passed an apartment block with one of these things, and it sounded exactly like it had a small car engine in the basement. No wonder, really.

  5. In real units... on Bugatti's Latest Veyron, Most Ridiculous Car on the Planet? · · Score: 5, Informative
    ...1000 horsepower is 750 kilowatts. Your average house electricity supply is 30 kilowatts. A single wind turbine, the really big kind they use in wind farms, generates about 1500 kilowatts.

    1000 horsepower is a lot of power.

  6. Re:Why is JFS the red-headed stepchild? on EXT4, Btrfs, NILFS2 Performance Compared · · Score: 4, Interesting

    Maybe it's just a case of, "it's a fine filesystem, but didn't really bring any compelling new features or performance gains to the table, so why bother"?

    I think because it's just not sexy.

    But, as you say, if you look into it it supports all the buzzwords. I use it for everything, and IME it's an excellent, lightweight, unobtrusive filesystem that gets the job done while staying out of my way (which is exactly what I want from a filesystem). It would be nice if it supported things like filesystem shrinking, which is very useful when rearranging partitions, and some of the new features like multiple roots in a single volume are really useful and I'd like JFS to support this, but I can live without them.

    JFS also has one really compelling feature for me: it's cheap. CPU-wise, that is. Every benchmark I've seen show that it's only a little slower than filesystems like XFS but it also uses way less CPU. (Plus it's much less code. Have you seen the size of XFS?) Given that I tend to use low-end machines, frequently embedded, this is good news for me. It's also good if you have lots of RAM --- an expensive filesystem is very noticeable if all your data is in cache and you're no longer I/O bound.

    I hope it sees more love in the future. I'd be gutted if it bit-rotted and got removed from the kernel.

  7. Re:Don't be so quick to defend the corporations. on Senators Want To Punish Nokia, Siemens Over Iran · · Score: 1

    No one forced them to sell systems to allow oppressive regimes to track and crack down on dissidents.

    Remember, software doesn't censor people. People censor people!

    How come selling software to places like Iran is considered bad, while selling arms and nerve gas to places like Iraq isn't?

  8. Re:*rolleyes* on Has Google Broken JavaScript Spam Munging? · · Score: 1

    Don't get me started on pedant.

    ITYM 'pedantry'. HTH. HAND!

    And your other point is only valid if you assume that the people are going to politely wait in a FIFO queue. In my experience, people are much more likely to mill around in a mob, resulting in an unordered set. Although if they keep interrupting each other, maybe it would be more like a stack...

  9. Re:*rolleyes* on Has Google Broken JavaScript Spam Munging? · · Score: 4, Funny

    <pedent>

    This, of course, is the traditional spelling/grammar flame typo. I think it's a law of nature.

  10. Re:*rolleyes* on Has Google Broken JavaScript Spam Munging? · · Score: 1

    Seriously, queue the obfuscation != security thing.

    <pedent>

    'Cue', actually. A queue is a data structure and something you stand in in the post office. A cue is a tool for playing snooker with and a signal indicating that it's time for an actor to go on stage and perform. Hence, 'it's your cue', which is the sense in which you're using it here.

    Don't get me started on hear vs. here and less vs. fewer...

  11. Re:And? on SSN Required To Buy Palm Pre · · Score: 1

    Who needs a contract?

    I'm in the UK, and I have a PAYG phone with Virgin Mobile. Call rates aren't cheap, at 15p per minute for the first five minutes of each day and then 5p per minute thereafter, but I don't make phone calls much and I mostly use it to receive calls. Text messages are 3p to 12p depending on who I'm texting. The big win, though, is that I get 25MB of data for 30p a day, only the days I use it.

    This makes it ideal for travelling, where I can use the phone to look at time tables and web browse as much as I like. I can even plug it into my laptop and get tethered net access. When I'm visiting my father in the wilds of Scotland it's actually cheaper (as well as much faster...) to use GPRS than try to connect via his ancient dialup line.

    And because I don't have a contract, I'm not tied down and I'm not wasting money if I don't use it. If I don't want to pay for it, I don't. The phone stays active provided my account is positive and I make one call every six months or so. I think that I spend about 20 pounds every 18 months or so.

  12. Re:Open source smart phone on Best Handset For Freedom? · · Score: 2, Interesting

    They did, but that is not at all what you did. You tried to say the microcode running on the radio is part of all the software. When people say that, they don't mean microcode. Not on the radio, and not in the CPU core.

    Right. But the OP specifically said that it had recompiled its OS and had verified that none of it was sending data to unauthorised sources. But the OP hadn't checked the radio, and wouldn't be able to, because the radio is a binary blob. Which means that it could have been sending data anywhere, for all the OP knew; the radio sees all data going over the air, knows exactly where you are, and has access to big chunks of the device's physical memory (which means it could probably, if it wanted to, snoop the application processor's workspace). If I were the DHS and wanted to know where every citizen was at all times, that's where I'd put my code.

    'Microcode' is a misnomer; the G1 radio processor runs a twenty megabyte operating system image. It's not a small or simple thing. Anything could be happening in there.

    (Usually these things are encrypted to prevent people from looking inside; the G1's isn't, though, and running strings on it shows that it seems to be the OKL4 variant of the Pistachio L4 OS. That's unusual --- things like VxWorks or Nucleus are more common. If you're interested in these things it's actually worth a look; there are a lot of interesting comments in there.)

    My point is that being able to audit the obvious source code gives you nothing. Computers these days aren't simple CPUs attached to memory any more. If you're going to trust T-Mobile's radio stack you might as well trust the main OS as well. Auditing the main OS (which is, in itself, a task beyond most humans) without also auditing the radio stack gains you nothing.

  13. Re:Open source smart phone on Best Handset For Freedom? · · Score: 2, Insightful

    The GP had said that because they had recompiled all the software on the phone; lets assume that they haven't...

    I'm using the traditional meaning of the phrase 'all the software', and assuming they had.

    Also, the GSM stack is not "untrusted" unless you don't trust T-Mobile...

    ...which the GP doesn't. Otherwise he wouldn't have replaced the firmware.

  14. Re:Open source smart phone on Best Handset For Freedom? · · Score: 2, Interesting

    No, that's not what I mean. You can't make phone calls on it without talking to the GSM protocol stack. The GSM stack runs on the radio processor, and is closed source. It's not in the git repository. The GP had said that because it had recompiled all the software on the phone; it hadn't, it'd only recompiled the stuff that runs on the radio processor.

    So in order to be able to make phone calls, it has to run untrusted software (that could well be snooping the memory space of the application processor and sending his credit card details off to the New World Order using GSM debug packets). The same applies for the DSP firmware and the GPU, assuming the G1's GPU is programmable.

    In order for the GP to completely trust its phone, it would have to remove the GSM protocol stack completely, and therefore lose the ability to make phone calls.

  15. Re:Open source smart phone on Best Handset For Freedom? · · Score: 4, Insightful

    With these criteria, I can recommend the T-Mobile G1. I compiled my own OS image...

    I doubt that. If you had, you wouldn't be able to make phone calls on it. The GSM stack runs on its own processor core, has its own closed-source operating system shipped as a binary blob, cannot be upgraded without the encryption key that they won't give you, and for excellent regulatory reasons even if you did have the key, turning the radio on while running unauthorized firmware would get you beaten to death by lawyers.

    Sure, you can run your own code on the applications processor, but let's face it, any modern electronics device is full if little (and not-so-little) processors running lots of code that you have no access to. You simply have no idea what any of that stuff is doing. Auditing the code running on the apps processor is a start, but no more than a start.

  16. Re:Power to the people! on Newspaper Crowdsources 700,000-Page Investigation of MP Expenses · · Score: 1

    "Power corrupts, but we all need electricity."
    --- Diana Wynne Jones

  17. Re:what's defined as culturally british? on UK Tax Breaks For "Culturally British" Games · · Score: 1

    Actually, if you go look at the election results, you'll see that the BNP only did very slightly better this election as they did last election --- the only reason they got seats was because so many Labour voters protest voted by going elsewhere (and, mostly, not the BNP). But that's okay, you can continue to feel smug and self-righteous if you like. You obviously know best...

  18. Re:It's not generation on English Market Produces Energy With Kinetic Plates · · Score: 1

    You're right, paving a road with them would be silly. So don't do that, then. Instead put them in places where you're expecting to waste energy anyway, such as, I don't know, those speed bumps you always see inside supermarket car parks...

  19. Re:what's defined as culturally british? on UK Tax Breaks For "Culturally British" Games · · Score: 1

    I think the people at the BNP know exactly what those values were.

    Yes --- depressingly, you are quite right... I'll amend my statement to: I don't think people who vote BNP know what the values are.

  20. Re:what's defined as culturally british? on UK Tax Breaks For "Culturally British" Games · · Score: 4, Insightful

    what's culturally british? ruling at the barrel of a gun for a century, poaching wildlife to extinction, or collapsing stable democracies so that you can rape a country of its natural resources?

    Don't forget that the ethnic cleansing, the genocide, the slavery, the wars started solely to gain political favour at home, the systematic disregard for human life (not just abroad, either), and the levels of bigotry that make the KKK look liberal. We also have the dubious distinction of being the inventors of the concentration camp. The British Empire was not a nice place and the world is better without it. (Not that the other colonial powers were any better, of course.)

    I don't think people like the BNP who keep going on about the erosion of British values actually know what those values are.

  21. Re:It's not generation on English Market Produces Energy With Kinetic Plates · · Score: 3, Informative

    Technically, you're right. Practically, cars waste such vast amounts of energy that the energy drain for this thing (about equivalent to driving over a small bump) probably couldn't even be measured.

    People don't understand just how much energy cars use, because car engines are typically measured in horsepower rather than in kilowatts. But it's the same quantity --- they're dimensionally equivalent. It's instructive to play with Google's units converter a bit: the Tata Nano, the world's cheapest car, has a crappy little engine producing 33 horsepower. That's 25 kilowatts, which is slightly more than the entire electrical supply to my house. A typical racecar produces about 400 kilowatts. A medium model wind turbine (with a 50m tower) produces about 600 kilowatts.

  22. Re:...lol on Wii Boosts Parkinson's Treatments · · Score: 2, Interesting

    Exercise is like sex, when you're doing it your body is spewing dopamine, endorphins, and bodily fluids in all directions. If you're doing it right, it feels great.

    Only if you're lucky.

    Some people have bodies tuned to do this. You're obviously one of them, and I envy you: you get rewarded for exercise. Other people don't. I find exercise uncomfortable, very hard work, and unutterably dull. I don't zone out, I don't get endorphins, I just have to keep working at it, and it never gets any easier --- if I train, all that happens is that I can keep going longer, which means I can prolong the agony. Some reward.

    And yes, I am doing it right. A couple of years ago I entered a 10km road race in my town, and with that deadline as an incentive I carefully trained up over a couple of months, and eventually did the race and got a decent time (about 1 hour 5 minutes, IIRC). I've still got the pot-metal medal they gave me for completing it somewhere. Did I get a feeling of accomplishment for doing this? Yes. Was it worth my time? No, not really.

    Of course, you probably won't believe me, telling me that I simply need to find the right technique, or the right sport for me, etc. The problem is that athletic types tend to have metabolisms like yours, and because you get a biochemical reward you find it very hard to empathise with people like me, who don't. While you find working out etc to be a goal in and of itself, the only way I can do it on a regular basis is by iron willpower. I'm sure that if I were to exercise hard every day for six months or so my metabolism would change gears and I'd get those mythical endorphins, but dear god, the mere thought makes me cringe...

    (BTW, I can only recall one case of an exercise related endorphin rush: I was spending New Year in Switzerland, in a hutte at the top of a 600m ascent. The first day I climbed it I felt really, really good, disturbingly so, for about 30 minutes afterward. The other 13 days of my two week holiday? I climbed that sodding mountain every day, and all I felt was tired...)

  23. Re:Is it worth it anymore? on AT&T Dropping Usenet Netnews; Low-Cost Alternatives? · · Score: 1

    Although, those =d7 sequences did give me nightmares. ;-)

    Too much Nethack?

  24. Re:Is it worth it anymore? on AT&T Dropping Usenet Netnews; Low-Cost Alternatives? · · Score: 2, Funny

    No, no, no. When trolling a programming forum, make damn sure you post in HTML-formatted text.

    Sigh. Kids today, no imagination, that's the problem...

    What I used to do was to have a four-line McQ compatible signature containing lots of Unicode line art. My newsreader would then encode this as Quoted-Printable (which is perfectly normal according to the standard). However, people who had ancient newsreaders that only supported ASCII would see the signature as a long line of =d7=81=43=99=e3=11 sequences.

    People would go apoplectic with rage over this, accusing me of things like posting HTML, posting binaries, not having a 80x4 standard signature, etc. And then, when they were absolutely frothing at the mouth, I'd point to the headers of my postings and say: "What, Content-Type: text/plain isn't good enough for you?"

    Good times. Good times...

  25. Re:I've got one already... on 7-inch Android Netbook From GNB · · Score: 1

    It's called a CnMBook.

    That looks like a rebadged SkyTone Alpha 400, a.k.a. the World's Cheapest Laptop (it hit the news here a while back). There's about a dozen different products based on it for sale.

    They look fascinating, and at some point I want to get one. I can think of lots of things to do with one, from using it as a cheap web browsing appliance to a lightweight mini server to a serial console to an automation computer. Plus, MIPS is cool. Skytone appear to be working on successor models to the 400, but they have ARM processors.