Wikipedia:Reference desk/Archives/Computing/2008 February 27

Computing desk
< February 26 << Jan | February | Mar >> February 28 >
Welcome to the Wikipedia Computing Reference Desk Archives
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


February 27

edit

Executing a command over ssh doesn't preserve the return value.

edit

I'm trying to write an automated check to see if a machine has the latest installed kernel currently running on it. To this end, I'm comparing ls /lib/modules/ -1t --color=never|head -1 against uname -r. I want to run this check via ssh on a central server. Unfortunately, I've run into a bit of a snag. In short:

I ssh to my server and see this:

$ if [ `ls /lib/modules/ -1t --color=never|head -1` == `uname -r` ]; then echo GOOD; else echo BAD; fi
BAD

I do it from another server and see this:

$ ssh otherserver "if [ `ls /lib/modules/ -1t --color=never|head -1` == `uname -r` ]; then echo GOOD; else echo BAD; fi"
GOOD

I can manually run each component of the test remotely, and they return what they should. Why does running the command over ssh make a difference? grendel|khan 00:47, 27 February 2008 (UTC)[reply]

I think your backticks (``) are executed locally and substituted in by the local shell before ssh is run. Maybe you want to use single quotes instead of double quotes. --Spoon! (talk) 01:06, 27 February 2008 (UTC)[reply]
Yes, the backticks are interpreted by your shell on the local machine. One good way to fix this might be to put this stuff into a shell script and just "ssh otherserver scriptname". Friday (talk) 01:09, 27 February 2008 (UTC)[reply]
There are three main differences between single quotes ' ' and double quotes " " in the Unix (and therefore Linux) shells:
  1. Shell variable expansion using $ is still performed inside of double quotes.
  2. The backtick mechanism `...` works inside of double quotes.
  3. Using the backslash \ to escape special characters (basically ", $, `, and \) works inside of double quotes.
(Inside single quotes, on the other hand, nothing is special, and among other things there's no way to have a single quote inside a single-quoted string.)
Number 2 is little-known, but Spoon and Friday are right, it accounts for the OP's problem. —Steve Summit (talk) 01:39, 27 February 2008 (UTC)[reply]
Other problems in that command waiting to bite you later include the bashism '==' comparison (correct syntax is a single = for string comparison in the test ([...]) command) and the bad ordering of arguments to ls (options belong before non-option arguments; allowing them backward is a non-portable feature of GNU getopt). And I really don't like the implication that you've got an ls that shoots multi-column colored output down a pipe, but that's probably just an alias in the wrong place. --tcsetattr (talk / contribs) 01:47, 27 February 2008 (UTC)[reply]
Thanks, all. What a wallbanger. And it turns out that my ls doesn't actually shoot multi-colored junk down a pipe; that was just me building it out of blocks I wrote by running each bit in an interactive terminal, and assuming that it did. So I'm left with the following. grendel|khan 03:14, 27 February 2008 (UTC)[reply]
ssh otherserver 'if [ `ls -1t /lib/modules/|head -1` = `uname -r` ]; then echo GOOD; else echo BAD; fi'

Computer longevity

edit

Is it bad to keep the computer on continuously? Does that shorten it's lifespan? —Preceding unsigned comment added by 99.226.26.154 (talk) 02:32, 27 February 2008 (UTC)[reply]

The computer will start running slower. It's RAM will get full, it will be running tons of processes, etc. I turn mine off every night. We sleep at the same time. Useight (talk) 02:58, 27 February 2008 (UTC)[reply]
That's not true at all. It's a good idea to shut off the computer when you're not doing anything with it (it wastes a lot of power when lots of people leave it on), but it doesn't "start running slower" on account of being left on. Well-written programs that don't have memory leaks will not fill up your RAM unnecessarily; processes don't just start running on their own. --98.217.18.109 (talk) 03:02, 27 February 2008 (UTC)[reply]
A Utopian computer will not get full of memory leaks, hung processes, and random unforeseeable errors over time. However, we live in the real world. Programs are not perfect to begin with. They do have errors. Also, many (if not most) users install all kinds of garbage on their computer that is written by people who know very little about proper programming. This tends to include spyware and related nasty programs that run whenever they feel like it. All together, computers are helped by a periodic restart to clean everything out.
As for shortening the lifespan of the computer, the common belief is that turning a computer on and off will shorten the lifespan of the electronics. How much? Not a lot. I have had servers die in a matter of months and they are rarely turned off. I have a laptop I bought in 1997 that I turn on and off all the time (often multiple times each day). It hasn't died. So, protecting your electronics by leaving them on all the time isn't based on a hard fact that your computer will die after a specific number of boot-up times. It is rather random - just about as random as having a spider climb in while the computer is turned on and shorting out a couple components. -- kainaw 03:16, 27 February 2008 (UTC)[reply]
Nearly lost the info due to an edit conflict... any ways...Make sure to restart the computer regularily. This will remove any background processes that may have come up, by your own doing or even by spyware and adware programs. However, keeping your computer on longer may be helpful, for example allowing Google Desktop to index files, or other such things. But you should probably turn off the computer, or put it in hibernation. (Please be aware that hibernation is not the same as turning off the computer, as it saves all processes running and shuts down. Read more on the hibernation page). PwnerELITE (talk) 03:25, 27 February 2008 (UTC)[reply]
See, told you, 98.217.18.109. Useight (talk) 03:53, 27 February 2008 (UTC)[reply]
If you need to reboot constantly to maintain performance, you're either using a pre-NT version of Windows, or something is wrong. You shouldn't just accept that as a part of using computers; it isn't. Malware or extremely craptastic software might cause this, though usually with the latter you can just kill and restart it. Standby/suspend/sleep is a good idea though, or hibernate for longer periods / for computers that can't suspend properly. -- Consumed Crustacean (talk) 04:17, 27 February 2008 (UTC)[reply]
As far as the software goes, Linux is said to be much more friendly towards continuous operation than Windows.
For the hardware, in usual circumstances, as kainaw points out, unnecessary turning off\on can cause more damage than continuous operation. However, I guess that if your computer has a problem with its cooling and your parts get overheated, continuous operation can be harmful.
98 mentioned power, and said that a lot of power is wasted by "many people leaving it on". I think the last is faulty logic. If you take any phenomenon and multiply it by the number of people involved, of course you will get a large number. To reach an objective decision we need to measure the cost\benefit at the individual level. So think about your computer as a heating stove that runs on a few hundred Watts. If it's winter, you're possibly operating stoves anyway so nothing is really wasted. If it's summer, you're possibly operating air conditioning, so you'll have to pay for energy the computer takes and for the energy required to cool the heat generated by it (which is on the same order of magnitude). It's up to you to figure out how significant this cost is to you. -- Meni Rosenfeld (talk) 10:08, 27 February 2008 (UTC)[reply]
If you have a reason to leave it on, leave it on. If you're leaving it on just so that your friends can see that your IM program says you are sleeping, that's a stupid reason to leave it on. But anyway, my argument was not about the individual cost, but indeed, the social cost. If people turned off their computers (or put them into a very low-power consumption mode) when not using them, it would save a lot of wasted energy. College students in particular seem to feel that they should leave their computer on at all times as a severely over-powered answering machine; that's just wasteful of natural resources. --98.217.18.109 (talk) 16:36, 27 February 2008 (UTC)[reply]
"To reach an objective decision we need to measure the cost/benefit at the individual level."
See also Tragedy of the commons. —Steve Summit (talk) 15:12, 27 February 2008 (UTC)[reply]
If I understand this correctly, it addresses a point I did not mean to make (though I see how you would get that impression). It is basically an extension of the Prisoner's dilemma - if every individual works to maximize his own benefit, everyone suffers. But I didn't imply the OP should act selfishly, but rather that he should think reasonably about the quantitative implications. Let's assume that keeping the PC on overnight has a cost in terms of a person's electrical bill of, say, a dollar. Let us also assume that this will have ecological implications that will worsen the state of humanity in an amount also equivalent to a dollar. If a person is altruistic, then the total damage of leaving the PC on is 2$. If this is justified by the advantages, the correct decision will be to do so - and if he feels bad about taking a dollar from the rest of humanity, he can always give it back in the form of charity to a cause he deems worthy. But the cost is still only 2$. Saying, "a billion people do this and thus the total cost is 2 billion dollars which is a huge amount" is cheap demagogy as far as I am concerned. -- Meni Rosenfeld (talk) 16:01, 27 February 2008 (UTC)[reply]
It's not cheap demagogy to suggest that people should engage in more environmentally sensitive habits when the cost of doing so on an individual level is so low. If consumption habits were lowered by even very small amounts, there would be great benefits. I'm not exactly asking people to give up their cars here, though if they lived in an area where that is feasible it's not a bad idea! --98.217.18.109 (talk) 16:39, 27 February 2008 (UTC)[reply]
The total wastage\damage is an important criterion for an activist choosing an agenda worth campaigning for. It is not important for an individual, however ecologically minded, faced with a choice on how to behave personally - and is thus irrelevant to this discussion. -- Meni Rosenfeld (talk) 17:00, 27 February 2008 (UTC)[reply]
Any "well designed" spyware, malware, viruses, or other parasites will simply restart itself at reboot. It's not difficult to remove most such things permanently, anyway. (See Adaware) If individual programs are leaking memory (Firefox?) you could easily restart just that program. I keep my home PC on all the time. The only time I reboot is when I switch from Windows to Linux. (Or a poorly designed driver installer forces me too.) Since I haven't installed Linux on my new PC yet, at the moment my home PC has run over a month in Windows with no reboot, with no problem at all, and no unusual memory or CPU consumption. (I'm running Windows XP, Pro) 72.10.110.107 (talk) 14:06, 27 February 2008 (UTC)[reply]
I have to second (third?) what 98.217.18.109 and Consumed Crustacean have said above. If it's convenient for you to leave your computer on (or sleeping/hibernating) all the time, you should be able to. People in this thread have said things like "The computer will start running slower... its RAM will get full" and "all together, computers are helped by a periodic restart to clean everything out", but that's not true in the general case. In the special case of broken or toy computers, they may be helped by periodic restarts, but real computers don't need them. This is not some utopian fantasy I'm spouting, either -- the laptop I'm typing this on has been up for 63 days. The only times I reboot it are when I'm forced to by one of the few remaining (broken) software installers that inanely insists on it. —Steve Summit (talk) 13:40, 27 February 2008 (UTC)[reply]
It'd be great if people were to cite some sources for their assertions. I was told 15 years ago that turning computers on and off was bad for the hard disks specifically because it wore out the motor "brushes". But I have no actual citable source for this claim, or any idea whether motors are better now than they were 15 years ago. Temperature cycling might reduce the life of electronics, though again I have no source for this. Tempshill (talk) 17:10, 27 February 2008 (UTC)[reply]
I took apart a hard drive made circa 1997 and it didn't use a "motor" per se. It used an electromagnet between two permanent magnets to move the drive heads. I doubt that turning computers on or off has any effect on the hard drives, mainly because the hard drive makes a point of moving the heads to the outer unreadable sector of the platters right before the PC shuts off. 206.252.74.48 (talk) 17:17, 27 February 2008 (UTC)[reply]

Don't install crappy software or IM nonsense. If you're running Vista or BSD/*nix you will rarely (every few months?) have to restart your computer and if you don't leave things running then you won't have memory leaks. Holy crap people it's not that hard, just check your task manager or ps every few days and see if anything's taking up a lot of memory, and if there's anything then restart it. You'll have a similar experience with win 2000 or xp if you strip them down a bit. No it's not bad for it to leave it on, and having your IM client report that you're sleeping is a perfectly good reason to leave it on if you don't want to boot again in the morning. If you're dealing with a user, tell it to restart the computer regularly, but anyone intelligent can easily manage their computer's resources and perform basic on-line maintenance to keep it running for long periods of time without restarts. Don't install stuff all the time, just what you need, and get familiar with what processes tend to freeze or leak and clean them up when necessary. I can't believe people are giving advice that you have to restart regularly even on linux. That's completely wrong. I've read innumerable stories of epic uptime on slashdot.. I recall one story of a network tech rewiring a small school.. he was following the cables to try to find the main router, and traced them to the back of the janitor's closet where under mops and piles of dust he found an old pentium 1 beige box.. both fans completely burned out, hard drives utterly wrecked. It was running BSD from memory acting as the router for the school with an over 5 year uptime. :D\=< (talk) 18:39, 27 February 2008 (UTC)[reply]

Ignoring all of the above, it doesn't really matter if you turn the computer on and off, or if you leave it on all the time. There are two major factors that can cause the non-moving parts of a computer to fail: thermal cycling causing crack propogation in chips, and electron wind eroding wires within the chips. One of the final steps in manufacturing computer chips is to cut the silicon wafers apart into individual chips; this creates miniscule cracks at the edges. Every time you turn a computer off or on, the resulting temperature change will cause the cracks to grow slightly, and eventually, a crack will cross a critical bit of a chip. Keeping computers on all the time isn't the solution to this: as long as the computer is on, electrons flowing through the wires will occasionally knock copper atoms loose, damaging the wires. It's a very slow process, but because of how small the wires within a computer chip are, it doesn't take much to wear them out.
For a typical computer that's turned off every night, it's a 50/50 chance which one of the above will cause it to fail. Either process will take many years to kill a computer, and it's far more likely that the computer will fail from some other cause before then. --Carnildo (talk) 21:50, 27 February 2008 (UTC)[reply]
Electromigration (the electron wind referred to above) doesn't kill well-designed circuits although it is a major problem facing chip designers. Chip fractures are pretty rare too if you're not toasting your chips through bad cooling or overclocking. On the other hand chloride contamination (salts) getting into a critical part of a plastic-packaged chip does kill computers. So does the drying out of electrolytic capacitors. Both are made far worse by overheating so it turns out that dead fans are a big cause of system death. Bearings on hard drives also wear out, practically on a pre-determined schedule. Soon, thanks to ROHS directives, tin whiskers and broken solder joints will likely be a big cause of computer death.
Nowadays, I'd say the better bet is to sleep your computer if possible and if you tend to leave a lot of work "open", otherwise shut it down. This may change when brittle ROHS-compliant solders become more widespread.
Atlant (talk) 00:51, 28 February 2008 (UTC)[reply]

Gamer Fo life :P

edit

Anyone play guildwars? —Preceding unsigned comment added by Inutasha De Fallen (talkcontribs) 04:21, 27 February 2008 (UTC)[reply]

I know someone who does. Could I ask what the question is? Kushal 04:47, 27 February 2008 (UTC)[reply]

Just reaching out to People and saying HI There isnt much to do in a place like fallon nevada unless your gonna knock someone up or your in a Gang...I love playing with people :P —Preceding unsigned comment added by Inutasha De Fallen (talkcontribs) 05:04, 27 February 2008 (UTC)[reply]

WP:Tyop The Typo project is fun. - You can help! :-) Kushal 06:13, 27 February 2008 (UTC)[reply]


ha ha im amused :P >.> <.< >.< not really im soooo sorry i inconvinced you with my edjewkated tipoes i trwy ta mak Em beta fo yaz! —Preceding unsigned comment added by Inutasha De Fallen (talkcontribs) 06:37, 27 February 2008 (UTC)[reply]

I play guild wars. Have all 3 campaigns beaten (most quests, most masters mission rewards), but haven't done any of the crazy hard stuff like Sorrow's Furnace, Underworld, Fissure of Woe, or a lot of the Realm of Torment quests, and I don't own EoTN. Only one character, only one run. I've got like 180 hours in the last 2 months :O :D\=< (talk) 00:58, 28 February 2008 (UTC)[reply]

sweetness whats your in game name maybe we could hook up and play :P —Preceding unsigned comment added by Inutasha De Fallen (talkcontribs) 20:50, 28 February 2008 (UTC)[reply]

Mage Illusioner, named from the Progress Quest class. I'm actually playing right now (bought GWEN 3 hours ago.. not impressed) until some people go to sleep and my ping is low enough to play Insurgency :D\=< (talk) 03:34, 29 February 2008 (UTC)[reply]

you guys might want to take this conversation to a discussion page

Tell me how this is done

edit

http://img186.imageshack.us/img186/8471/1204033097892lt6.th.png http://img186.imageshack.us/img186/8471/1204033097892lt6.png

Browsing 4chan last night, I found this very curious image. Those two are the same image. The first is the thumbnail of the second. You can download and open it in photoshop, but the full size image became the image in the thumbnail. There is a sly trick to this... the way the pixels are arranged maybe? But I can't figure it out. Enlighten me please? Aurora sword (talk) 05:24, 27 February 2008 (UTC)[reply]

The big one has a gamma tag. The image gamma is set to 0.015150 or about 1/66. This convinces your image viewer that the image is very bright and needs to be darkened to be displayed correctly. Of course that only works if you are using an image viewer that understands and respects the gamma tag. The first viewer I tried didn't, and for a minute I wondered what was so weird about it since the images looked the same. Both images are actually present in the big one, but only one of them is bright enough to still be visible after the large gamma correction is applied. The other one becomes so dark that it is just a bunch of single-pixel-wide black rows and columns which aren't noticeable unless you zoom in. You should be able to see both at the same time if you look at the big one adjust the gamma (brightness).
The smaller one, in spite of having .png on the end, is actually a jpeg, with no gamma tag. The conversion process has lost more information than a typical image resizing, because the gamma tag is gone. Also, it seems to have lost enough detail that the other image is not visible regardless of brightness level. --tcsetattr (talk / contribs) 06:07, 27 February 2008 (UTC)[reply]
I see, gamma tags eh? In other words it fools the viewer. The bright pixels contain the girl image and the dark pixels contain the forest image. Thanks a lot. Aurora sword (talk) 06:35, 27 February 2008 (UTC)[reply]
Oddness: if you have a laptop, you can see the second image by looking at the first one at a weird angle. On my Macbook I can see it by ducking down low and looking up at the screen. Crazy. Why should that be? --98.217.18.109 (talk) 13:34, 27 February 2008 (UTC)[reply]

a lightweight (couple of megabytes!!) LOCAL web server with cgi support for windows? FOUND IT!

edit

I want to test my python cgi script locally, what lightweight web server can I download (a couple of megabytes) that doesnt' require a bunch of configuration?

FOUND IT! not even megabytes, 700 KB, called abyss. already running my scripts locally....

heaven must be like this

Harddrive misreporting size

edit

Hi everyone,

I have a DELL Inspiron 6000, which, I am about 99% sure came with a 40gig harddrive. Now, when I right click on C drive and go to properties, it reports a 71 Gig harddrive. I've had a pretty massive computer slowdown in recent weeks, and I'm considering reformating, but I want to solve this problem first.

thanks! --Cacofonie (talk) 12:54, 27 February 2008 (UTC)[reply]

Gparted will most probably report correctly the size of your hard drive. I know it's a partitioning tool, but it is also useful as this, ain't it? --Ouro (blah blah) 13:19, 27 February 2008 (UTC)[reply]
Yeah, boot up a GParted live CD and it will tell you what's going on. --98.217.18.109 (talk) 16:31, 27 February 2008 (UTC)[reply]

Is there aby possibility y9ou ahve turned on disk compression? That might explaina performance slow down and apparent increaded disk space.

bash aliases

edit

How do I make a bash alias so that everything passed to the alias (example: myalias --foo bar) get passed to the actual command? Or is this only possible with functions? --grawity talk / PGP 16:09, 27 February 2008 (UTC)[reply]

I just tried this and it worked:
alias e='echo $*'
Strictly speaking (but the reasoning is somewhat obscure), this would be better:
alias e='echo "$@"'
Steve Summit (talk) 16:14, 27 February 2008 (UTC)[reply]
I don't think you have to do anything special. I have an alias from mingw32i586g++ (or whatever the heck that executable is called) to "mingw" and it still takes arguments perfectly fine. :D\=< (talk) 16:26, 27 February 2008 (UTC)[reply]
Seconded. Aliases pass on arguments just fine. The trick is if you don't want them passed, or want to expand more than one alias, etc. In bash, making an alias's expansion end in a space — alias a='b ', for instance — makes the following word subject to alias expansion when the alias is used. And alias a=b; alias b=c works as expected; you can even combine them with alias a='b c'; alias b='d '; alias c=e and have "a" become "d e". --Tardis (talk) 16:56, 27 February 2008 (UTC)[reply]

.bashrc|.bash_profile|.profile: SSH vs SFTP

edit

Is there a .rc (such as .bashrc) that only gets executed for SFTP logins? only for SSH terminal logins? --grawity talk / PGP 16:35, 27 February 2008 (UTC)[reply]

I don't think SFTP even starts a shell. With SSH, I don't think there's a separate file for it, but you can probably (by analyzing the output of ps) determine from within one of the startup files (.bash_login, perhaps) whether the current session was started by sshd. --Tardis (talk) 17:19, 27 February 2008 (UTC)[reply]
Thanks. I just noticed that only SSH shell session sets SSH_TTY=/dev/ttypd, the others don't. But all SSH|SFTP|SCP use .bash_profile|bash_login|.profile. --grawity talk / PGP 17:39, 27 February 2008 (UTC)[reply]
Yes, I believe any login to a *NIX system will run the "shell" configured for that account in /etc/passwd (see chsh). That shell can be any executable you like, but in your case is clearly bash, which will automatically process the various initialisation scripts you mentionned.
If bash is invoked for a non-interactive session (I don't know if SFTP does this or not, but actually think it might well) it may invoke different processing, but it will certainly set different variables. I believe one is the magic variable $-, which will contain an i when interactive (you can test it with case). - IMSoP (talk) 19:10, 2 March 2008 (UTC)[reply]

Setting up workgroup names

edit

Hi,

I'd like to use a Debian box to set up local DNS names for the computers on my network, so I could access "http://mydell/index.html" or "http://debian3/bugzilla/" by just typing in those URLs. From skimming, the only advice I saw was to actually set up a whole DNS server, so every time I access any site on the Internet, the DNS lookup would be on a computer of mine that'd be hosting DNS for me. Can I do the first part without doing the second part? Tempshill (talk) 17:13, 27 February 2008 (UTC)[reply]

You can use a hosts file, but you'll have to set it up on each client computer separately. (This approach doesn't even need a separate DNS machine.) --Tardis (talk) 17:23, 27 February 2008 (UTC)[reply]
Thank you! That'll probably work fine. Tempshill (talk) 21:39, 27 February 2008 (UTC)[reply]

plays sound files at the press of a button

edit

I'm looking for a (free) program that allows me to assign any wav or similar file to a particular key and then play it on a seamless loop when I press that key (EDIT: and stop playing it when I take my finger off the key). Also it should allow you to bind multiple keys to sounds and play them at the same time. I'm sure there's some complicated music making thing that has that feature hidden in it somewhere but I can't get past the confusing interfaces. Is there anything that fits this description? --86.144.102.254 (talk) 18:01, 27 February 2008 (UTC)[reply]

I've never seen any free ones, there might be one but I've never seen it. George D. Watson (Dendodge).TalkHelp 20:07, 27 February 2008 (UTC)[reply]
It may help to start with Audacity. That's an oddly specific request, though. It sounds like you would be better off writing a simple program yourself. May I suggest Game Maker if you are not experienced? --Russoc4 (talk) 20:25, 27 February 2008 (UTC)[reply]
I've also never seen any free software to meet your needs, but it may help you to know that the hardware version of what you want is called a sampler. jeffjon (talk) 20:30, 27 February 2008 (UTC)[reply]

LaTeX issues

edit

I am trying to use latex (bibtex) for Harvard style citations, and am encountering many problems:

  1. I'm not able to get rid of repetition of author name in case I cite multiple references of the same author. For example, I get (Wainwright 1982, Wainwright 1988) whereas I want (Wainwright 1982, 1988).
  2. I can't get rid of long lists of authors on some citations, where I want them to be replaced with et al.. For example, I get (Kanzawa, Hoshino, Chiba, Hoshino, Kobayashi, Kamasawa, Kishi, Osumi, Sameshima & Tsuchiya 2006), where I want (Kanzawa et al., 2006)
  3. I want to cite several papers "as noun" in the beginning of a sentence, but can't do it. For example, I want something like: "X (1943, 1956, 1996, 2001) proved P". But I'm able to cite only one reference using \citeasnoun .

I'm using the dcu.bst style file (I've tried others), and I'm using the harvard package. Any help will be highly appreciated. deeptrivia (talk) 21:49, 27 February 2008 (UTC)[reply]

Hello. In my LaTeX days I settled on natbib for citations. It had the best coverage of these sorts of issues. Good luck! --87.74.1.108 (talk) 21:06, 28 February 2008 (UTC)[reply]

what do tr and td stand for in html tables

edit

what do the abbreviations stand for in html table tags —Preceding unsigned comment added by 79.122.58.97 (talk) 23:31, 27 February 2008 (UTC)[reply]

<tr> creates a row and hence stands for "table row". <td> creates a cell within a row - I believe that the "td" comes from "table data cell". Xenon54 23:36, 27 February 2008 (UTC)[reply]
yep. There's also <th> for table header. Don't use tables, use divs and CSS. :D\=< (talk) 00:09, 28 February 2008 (UTC)[reply]
Well, don't use tables if you're not displaying tabular data. There are still plenty of good times to use tables. You just (generally) shouldn't try to use them as a means to doing complicated layouts, as used to be done. (But even then, they sometimes have advantages over CSS, not the least that they are often much easier to use for things like simple column layouts which render more uniformly than do the CSS required to do such a thing.) .--98.217.18.109 (talk) 00:14, 28 February 2008 (UTC)[reply]
OK well my advice is to never use tables, they're nasty and difficult to control. :D\=< (talk) 00:17, 28 February 2008 (UTC)[reply]
I personally think that sometimes, although desirable, CSS and IE makes divisions nastier to control than tables... x42bn6 Talk Mess 00:52, 28 February 2008 (UTC)[reply]
I second x42bn6's assessment. Sometimes CSS is easier to control, but often it is not. It takes a LOT of CSS to make columns work correctly (much less work correctly in browsers other than Firefox), whereas a few nested tables can do the job extremely easily without any difficulty at all. On the whole I think CSS is indispensable, but there are some places where tables just are easier, if more (theoretically) inelegant. --98.217.18.109 (talk) 02:24, 28 February 2008 (UTC)[reply]
Easier but inelegant.. sounds familiar. The more elegant solution is always the better one, don't be lazy and use tables :D\=< (talk) 04:19, 28 February 2008 (UTC)[reply]
No, the "elegant" solution is not always the better one in the real world, something you'll probably learn once you spend some more time there! Personally I'm not at all convinced that tables are not appropriate for things like simple columns, either. Personally I find the two lines of HTML needed to set up a two-column table much more "elegant" than the 10 lines of CSS required to do the same thing. --98.217.18.109 (talk) 16:20, 28 February 2008 (UTC)[reply]
Tsk tsk all this talk of real world. I don't need more real world experience, you should be jealous of me for being able to afford doing the Right Thing! The shorter table tags might seem more elegant, but as we move to the FAR better xml-y style of website coding, HTML tags are supposed to tag divisions in content, which is then actually formatted and styled with CSS. The ideal way is to just have your page content in xml tags and have xslt sheets to define how it should be displayed in the browser. We're only halfway there but you should get in the habit of using that model even now with divs and css. :D\=< (talk) 02:13, 29 February 2008 (UTC)[reply]
Right. So the following:

<table border=1>
<tr><td>Row 1, Cell 1</td><td>Row 1, Cell 2</td></tr>
<tr><td>Row 2, Cell 1</td><td>Row 2, Cell 2</td></tr>
</table>

Renders like:
Row 1, Cell 1Row 1, Cell 2
Row 2, Cell 1Row 2, Cell 2
Relatively simple, no? It gets much more complicated, but that's the basics of it. --98.217.18.109 (talk) 00:14, 28 February 2008 (UTC)[reply]
In the meta-discussion about tables vs. css, we are at a point where CSS can do most of what tables can do, but not all of it. For example, if I want an area where all text is aligned to center both vertically and horizontally, I can <table><tr><td align='center'>My Content</td></tr></table>. Try and do that with a div and CSS so that it works in all popular browsers (any by "popular", I don't mean just IE6 and IE7). Over time, things such as vertical-alignment will become supported by CSS. We'll also be able to attach the height or width of one div to the height or width of another div - so that if one expands, so does the other. Tables do this, CSS+div does not. So, we are using tables, knowing we shouldn't, because CSS hasn't caught up with the capabilities of tables yet. -- kainaw 16:57, 28 February 2008 (UTC)[reply]
Why would you want to center something vertically? :D\=< (talk) 04:25, 29 February 2008 (UTC)[reply]