Slashdot Mirror


User: margulies

margulies's activity in the archive.

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

Comments · 23

  1. Re:Dynamic typing on Beyond Java · · Score: 2, Insightful

    The following is taken from Andrew Cooke's excellent write-up of issues like this...

    http://www.acooke.org/andrew/writing/lang.html#sec -staticdynamic

    Static and Dynamic Typing

    Types can be static or dynamic. Languages like Lisp or Python have many different types, but when you look at a piece of code there is nothing that forces a variables to "be" (or to "point to") a piece of data of a particular type. In other languages, like ML or Eiffel, a certain variable will always be connected with a value of a certain, fixed type. The first group of languages (where the type of everything is unknown when the program is compiled) has dynamic types, the second group has static types.

    Dynamic types are good because the program source can be more flexible and compact (which might be particularly useful for prototyping a system, for example). Static types are good because they allow certain errors in programs to be detected earlier (a compiler for a statically typed language may also be able to make extra optimisations using the extra information available, but this depends on details of particular languages and compilers).

    My own view is that at computing projects become larger, static typing becomes more important. I would not like to work on a project with many other programmers using a dynamically typed language, and I choose to use dynamically typed languages, usually, when doing projects of my own.

    In some languages (e.g. ML) the interpreter or compiler can often work out the type associated with a variable by itself, which saves the programmer a lot of effort.
    Strong and Weak Typing

    Types can be weak or strong. The languages mentioned above are all strongly typed, which means that at any point in the program, when it is running, the type of a particular chunk of data is known.

    Since a dynamically typed language does not have complete type information at compile time it must, if it strongly typed, keep track of the type of different values as it runs. Typically values are boxed together with information about their type - value and type are then passed around the program together.

    It might seem that a strong, statically typed language would not need to do this and so could save some memory (as type information is available when the program is compiled). In practice, however, I believe that they still do so - possibly because of polymorphism (see below).

    Unlike the languages mentioned so far, C has weak typing - some variables can point to different types of data, or even random areas of memory, and the program cannot tell what type of object is being referred to. Depending on the context within the program, the variable is assumed to point to some particular type, but it is quite possible - and a common source of confusing bugs - for this assumption to be incorrect (some type checking is done by a C compiler, but not as much as in a language designed to have rigorous compile time checking, like those described as statically typed above).

    Java is strongly, but not statically, typed - classes can be converted (cast) and, if the types are not compatible (related through inheritance - see below), a run time error will occur. Apart from this (significant) exception the Java type system can be considered static - one description is "compromised strong static typing".

    When strong static typing is enforced (even if only partially, as in Java) it can be difficult to write generic algorithms - functions that can act on a range of different types. Polymorphism allows "any" to be included in the type system. For example, the types of a list of items are unimportant if we only want to know the length of the list, so in ML a function can have a type that indicates that it takes lists of "any" type and returns an integer.

    Another solution to the problem of over-restrictive types is to use inheritance from OOP (see below) to group data together. Yet another approach, used in C++, is templates - a way of describing generic routines which are then automatically specialised for particular data types (generic programming and parameterised classes).

  2. simple solution? on A Countdown To Global Catastrophe? · · Score: 1

    launch a spacecraft to move out to a point between the earth and the sun.

    have it deploy a large enough "umbrella" to shade the earth.

    the closer it gets to the sun, the smaller the SpaceShade (tm) could be because it would throw a larger shadow over the earth's surface.

    it could be tuned to open and close to precise amount to achieve the desired level of planetary cooling.

    ha ha, only serious

  3. ogden nash's prescience on this matter.... on Nanobacteria Discovered? · · Score: 4, Interesting

    Bigger fleas have smaller fleas
    Upon their backs to bite'em
    And smaller fleas have lesser fleas
    And so ad infinitem.

    And the bigger fleas, in turn
    Have greater fleas to go on
    And these in turn have greater still
    And greater still, and so on.

  4. if i could trade my life for theirs on Space Shuttle Columbia Breaks Up Over Texas · · Score: 1

    i would.

  5. PRK/Lasik on Laser Vision Surgery for Developers? · · Score: 1

    I'm a professional programmer and I just had PRK (similar, but not quite the same as lasik). I had it done 22 days ago. Here's my experience.

    immediately after: pain, good vision, more pain.

    next three days: lots of pain, downed an entire bottle of vicodin during the first week to dull the pain. in fairness to the doctor, he did warn me that PRK was more painful than Lasik. I couldn't have Lasik because the epithelium of my eyes are too thin and besides Lasik leaves a flap in your eye that never fully heals. I'd rather deal with a few days of pain and then no flap, than less pain and a flap. Personal preference.

    one week: pain gone. night vision definitely affected. starring and haze around headlights on the highway. day vision fluctuating a lot. sometimes 20/20 sometimes 20/25ish. discovered that i am now somewhat farsighted and cannot easily focus on objects that are near (~6" away). Fatigue plays a large part in how my eyes perform. When I get really tired my eyes stop behaving and I must stop what I am doing and rest.

    three weeks (today): vision quite good. i believe i am corrected to 20/25 or better (still fluctuates). night vision has improved quite a bit. farsightedness effect is fading slowly. i am still on corticosteriod eye drops to fight scarring from imflammation, and the drops do affect my vision. should be off them in two weeks. doctor says my vision will continue to improve over the coming year.

    bottom line: i'm glad I had the operation done. *it isn't perfect*, but then my vision with contact lenses wasn't perfect either (astigmatism wasn't corrected). *also contact lenses are not zero risk.* i've known people who've had nasty bacterial infections/scratched corneas from contact lenses and have lost vision in one eye from bad contact lense events. i feel that i was on a collision course to eventually have that happen to me. so this was preventative as much as anything.

    if you want perfect vision, wear glasses. end of subject.

    if you hate glasses and want freedom from them, then laser surgery is a good option.

    i have faith that my vision will improve over the coming year. In six months to a year I believe my vision will be even better than it is now and it is already very close to perfect. But i won't bullshit you, the first few days after PRK were pure HELL and I did wonder if I'd just made the biggest mistake of my life. if i hadn't been so zonked on vicodin, i might have panicked. three cheers for modern pharmacology :).

    bottom, bottom line:
    I can program no problem although the damn steriod drops do cause my vision to flutuate (intraocular pressure rises when you use them). I've pulled a couple of all-nighters coding away with no problems. I don't believe laser surgery represents a significant risk to coding professionals.

  6. we're using it in production on MySQL 4 - Is it Stable? · · Score: 1

    we use MySQL 4 here at hotjobs to sync up our resume database with our search engine (altavista). works very well under high load. no problems thus far.

    one thing i wish that the mysql team would add is error trapping for when the disk fills up. oracle handles this gracefully, mysql doesn't.

  7. 10nm isn't 0.1 micron on Nanoimprint Lithography · · Score: 2, Funny

    it is 0.01 micron

    but what's ONE ORDER OF MAGNITUDE between friends?

  8. Re:Can someone answer this for me? on Apollo 1 · · Score: 1

    I believe the reason was the same that deep sea divers use pure O2, it was to prevent the bends.

    When the spacecraft leaves the atmosphere the internal pressure of the capsule is much lower than it is at sea level. (It would be prohibitively expensive to pressurize the capsule to 1 ATM.)

    If at that time the astronauts still had any nitrogen in their bloodstream it would come out of solution and form bubbles, etc...

  9. unmanned missions save money on Goldin to Retire from NASA · · Score: 1

    if i were director, i'd go to completely unmanned missions. i know it would kill me in the popularity polls, but it would be a huge boon for budgets AND science.

  10. benjamin franklin's opinion on Stallman: Thousands Dead, Millions Deprived of Liberties · · Score: 1, Redundant

    "They that give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -- Benjamin Franklin, 1759.

  11. herniated disks on What Do You Do To Relieve Lower Back Pain? · · Score: 1
    I had several undiagnosed herniated disks in my back for *years*. I visited orthopedic surgeons, general practitioners, chiropractors, acupunturists, massage therapists, witch doctors, etc. (it's surprising what you'll do to get rid of pain).

    results:

    massage: nice, but sort of like kissing a cancer tumor "to make it better".

    acupuncturists: total hoakum in my opinion

    chiropractors: almost total hoakum. their adjustments did relieve the pain temporarily, but none of them diagnosed the root problem and because they temporarily relieved the pain their adjustments actually put me at greater risk of rupturing a disk. sort of like taking morphine for a broken leg.

    orthopedic surgeon: sent me immediately for an MRI, predicted precisely what they would say, was completely correct (scarily so), and had me on a physical therapy program within days.

    initially i wore a brace while i healed (i think he was being overly cautious), i was put on a stretching machine to relieve the pressure on my disks. after the pain was gone came flexibility and strength training.

    i haven't had a *twinge* of pain since. now i can run 10k without thinking, and more importantly i *know what's wrong with my back* and i know how to protect it against future injury.

    what you need to do is keep your abdominal muscles and back muscles in good shape with an exercise program. losing weight and improving your posture also help a lot. the total regime feels something like a cross between calisthenics and yoga and takes about 15 minutes a day. once you're committed to these exercises you can work them into your other exercise easily. it's good motivation to improve everything about your health, not just your back.

    what the exercises do is build muscle to support your spine so that there is less pressure on your disks. it was the disks ballooning out and damaging nerves near my spine that caused the intense pain.

    western medical science is sometimes so far superior to non-traditional medicine that the difference is breathtaking. i saw that difference first-hand.

    i have a hunch that many, if not most, people with severe "lower back pain" actually have a herniated disk or disks. If you don't take care of it, it *will* get worse, eventually resulting in surgery, removal of disks, fusing of vertebrae, and then you'll move like you're 110 for the rest of your life. not something to screw around with.

  12. Re:A couple of quotes from the History Channel's s on Review: Pearl Harbor · · Score: 2
    points:

    1. all but 3 ships were repaired and returned to service.

    2. the ships they sunk were mostly out-of-date WWI battleships (useless).

    3. the American navy was already building the next generation of fast cruisers and carriers which would defeat the Japanese navy.

    4. they didn't hit our fuel dumps, shipyards or carriers. hitting these would have crippled us far more than losing the ships we did lose.

    brilliant psychological victory, piss poor strategic outcome. overall...one thumb up, one thumb down.

  13. Re:Patriotism and the baddies on Review: Pearl Harbor · · Score: 1

    q: what do you get if you take a bunch of English people and send them to another continent and let them stew for a while? a: Americans ;) we're all human, all citizens of the world, and we're all the *same*. these sorts of arguments seem to try and prove the contrary. that's why they never get anywhere.

  14. hacking != cracking on 13-Year-Old Suspended For Hacking Commits Suicide · · Score: 1
    shouldn't the title be "13-year-old suspended for cracking commits suicide".

    come on slashdot, practice what you preach and don't perpetuate the big media conflation of hacking and cracking.

  15. flat earth on Tito In Space · · Score: 1
    NASA didn't want him up there because it means having to brainwash him too.

    viz. flat earthers

  16. Re:The Perfect Number on Larry Wall on the Perl Apocalypse · · Score: 1

    0
    6
    28
    496
    8128

    then it gets hard.

    anyone know a proof that all perfect numbers are even? :)

  17. Re:three travelers at the hotel on Geek Brain Teasers · · Score: 1

    the bellhop's two dollars doesn't count as money that the travellers spent. So the equation isn't (9*3)+2 != (10*3). The money the bellhop keeps is money that the hotel thought was refunded to the travellers but was, in effect, stolen. So the equation is... 9*3 = (10*3) - (5-2) which balances. You can consider the bellhop part of the hotel, not part of the travellers group, then the apparent paradox evaporates. It's the misleading wording of the puzzle that leads you to believe that the bellhop's take should be considered part of the travellers contribution.

  18. how to get this working if the installer dumps on GNOME 1.4 Beta 2 is Out · · Score: 5

    if the installer cores on you, try the following:

    cd to /var/cache/red-carpet/packages
    then issue "rpm -Uvh *"

    works for me on RH7.0 (even on fisher).

    i believe the installer dumps right before or during the final call to rpm. not sure why it works from the command line and not from within red-carpet.

  19. java and xml - o'reilly on Inside XML · · Score: 1

    i really liked brett mclaughlin's book
    java and xml from o'reilly
    he's also involved with the Jdom project which is a cool set of java classes that make working with xml fast and easy.

  20. isn't this this country that... on Draconian Censorship Push In South Australia · · Score: 1

    up until the 1960's was removing aboriginal babies from their parents and placing them in "white" homes "for their own good"?

  21. Re:glaring error on Science and Technology In Y2K · · Score: 1

    uracine replaces tyrosine in RNA, minor difference.

  22. glaring error on Science and Technology In Y2K · · Score: 1

    They call adenosine, cytosine, guanine, and tyrosine (the A,C,G,T of DNA fame) "amino acids".

    They're not amino acids. Amino acids are what make up proteins. These are nucleotides. Nucleotides make up nucleic acids.

    I can't believe SciAm missed something that basic!

  23. follow the money on The Last Days Of Politics · · Score: 1

    the government still controls 30-40% of our GNP that makes it the most powerful force in the country. period.