Slashdot Mirror


User: _xeno_

_xeno_'s activity in the archive.

Stories
0
Comments
2,831
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 2,831

  1. Re:You can, but it's hard, and why would you want on Too Cool For Secure Code? · · Score: 1
    Well, you're right, but you're wrong too.

    His version contains extra useless code to set the pointer to NULL. That's why he has the separate definition. So that after a call to mfree, the pointer is set to NULL and everyone is happy.

    Except that it's in a function and hense the caller keeps the original non-NULL pointer. (Although it might not; it depends on the compiler's definition of "__inline__". GCC would leave the "callers" x alone, I tested it. I expect that this would be the case for most other compilers as well.) An actual preprocessor macro would be needed to make that actually work.

    Except that there's another problem making even that useless:

    #define NULL (void*)0
    #define mfree(x) \
    if (x != NULL) { \
    free(x); \
    x = NULL; \
    }

    void f() {
    char *buf = malloc(128);
    foo(buf);
    free(buf);
    }

    void foo(char *bar) {
    // does something
    mfree(bar);
    // (bar now == NULL)
    }

    (No indentation courtesy our Python hating <ecode> friend.)

    After mfree sets bar to NULL, buf, the same pointer, remains pointing to memory. And it then attempts to free it again - a double free, even when using the mfree "safe" macro.

    This example is an obvious example of poor coding - foo() should not free the memory. However, it's a simple example to illustrate the more likely result of a much more complicated program, where the memory is freed but pointers remain. Once code becomes non-trivial, bugs like these can easily slip into C code.

    So you're completely right. His code is extra overhead that accomplishes nothing above what a standard call to free() would do. It's an almost-exact alias. (Unless you intend to do a lot of free(NULL)ing, in which case the inlined if statement will reduce overhead.) And it doesn't actually prevent against doublefrees. So some thought would have been nice, on behalf of our AC friend.

  2. Re:Not a problem on False Information A-Okay in Primary FBI Database · · Score: 1
    I'm not sure about the specifics, but it's possible that because of the Privacy Act, Craig Livingstone's actions were legal, while Chuck Colson's were not.

    I'm not sure when Chuck Colson disclosed an FBI report, but assuming it was before 1974 (which makes sense, Watergate happened in 1971-1972), then it would have been illegal. But by the end of 1975, investigation reports could be requested using the Freedom of Information Act. (The FBI's FOIA page.)

    Although since I don't know the exact particulars about either cases, and IANAL, I can't actually be sure that what I'm saying is correct. However, it is a possibility that because the laws had changed, Colson was doing something illegal and Craig Livingstone was not.

    (For those who remember that the FOIA went into effect in 1967, good for you. It didn't effect the FBI until amended by the Privacy Act of 1974, which apparently didn't go into effect until the end of 1975. See the above link for info from the FBI.)

  3. Re:Farscape and SciFi on Farscape Finale Tonight · · Score: 1

    Turns out that they still are. At 9 in the morning (EST?) every Saturday. SciFi's MST3K page.

  4. Re:One possible project on LGP Announces Game Development Team · · Score: 1
    I much prefer an open-source game; it allows me to make tweaks and implement house rules; something a proprietary game does not allow.

    Mods.

    Doom has allowed modification for a while, the Quakes had something too.

    Most of the early Half-Life mods were (bad) implementations of various house rules. Dumb things like letting you change the color of the laser weapons, but still interesting.

    Unreal Tournament (and Unreal itself?) have mutators that allow you to easily mutate one small aspect of gameplay, allowing the implementation of house rules that way.

    In other words, house rules is a good idea and it is appearing in commerical games too. And "a proprietary game" can allow it, but not all do.

  5. Re:WTF? on XML Co-Creator says XML Is Too Hard For Programmers · · Score: 1
    You can certainly describe a page using XML, and I see no reason why you couldn't construct a programming language using XML syntax, but how on earth are you going to store data in C++ or Java?

    Like this: XPM file format.

    Be afraid. Be very afraid.

  6. Re:Perl suggestion on XML Co-Creator says XML Is Too Hard For Programmers · · Score: 1
    If I understand what you're suggesting, that won't work (necessarily) to parse XML. Take the following XML:
    <a>
    _<b>
    __<b>
    ___b
    __</b>
    _</b>
    </a& g t;

    ("_" used to get around Slashcode's broken <ecode> tag that refuses to allow indentation. To get back at me, ecode then fucked up the closing </a> tag. Unless it fixes it on post, which would be nice but annoying.) I'm going to invent the "$a = <FILE>=~/regex/" notation to do what you're suggesting.

    The regex is evalutated on the input stream until a match is found, and then everything up to and including the match is returned. Grouping is allowed, so you're $1's will be set.

    So you start by doing a:
    <FILE>=~/<(\w+)>/
    to get the first tag. (Estutue observers will note this does not handle attributes, empty tags, or all legal tag characters. But it's an example.)

    Now that you have the first tag, you want to find the end tag. $1 has the tag name, so you can easily do:
    <FILE>=~/<\/$1>/
    So far, so good: you have the text for a's children.

    But now, you repeat the first regex to get "b" as the tag. The second step will net you:

    __<b>
    ___b
    __</b>
    Whereas, what you really wanted was:
    __<b>
    ___b
    __</b>
    _</b>
    There's no way to parse XML with regular expressions. As the name suggests, a regular expression can only parse a regular grammar. XML is a non-regular grammar. (A previous poster stated it was a non-regular context-free grammar. I think that's right, but am too lazy to try and figure it out on my own.)

    Bottom line: you really can't parse XML using regular expressions.

  7. Re:Tech support for your family?? on Family Tech Support · · Score: 1
    I dunno about the specific BIOS, but on some machines, simply removing the CMOS battery will get you back to factory defaults. (Unless it was flashing the "save defaults" or something.)

    I've found that even with the battery removed, you still need to unplug that machine to get power to stop flowing. Not sure about the old AT power supplies, but ATX keeps enough juice going to keep the CMOS settings when plugged in but "off". (And my mouse, too; it's eerie - my room glows blue from the Logitech icon on the mouse.)

    Dunno if that'll help - g'luck :)

  8. Re:My tech story. on Family Tech Support · · Score: 1
    I just got an e-mail from somebody that reads simply:

    Subject: Javaroids
    A)internet explorer 4.1
    B)Dell

    But:

    1. I'm not a tech support worker.
    2. I took Javaroids off my web page starting this year. (Because I can't even find the source code anymore, let alone feel like having Sun find out about it.)
    3. My web page was down for the past year. (Year off from school to earn enough $$ for ... well, for another semester. Gah.)

    He's not getting a response...

  9. What's wrong with PowerPoint? on Using Memory Errors to Attack a Virtual Machine · · Score: 1
    What's wrong with PowerPoint? There's nothing wrong with PowerPoint! Do you expect people to be able to communicate without PowerPoint? Have you people managed to evolve beyond the PowerPoint stage? I thought that everyone had to send e-mails that contained three bullet points as a PowerPoint attachment. You mean to suggest that there are better ways to do this?!

    But how would you get the bullet items to fly in from the right and dissolve out from a white to gray using plain text? It's just not possible!

    People who can communicate without PowerPoint? Hah! Next thing, you'll be telling me that people can talk from all over the world using nothing but text!

  10. Re:tell them... on A College Without Microsoft? · · Score: 1
    Are you telling me that if you sat down a jounalism student in front of Openoffice, they wouldn't be able to compose a paper?

    Sure. Based on my experience, OpenOffice would segfault well before they could complete the paper.

    Of course, I can't stand anything that's even remotely related to StarOffice, and hope that the project will DIE DIE DIE and be replaced by, well, anything else. God I hate that program. Mozilla is a better word processor than OpenOffice. Or maybe I'm just bitter.

    (Seriously, support KWord or AbiWord or anything like that. Let OpenOffice die. Please. I think there are better open source solutions for everything but PowerPoint than OpenOffice. Although I may be a bit biased...)

  11. Re:Massachusetts on MA Dept. of Revenue consider Linux · · Score: 1
    Nah, the Mets suck only when not playing against the Yankees. No team sucks when playing against the Yankees, because the Yankees outsucks everything.

    And yeah, New York Sucks! Everyone knows the real hub of the universe ain't over there...

    (I wonder if New Yorkers have the same pointless "sibling rivelry" type thing back at us that we do to them?)

  12. Re:Yeah, but... on New Windows Worm Inching Around Internet · · Score: 5, Funny

    Yeah, I just checked. 88888888 won't work.

  13. Re:Massachusetts on MA Dept. of Revenue consider Linux · · Score: 1
    Despite fading out of common use, do not refer to "soda" or "pop" as such; it's "tonic".

    Bah, it's soda. Only people who still call it tonic are from Rhode Island. Or just too close to Rhode Island. Which may as well be the same thing.

    I find it interesting that everyone thinks that the Yankees suck. It's true - non-Americans think that the Yankees (Americans) suck. Southern Americans think that the Yankees (Northern Americans) suck. Northern Americans think that the Yankees (Northeastern Americans) suck. People in the Tri-State area think that the Yankees (New Englanders) suck. New Englanders think that the Yankees (baseball team) suck. It's amazing!

    But yeah, if you're driving through Massachusetts and can't get any respect from the other drivers, just get a "Yankees Suck!" bumpersticker. You still won't get any respect from the other drivers, but at least they might shout "Hell yeah, Yank-hees SUCK!" before flipping you off and running the red light.

    And in case I upset anyone, I was born and raised in Massachusetts, best place in these States to live. Yankees suck!

    (Anyone else from Massachusetts take until about the eigth grade to be able to spell Massachusetts? 'Course, I can't spell anything anyway, so it wasn't too big a problem...)

    k, that was wicked pointless...

  14. Re:ummm.... on New Windows Worm Inching Around Internet · · Score: 1
    How about both? Specific guy I'm thinking of uses a capitalized dictionary word followed by "1234". When forced to change it (after it expired), he switched to "1234" followed by the same capitalized dictionary word. And he updated his Post-It note, accordingly. (Which he made sure everyone knew. After all, we all need to be sure we can log on to his computer.)

    But, we don't have to worry about being vulnerable from the Internet. We have a firewall. </sarcasm>

  15. Re:What were those commons passwords in Hackers? on New Windows Worm Inching Around Internet · · Score: 2, Funny

    Who'd be foolish enough to use ****** as a password? I use ********!

  16. Re:Microsoft's fault? on New Windows Worm Inching Around Internet · · Score: 2, Informative
    Or, for the terminally lazy, cut the following and save it as a .REG file. (For example, "Disable Admin Shares.reg".)

    ----CUT HERE----
    Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servi ces\lanmanserver\parameters]
    "AutoShareServer"=dword:00000000
    "AutoShareWks"=dword:00000000
    ----CUT HERE----

    Note the italicized line. Slashcode inserts a space there to prevent me from "page widenning". Remove that space. If the lines wrapped, then the line in italics should be one line and not two.

    Once the file is saved, right click and choose "Merge". (Or just double click/single click/whatever to cause the default action to take place.) Merge the values into the registry, and this will set the keys mentioned above without the need to play with the registry. Reboot, and you should be all set to delete the C$..Z$ and ADMIN$ shares. Damn those things annoyed me - thanks for the post!

  17. Re:ummm.... on New Windows Worm Inching Around Internet · · Score: 1
    Yeah, same with mine. Unfortunately, this leads to the "Post-It Note Effect", wherein many users leave their passwords on little Post-It notes on their monitors. (And this isn't trademark infringement, I do mean Post-It brand sticky notes.) I wouldn't worry too much about it, since we are a military contractor...

    Seriously though, I know one guy who thinks that everyone should let the other developers know their passwords in case they should ever need to access code on their computer. Which is even stupider than it initially sounds, since everyone's computer belongs to the corporate domain, and you can log on using your own username/password and gain access to all the files anyway.

    (Since most Windows setups seem to leave every file set to be world readable (ie, readable by the "Everyone" group), this generally works. Although I just checked my Windows XP machine, and the files are only readable by the "Users" group, so I could be wrong. Don't forget that Everyone and Users are both local machine groups, and not domain groups. Or are domain members automatically Users? You might need to add the other developers to the Users group or allow Everyone read permission on the development files. Or he could just accept that anything I did is checked into CVS and I'm not going to give out my password...)

  18. Re:My magic 8-ball sez... on MA Dept. of Revenue consider Linux · · Score: 1
    Yep - we are. (Yay, I'm now a voting citizen of MA. I'm so happy that my voter registration papers didn't get lost this time...)

    You can also view the time line of Massachusett's involvment in the antitrust trial.

    Good luck navigating our Attorney General's website - the information may be there, but it's hard to find.

    On a completely unrelated tangent, the Massachusetts Government Portal runs on a Netscape Enterprise Server under Solaris 8. Apparently they've had over a year of uptime, after switching away from IIS. (With a brief transition to Apache.) Apparently this isn't the first time the state has moved away from Microsoft.

  19. Re:Does everything have to be about MS? on Grand Theft Auto Released For Free · · Score: 1
    Actually, it was an attempt at a joke. I dunno who the hell modded it up as "Interesting" in that the only real point I made was that Hemos didn't actually post the "childish" comment - the story submitter did.

    Also, you left out the "or something" after "runon" - as a graduate of the American educational system, my grasp of the English language isn't supposed to be complete.

    Besides, I would hope that the sentence (happy?): And I should know - this entire post is, well, childish. would help you figure out something about the post... and "trolling" suggests I was trying to get responses, which I wasn't. I was hoping that some people might find it amusing, which is why I didn't use my bonus point. Well, OK, I did use the bonus point when I hit "Submit" instead of "No Karma Bonus", but the intention...

  20. Re:Does everything have to be about MS? on Grand Theft Auto Released For Free · · Score: 2, Insightful
    From an earlier story:
    World of Ends Public Draft
    Posted by Hemos on 08:39 AM -- Saturday March 08 2003>
    from the and-i-feel-fine dept.

    Doc Searls sent me the link over to the newest work that he and fellow Cluetrain person David Weinberger haveput together. It's called "World of Ends"[,] although I like the subtitle "What the Internet Is and How to Stop Mistaking It for Something Else" better - but that's just me. In any case, some interesting reading, particular if you like/d The Cluetrain Manifesto.

    First off, "person"? I suppose that works, but it reads strangely. We'd hardly expect a "David Weinberger" to be something else. Maybe "worker" or "contributor" or "author" or something, but "person" doesn't read well.

    Next we have "haveput" - oops. Then we need a comma to keep the next sentance from being a runon or something. Particular should be particularly, and "like/d" is obviously a typo.

    I don't think he's had his coffee yet... despite his belonging to the "and-i-feel-fine" department.

    Update: 03/08 14:42 GMT by CN: Yeah, this is a dupe of yesterday's story. Everyone point at Hemos and laugh.

    So as you can see, Hemos is evidently having a bad day. After being laughed at, he must have felt the need to take it out on Microsoft.

    Actually, if you look closer at the italics, all he posted on this story was "Ah, what a classic game." -- presumably, that means that Snover is being childish, and not Hemos. And I should know - this entire post is, well, childish.

  21. Re:Sigh. on Slashback: Humility, Patents. Vapor.com · · Score: 4, Insightful
    I'm not sure if he has the same concerns that I do, but:

    Qt is under the GPL. GTK+ is under the LGPL. This is important to me in my "commerical software developer" mode. If a Linux desktop is to succeed in the long run, it must allow third party developers to create applications for the desktop. It actually costs more to use Qt in a closed source app then it does to write a closed source app for Windows -- including the OS costs.

    Thats $1,079 for Visual Studio Professional and $299 for Windows XP Professional, coming to a total of $1378 for both the operating system and the complete Visual Studio Professional toolset. Qt costs $1550 for the developer kit. (That price is only to develop Qt/X11 apps - you do not get portability to Windows and Mac for that price. All three costs $3100 for a single developer.)

    So, total cost to develop a GUI application for Windows: $1378. Total cost to develop a GUI application for KDE: $1550 + cost of OS. Cost to develop GTK+ applications: $0 for development kit, which comes with most Linux distributions. All prices come with no vendor support.

    So - as a commerical software developer - which platform is the easiest to deal with? I don't know, actually. It depends on the documentation - MS documentation is (mostly) complete, if not totally accurate. I've only tried programming for GTK+ before, and unless things have changed with the 2.2 release since the 1.2 release, the documentation, while there, is very difficult to understand. I would hope that Trolltech's documentation is better, but I don't know...

    While most (vocal) Slashdotters seem to be against the idea of closed source applications "poluting" the open sourceity of their desktop (except where games are concerned...), for Linux to actually be even a potential platform for users to use instead of Windows, the cost for the development tools for clsoed source authors must be far lower than the Windows tools. Closed source developers "know" how to write software for Windows. Why pay $1550 to develop for what is basically an unknown?

    Also don't forget that the prices listed are for one user - MS and Qt offer bulk licensing, but even $1000 x 5 is still more than $80 x 5 (assuming $76 for the distro + $1 x 4 for CD-R copies of said distro). Don't forget what Stve Balmer said: "Developers! Developers! Developers! Developers!"

    He may have looked like a retarded monkey while saying it (and can someone please buy that man some anti-persperant?), but he has a point - without developer backing, a desktop cannot succeed. If developers will create software for your desktop, it will help increase the potential userbase of the desktop. Gtk+ is a much cheaper platform to develop for, simply because of its licensing.

    That is my concern with KDE's licensing - that KDE may be forcing the larger developer community away through its use of Qt. Although feel free to prove me wrong :)

  22. Re:Sigh. on Slashback: Humility, Patents. Vapor.com · · Score: 1
    From the linked e-mail:
    I hope your mail won't land on Slashdot or some other web site. Slashdot (= shorthand for all similar sites) is the most evil influence possible if we really want to do what it takes for Linux (or UNIX) to succeed on the desktop."

    Glad to be part of the problem :)

  23. Re:Bah! on Master of Orion 3 Released · · Score: 1
    Hence, it is option "C". If you find options "A" or "B", more power to you.

    I tried switching to Linux for over a year, but it just didn't work out. In my case, Windows costs less for me to use than Linux did - I can get all of my work done in Windows, but only most of it in Linux. Therefore, I use Windows and not Linux for my own personal desktop.

    I'm still open to changing back, should the situation change. For the time being, Windows is the better platform for my usage. The cost of not being able to use VPN and play various games while using Linux outweighs, for me, the freedoms Linux offers. I wouldn't say, or expect, that's true for everyone. But it is for me. Hence, I currently use Windows for my desktop.

    Go ahead - use Linux. I'm not saying you shouldn't. The more people that use Linux, the better. But it isn't for me. Windows is a better platform for me. Keep in mind that just because I use Windows does not prevent me from using Open Source software - I use Mozilla for my browsing, Gimp for image/digital photo editting, Cygwin for my command prompt, jEdit for text editting, Ant and Tomcat for my job...

  24. Re:Bah! on Master of Orion 3 Released · · Score: 1
    Do you find you have to make batch files named

    Nope - that's what Cygwin is for :). Even though they suggest against it, I have Cygwin's /bin directory in my Windows path - meaning that I can use common Unix commands directly from a CMD window. Nothing too drastic has gone wrong ... yet.

    Frequently though, when I need to use a command line, I just use the Cygwin bash environment. I dunno - I'm actually fairly good at switching between the two environments.

    Just don't forget the important CMD registry entry:

    Windows Registry Editor Version 5.00

    [HKEY_CURRENT_USER\Software\Microsoft\Command Processor]
    "CompletionChar"=dword:00000009

    That enables tab completion in (any?) version of CMD. They only set it by default in Windows XP. It's documented in the CMD /? blurb, if you're ever really bored.

  25. Re:Bah! on Master of Orion 3 Released · · Score: 3, Insightful
    or:

    C) Give up on Linux, and allow Windows XP to be your desktop platform. Install Cygwin for the Unixy things you need, and then realize that most of your development work (as in, for pay) is Java-based anyway and that you might as well stick with Windows for a better desktop experience.

    This isn't intended as an anti-Linux troll - I have Gentoo installed along with Windows XP, I got UT2003 running under Gentoo with almost no problems; but I found that for my day-to-day tasks, Windows was a far superior desktop environment than Gnome. (I personally like Gnome better than KDE, so don't try that route.)

    Sorry, Linux guys - I appreciate Linux as a server platform (I have a dedicated Linux server). But it isn't ready on the desktop yet. At least for me, since I do a fair amount of gaming. On the other hand, my Dad (who's a software engineer) has completely switched to SuSE. It's actually kind of ironic - he switched to Linux at about the same time I returned to Windows.

    (On the other hand, I still emerge rsync && emerge --update system && emerge --update world far too frequently considering I then have to reboot back to Windows to get actual work done. I even have a shellscript to help resolve new configuration files. So I have an up-to-date Gentoo system - that I don't use... I'm pathetic :))