Slashdot Mirror


User: Fweeky

Fweeky's activity in the archive.

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

Comments · 1,807

  1. Re:Ruby on Rails May Not Suck · · Score: 4, Insightful

    Ruby code beyond "hello world" and simple arithmetic looks like gibberish to me. Ruby looked like gibberish to me, too. Coming from ARexx (heh) and PHP, with a bit of C etc, seeing:

    %w{foo bar}.map {|e| e.upcase }
    Simply didn't mean anything to me; map? What are those {}'s doing? What's |e|? What the fuck's %w{}?! It's bit of a triple-whammy really; first you've got a bit of perlish shorthand (%w{foo bar} == ['foo', 'bar']; make an array containing these words), second you've got a code block with slightly Smalltalkish parameter syntax, and third you've got an unfamiliar verb "map".

    But you're right, once you actually grasp some of the concepts (and if you don't know about things like map/select/reject/inject (reduce), you really fucking should, I don't care what language you use) and the basics of the syntax, it all just flows; make an array, make a new array from it by running the upcase method on each element, just like:

    array_map('strtoupper', array('foo','bar'));
    Only it doesn't fall to bits when you want to do non-trivial things to the elements. After that, it's mostly getting familiar with what the other methods do and getting used to using/chaining them. If it doesn't go from confusing to obvious or even useful outside Ruby in an hour or two, you're probably doing it wrong.

    Similarly when it comes to things like metaprogramming; it starts off confusing and ends up being a force multiplier for your work. The confusion hopefully means you're learning something new, and you don't become a better programmer by running away from that.
  2. Re:Neat in theorey, imho. on Cryptographically Hiding TCP Ports · · Score: 1

    Or, you could be a bit more proactive about making sure the things you depend upon are working and set up a little system monitoring so you know when things fail.

  3. Re:hmm. on BitMicro Takes Wraps Off 832 GB Flash Drive · · Score: 1

    25*76G 2.5" 15kRPM drives + shelf: ~£6500, ~900G RAID-10, ~4000 IOPS, 2U + server, 200W.

    2*832G 2.5" SSD: £????, 800G RAID-1, ~40,000 IOPS, fits in 1U server, 10W.

    They could be £5k each and still be rather attractive, though the crappy write performance on SSD's reduces their appeal rather a lot.

  4. Re:How vs. Why on Science Text Attempts to Reconcile Religion and Science · · Score: 1

    If there is no why, then we are here for no reason at all. And if we are here for no reason at all, why behave nicely? ... If we are here for no reason at all, what is the justification that I can't just kill left and right, for the hell of it - other then being killed myself, which, given there is no purpose, doesn't matter? What the fucking fuck? Rape and murder is wrong because there's a Really Big Guy who doesn't like it and will punish you for it once you're dead? The lack of an externally enforced reason for existance would leave you unable to form a decent moral base for life? That sounds.. psychopathic.

    Because if you believe we are here for no reason at all, but still care about poor people, drug abuse, the environment and war in remote countries, then you are acting extremely irrationally. In what way is that? See, just because Big Angry Loving Beardy Guy doesn't fly around in the model of reality I have built in my head, doesn't mean my own existance isn't important to me. In fact, the natural processes I'm certain have led to my existance have imbued me with certain drives which pretty much ensures that I want to live, and live well, and want the same for my kin.

    That these drives have been built by natural selection and not Magic From Outside Time[tm] is irrelevent; I still care about people in accordance with the Strong Suggestions of the Monkeysphere, and this handy ability to think abstractly about things means I'm even willing to put the effort in to go a bit further than that, because it's good for me and everyone else.

    This handy ability to think also allows me to form my own fairly abstract goals about life above and beyond the basics nature has good practice with, and killing people isn't really a very good way of achieving those goals. Are you really so listless that you can't do the same, and instead need to follow someone else's rather strange set of goals and guidelines for achieving them just to stop you murdering people for fun?
  5. Re:Firefox... on MS To Push Silverlight Via Redesigned Microsoft.com · · Score: 1

    "Bring the capabilities of running Silverlight applications on Linux."

    Ok, and all the other freebie OS's? Solaris? BSD's? Different architectures? Presumably it'll Just Work if Mono does...

  6. Re:Firefox... on MS To Push Silverlight Via Redesigned Microsoft.com · · Score: 1

    Also, if Google don't know how to index it, not interested.

  7. Re:But that's Ruby itself! on Rails Bigwig Rails on Rails Community · · Score: 1

    Ruby is Lisp with Perl syntax. YES!!! I knew it! each time i take the time to try to learn this while knowing python I cant bring my self to see why they use it for web programming. Perhaps it's because they see something you're missing when you "try to learn" it. And I assure you, "Perl syntax" in the context of Ruby is no excuse, because there's practically none; @ and $ sigils are completely benign and probably more informative than Python's endless underscores, magic Regexp variables are a bit icky but completely understandable (and largely avoidable if you're that bothered), and the syntax used for lambdas/blocks has more to do with Smalltalk than Perl, and isn't exactly tricky.

    Unless you wet yourself every time you see someone in Python using a lambda or list comprehension I don't really see where you're coming from.

    then prel (just as i write this) brings to mind the feeling i had while writing CF, that i must get by without writing a function Why? Because sub bla { } is so incredibly difficult for your poor little addled mind? Perl's not exactly a beautiful language, but it's rather powerful. I can understand what you mean if you didn't have a clue what you're doing though :P
  8. Re:But that's Ruby itself! on Rails Bigwig Rails on Rails Community · · Score: 1

    My pet rant against the Ruby guys is that they use multi-sillable (usually invented) words to describe their own favorite Ruby features Uh? What, like closure, or mixin? Ooh, big words..

    the time you save with the simpler and more regular syntax. Now it's time you provided an example.
  9. Re:You need more data before you jump to conclusio on Computer Glitch Halts Seattle New Year's Fireworks · · Score: 1

    If you look up corrupted file you will see that every operating system known to man has to deal with that. There is no operating system that can magically correct the corrupted file and cause a fireworks display to run correctly. That is just silly talk. ZFS checksums everything, and mailing lists and blogs are full of people mentioning that it's detected and corrected corruption on their HD's. Sometimes it's corruption that's been happening unnoticed for years on other filesystems, aside from the odd mysterious crash, now reduced to a number in the CKSUM column of zpool status (provided there's a good alternative copy, which doesn't have to be on a different disk).
  10. Re:Tyan on Best Motherboards With Large RAM Capacity? · · Score: 1

    I'm running a Tyan Thunder K8WE with 8GB and a pair of 275's using FreeBSD. Excellent expansion, solid hardware, and well liked, though getting on a little bit; you might like to look at some of the newer Socket F options.

    These boards aren't cheap, though; here in the UK you're looking at ~£250, which looks to be about the same as Xeon motherboards. You have specialist needs, suck it up.

  11. Re:Your AMD Options on Best Motherboards With Large RAM Capacity? · · Score: 1
    Just be careful what you put on a ServerWorks HT1000 board, they have some nasty bugs that need to be worked around (Linux and Windows should be ok):

    Implement a workaround of the datacorruption problem on serverworks HT1000 chipsets.
    The HT1000 DMA engine seems to not always like 64K transfers and sometimes barfs data all over memory leading to instant chrash and burn. Somewhere there's a QA team which needs to be set on fire.
  12. Re:Tyan on Best Motherboards With Large RAM Capacity? · · Score: 1

    Heh, I've seen that before. This was an Antec PSU connected to an EpoX motherboard (a single socket SoA) with a couple of doming capacitors. It melted part of the ATX connector into the motherboard socket (these are the 5v lines, same as yours); the board still worked, but it had some stability issues, and the 5v line reading from the on-board sensors was sagging badly (unsurprisingly; much of it's clearly being lost as heat).

    I gave the board to a more electrically oriented friend; he cleaned up the socket, and still uses the board today. I don't use Antec PSU's any more, though.

  13. Re:critics... let me guess on Hospitals Look to a Nuclear Tool to Fight Cancer · · Score: 1

    While insurance based private healthcare never cuts corners by telling patients to fuck off and die because of any of a long list of excuses, and indeed always at least tries for the tens of millions without insurance. And of course those with insurance can always afford their treatment despite deductables and co-pay schemes.

    Wait, doh. Well, at least they do pretty well with catastrophic care when insurance does pay up, but if you don't think it's similarly flawed I have a bridge you might be interested in buying.

  14. Re:36.4% of the world's computers have LimeWire in on Report Says 36.4% of World's Computers Infringe on IP · · Score: 1

    Boomkat's another one I came across a few months ago.

  15. Re:Or.... on Convert NSF Files to MP3s · · Score: 1

    Or indeed use foobar2000 and the Converter plugin; no need to switch to a different output module for playback, just select, right click -> Convert, and it'll spawn off $numcpu threads to handle it without disturbing your playback.

    Oh, and it's not full of bloated crap, doesn't really wish you were paying for it or installing their IE toolbar/systray agent/etc, and doesn't default to using awful skins.

  16. Re:Where can I buy one? on Top Solid State Disks and TB Drives Reviewed · · Score: 1

    They'd be reasonable in a server. We just spent £6000 on storage for a single system where we're more interested in IOPS than capacity, and if we could spend a similar amount for much faster storage you can be sure we'd seriously consider it.

    It's just a shame most manufacturers seem to be concentrating on mobile users, not those who need serious IO.

  17. Re:Why Ruby? on Ruby 1.9.0 Released · · Score: 1
    |a,b| are a block arguments list, like (a,b) are method arguments in def bla(a,b).

    The block of code in {..} is passed to bla as an argument; bla(&foo) says "If you're passed a block, turn it into a Proc object and put it in the variable foo". foo.call then calls the block with whatever arguments you pass it. The example is just to show that block passing is a general purpose construct, not a special case for list processing, hence all the nonsense variables.

    e.g. if you add:

    def cleanup_after_foo
      puts "Cleaning up"
    end
    def moo() end
    def woo() end
    You get:

    Before foo
    Cleaning up
    NoMethodError: undefined method `frob!' for nil:NilClass Note that even though the code block raised an exception, the bla method caught it and hid the details of cleaning up afterwards, while still letting the exception propagate (which is what File#open(..) { .. } and other resource-allocation based methods tend to do). It could also catch the exception and retry, or it could call the block multiple times over a collection (thus you get each()), put the results into another collection (and thus provide map()/collect()), or just save the block for later use elsewhere (e.g. you can have a block to calculate the default value for any unset key in a hash).

    A simplified real-world example may be more useful than generalized foo/bar/baz/moo:

    run_once do
      server do |client|
        category,title = client.gets.chomp.split(/\t/,2)
        client.puts lookup(category.to_i, title).map {|record| record.id }.join(",")
      end
    end
    run_once() wraps a bunch of setup code; pidfile handling, config file reading etc. server() spawns off a bunch of worker threads, and uses the code block in those workers to handle each client. Both have their own resource control (server ensures the client gets closed and logged cleanly, for instance) and exception handling (server logs and keeps going, run_once logs/prints and exits with a >1 return code). map { } just modifies the array lookup() returns to only contain the record ID's.

    Obviously you could achieve the same sort of effect using callbacks, either by making more methods or defining lambdas, but you just need to see how rarely array_map() in PHP is used compared with map/collect in Ruby to see that doesn't exactly encourage use; you'd normally tediously write yet another foreach() and do it yourself.
  18. Re:Why Ruby? on Ruby 1.9.0 Released · · Score: 1
    They're not really list operations like Python's, that just happens to be what the method calls do.

    def bla(&foo) # you could also skip the &foo and use block_given? and yield
      puts "Before foo"
      foo.call(moo, woo) # in 1.9 you can write foo.(moo,woo)
      puts "After foo"
    ensure
      cleanup_after_foo
    end
     
    bla {|a,b| b.frob!(a) }
    Methods can receive blocks of code, or not, and call them whenever they want, however many times they want, pass them around, whatever. With Ruby2Ruby you can even get an AST out of it (which at least one SQL abstraction library uses to build SQL statements). They're pervasive; want to fork or thread? Pass the fork method or Thread.new the code you want them to execute. Want to open a file? Pass it a code block and it'll autoclose when your block exits. Run some code to handle each match in a string search/replace? Pass String#gsub the block.

    Yes, you can get much the same behavior in Python by passing about lambdas, ala Ruby's foo(lambda {|bla| bla.moo }), but it's not so natural that you find yourself doing it everywhere with the blessing of your standard library.
  19. Re:where's unicode? on Ruby 1.9.0 Released · · Score: 1

    Traditionally, Ruby's considered a String as being a stream of bytes; with Unicode that breaks down somewhat, especially UTF-8 where each character might be a different length. Unicode support means it's aware of the encoding, and thus can behave sensibly when you ask things like, "how long is this string?" (is that how many bytes or how many characters?), and "give me the character at location 5" (is that 1 byte 5 bytes in, or whatever the encoding says the 5th character is?).

    Similarly, Ruby's now using Oniguruma, a very nice multibyte-aware regexp library; and of course that needs to be encoding aware so it knows how much . etc should match and what offsets you're expecting.

    I haven't looked at it too closely, but one of the reasons it's taken so long was matz saying he wanted to get it right, and to not just support Unicode but be entirely charset and encoding neutral; yes, it's developed by a lot of people who write using crazy multibyte glyphs, but that doesn't mean they all use Unicode for them.

  20. Re:Huh? on FSFE Supports Microsoft Antitrust Investigation · · Score: 1

    Acid 2's hardly an exhaustive test of standards compliance. Passing it's good, but a decent HTML, CSS and JS test suite involve more than a smiley face and one person saying "yup, looks like a smiley face, here's a downsampled gif".

  21. Re:how much? on Afterlife Will Be Costly For Digital Films · · Score: 1

    I have batches from just a few years ago which are unreadable. Some of them even have holes in them. Mostly it's the crappy cheapo media, but even the fancy ones aren't exactly super reliable.

    And people use these to make *backups*?

  22. Re:Is it really that hard to solve? on Afterlife Will Be Costly For Digital Films · · Score: 1

    Just because you're using a DVD doesn't mean you have to write MPEG2. People who backup to DVD-R don't convert their disk images to .ts before burning them do they?

  23. Re:A bit of trivia... on Alpine 1.00 Brings Pine Back · · Score: 1

    I've tried using mutt, but there seems to be a big learning curve before a mere mortal can use it. Nice keybindings help; 98% of my use in mutt is just left/right/up/down -- far left is the mailbox list, right enters a mailbox, right enters a mail, right lists the attachments, right views an attachment. r/g for reply, m to write a new message. l ~s foo to search (limit) by subject, l ~f to search by from, etc.

    bind pager <up> previous-line
    bind pager <down> next-line
    bind pager <left> exit
    bind pager <right> view-attachments
    bind attach <left> exit
    bind attach <right> view-attach
    bind index <right> display-message
    macro index <left> "<sync-mailbox><change-folder>?<toggle-mailboxes>"
    bind browser <right> select-entry
    bind browser <left> exit
    Granted, getting it all working/looking as you like it can take a while, but a decent example config got me going pretty quickly, and it's served me well for many years. The last I heard about Pine was it finally getting thread support; makes me wonder what else it must be missing. Maybe I'll take a look at Alpine, that was a while ago.
  24. Re:MS does have some valuable patents on Microsoft is the Industry's Most Innovative Company? · · Score: 1

    The gif has contrast turned way up, it looks almost as bad as Apple's. My setup with it turned all the way down looks nothing like it. If I look really close I can see a tiny bit of fringing, but only someone who seriously needed glasses would do that.

  25. Re:MS does have some valuable patents on Microsoft is the Industry's Most Innovative Company? · · Score: 1

    Looks pretty sharp to me. Maybe you need to turn down the contrast.