jcl

Linux Experts
  • Content Count

    1299
  • Joined

  • Last visited

Everything posted by jcl

  1. Well, almost anything is better than C and C++.
  2. D'oh. Forget what I posted, it doesn't work. I didn't read the description of clock() closely enough and didn't test the code well. The only portable way do what you want is to use difftime() or to build something on gmtime() or localtime(). For example #include <ctime> #include <iostream> using namespace std; int main(void) { int a = 5; for (time_t t = time(0); difftime(time(0), t) < 10; ) { cout << a; } return 0; } If you don't care about portability, most operating systems provide more useful time-related functions. For example, on P
  3. No syntax, but you can bang something together using the <ctime> functions. Here's a (typically stupid) busy-wait function #include <ctime> using namespace std; void busy_wait(unsigned sec) { for (clock_t t = clock(); (clock() - t)/CLOCKS_PER_SEC < sec; ) ; } (IMO this is more natural with a while loop.)
  4. I never design ahead of time. Usually I start with a basic XHTML (strict, always) template and grow the page from it, refactoring and redesigning until the structure seems reasonable. Then I work on the CSS, restructuring as needed, until it looks decent. Last time I did any work on a page it was backed by a mess of Ruby scripts, so I spent a lot of time extracting parts of the XHTML and moving them into the scripts. Then I got distracted trying to move from XHTML to XML with a transformation layer (both Ruby and XSLT at different times) and got bored and quit. The standards I use are dete
  5. jcl

    Who To Trust?

    Most people don't know how to maintain a car. They have a (very) small library of scripted responses to certain events; when those scripts fail they turn immediately to experts. The same is probably true of pools. That's an entirely reasonable expectation. We know how to provide nearly maintenance-free computing services. It was the norm for decades and is still the norm away from the desktop. The egalitarian revolution that followed the introduction of personal computing is pure insanity. People should be able to use a computer without thinking about worms and spyware and DLL Hell. Bu
  6. It depends on the context, but I assume you mean the 64-bit operating systems. Windows XP x64 (formerly Windows XP 64-bit Edition for 64-bit Extended Systems) is a version of Windows for the AMD64 (also known as EM64T and x86-64) platform; AMD64 is a 64-bit extension of the familiar IA-32 (as known as x86) platform. AMD64 is currently supported by systems using AMD Opteron, Turion, and Athlon 64 processors, Intel Xeon processors, and newer Pentium 4 processors. It won't run on others processors. There are also 64-bit versions of Windows 2003 (Microsoft's current server platform), supporting
  7. IE7 is planned to support (at least) XP SP2, 2k3, and x64. It seems to be based on a backport of Longhorn IE but the two appear to be distinct and fairly different. Longhorn IE will presumably now be called IE8 or IE-FX or something. The IE7 beta is scheduled for this summer. Final release could happen before the end of the year.
  8. jcl

    Who To Trust?

    Maybe better. I'm very impressed with the combination of hotplug and udev. Strange as it sounds, the problem I'm having now is the hardware detection being too good; hotplug is screaming at me about missing kernel modules that I haven't gotten around to building yet. I can't complain about a system that's better at detecting hardware than I am
  9. As CurlingSteve said, it depends on the instruction and also of course on the architecture. IA-32 has the opcode more or less in the low-order byte(s) of the instructions. Data is encoded in the instruction. Simple as that. For example, the instruction mov eax, 1 is encoded as b8 01 00 00 00 a one byte opcode (B8, or "MOV reg32, imm32" with EAX as the target register) followed by a four byte integer representing 1. Never heard the term 'codebook' used in reference to processors.
  10. jcl

    Which Is Faster

    Well, "solid" and "liquid" are phases of matter, but they're fairly coarse-grain descriptions. You can't really have liquid or gaseous light. It's just electromagnetic radiation in a certain range of frequencies. It's both. All 'particles', including photons, exhibit both wave-like and particle-like behavior depending on how they're viewed. This is called "wave-particle duality" and has been troubling people for a very long time.
  11. jcl

    Which Is Faster

    The invariance of c is the Second Postulate of Special Relativity. (The First is that physics shouldn't change if you're in motion. The two of them together imply, among other things, that the speed of light is constant regardless of the motion of the observer.) He was the first to explain how it the speed of light could be constant. Einstein was well-known for his dislike of QM and specifically the Copenhagen interpretation. My understanding is that he accepted that it was the best theory available but did not accept that it was a correct description of reality.
  12. Heh. My understanding is that GCC doesn't schedule for the P4 at all. It does perform some instruction-level optimizations, but the code it produces is almost identical that produced for the (also unscheduled) i386 and i486 targets.
  13. jcl

    Which Is Faster

    Light doesn't slow down when it loses energy. The most noticable effect, I believe, is that the frequency shifts downward.
  14. That's normal. That may be normal but I don't know. It doesn't really matter either way; the permissions of the target file are checked as well. Nope. If you want them, create them.
  15. jcl

    Which Is Faster

    For most purposes the speed of light is determined just by the permeability and permittivity of the medium. Increasing the input energy to the laser will increase the output energy (amount of light, frequency, whatever) but won't increase the velocity of the light. You sure that was a laser and not a charged particle beam? That sounds similar to one of the proposals for 'neutralizing' particle beams so they could maintain cohesion in the open despite the tendancy of the charged particles to repel each other. The idea probably died when the gov't lost in interest in space-born directed-ener
  16. Gentoo wouldn't be my first choice. If it was your laptop it'd be fine, but Gentoo maintenance can be pretty time consuming. You'd have to make sure he'd be willing to periodically surrender the machine for hours or days at a time while you ran updates. Or willing to learn portage himself. The wireless card will no doubt be tricky. It would help if you knew exactly what chipset it uses. I have found reports of Wireless-B adapters working under Linux but it looks like it was trial and error until the correct driver was found. Easiest way to get the chipset information (AFAIK) is to boot th
  17. jcl

    Which Is Faster

    You have to know how quickly each type of signal can propogate through whatever media are being used. In any case, electrical signals, like all signals, can't exceed c and usually will fall a bit short of it (if for no other reasons, because of the geometry of the wiring), so under optimal conditions either the laser will win or it'll be a tie. Given the distance involved it's probably safe to treat the optical medium as a vacuum, so there's no way the lamp can win. Forgot to mention that this is true regardless of how fast the electrical signal travels. Information can't be transmitted fast
  18. You can use a boot floppy and perform a network installation. If the modem isn't supported you should be able to rig up a network over the serial or parallel port. It would be, uh, educational. (Read: not fun.) Alternatively, you could find an old floppy-based distro, install it on a small partition, use it download a more recent distro, and then install from the hard drive. Also educational, but less so. Memory is going to be a problem. Full-blown word processors are out of the question, but if you're more interested in producing nice documents than with easy preparation, you could use
  19. Your first problem is that C++ doesn't have logic variables. The operations in the program are evaluated in more-or-less the order written. That means that this block: int a; //Listing all the integers i'll be needing (can i lose a few?) int b; int c; double d; int d2; double x; double x2; x = (-b + d)/2*a; //Listing what the doubles are (i wanted to use doubles x2 = (-b - d)/2*a; //so i would know if it wasn't a perfect square). d = (b * b)-(4*a*c); //Something is definately wrong here. assigns the values of x, x2, and d right there, using the current
  20. jcl

    Age Program

    Common error. Your problem is in the 'else' branch of the conditional. This: else (age<50); { cout <<"Wow, you are young!\n"; } is equivalent to this: else { (age<50); } { cout << "Wow, you are young!\n" } What you have there is the single-statement (blockless) version of 'else' followed by a block with some deceptive formatting. You probably want: else if (age<50) { cout << "Wow, you are young!\n" } or perhaps: else { cout << "Wow, you are young!\n" }
  21. Sun's implementations are the safest bet. IBM's have traditionally been very good, maybe better than Sun's, but I think they lag a bit behind Sun's releases. Other than that you probably want the Standard Edition of the current release. At the moment that would be J2SE 1.5, AKA J2SE 5.0. (Sun likes to gratuitously inflate the release numbers of their products.)
  22. Well, since this thread is active again and I have this sitting around.... Behold, E17: It's more impressive if you can see the animations.
  23. The mentality is closer to "We know what we need, if you don't like it, change it" or more succinctly, "Shut up and show us the code". Most Linux developers work on projects they'll use, and not surprisingly most Linux developers have no use for the sort of convenience features that attract casual users. So it's up the casual users to make the system easier for themselves by contributing. The GNOME and KDE Usability Projects could probably use the help.
  24. IBM 3x0s are amazing computers now. Hundreds of users running simultaneous interactive sessons on individual virtual machines on a hardware hardly more potent than a modern graphing calculator. Zealots and evangelists should be ignored. The former are beyond reason and the latter will say anything to win converts. Indeed. That is I think a side-effect of variety. You frequently find people suggesting suboptimal solutions to problems because they simply aren't aware of all the alternatives. KDE is used by a minority of Linux users so it doesn't surprise me that most of the advice you go
  25. Hmm. According to her bio, she "helps direct the content on CNET's home page". Wonder if that includes the bios: