Slashdot Mirror


User: Steeltoe

Steeltoe's activity in the archive.

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

Comments · 1,752

  1. Ruby has been extremely good for me on RubyGems' Module Count Soon To Surpass CPAN's · · Score: 1

    I'm using Ruby for a personal project of mine going on for about a year now, semi-fulltime. I'd like to add that I've been programming since I was 8 years old, and have a grasp of most common procedural languages except LISP and functional languages.

    If you don't like Ruby because it's too powerful for you, fine. However for my needs, Ruby has really made my system of several processes faster to create, more dynamically flexible than I first envisioned, easier to extend and refactor. In fact, my experience has been so positive, that I have almost nothing negative to say about Ruby and ActiveRecord. This is because whatever hurdles I met, I overcame them, and often enhanced my system further by learning to do things better from the higher-level and down.

    What you list as weaknesses of Ruby, as a quite experienced programmer, I see as benefits:
    1) "Monkey patching": I have a few files where I extend basic objects like String, Object, etc., for use with serializing and mathematical extensions I required. No I don't "monkey patch" unless required, but native float is just too horrible, so I had to modify BigDecimal to make the core functions easier to use. I also combined Msgpack (faster serialize, but doesn't support all Ruby types) and Marshal (native serializing in Ruby), to be able to serialize everything over the faster Msgpack implementation as strings of Marshal. It is faster and more compact than just using Marshal. ActiveRecord was extended because I needed lightning fast mass "insert-or-updates" to DB, for which I used temporary db tables. A very simplistic one-liner is all that is required to update any of my tables with arrays of objects. Neato.

    Now, the files and lines where I extended library and core functionality is not too great, and it allowed me to stich together already accessible functionality to improve performance, and making things more readable and accessible at the same time.

    For very little effort, "monkey patching" enabled me to extend my very programming environment and libraries, something which in many languages are not possible.

    Of course, when abused or misunderstood, this can be negative, just like a pistol is harmful in the hands of a child. When upgrading, of course, I'll need to review and test the code to see if something's changed. But these are very small drawbacks for me, and I have minimized and compartmentalized the code.

    2) Duck typing: After using Ruby, I'm on the other side of the fence. I now see absolutely no reason to declare types anywhere. What I did instead is to create standard-code to dynamically check incoming arguments of all functions. That way, I can have a sort of one-sided contract behaviour, checking for *whatever* I want in the beginning of the function using instance_eval(), and save myself all the troubles of static types altogether, while enhancing my system at the same time.

    I realize the standard Ruby libraries are missing such functionality, and also the efficient error-handling routines I created, but once you have such functions in place (what you need), I see no reason for static types. In fact, getting rid of types allows for more flexible arguments and handling, better fail-checks and faster development altogether. If something is wrong, often my argument- or paranoia-checking code is picking it up instantly. Neato.

    3) ActiveRecord: Yes, it's ORM, but only if you want to. You can use db-depdendent, direct sql if you like, or get faster queries using arrays of arrays instead of the more general ActiveRecord objects. What ActiveRecord has done for me, is save me from endless work with SQLs, only to change them again and again. I've also extended the functionality of ActiveRecord, to deliver fast insert-update operations. If I were stuck with creating dozens of SQLs, I would probably have missed that opportunity to optimize. Because ActiveRecord freed me, but didn't bar me, from the low-levels, I was able to optimize more from the higher-level down.

    Another thing ActiveRecord has done, is make my

  2. Re:Just admit you don't really know what it is on Free Radicals May Not Be Cause of Aging · · Score: 1

    I'm very fond of the scientific method and principles myself. I also agree about funding and special interest groups. They generate alot of biased crap generally, I guess it's human nature, at least it's nothing new. However, when done right, nothing beats scientific results hands down. There is alot of superstition, which can even be harmful, and many "non-intuitive" answers to be gotten from science.

    However, I've had experiences which have taught me that 1000 scientists can be wrong, and that basing my life on scientific consensus means the lowest common denominator. So not always what I'd like to do.

    I'm also the creative and investigative type of people. I guess, at some point, we need to just make our own decisions, and basing everything in my life on scientific papers, would just make it impossible for me to be who I am. Many great experiences that I've had, I would be without, and if that were so, I would much rather not live. They were that important to me.

    I'd rather not go into details, because it's personal, and very few people on /. can relate to out of the ordinary experiences (which are not delusions btw). To each their own I guess.

  3. Re:Just admit you don't really know what it is on Free Radicals May Not Be Cause of Aging · · Score: 1

    I know I am not an expert in this. I was just offering my opinion, and I don't see any refutations yet.

  4. Re:Just admit you don't really know what it is on Free Radicals May Not Be Cause of Aging · · Score: 1

    News for you:

    Peer reviewed papers != Reality

  5. Re:Just admit you don't really know what it is on Free Radicals May Not Be Cause of Aging · · Score: 1

    Are you a biologist all the time? Chemist all the time?

    If you can't communicate with other people in "emotional terms", ie. plain language, then you're a nerd, out of touch with fellow human beings.

    I said I'm not an expert on farming, and if you'd like me to do your homework, I'm sorry, you're probably more qualified for that than me. But only if you're willing.

  6. Re:Oh wow. on UK Gov't Wants To Block Internet Porn By Default · · Score: 1

    What kind of harm do you believe they will suffer?

  7. Re:Oh wow. on UK Gov't Wants To Block Internet Porn By Default · · Score: 1

    What is it exactly that you fear so much?

  8. Re:Oh wow. on UK Gov't Wants To Block Internet Porn By Default · · Score: 2

    Children watch porn. At least everyone I ever talked with honestly said they did. They did so in the 60s, 70, 80s, 90s, 00s.., and probably before that too.

    It's just that they don't understand it, so get tired of it after 5 minutes. Until they become teens of course...

    Why is this a problem again?

  9. Re:Well... on Free Radicals May Not Be Cause of Aging · · Score: 2

    Funny, being vegetarian and looking at others, seeing how old they look, I'm more inclined to believe it has more to do with genes. I believe there is a clockwork in our body, making us older, by programming rather than something that has to happen. I believe there are drugs you can take to supposedly "slow the aging process", but it's not been proven yet.

    Especially when thinking about the massive amounts of Cola and candies I've consumed ;-)

    Anecdotes, anecdotes..

  10. Re:Well... on Free Radicals May Not Be Cause of Aging · · Score: 1

    I'd go with food made for the sake of love and interest over profits any day.
    Well said.

    MOD PARENT UP!

  11. Just admit you don't really know what it is on Free Radicals May Not Be Cause of Aging · · Score: 5, Informative

    Organic food is almost all grown the exact same was as regular food: on large, industrial farms, in large volumes, for a profit. The only difference is that the expense of Organic food comes from the limited supply (due to demand as well as a higher rate of spoilage), while the expense of normal food comes from making it better, cheaper, and safer.

    Are you trolling, or just ignorant? Most people don't know what organic food is, but if you're going to make an argument about it, why not educate yourself on the subject first rather than just spout your own prejudices for everyone on the internet to read?

    Food quality has been on a steady decline. Poisons and hormone-mimickers in food are steadily going up while nutrients like minerals and vitamins are going down. Read the studies about it and wonder why this is so, all while buying cheaper food in larger quantities. The long list doesn't end there however, the earth itself is being drained of nutrients due to unhealthy mono-culture and non-stop farming each and every year. For many farmers, this is more important, so there is a big shift today to organic farming, just because of the higher sustainable development factor. If we destroy the earth, famine is not too far away. If we destroy nature or cut outself out from it too much, we may have to turn to genetic engineering to be able to sustain healthy bodies, always fighting new unknown diseases, not a very pleasant prospect except for the medical industry.

    Organic farming can be many different ways, with the more extreme end being biodynamic farming. It is true that you can have large farms producing roughly the same yield as "modern farms", at least if you compare nutrients. Many people have the opinion that you can eat less of organic foods, and still feel satiated. So less yield does not necessarily mean less food.

    This clockwork-universe mentality that everything to food and life is about proteins, minerals, vitamins, and this obsession of getting rid of dirt and bugs, is well, an hypothesis without basis in nature. Many people believe that there is more to food than what we can measure in its quantities. Life is certainly about more than its parts. If you lack this understanding, you've been living in the city for too long. It's clouding your judgement, so time to take a break off media and city, find some new fresh perspectives in nature.

    Why Organic? (Quite interesting introduction)
    http://journeytoforever.org/garden_organic.html

    Top 10 Reasons for Organic Farming (Showing that the soil and environment is given more importance)
    http://www.organic.org/articles/showarticle/article-206

    Btw, IANAF (I Am Not A Farmer), however, I know there is alot to organic farming and sustainable development, than our prejudices. Currently living outside major cities, and it does bring a different perspective to life than endless visits to cafes and caffe lattes.

    Before you condemn something, at least give it a fair shot first, hmm?

  12. Re:Which is the sane thing to assume on NSA Considers Its Networks Compromised · · Score: 1

    My focus was not to stop freedom of information (ie. promote police-state to enforce war against "information wants to be free"), but rather secure the network even though it has been compromised with untrusted clients. This is what the article was talking about. I2P already supports encrypted communication between trusted and arbitrary clients. You can have fixed tunnels between clients, or provide encrypted and anonymous services to arbitrary, or a selection of clients, inside the darknet.

    The way most LANs are operated today, makes them very vulnerable of _any_ compromise in the network. So I'd say this is the first step, if you require security at all. It's not a firewall issue, because clients themselves can be compromised, and then you will seek to minimize that damage.

    Of course, if your endpoints are compromised, you've got big problems.

    If it's a hardware compromise, ie. theft, running TrueCrypt can save you if you are dilligent in securing the key, and it's long enough.

    Software and wetware compromises, well, I'll leave that out of the scope for now. The article was talking about the network.

  13. Re:Which is the sane thing to assume on NSA Considers Its Networks Compromised · · Score: 2

    I2P sports end-to-end encryption. Arbitrary tunnels between computers. Darknet capabilities. Integrated bittorrent. Anonymous and encrypted websites. P2P naming services.

    If you need transparent encryption between nets, while preventing sniffers and MITM-attacks, I believe I2P can be a great fit. I wonder what performance a custom version restricted to the LAN might yield, given that it's already many orders of magnitude faster than FreeNet?

    I2P: http://www.i2p2.de/

  14. Re:Completely free kernel? on Debian 6.0 To Feature a Completely Free Kernel · · Score: 1

    Yup, thanks for bringing focus back. My stance is that he's a brilliant coder and philosopher. I really like Emacs, and have used it for many many years, although have lost the taste for it when I can have equivalent and more integrated editors in Windows. I'm sure I've used tons of RMS' programs without even knowing it too, but none of them have REALLY taken off like Linux. Two reasons may be that they're mostly made for geeks, and the academic factor is very high. Lisp is not for everyone it seems. Remembering the "GNU Linux" debacle, RMS may also not be the easiest fellow to work with, or to fork his projects.

    I do love his idealism and fight against restrictions, despite contemporaries and peers condemning him. He stands for his principles, and they are mostly correct and long-sighted. I think this is his greatest strength and contribution to free software, which is immense if you really think about it, as he even defined the term itself.

    My point was that there are other projects that have succeeded more than the core GNU organisation and RMS in producing free software, and maybe that has to do with leadership, luck, or something in between?

    Hurd as always been a joke, at least since the late-90s. I don't see any reason to treat it as other than a joke now over 15 years later. It's probably because it's so much easier to create a performing monolithic kernel quickly, and that the users don't really need all that flexibility.

    Maybe in the future, Hurd will rise against all oppression. I'd really like to see a less spaghetti kernel rise and shine, but I guess it's damned hard to do well, and not lag in development and evolution compared to alternatives.

  15. Re:Completely free kernel? on Debian 6.0 To Feature a Completely Free Kernel · · Score: 3, Insightful

    Lol. Luckily I'm not drinking coffee right now.

    Hurd is and has always been a lost case. No matter how many developers, if it's dead in the water, they can't breathe life in it.

    RMS is great at many things, but attracting and sponsoring development on the order of scale as the Linux kernel and other high-profile projects, he's not. And that's a good thing, really. More legs to stand on and all that.

  16. Re:Possible to emulate via temporary tables on Oracle Releases MySQL 5.5 · · Score: 1

    Unfortunately yes, because despite ANSI making SQL standards the actual common feature set is extremely minimal. It's not a strength nor a feature, of course if you want that last bit of performance you will optimize for a specific database. However, there are many applications between trivial and "pedal to the metal" that ought to be possible to write in a database-independent way, but that you can't because of syntactical sugar.

    Agreed

    Operations on date and time for example are a genuine pain in the butt and doesn't work the same at all.

    No problem with Ruby and ActiveRecord. Just dump the Ruby datatypes into the appropriate ActiveRecord fields.

    A lot of the basic operators aren't the same, like if you ever use "||" as concatenation as per the SQL standard your code is broken on MSSQL and MySQL. And even if you need the most trivial of triggers, good luck writing one that's valid T-SQL, pl/SQL, pg/SQL and whatever MySQL has, even if it's just basic SQL statements in a wrapper. Even for what I'd call a basic application - not a trivial one but one step up - you're likely to be tied to a specific database unless you use some sort of meta-SQL wrapper which has tons of issues on its own.

    I guess I'm lucky to have found such a wrapper in ActiveRecord that works very well for me, and doesn't handcuff me from writing DB-specific code when required.

    Drawbacks of ActiveRecord is that the default objects generate a bit of overhead. However, it's possible to use arrays within arrays instead of arrays of objects or direct sql to speed things up. For me the overhead has had minimal impact.

    Other than that, I'm having trouble finding drawbacks of ActiveRecord, because in most areas it has made me more effective and clearer, rather than hand-crafting SQL or stored procedures.

  17. Re:Possible to emulate via temporary tables on Oracle Releases MySQL 5.5 · · Score: 1

    Well, my needs are dumping and updating tens of thousands of records in bulk every minute or so. Using individual SQLs was painfully slow. Using transactions unnecessarily locked the DB and gave worse performance because of that. So how to do bulk operations on the DB?

    My solution was using temporary tables, and I'm betting I'm getting near peak performance, since temporary tables are residing in client-side memory (my assumption for an optimal implementation of it anyways). Two lines of sql dumps everything to the database in terms of insert or update, often just one of them.

    Another method is to build a huge insert with multiple rows. This is also fast, but for some unknown reason I'm getting better results with temporary tables. Maybe because I'm not sending over the huge sql-syntax over I/O, but using a native implementation of the temporary tables.

    It may or may not be as efficient as a native implementation of "insert or update" in the DB, but it's damn fast and versatile. Can be used for many types of processing, although I suspect most projects don't need that flexibility to work with the DB directly.

    As for ActiveRecord in Ruby, it has saved me hundreds of hours and thousands of lines of useless code pampering to the database-layer.

    For me, less code is more, it makes me able to extend and refactor my project faster, as well as structure my ideas to achieve more detailed and more real-life results. Since my requirements are not fixed, this makes for very agile development and results.

    Of course, since I'm using Ruby, ease of coding, simplistic structure and rapid development is more important to me than raw performance. However, in my experience, alot of the slowness can be identified and remedied. The parts that is not crucial for performance, do not have to run at peak performance. Often, some Googling or trial and error can reveal why some parts of code is slow. For me, this is more cost effective.

    If performance becomes an issue in the future, I might consider making C-extensions to Ruby to pamper to my specific project. In my experience, higher-level languages frees the programmer to think of higher things, and achieve more. But it depends what kind of project and architecture is required too of course.

    Why do you say database-independent applications are _always_ a mistake though? It's saved me so much work. I'm using fast bulk-processing, with some Postgresql-specific code to speed up the most crucial parts. ActiveRecord makes it possible to use raw sql, db-specific stuff or generate sqls dynamically in a different and more optimal manner than the default. So it's quite flexible. Profiling can reveal hogs and are usually fixable. Anyways, the real hogs seem to be more I/O-related in my project, than what's going on in memory.

    I didn't plan to be database-independent, it's just that ActiveRecord in Ruby makes a damn good job at it by default, releasing me of DB-dependent syntax and rules. Sure, there may be some extra SQLs, often in non-crucial parts, but I am not here to work for a computer, but having computers work for me. Hand-coding the SQLs ActiveRecord generates for me dynamically would be madness, and probably stopped my progress for a considerable time, maybe even aborted the project if it was too much. In short, DB-independece hasn't been a hassle, using ActiveRecord, it's saved me work and made my program better. DB-independence has been a bonus feature of ActiveRecord to me, an enhancement to the beauty of Ruby.

    Not having to think of SQL for the most time, has made me achieve both higher-level design and results of my application, as well as fast refactoring when required.

    Keep in mind: Higher-level optimizations often lead to radical performance improvements, but is hard to do if you're stuck at a lower level. So it may be that one should find a balance between resources and how low level you're willing to go, for each specific project.

    I've reviewed several nosql solutions. But with Ruby, ActiveRecord and Postgresql,

  18. Re:Possible to emulate via temporary tables on Oracle Releases MySQL 5.5 · · Score: 1

    "Oh don't use mysql Oracle is evil blah blah blah do it this way instead even if it takes 4x as much code".

    Nice bunch of strawmen you've got there, but I fail to see I wrote those words you're putting into my mouth.

    4x the code? I assume you've heard of classes and methods? Having extended ActiveRecord in Ruby, mass updating in this fashion is a tiny one-liner, just sending an array off to a function-call, and the data is merged into the DB very efficiently, regardless of column names and wether each row should be inserted or updated. I must admit, there are rare occations where that is really necessary, but it really came in handy in my latest project.

    Using ActiveRecord, I don't really care much what database I'm using. Can switch to Oracle, Mysql and a bunch of others with almost no change in code. If mysql had installed properly, I would probably have used that, since that's what I'm most familiar with.

    If you haven't used ActiveRecord, and coding SQLs by hand, I'd say you're missing out. My latest project would've been an endless spagetthi of SQLs if not for ActiveRecord in Ruby. It has saved me so much time and simplified my code tremendously.

    Other than that, I don't care much about where Oracle is going with mysql. It will have to continue on its own merits. If mysql fits your bill, please continue to use it. One more choice is always good.

    Please take my words for how they are meant: A solution to the UPDATE OR INSERT-issue on Postgres, and any database supporting temporary tables, including mysql. It's a solution that can speed up bulk updates by an order of magnitude or two. Especially rather than doing individual updates and inserts.

    For smaller projects though, maybe this will be overkill, or maybe someone will release the code for everyone, even smallies, to benefit. I could also do that, but would rather not maintain a more universal version. It's quite easy to implement in ie. Activerecord anyways. There'some similar code online to start from in Ruby already published on some blog.

    I've been working for this project for over a year, so for me this has been of great value and help to me. So I wished to share, that's all.

  19. Re:Possible to emulate via temporary tables on Oracle Releases MySQL 5.5 · · Score: 1

    I can't see I critized anything much. I may have mentioned the mysql-install failed on me at the second attempt, and made me ditch it.

    But thanks for standing up anyways :)

  20. Possible to emulate via temporary tables on Oracle Releases MySQL 5.5 · · Score: 1

    You can create a temporary table, fill it up with rows of data and:
    1) INSERT rows not existing from temporary table
    2) UPDATE from temporary table unless INSERT affected all rows
    Ensure you drop temporary table at last.

    If you suspect UPDATE is necessary, you may do #2 first to save on the number of updated rows.
    If you supect UPDATE is not necessary, do #1 first like shown above. If you're paranoid, you may raise exception if UPDATE becomes necessary.
    You may find variations which may be more efficient or simpler, but this works for me at least.

    It may not be native support, and not fully optimized regarding the last update in some situations.
    However, it's incredibly fast because it's using memory to cache the processing, and then sending everything off to the DB in bulk, saving on I/O and locking mechanisms.
    I've got performance from this comparable to the most aggressive nosql database solutions, with the benefits of RDBMS intact.

    I've switched to Postgres and am not looking back at mysql. The default install even failed the second time, which made me go to Postgres and be done with it.

    Temporary tables give alot of possibilities to speed up and perform bulk-processing directly with the DB.
    I'm surprised it's not used very much. Postgres has been a pleasant surprise as well, coming from an Oracle-laden background.

  21. Re:Cars? on Why Special Effects No Longer Impress · · Score: 1

    Avatar was nice because there was a neat story to go with it, and on the big screen, you got the feel of being on that planet. At least the first time watching the movie. Even though it was all mostly CGI, they'd manage to humanise the natives, and make the planet look real, cool and different. Spiritual and universal values were integrated into the whole story in a way which speaks of life on Earth as much as this distant planet.

    Inception was just special effects crammed upon special effects. Halfway through, boredom set in, and I just couldn't see the point of the whole movie, except to over-hype and over-sell something which is really mediocre. There are really so many better ways this story could've been, but it was all virtually blown away.

    For me at least, when the story is so obviously modified to fit the effects, it reminds me more of games. Then I'd rather play it myself than watch some CGI.

  22. Re:Stock Market Shenanigans on Statistical Analysis of Terrorism · · Score: 1

    You pose an interesting dilema: If the market is accurately modeled and understood, that very model changes the market, thus rendering the model invalid.

    From my experience, I would say it really depends on the model, and how well you're at keeping secrets if it's any good ;)

    During the past 200 years, people have modeled the markets in so many ways, yet, the dynamic expression of markets is very much the same as so long ago. There is not much difference, when comparing the same levels of liquidity, which is really just some other word for resolution.

    Yes, there is higher liquidity today, more resolution and more values going in trades. However, even these trades follow the same dynamics on a 1-hour chart today, as on a 5-year chart 100 years ago.

    People have successfully traded the markets using astrology, numerology, fibonacci ratios and any number of means. Heck, the best traders can pick trades blindfolded. With proper money management, they know how to avoid big losses and ride the rising tides. Not just play the odds, but playing the inefficiencies of the markets. I'm not talking about luck or hoaxes here, but real strategies that really works (for the most part anyway).

    After having studied stock markets for some years now, I've come to believe the markets portray something very basic and common to life. It's just that, for the most part, it's invisible, without a number, but it's still ruling most of us.

    Why do trends set in in fashion, and when and how? Why do countries attack other countries? How do different species affect eachother? At some level, I believe similar dynamics as the markets are ruling all our lives, just that it's not visible.

    And that, should be terrifying.. ;)

  23. Re:The term "Terrorism" is... on Statistical Analysis of Terrorism · · Score: 1

    Says who?

  24. Re:The term "Terrorism" is... on Statistical Analysis of Terrorism · · Score: 2, Insightful

    Actually, it's very simple: Blowing up innocent people, just because you can, is terrorism.

    Wether you do it from a Comanche helicopter or with pipe bombs doesn't make much difference.

    Why make it more complicated than that?

  25. Re:Stock Market Shenanigans on Statistical Analysis of Terrorism · · Score: 1

    Sounds like you've been had there my friend. However, do you think we now know everything there is to know? For it sure sounds like that.