Wikipedia:Reference desk/Archives/Computing/2008 April 2

From Wikipedia, the free encyclopedia

Computing desk
< April 1 << Mar | April | May >> April 3 >
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.


Contents


[edit] April 2

[edit] Unix shell script request

I have some files in a folder with filenames like:

1989-Author-Title.pdf
1990-Author-Title.pdf
1998-Author-Title.pdf
2002-Author-Title.pdf

I'd like a little Unix shell script that will go through said folder and change the names to:

89-Author-Title.pdf
90-Author-Title.pdf
98-Author-Title.pdf
2002-Author-Title.pdf

Note that everything which starts with "19XX" is converted to just "XX", whereas anything starting with "20XX" is left as is. And note that in practice the authors and titles and etc. are different. But that shouldn't matter, no? Only the first two/four characters matter.

I imagine this can't be too hard to do, no? I'm on OS X but that shouldn't matter much. I was going to do it with Automator but I didn't see any easy way to filter out the files based on the filename (without searching the whole harddrive or having to hard-code the folder locations in Automator), and anyway I find Automator pretty clumsy. I thought maybe a shell script could help. I won't be running this over the whole drive, just a few folders with a lot of similarly named files in them.

One last caveat: some of the files already have been manually renamed. So the script should ignore any file that starts with "XX-" as shown above.

Thanks for your help! --Captain Ref Desk (talk) 02:22, 2 April 2008 (UTC)

Didn't Y2K panic teach us not to do this?
for file in 19[0-9][0-9]-* ; do mv "$file" "${file#19}" ; done
--tcsetattr (talk / contribs) 04:24, 2 April 2008 (UTC)
Awesome, thanks! That works perfectly. And re: Y2K -- these are just personal records, and the date range is very limited (1945-2008), so there's not a lot of risk here. --Captain Ref Desk (talk) 12:46, 2 April 2008 (UTC)
Yeah, you say that now, but when medical science advances sufficiently far as to allow you to live to 2045, won't you feel like a 1960s COBOL programmer who made it to 1999! ;-)
Atlant (talk) 15:53, 2 April 2008 (UTC)
But everything from 2000 on is unique right? :D\=< (talk) 22:50, 2 April 2008 (UTC)
Yea! But now he has a Y19K problem! APL (talk) 15:52, 3 April 2008 (UTC)
You could also simply do: rename s/^19// *.pdf --Dacium (talk) 01:22, 3 April 2008 (UTC)
rename(1) is not a standard Unix command. Maybe it's something that's widely available in Linux distributions, but it's not part of FreeBSD, nor Solaris, for example. -- Coneslayer (talk) 12:31, 4 April 2008 (UTC)
It's not POSIX but it seems to be common. Some sort of pattern matching rename :D\=< (talk) 01:46, 5 April 2008 (UTC)
"Common" is a euphemism for "It's on Linux, and who cares about anything else?", right? Linux-centrism is the new Vax-centrism. -- Coneslayer (talk) 19:25, 5 April 2008 (UTC)
As far as you don't have files dated 1919, you're safe. Admiral Norton (talk) 16:13, 7 April 2008 (UTC)

[edit] XML Editor

Could anyone here recommend a good text-based XML editor? I tried XMLSpy a while back, but found several problems with it. First of all, I had to get a "trial version" which is bad if I intend to use it for more than 30 days. Second, it choked on large (250 MB) files (and kept using CPU way more than it should have). Third, it's not available for Linux. I did like the validation feature and the "Generate DTD/Schema" feature. Do any of you know of an any editor which has these good features, with the aforementioned negative features? I don't care about graphical editing and I definitely don't need WYSIWYG. Yes, I know I could try Googling "free XML editor", but I'd like to hear from people who have experience with such things about which editor is actually a good choice. - SigmaEpsilonΣΕ 03:14, 2 April 2008 (UTC)

[edit] difference in RAM capacities

what is the difference between adding two 1gb RAM to a computer and adding one 2gb RAM to a computer? —Preceding unsigned comment added by 220.225.211.204 (talk) 05:32, 2 April 2008 (UTC)

1gb of RAM. Seriously, it depends on what the computer is doing. Ram is used to keep different processes in memory, when you haven't got enough inactive processes will be paged to disk. The more RAM the more processes can be run without a delay switching between them. Also, most operating systems use RAM not needed by processes to cache files; when you read a file a copy of it (or part of it) is kept in RAM so it can be accessed quicker, which can speed up certain things quite a lot. Its possible that if you do very little, maybe running a print server or just browsing the internet (without many tabs or windows) that the extra RAM won't make a difference, i.e. that 1GB is sufficient. -- Q Chris (talk) 06:57, 2 April 2008 (UTC)
Uh what. Re read the question. :D\=< (talk) 07:44, 2 April 2008 (UTC)
Ooops - Q Chris (talk) 08:08, 2 April 2008 (UTC)
If computer has dual channel memory controller, then using 2x1GB could work in dual channel mode, but 1x2GB will be able to work only in single channel mode (it might affect maximum memory throughput). None of this could affect total memory capacity (in either case there will be 2GB) -Yyy (talk) 07:12, 2 April 2008 (UTC)
If your system supports more than 4 GB, you might add just one 2 GB module and buy another 2 GB module next month! Kushal 01:22, 3 April 2008 (UTC)
You may also find that the higher capacity memory has a lower speed than the lower capacity. On the other hand if you put in 1x2GB you can later add another to get a total of 4GB. This may not be useful to your computer if you run a 32 bit operating system like Vista or XP. Graeme Bartlett (talk) 01:51, 3 April 2008 (UTC)

[edit] Question

I REALLY hate the "page can't be diplayed" error message in IE7. How can I change it? 124.176.173.188 (talk) 09:35, 2 April 2008 (UTC)

Use Firefox. No, seriously. You can't change things in any meaningful way in IE (you may possibly be able to change that specific error message, though I highly doubt it, but there are thousands of similar things that can't be changed). IE was not built to be modified. Firefox was. In Firefox, I don't get a generic "this page cannot be displayed" message: I get a message with about six different buttons on it: "Try again," "View Google cache of this page," "View Wayback Machine's entry for this page," "Coralize this link," etc. etc., which is far more useful to me than "This page cannot be displayed." And it exists because some bright person made a simple modification to Firefox, which I installed easily as a plug-in.
— Sam 11:41, 2 April 2008 (UTC)
Actually, wasn't IE7 made to support add-ons? It borrows much from Firefox, so I'm sure you can get a plug-in like the one Sam described for IE7. 206.252.74.48 (talk) 15:59, 2 April 2008 (UTC)
You might be able to do this sort of thing with the IEAK - ISPs and businesses use it to make customised versions of IE. Firefox would probably be easier, but if you particularly like IE then the IEAK might be worth investigating. (Bear in mind that you can also get add-ons to make Firefox look like IE7.) AJHW (talk) 14:53, 3 April 2008 (UTC)
First create a custom html file that is to be displayed when navigation fails. Then change/create the following registry key to point to that file.
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\AboutURLs]
"NavigationFailure"="<path_to_your_custom_error_file.htm>"
If you want to enable that option for only one user (and not everyone who uses the machine), use
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\AboutURLs]
Thats it. You may need to logoff/restart for IE to recognizes the change. To restore the default action, delete the setting. Of course, as others have already noted, Firefox is always the preferred solution for anything related to web browsing. -- Fullstop (talk) 20:33, 8 April 2008 (UTC)

[edit] Batch processing PDFs

Hello, I'm looking for a way to batch process InDesign files into PDFs. Is there a way Acrobat or InDesign can do this? Thanks 195.60.20.81 (talk) 11:21, 2 April 2008 (UTC)

Right off hand I don't know of a way, but there is software for automating Windows processes. So software for that might be able to automate something like:

Open InDesign
Counter = 0
-start of Loop
File menu, Open
Sort list by creation date
Start at top of list
Arrow down "Counter" times
Open that file
File menu, Print
Select Acrobat as the printer
Print
Counter = Counter + 1
Save PDF file with the same name but pdf extension
Does it prompt for overwrite?
Yes - Exit loop
No - Loop to "start of loop"
Many many years ago I used WinBatch to do things like this. But that was so many years ago I don't know if WinBatch is the best anymore.--Wonderley (talk) 20:27, 2 April 2008 (UTC)

Sadly, of course, I have to work on a filthy Mac so that's out of the window I expect. 80.229.160.127 (talk) 22:46, 4 April 2008 (UTC)

Depending on whether you have a recent edition (since you mentioned InDesign, I assumed you do), batch processing should be built in to your Adobe Acrobat Professional application. Please look under "tools" drop down menu. Kushal 01:19, 3 April 2008 (UTC)

[edit] Convert VOB to AVI or MPEG

I've tried dozens of Linux programs for converting VOB to either AVI or MPEG. All of them have the same problem. The resulting video has audio that is extremely out of sync with the video. Every Google search for a solution comes up with another program to use that simply puts the audio out of sync in a different way. The best I've found is a program that makes the video extremely choppy to sync it up every 5 seconds or so. Is there such thing as a program that will turn a VOB into either an AVI or MPEG with the audio and video in perfect sync? -- kainaw 12:15, 2 April 2008 (UTC)

Any of them? I like mencoder but ffmpeg is good too. I bet you're using VLC to play the video and VLC just dies on high definition video. You should also use a good container format like mkv but mencoder doesn't do mkv. Or maybe the problem is that your codecs are screwed up and the video is playing back badly but the file is fine. Try playing it back on a Windows machine that you know has the correct codecs :D\=< (talk) 12:23, 2 April 2008 (UTC)
You might try using HandBrake, which converts from VOB to MPEG in one step. I've never had trouble with its syncing and it's really easy to use. (It is technically just using ffmpeg, I think, but it'll manage all of the parameters). If you still get syncing problems, the problem is likely whatever you are using to play it back in, as Froth suggests. --Captain Ref Desk (talk) 12:37, 2 April 2008 (UTC)
I definitely not recommend HandBrake. It's point-and-click garbage for the densest of mac users, and if you have a basic understanding of video encoding then you can use something more advanced :D\=< (talk) 12:49, 2 April 2008 (UTC)
Yawn, it is easy and works fine, as if that were a sin. And is available for Linux and Windows. :-P And I don't want to judge but it doesn't sound like the "more advanced" options have proven adequate in this case. --Captain Ref Desk (talk) 13:01, 2 April 2008 (UTC)
It works easy and fine for ripping DVDs to AVI or MPEG. However, I asked about converting a VOB file (not a DVD) to AVI or MPEG. I do not have a DVD. I have a VOB file. So, this "easy" solution requires me to burn the VOB to a DVD and then rip it back off and convert it. I personally do not consider that to be "easy" when I don't have a DVD burner. -- kainaw 13:10, 2 April 2008 (UTC)
I was under the impression that you could specify a specific VOB file as the source for Handbrake (rather than a DVD), but I haven't tried it for awhile. Googling around though seems to encourage my impression. --Captain Ref Desk (talk) 14:02, 2 April 2008 (UTC)
Easiness encourages stupidity! :D\=< (talk) 13:11, 2 April 2008 (UTC)
Stupidity works its way in easy enough in any case. Trying to separate stupidity from computing is like trying to get into a full bathtub without getting wet. ;-) --Captain Ref Desk (talk) 14:02, 2 April 2008 (UTC)
I imagine a future where a computer is just a button with "Go" written on it, and when you press the button it knows exactly what you want it to do and it does it flawlessly. What would happen to humanity then? 206.252.74.48 (talk) 18:29, 2 April 2008 (UTC)
You'd need brain reading technology.. a chilling future :D\=< (talk) 22:49, 2 April 2008 (UTC)
If you have access to Windows, AutoGK will convert VOBs to XviD or DivX. —Wayward Talk 03:35, 3 April 2008 (UTC)
I don't have any vobs on hand, but I think that DeVeDe will convert them. Of course, it uses mencoder, but that's what I use for converting all my matroska's to mpeg-4. Xiong Chiamiov ::contact:: help! 07:06, 3 April 2008 (UTC)

[edit] Google search field bug?

Hi all,

Has anyone else noticed what could be recent a bug in Google's search bar on its homepage (or it could just be me)? If you go to Google and search, or search from your tool bar, a Google search results page appears. If you then try to modify the search field that appears at the top of that page and hit "enter" or click "search", nothing happens. I have to either re-load the Google home page or search again from my toolbar.

I'm using Firefox on a Mac, but a friend hollered something similar was happening to her on her Windows PC (Firefox again).

Anyone else notice this?

— Sam 16:37, 2 April 2008 (UTC)

Ah, I think maybe it had to do with a badly-working Firefox plug-in both computers had installed. — Sam 18:15, 2 April 2008 (UTC) —Preceding unsigned comment added by 63.138.152.238 (talk)

This used to mappen to me too years ago. It was not possible to modify the search field box. But this happened on Netscape. Upgrading to later viersion, and firefox versions the problem vanished. Your theory could be correct. Graeme Bartlett (talk) 00:58, 3 April 2008 (UTC)
It had to do with the javascript pop-up frame that appears when you start typing a search term. All buttons, fields and other such windows were affected by the extension... Oh well, no matter. — Sam —Preceding unsigned comment added by 63.138.152.238 (talk) 14:41, 3 April 2008 (UTC)

[edit] LogMeIn

Hi! I'm using LogMeIn Free! - or hoping too... A couple of questions:

  • Would it let me access websites from my place of work that are normally blocked?
  • Do I need to leave my home computer on, on standby, hibernated, off, what? Can I leave it off? How do I stop it from going on standby if it needs to be on (the time-default thingy)?
  • I have a monthly bandwidth allowance from my home computer - if, using LogMeIn, I download a large file, does it come off my allowance or my office's allowance?
  • If I want to go on holiday for a few days - and obviously not leave the computer on - would it still work?
  • Thanks!! TreasuryTagtc 17:52, 2 April 2008 (UTC)
  1. Yes
  2. It needs to be on; look in the power settings in the control panel
  3. If you download it to your home desktop then it comes off your home's allowance. If you then transfer that somehow with the LogMeIn software to your office computer then it also consumes bandwidth there.
  4. No it wouldn't and why wouldn't you want to leave your computer on for a few days?
Also don't use this LogMeIn crap, you have remote desktop built in to your Windows.. it's a bit better if you have Vista but a non-Home version of XP will do as well. See Terminal Services. You can set up your computer to allow remote access by looking at "Remote Settings" under the properties of My Computer (at least that's where it is in Vista). If it's too difficult to figure out you can try a real VNC client like hm RealVNC (har har). In any case, LogMeIn, Terminal Services, and RealVNC require at least 1 port to be forwarded on your router to the machine you want to connect to.. you'll have to figure that out. :D\=< (talk) 22:47, 2 April 2008 (UTC)
Actually, I kind of like LogMeIn. But, yeah, the computer has to be on. Useight (talk) 23:00, 2 April 2008 (UTC)
If one is using something like this as a proxy, then surely it will use twice as much of that proxy machine's bandwidth allowance - once for the web-to-proxy leg, and the same again for the proxy-to-workplace leg. -- Finlay McWalter | Talk 12:49, 3 April 2008 (UTC)
Isn't LogMein a type of ChowMein made from bamboo strips ? :-) StuRat (talk) 21:07, 3 April 2008 (UTC)

[edit] Distributive Computing

Contributing to a distributive computing project, such as SETI@home, would use a large amount of idle CPU time. Would this have a detrimental effect on my computer after some time? Will running a computer with a high load for extended periods of time deteriorate its performance in any way? —Preceding unsigned comment added by 138.29.50.28 (talk) 21:50, 2 April 2008 (UTC)

Yes, thermal stress damages components. If you plan to keep your computer running for 10-15 years then don't run it hot every night. :D\=< (talk) 22:39, 2 April 2008 (UTC)
We don't appear to have a thermal stress article, just a redirect to the Stress (physics) article, which fails to mention causes of stress, AFAIcan see. So I cannot lookup to find out if it's better to run the processor at a consistently hot temperature, or cycle the temperature - as ordinary use would imply - and which would presumably increase the sort of expansion & contraction effects that do for physical things. --Tagishsimon (talk) 23:15, 2 April 2008 (UTC)
There are a lot of computers run 24/7. There should not be significant damage to your processor by running SETI@home as opposed to just leaving it idle. Your computer is supposed to take care of heating issues with heat sinks and so on.
It won't deterioiate its performance in any way at all. It *may* reduce the lifetime of the CPU, but I strongly doubt it. Just run a useful one in the back ground, not useless ones like seti or distributed.net. They are just a waste of power.--Dacium (talk) 01:19, 3 April 2008 (UTC)
Seti and d.net's OGR challenges are both pure research. Lack of obvious immediate practical value is not the same as "useless". APL (talk) 13:47, 3 April 2008 (UTC)
I agree with APL. Kushal 15:42, 3 April 2008 (UTC)
Given the rate at which computer components become obsolete, I doubt the reduction in lifetime is something you should worry about. The power consumed, however, is - and I don't know of any evidence that the benefit of contributing to such projects justifies the power consumption. -- Meni Rosenfeld (talk) 17:00, 3 April 2008 (UTC)
The weak spot for computers, like everything else, is moving parts. Since the CPU has none, it is likely to last for a very long time (long enough to become obsolete). As per the discussion above, I'm not sure whether cycling the temp or leaving it high is worse for the CPU. The fans and hard disks, on the other hand, will definitely last longer if not used as often. Any use of the CPU will certainly cause the fan(s) to run, and may also cause the hard drive to operate, depending on the program running. StuRat (talk) 16:58, 3 April 2008 (UTC)
I can vouch for that. I typically leave my desktop PC on 24/7, and over the years I've had to replace CPU fans several times. They're easy to replace so long as they don't damage anything when they fail. I just got a new computer, but when my last computer was finally put in the closet, it had a fan I salvaged from 486 held in place with twist ties. APL (talk) 18:42, 3 April 2008 (UTC)
In any case, the likelihood of you wanting to use the same computer in 10-15 years is low. New computers are getting cheaper all the time, and it's unlikely that a computer 10-15 years from now will be able to do a whole lot with the technology of that present time (how many computers from 1993-1998 could even run a modern OS well, excepting super-stripped down Linux boxes, much less the sorts of programs we consider mandatory for even basic use, much less the programs that may be considered mandatory in 10 years?). My desktop computer can do OK, having been purchased in 1999, but it's nothing compared to a new machine; I wouldn't use it as a primary computer. --Captain Ref Desk (talk) 20:18, 3 April 2008 (UTC)
That's right, in 15 years when you move the mouse over the word "cat" in a document, the 3D holographic movie of a cat that would normally appear at that time won't show up on your old computer. And what's worse, while the spell checker and grammar checker may work, the InstantPyschologist may not be able to accurately determine your mental state as you write the document. Will you be able to live with that ? :-) StuRat (talk) 21:02, 3 April 2008 (UTC)

[edit] EAW XML syntax error finding program?

Star Wars Empire at War Forces of Corruption has the ability to be easily modified with XML files. Problem is, I did so, and I supposedly made a syntax error. Is there a program that can find the syntax error? 71.220.214.7 (talk) 22:17, 2 April 2008 (UTC)

In my experience, most XML syntax errors has to do with ampersands; you can't just throw one in because they are used to encode for special characters. For instance, lets say I wanted to have a little database over my small time crime-ring. This would be incorrect:
<?xml version="1.0"?>
<people>
<person>
<name>Micke the Fig</name>
<duties>Bag-man</duties>
</person>
<person>
<name>John Two-Times</name>
<duties>Enforcement & general bad-assitude</duties>
</person>
</people>

(a hilarious side-note: I couldn't even use the mediawiki <source> tag here, it went all nuts :)). You would have to write it like this:

<?xml version="1.0"?>
<people>
<person>
<name>Micke the Fig</name>
<duties>Bag-man</duties>
</person>
<person>
<name>John Two-Times</name>
<duties>Enforcement &amp; general bad-assitude</duties>
</person>
</people>

So, first thing, search for stray ampersands. If that's not it, you can use this nice little validator which I found after some googling (you can find a bunch more if you want another). --Oskar 08:36, 3 April 2008 (UTC)