Slashdot Mirror


User: Paradox

Paradox's activity in the archive.

Stories
0
Comments
710
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 710

  1. Rails has a very clear MVC separation. on Part 2 of Ruby on Rails Tutorial Online · · Score: 1
    At any rate, you tend to define look and behavior in the same file in Rails,
    Excuse me? Uhh, the look is defined by the templates, and the controllers just do the setup and actions. Rails has a very clear separation of view and controller.

    You define look in the templates and behavior in the controller. Sometimes, the behavior is just loading a group of database items into a class variable for display. Sometimes, it's more complex, involving things like redirection and database manipulation.

    But you'd be hard pressed to say the separation isn't there at all.

  2. Re:Ruby? on Part 2 of Ruby on Rails Tutorial Online · · Score: 1
    Nobody has managed to convince me about 'object oriented' vs 'functional' programming. I've seen just as much shit code in every language.
    One thing about Ruby, is that it is very pragmatic concering its feature set. It has very functional features but is still very OO.
    Just get the job done!
    Seriously man, you'd love Ruby. It's probably one of the most pragmatic languages I've ever used, and I've used most of them.
  3. Re:Python Version of RoR on Part 2 of Ruby on Rails Tutorial Online · · Score: 1
    It isn't just Ruby's blocks that make Rails so great. It's the fact that it's possible for Ruby Classes to reopen themselves and dynamically define, alias, and remove methods from themselves.


    When you see a block of code like this in Rails:

    class Person < ActiveRecord::Base
    has_many :addresses
    has_and_belongs_to_many :friends, :class_name => "Person"
    end
    What it does is take the schema for the People table, parse it, and actually re-open the Person class at runtime and adds the methods to support the schema fields and relations.

    Open classes are something many languages frown upon, which is why it's so darn hard to make an ActiveRecord class or an ActionView class like Rails' in another language besdies Ruby.
  4. Caveat on Part 2 of Ruby on Rails Tutorial Online · · Score: 1
    Yeah, it does run under most basic webservers. Not too long ago, Rails needed apache's mod_rewrite to get the pretty URLs. But the addition of Rails Routes fixed that mostly.

    Your web server can run Rails if it does the following:

    1. Can invoke CGI somehow (duh)
    2. Can forward URLs like http://somesite/somename/blah/blah/blah to http://somesite/somename/dispatch.cgi?/blah/blah/b lah
    This is an awful lot of them, and Ruby runs on just about every platform used for web serving, so yeah. Rails could work most anywhere.

    If you can't do the URL forwarding, Rails still works. The URLS are just ugly as sin and you lose some nice URL autogeneration features in the API.

  5. Re:Ruby? on Part 2 of Ruby on Rails Tutorial Online · · Score: 1
    Ruby seems interesting, maybe once I've swallowed VB and Java, I'll get around to it.


    It might be best not to learn Ruby first. If you were to learn it first, learning Java afterwords would be incredibly painful. Nothing makes you realize how bad Java is like learning Ruby.

    VB isn't so bad, I guess, but I'd rather use Ruby and the FX toolkit for those kinds of simple script apps. But Ruby does have an amazign set of winapi bindings as part of the standard library. You might want to elevate it above VB.
  6. Re:Python Version of RoR on Part 2 of Ruby on Rails Tutorial Online · · Score: 4, Informative
    I can't impress you, sorry. But I can say that Ruby blocks are a powerful tool that are very flexible and useful. Ruby iterators are the showcase of this tool, and they're something you use every day in ruby. For example:
    ary = [1,2,3,4,5] # Example Array
    ary.each do |val| # Begin a block
    puts val.to_s + " was here!"
    end
    Blocks can be used inline as above, or turned into true closure-bearing functors like so:
    my_block = lambda { |x| puts x.to_s was here }
    my_block.call "Kilroy"
    ary = [1,2,3,4,5]
    ary.each &my_block
    You can write higher order functions that accept lexical blocks trivially. For example:
    def my_hof( &block )
    yield # Calls the associated block within scope
    block.call #Calls the associated block as a function
    end
    Also, ruby's blocks are used to do neat things like ensure things happen at the end of an operation. File I/O is the classic example. Check out how Ruby's library ensures your file closes:
    File.open( "somefile.txt", "w" ) do |handle|
    handle.puts "This is text in the file."
    end # File is ensured to be closed now
    This is just a small sample of what Ruby's standard lib does with blocks. They're really quite useful. They're like Lisp's lambdas but with a cleaner syntax when used inline.
  7. Re:Ruby? on Part 2 of Ruby on Rails Tutorial Online · · Score: 1

    Because if you don't learn Ruby, you can't use Rails. Rails is so compelling, you'll learn Ruby just to use it. Then you'll realize how incredibly cool Ruby is as a language, and how incredibly productive it is at the same time. And in the long run, you'll be better off for it.

    Yes, Ruby is that good. Rails is a very nice framework, and it does things that you couldn't do easily in other languages (and that includes Python).

    As for editor commands, didn't you know only Emacs users get into heaven? ;)

  8. Re:Comparing RoR with Java solutions on Part 2 of Ruby on Rails Tutorial Online · · Score: 2, Interesting

    Compare the Trails video with any of the Rails videos. It's kind of sad really. The trails video does less than what the Rails video does, and it takes much longer, is more complex, and relies on an IDE. Bummer for Java.

    I'm not sure that Java can be used to replicate Rails. It might be possible, but it would probably mean abandoning a lot of existing infrastructure. Ruby does a lot of very clever/strange things, like dynamically adding methods to classes based off database schemas. The best we've seen Java do thus far is do this kind of thing statically via code generation and hints garnered from the source file comments.

    Trails is a neat idea and it does bring some great things to the table when it comes to Rapid Web Application Development, but it isn't fair (for Trails) to compare it to Rails... at least as of yet, anyways.

  9. (ptr == NULL) is wrong in C, bad in C++ on Optimizations - Programmer vs. Compiler? · · Score: 1

    If you check your C defines, NULL is actually a C value defined in stdio's tree of includes, not in mem or sys. NULL is meant for I/O use, not for use in comparing memory pointers.

    Check the types. Most include files define NULL as something like: (0)

    This is of type int, which you generally shouldn't compare to a type of void*. Your compiler will tend to catch it. While we usually expect that 0 is an invalid pointer, strictly speaking that's not guaranteed to be true on every system out there.

    In C++, 0 is actually a valid and guaranteed empty memory address, but NULL doesn't exist, it's defined by a C header.

    So no matter what C-type you're using, ptr == NULL is bad. Don't do it.

  10. Re:Unpossible to Clean SpyWare? on Microsoft Warns of Impossible to Clean Spyware · · Score: 1

    To answer your question seriously, Mac OS X comes with fabulous CD burning support out-of-the-box.

    Pop in the CD and in creates a disk image of the media. Use it like any other mounted disk. When you're ready to burn, simply click burn. All very easily and works with your available tools for handling files.

    You can also save the image, so you can burn the same thing many times. Heck, you can just make images (.dmg usually) to distribute data as a kind of virtual CD. This is what most mac software vendors do.

  11. But this is what we're talking about! on Study Finds Windows More Secure Than Linux · · Score: 1

    I'm not sure why you're so angry, since we seem to be saying the same thing. I barely even mentioned TFA in my post, we were talking about criticism to Linux in general.

    Legitimate complaints from critics are like free money for the OSS community, because they tell us what's wrong without having to spend the resources to discover it. It doesn't matter if these two are security researchers or your parents. What matters is that we admit that it's possible they have a point.

    If they don't really have a point, then we dismiss them. But we have to keep an open mind and welcome criticism, because occasionally people will hit on real points.

    What concerns me is the rabid Linux fans who got the message that Linux is terrific, but never seemed to understand why. Knee-jerk reactions like yours suggest a closed-mind. I mean, here I say, "Criticism is good, we can find legit complaints every now and then!" and you come down like a ton of bricks. That's what we're talking about.

    Linux has reached it's current state only by fixing many bugs, redesigning many components, and outright admitting that sometimes the other teams had it right. That's what makes Linux such an unstoppable phenomenon.

  12. Linux thrives on criticism on Study Finds Windows More Secure Than Linux · · Score: 5, Insightful

    I wish I could mod you up, bonch. I've experiened the head-in-the-sand Linux mentality too, and it is scary. It misses the whole point of linux.

    Linux is awesome, this study doesn't change that but we always need to work to make it better and easier to secure. Critics of Linux are our best friends, because they do the work of finding out where we need to improve for free.

    The best thing about linux is that when people have a legitimate complaint, it's well within our power to fix it! If Linux is temporarily less secure, so what? After reading this, everyone will adapt their linux distros to render the complaints moot.

    This is part of why we love open source, right?

  13. Re:Black Art? Uh... on Grand Unified Theory of SIMD · · Score: 1

    Yeah, the C library is out there, and it's not too hard to use. :)

    But one could counter that even in the C library, unless you know what you're doing, you may not get as dramatic a speedup as you wanted. Until I looked at serveral of Apple's examples, I couldn't write altivec-aware code properly (i.e. maximum performance benefit).

    Once I knew what I was doing I went back and redid the code, and it ran much faster. So it is still tricky to maximize your bang-for-buck.

  14. But times are changing, this is becoming valuable on Grand Unified Theory of SIMD · · Score: 1
    Recently Herb Sutter (famous software engineering guru and C++ wizard) posted this essay in which he reminds us, among other things, that the generalization of Moore's law to processor is allready failing! While computers are continuing to get faster, it's not just in their clockspeed anymore.

    While memory speeds will continue for awhile, already processor speeds are falling off. Check out this graph from the article where he clearly shows what's happening.

    This brings an interesting dilemma to modern programmers. Programs won't magically get faster anymore. We need to start coding to take advantage of concurrency.

    The same is true of using SIMD units. They can speed up your code dramatically, but they must be taken into account in your code. That's why this macstl project is such a good idea. It is a standard set of common primitives that let you harness the SIMD functions of your processor. By putting a library over the specifics, your vector-aware code will grow with modern SIMD systems.

    Few people will ask you to write in assembly these days, but if you could easily give your math-intensive program a 10x-30x speedup by using one library (that seems very easy to use, by my standards), why wouldn't you?

  15. Re:Well then... on Why Does Windows Still Suck? · · Score: 1
    Oh quit trolling.
    I'm not. You (and the other poster who replied to me) are making the grevious error of forgetting that most slashdot readers are very atypical computer users.
    I already own a router/firewall. That's because I have multiple machines in my home. If I buy a Mac or a PC it'll be connecting to the 'net from behind a firewall. No additional cost.
    Good for you. Too bad for everyone else. The fact that viruses and worms persist for so long should tell you that your situation is unusual at best.
    I don't run anti-virus software. Even if I did, you can get it for free.
    Firstly, not running anti-viral software on a windows machine? Gluttons for punishment need not apply.

    Even so, I won't deny there is quality free virus protection out there. I know of several services that offer it. Two problems with this argument:

    1. Most people immediate respond "Norton" or "McAfee" when you say virus protection. The folks at best buy will cheerfully sell you a copy of these.
    2. Chicken & Egg. I have to go online to download the software, but by the time I get it, I am allready infected. Mean time to infection is down under 10 minutes on an unprotected network. Even with a firewall, it's possible to get email based or mistaken-url virii.
    I do use ad-aware from time to time. It never finds nasty software that I didn't intentionally install. I didn't pay for ad-aware though (they offer a free version) so there's no additional cost. If I use a Mac I'm still at risk of installing nastiness if I randomly download and run stuff.
    You're either incredibly lucky or wrong. Either way, the argument that macs are "just as suceptible" is not really true. While it's true you can run into trojan horses, with a default keychain setup they have a really tough time propogating. Also, Mail.app makes it rather clear what monumental folly running an executable right from an email is (and Apple fixed up their disk automount problem last year).

    Even then, OSX comes with much of the resistance of a system like linux, which is certainly harder to work with than the open book which is WinXP.

    As for "You can't use your regular browser", my regular browser is Mozilla. So I can use it.
    May I reiterate for you? Not default.
    I have a 3 year old PC running windows XP home. It still boots as fast as it always has, it never goes wrong, it never does anything unexpected, it does run the software I want to run. So you may get a hassle-free computer; I get a hassle-free computer that I can play FPS games with new, inventive graphics on.
    You act like I'm saying that it's impossible to make a WinPC experience as smooth as a mac. I don't think I can soundly make that argument. Instead, what I'm saying is that the upfront cost of a mac quickly balances out with the hidden and over-time costs (in terms of effort) that you pay with a PC.

    As a snide aside, how many boring, repetitive FPS games can you play? There's about a billion of them, and 99.9% of them suck.

  16. Well then... on Why Does Windows Still Suck? · · Score: 2, Insightful

    If you need a firewall in order to use the 'net safely, why isn't it bundled and included in the price of these $499 pcs?

    This is why I get irritated at people who constantly go off about how much cheaper PCs are than macs. They never mention these little things, and these little things start to add up real fast.

    You go out and pay $70-$100 for a firewall, get a mcafee virus scan subscription for $35/year. Oh, just to be safe you better grab yourself the latest copy of AdAware, another $40-ish dollars down the drain. Holy cow, your $499 pc now cost you like $700 for the bare minimum! And that's just the beginning of the pain you're in for. You can't use your regular browser, no sir! You need Firefox to avoid totally foobaring your computer. Download and install that.

    Meanwhile, my barely-computer-literate sister's iBook is online without a firewall all the time. She did what the computer recommended and enabled autoupdate and forgot about it. She didn't need to go out and buy any extra software or hardware to use the internet.

    Yeah, Wintel-ites may get a whole bunch of copies of FPS games with new, inventive graphics. I get the privledge of having a hassle-free computer.

  17. Re:Hold it right there, pre-iPod HD players? on iPod Most Popular Music Player on Microsoft Campus · · Score: 1

    They can use Windows Media Player 10 or any other good client (Quintessential Player, J. River Media Jukebox, WinAmp, RealPlayer, MusicMatch) to play, organize, and synch.


    "And coming around the final turn, in the rear is 'Anonymous Coward Misses the Point.'"


    iTunes' integration with my music store does not limit me from using other music stores (although other aspects, like the file format, do). The real power of this integration is that there is no intermediate step between purchase and play/sync/organize/burn. It goes straight into your music collection, indexed and ready.


    The value of that is amazing. Integration with other products always seems to be an american product weak point, and these days there's no excuse for it.


    Besides, I do have a choice of music player (no one makes me use iTunes and there are other iPod sync tools out there), and I chose iTunes. I have a choice of music stores as well, and I have to ask, why would I use anything but the iTunes music store? More songs, the best DRM policies (although no DRM can be called good, less DRM is better).


    The only other music player I've seen that to-date even comes close to giving me as much control over my music collection is MusicMatch, and I still think iTunes is superior to it.


    People do have a choice, and they're choosing the iPod and iTunes Music Store in droves, even when they don't own macs. Heck, we just saw that Microsoft employees are buying them. This is called "Market Domination by a Superior Product and Superior Marketing." It's a rare thing to see, so sit back and enjoy it.

  18. Re:Hold it right there, pre-iPod HD players? on iPod Most Popular Music Player on Microsoft Campus · · Score: 1
    Not that I particularly care what "the market" thinks, but in this instance I seriously doubt that it has made any vote. I know very few people who have used anything other than the iPod and thus have no basis for comparison. This is fine from a market perspective, apple was an early mover who came out with a smooth unit and people thought it was "good enough". More power to them. But I've used a couple units now and they aren't my favorite.
    I think people are more informed than you give them credit for. My grandfather tried a bunch of players and was going to buy a Creative Zen, until I told him he could indeed use an iPod on his PC. After he realized that, it took him about 10 seconds to decide which he wanted.
    Also, I *strongly* prefer the karma browse idiom of picking a letter of the alphabet to narrow the scope instead of spinning through thousands of songs or hundreds of artists to get to the right point in a list of everything.
    This is disingenuous, I'm sure you realize you're comparing philosophies and not features. The iPod revolves around its interaction with iTunes. In general you don't browse your library with an iPod, you use your iTunes organizations to control that. Since it's so easy to dock and control the iPod, and iTunes makes it so simple to control, the iPod deliberately does not go to great lengths to sort through large libraries.

    The same goes for making playlists. The iPod is, conceptually anyways, for playing, not creating lists. I've never tried this operation on a model like yours, but from the controls you seem to have, it'd be obnoxious at best.

    Also, the silly wheel metaphor is OK I suppose, but at least on the 4g is way too sensitive on some menus and not sensative enough in others. Tuning is required here.
    The "silly wheel metaphor" is pretty much hands-down superior, because you can do it continuously. For the Zen and the Karma, you have to keep lifting your hand over and over again, stroking the interface to get where you want.

    As for the sensitivity, maybe you failed to notice that the speed at which you move your hand directly corresponds to the speed at which you move (with a maximum acceleration curve). Move your finger slowly and it's very precise, move it quickly and it goes real fast.

    Also, on the non-interface side, I prefer vorbis and the iPod of course doesn't speak it.
    You're right, I guess. It doesn't speak vorbis. But I like how people complain that they can't get the "better sounding files of vorbis" on the iPod, but the machines they use to play MP3s have a demonstrably lower sound output quality than the iPod.

    That's like complaining that your car's acceleration is unresponsive while you're driving through 2ft deep mud. It's not the car, it's the environment in which it runs!

  19. Re:Hold it right there, pre-iPod HD players? on iPod Most Popular Music Player on Microsoft Campus · · Score: 1

    This is a subjective area, but I've owned both an iPod click wheel and a Rio Karma and overall I prefer the Karma.


    You're welcome to your own opinion, but keep in mind that the market seems to disagree, in general.


    Err, I find the karma's interface is nearly useless compared to the iPod system. The only thing I've seen that's worse, to date, is the Rio Zen interface. My god, that's awful. My thumb hurts just using it.


    Because the iPod menuing system is so weak...


    How is it weak at all? It seems that everyone else copied it nearly verbatim.
  20. Hold it right there, pre-iPod HD players? on iPod Most Popular Music Player on Microsoft Campus · · Score: 3, Insightful
    And there were many MP3 players (both harddrive and otherwise) out before the iPod. Creative had at least half a dozen different models alone.
    Stop right there. If memory serves me correctly, the only notable entry in the world of large-capacity HD-based was the Nomad Jukebox. Rememebr that thing? Dumb as a brick and twice as heavy? The old, "Pray you get 3 hours of battery life" Nomad Jukebox?

    Haha. Very funny. Sorry, not a fair comparison.

    What Apple came up with was a high-capacity affordable music player with an interface that no one has betterted, to date, along with a weight/form/design factor that sits in an optimal tradeoff zone. They also championed a tight integration into a general music suite (as opposed to a separate tool that works on files).

    Oh yeah, and then Apple built the music store into the same client that plays the music, organizes the music, and syncs your iPod. So far only iTMS and MusicMatch even try to do this as more than a token gesture, and it's hard to argue for MusicMatch over iTMS.

    If that's not enough to make it an "innovation" then I don't know what is. Did carriage builders complain that the automobiel was really their invention, just without the engine and obedient steering?

  21. Re:Useless... on Ciphire, A Transparent, Easy PGP Alternative · · Score: 1

    This kind of programming is typical of the cryptographic arena of programming. I suspect that it's a throwback to when systems were small and weak compared to the task of encrypting the text.

    Since mathmeticians don't usually keep up on programming, they tend to learn their style from older works. It's kind of a self-propagating evil. This is why when people come out with easy-to-use, quality encryption software, everyone is shocked.

    For example, there's a little app for Mac OS X called PuzzlePalace, which gives a drag-n-drop interface to libcrypt. It's very easy to use and understand. People love it.

  22. Wait for your messiah before mouthing off. on Rolling With Ruby On Rails · · Score: 1

    All this sh!t has not been done already. Until Perl 6 is ready for primetime, it's nothing compared to Ruby or Python. Perl 6 looks very promising, but I can develop Rails apps today, and have them up-and-running in just 10 minutes.

    Maypole doesn't even come close to matching Rails. I have all kinds of respect for Perl developers, because I was one. But like you said, "We need programmers to act sensibly and use the right language/framework for the job at hand."

    Ruby and Rails are those frameworks for now.

  23. Oh hey, a WO developer on Rolling With Ruby On Rails · · Score: 1

    Wow, I'm surprised to find a WebObjects developer responding. I figured the few remaining WO developers were all hiding ina Y2K bunker somewhere wondering if it was safe to crack the hatch yet, or something. :)

    Seriously though, Rails does things differently from the typically NeXTSteppish way that WO approaches the problem. And there is code, but it's generated, which is the same case with Rails. You didn't think you normally wrote those little two lines did you? Of course not. You generate it and only modify it if you need something special.

    But WO is probably one of the only web development frameworks that I can think of that comes anywhere close to Rails.

  24. Re:Offtopic - Ruby on Rolling With Ruby On Rails · · Score: 2, Informative

    Ruby has an amazing community, almost everything you could want is online.

    Check out www.rubycentral.org, which has an online ruby book (for 1.6, but it's a place to start). It will take you to all the other sites.

    I highly recommend getting in on the mailing list, ruby-talk. It's very interesting.

  25. To quote the developer... on Rolling With Ruby On Rails · · Score: 1
    I found this quote on the Rails Development Weblog.
    Three levels of caching: I implemented page, action, and fragment caching for the Action Pack in Rails so I could be able to use it in Ta-da. And it's working exceedingly well. Lots of pages went from 50-70 req/sec to 400-1100 req/sec due to caching.
    As another data point, consider that www.rubyonrails.com and its wiki are both Rails apps themselves, and are still running along gamely despite the slashdotting they're receiving.

    That may also answer your PEAR::Cache deal (as I understand PEAR::Cache anyways). But Ruby doesn't need a framework to cache method calls. Making caching function calls is kind of a learning excercise. It's covered in the old, online version of Dave Thomas's "Programming Ruby" book. Specifically, in this chapter. Search for "class and module defintions" and read on. It's really quite interesting how easy it is.