Slashdot Mirror


User: mikpos

mikpos's activity in the archive.

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

Comments · 608

  1. Re:One good point -- too much C in open software on KDE Strikes Back · · Score: 2

    Just off the top of my head, here's something you could do for (non-threadsafe) error handling in C:

    #include
    #include

    extern struct exc_env_t {
    struct exc_env_t *prev_env;
    jmp_buf env;
    } *cur_env__;

    #define try \
    do { \
    int jvr__; \
    struct exc_env_t *ne__; \
    \
    ne__ = malloc(sizeof *ne__); \
    assert(ne__); /* maybe put in a diagnostic here? */ \
    \
    ne__->prev_env = cur_env__; \
    cur_env__ = ne__; \
    \
    jvr__ = setjmp(cur_env__->env); \
    if (jvr__ == 0)

    #define catch(e) \
    else if (jvr__ == (e) && (cur_env__ = cur_env__->prev_env, \
    free(ne__), 1))

    #define catchall \
    else if (cur_env__ = cur_env__->prev_env, free(ne__), 1)

    #define endtry \
    } while (0)

    #define throw(e) longjmp(cur_env__->env, (e))

    And then you would define cur_env__ in a module somewhere. OK it's not exactly 20 lines, and I don't know that you could get something really generic and useful in 20 lines (unless your lines are 100 characters long I guess, hee hee). Preferrably you would carry around something else in the struct exc_env_t, like a string or an object or something that would help describe the exception. There are a few other problems here, but nothing that wouldn't be completely and utterly trivial to implement. BTW a sample usage might be:

    try
    throw(error_super_cool);
    catchall {
    try {
    some_function();
    another_that_might_throw_an_exception();
    } catchall
    exit(1);
    endtry;
    } endtry;

    I think I saw something like this on Freshmeat once, but wasn't very impressed with it for one reason or another. Anyway, hope this helps.

    Hope Slashdot formats it well :)

  2. Re:Welcome aboard. on Men of Zeal · · Score: 2

    Uhh you severely missed his point. Even though you have an account, you're no less anonymous than an AC. Perhaps if your username were "Harold Thompson from Houston, TX" you might have a case. As it stands, the difference in anonymity between you or me or an AC is pretty much zero.

  3. Re:Textbooks and UXGA screens on Dell Offering 1600x1200 Laptops · · Score: 2

    Personally I'd prefer teachers/professors actually teaching instead of going from textbooks all the time, but I guess that's not quite as profitable. On the plus side, eBooks would be many times easier to copy than paper books, so I could end up saving money after all.

  4. Re:Resolution Independent GUI on Dell Offering 1600x1200 Laptops · · Score: 2

    Yes, this is due to Windows and X Windows sucking ass. AFAIK, both do graphical measurements in pixels, which is all but useless. OpenStep, Berlin, Mac OS X's GUI (which is more or less OpenStep I guess) and probably many others do measurements in real world units (e.g. millimetres, points, inches), which makes things a lot more logical.

  5. Re:Breaking news on AOL Sued for Creating Gnutella · · Score: 2

    Actually here name was Ada Byron. Lovelace was her nickname. IINM.

  6. Re:Dual monitor support with linux on Matrox Releases XFree86 4.0.1 Driver · · Score: 2
    Right now, the only dual-monitor support is in X :(. Well, there is dual-headed MDA support in the kernel, but I think that's only monochrome text, so its use is pretty limited.

    But yeah. I don't really like X, so if video goodness (such as dual-headedness) were to be added to the kernel, I'd be happy.

  7. Re:So how will it work? on Mozilla To Be Dual Licensed - MPL/GPL · · Score: 2

    The GPL forbids the licensee changing its terms. The licence holder (i.e. Netscape) can do whatever the hell it wants, no matter what the GPL says.

  8. Re:Confused on Mozilla To Be Dual Licensed - MPL/GPL · · Score: 2
    Without a licence, you have no way to legally use/copy a piece of software. When you download Mozilla, you will be forced to accept a licence before using it, as is with any other piece of software. That licence will *either* be the MPL or the GPL. If you accept the terms of the licence you are given, then you can use the software.

    At least that's the way I understand it.

  9. Re:Umm, right. on Lain Discussion Panel At Otakon · · Score: 2

    Uhh this is no more off-topic than Cowpland leaving Corel. If you like to read about Corel more than you like to read about Anime, filter out the "anime" category but leave the "Corel" category.

  10. Re:Speak english on English Language And Its Effect On Programming? · · Score: 2

    Umm no, that's false. Being Canadian, I was forced to learn French in school, and I am now anything but bilingual.

  11. Re:HURD rocks! on Debian 2.2 Potato Is Stable · · Score: 2
    To my knowledge, there aren't any real CDs printed yet. Right now, you have to bootstrap from Linux. There are instructions at http://www.pick.ucam.org/~mcv21/hurd.html . Basically what you do is:
    1. partition (if you put the Hurd and Linux on the same partition, things will get messed, because the Hurd does a lot of cool stuff with inodes to make changes persistent)
    2. get dpkg and a bunch of .debs
    3. "cross-install" the .debs onto the Hurd partition (there is a shell script for this)
    4. make a GRUB bootdisk (BTW GRUB is by far the coolest x86 bootloader I've ever seen)

    I suppose a CD would be nice (it would save quite a bit of download time if you're on dial-up), but, quite frankly, I don't think anyone would buy it :D

  12. Re:HURD rocks! on Debian 2.2 Potato Is Stable · · Score: 2

    It is available. It's usable, though I can't get apt-get to work for some, and the application support is a bit limited.

  13. Re:GPL your thesis! on 95 (thousand) Theses (for sale) · · Score: 2

    The GPL would be protected from being sold? What kind of glue are you on?

  14. Re:Wait! on 95 (thousand) Theses (for sale) · · Score: 2
    Damn straight! Oh wait a second, I just realised that "/.ers" aren't a single entity.

    Really, though, it is a stupid site. I don't care one way or the other if it stays up or not, but anyone who buys from there is utterly and completely stupid. Most doctors will send you their thesis for free, and those who don't will send you their thesis for the cost of reproduction. If not, then this really would fall under the "abandonware" article that Slashdot posted recently.

  15. Re:Read the entire agreement!!! on @Home Stops Allowing VPNs · · Score: 4
    The part about "reselling" is completely orthogonal to the part of VPNs. Here what you want:

    without limiting the generality of the foregoing, the service is for personal and non-commercial use only and [the] customer agrees not to use the service for operation as an internet service provider, a server site for ftp, telnet, rlogin, e-mail hosting, "web hosting" or other similar applications, for any business enterprise including, but not limited to, those in competition with the service, or as an end-point on a non-comcast local area network or wide area network, or in conjunction with a vpn (virtual private network) or a vpn tunneling protocol;

    That said, it's probably wise to just ignore the policy. I would suspect fully 100% of @home subscribers are breaking at least two of the rules mentioned there; if they're not, they're wasting their money. It seems that @home (at least in my part of the world) only gets annoyed when you start using up obscene amounts of bandwidth (e.g. around 1GB/day regularly/constantly).

  16. Re:yes but... on Ogg Vorbis - The Free Alternative To MP3 · · Score: 2
    Or even easier:

    ogglame foo.mp3 foo.ogg

    (ogglame is an encoder/transcoder)

  17. Re:Cool. There's no danger on SubZero Chilled Alcohol PC Cooling · · Score: 2

    Thank you, mister grade 3 science teacher.

  18. Re:Not impressive... on SubZero Chilled Alcohol PC Cooling · · Score: 1

    You were impressed by a poorly presented lie?

  19. Re:Yes on A Praise To Unix · · Score: 2

    WTF dude? Why does it always have to be Microsoft vs. Unix? There are other software companies out there. There are other operating systems out there. Windows sucks. Unix sucks. Let's call the whole thing off.

  20. Re:TM'd title on Let's Make UNIX Not Suck · · Score: 2

    Your assertion that Unix is not meant to be used by beginners is completely false. Maybe Unix is not meant to be *administered* by beginners; I'll concede that. But Unix was meant to be used in large corporate or academic settings to allow non-engineers the previlege of sharing some of that new fangled processing time. I'm sure Unix wouldn't be so bad if people would give up the idea that they can learn everything from a book (people are usually more helpful), but that's not to say that trying to make Unix better is pointless because "it's always sucked" (to paraphrase you).

  21. Re:I was wondering. on New Nautilus Screenshots · · Score: 1

    Actually, if you're referring to when they announced the G4 Cube, they were down because they were busy updating the site (uploading Quicktime clips and whatnot), not because of heavy load. Though I'm sure there was a huge load.

  22. Re:interface expert or not... on New Nautilus Screenshots · · Score: 1

    There are some instances where your POSIX.1 buddies come in handy, though. e.g. "uh oh I just realised that I didn't update my email address on my old pages. I need to change my email address from joe_smith@m1.example.com to joe_smith@example.com on all my pages. But there are so many of them!". A quick "for i in *.html ; do sed 's/joe_smith@m1\.example\.com/joe_smith@example\.c om/g' < $i > ._ && mv ._ $i ; done" would take care of that.

    Okay that example was a bit contrived, too. But any time you have to do a lot of similar (yet slightly uncommon) tasks to a large number of files that can be categorised, Unix will be your friend. Doing repetitive tasks is what computers were made for anyway, right?

  23. Re:humor on New Nautilus Screenshots · · Score: 1

    No kidding. This is outrageous. How am I suppose to whore if I don't get any karma. If this continues for much longer people might have to start making thought-out and meaningful posts.

  24. Re:Why C# is better... on Anders Hejlsberg Interviewed On C# · · Score: 1

    A simpler language.

  25. Re:Why C# is better... on Anders Hejlsberg Interviewed On C# · · Score: 1

    That's why we have code-checkers. Like lclint, and -Wenum-clash on g++ et al? Ya? Making it a requirement of the language is just plain weird.