Wikipedia:Reference desk/Archives/Computing/2007 May 21

Computing desk
< May 20 << Apr | May | Jun >> May 22 >
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.


May 21 edit

404 FNF page edit

Say I have a website, www.whatever.com. Someone types in www.whatever.com/asdfdasohjfqewfpoi and a 404 File Not Found page comes up. How do I make it so my custom-made 404 page comes up instead? I'm using Dreamweaver 8 on Mac OS X, if that helps. —Ignatzmicetalkcontribs 01:31, 21 May 2007 (UTC)[reply]

It mostly depends on your current server. If you are using Apache, you can edit your .htaccess configuration file, adding (or changing) a line reading ErrorDocument 404 /misc/404.html where /misc/404.html is your custom 404 page. That should work fine enough. -- ReyBrujo 02:31, 21 May 2007 (UTC)[reply]
If you use cPanel or Direct Admin or similar, you'll be able to do that through your control panel. JoshHolloway 13:01, 21 May 2007 (UTC)[reply]

iPod Videos edit

How do you enable/transfer videos purchased from iTunes on one computer to another computer? Deltacom1515 03:09, 21 May 2007 (UTC)[reply]

Flash drive or CD-R/CD-RW. --R ParlateContribs@ (Let's go Yankees!) 10:56, 21 May 2007 (UTC)[reply]

Firefox download problems edit

Why is it that often when I click a link to download something in Firefox, I will get the dialog box that says "you have chosen to open" bla bla bla...and then it asks "what should firefox do with this file?", i select open with Preview and yet it wont let me click ok. Only the cancel button is available.

Has anyone else encountered this issue? If so how is it resolved?

By the way im on a Macbook Pro on the latest version of OS X, Firefox v 2.0.0.3.

Also BTW it only does this sometimes. and other times, if I wait a while (maybe 30 secs to a minute) it will all of a sudden decide to let me click ok. seems very finicky.

Thanks in advance for the help.Theprizefight 04:06, 21 May 2007 (UTC)[reply]

It sounds like the download wasn't complete, so it couldn't open it. StuRat 06:51, 21 May 2007 (UTC)[reply]
I think what you're describing is a security thing. Just click on the OK button a few times. It's to stop you automatically downloading whatever crap that some sites might push you.
If the download window loses focus the download button will be greyed out to prevent auto-downloaders, try switch to another window and back and see if it's fixed. --antilivedT | C | G 09:14, 21 May 2007 (UTC)[reply]
To be more specific, click on that window specifically, and wait a few seconds for the OK button. -- Phoeba WrightOBJECTION! 11:13, 21 May 2007 (UTC)[reply]

Powerpoint presentation edit

How can you put a moving picture on a powerpoint slide?

Dudforreal 07:44, 21 May 2007 (UTC)[reply]

If it's a moving GIF image, add it as you would a normal picture. Inser | Image, or just drag it in.--Ryan 00:01, 22 May 2007 (UTC)[reply]

It doesn't move when I insert the moving GIF image.

Dudforreal 06:46, 23 May 2007 (UTC)[reply]

Macros in Powerpoint edit

Is it possible to assign a shortcut key to a macro after you have recorded it?Zain Ebrahim 08:47, 21 May 2007 (UTC)[reply]

Is it possible at all? It doesn't seem to be possible before, either. Also, there's nothing related to shortcut keys under tools -> customize (as in Word) or tools -> macros -> options (as in Excel). — Sebastian 18:25, 22 May 2007 (UTC)[reply]

GPL? edit

Say if I want to develop a website system based on PHP, I want to use some existing GPL'd codes such as search engines, do I need to make my code to be GPL'd is well? Or do I need to use an API or something in order to keep my code from being GPL? If I release it as GPL do I have to actively distribute the source code if only I am using it? I don't want to publicly release it yet because it would require a lot of work to actually make it readable and make it easily configurable. --antilivedT | C | G 09:08, 21 May 2007 (UTC)[reply]

From what I know of the GPL (I don't use it), if you're taking code from GPL-licensed code, or you're linking against GPL'd binaries, you must make your entire project GPL. If you're linking against LGPL binaries, you don't have to make your project GPL. I don't know about the API case, however, but I think if you have the GPL'd binary running with some IPC going on between your program and the GPL'd binary, that would be OK.
Well the thing with PHP is that it's interpreted language, and no binary exists. In that case, where does the line go? --antilivedT | C | G 09:16, 21 May 2007 (UTC)[reply]
If you're not planning on showing your code to anyone else or letting anyone else use your website software, you can use GPL'd code however you want. There is no obligation to release your personal changes to your personal website. If you plan to release your website software as a product or something (distribute it, in other words), then yes, you have to GPL your code if you are using other GPL'd code in it. This is what the LGPL was created for, so that people don't have to do that if they are just using libraries. --Oskar 10:08, 21 May 2007 (UTC)[reply]
gnu.org has a nice FAQ page that adresses this question. -- Diletante 15:17, 22 May 2007 (UTC)[reply]

Bash variables edit

Following on from my grep anagram question, I now have a general bash question, which I'll illustrate with example:

ls | grep a

when run in my home directory returns

personal

as expected, fine. When I do this:

COMMAND="ls | grep a"
$COMMAND

it fouls up somehow and I get:

ls: |: No such file or directory
ls: grep: No such file or directory
ls: a: No such file or directory

What's going on here? How do I get it to do it faithfully? Thanks. --87.194.21.177 11:10, 21 May 2007 (UTC)[reply]

Backticks. COMMAND=`ls | grep a`.
Hey thanks but backticks seem to assign the output of "ls | grep a" to the variable, but I just want the actual expression. It works with something simpler e.g.:
COMMAND="date"
$COMMAND
is just like typing "date", and that's what I want.--130.88.84.51 14:58, 21 May 2007 (UTC)[reply]
This doesn't directly answer your question but you might want to use an alias.
$ alias lsa="ls | grep a"
$ lsa
--Diletante 15:04, 21 May 2007 (UTC)[reply]
Use the built-in command eval:
eval "$COMMAND"
You can probably get away with omitting the quotes, even. --Tardis 15:41, 21 May 2007 (UTC)[reply]
Ah-ha! So the real solution to the problem is:
COMMAND="eval ls | grep a"
to make it execute rather than simply parsing the string. Or something like that. Anyway, putting the eval in there makes it work. --jpgordon∇∆∇∆ 15:53, 21 May 2007 (UTC)[reply]


The root of the problem is the order of evaluation: the shell first does command parsing, then does variable substitution, then looks for space-separated arguments, and then runs the command. So you start with:

$COMMAND

and bash scans that 8-character string looking for pipes and other redirect characters. It doesn't find any, so it decides that you're just running a simple command. Before doing that, it must resolve any variable references. It therefore translates the line into the string:

 ls | grep a

but the time for looking for redirects has passed, so the pipe is not treated specially. Next he splits up the arguments on whitespace, and ends up with a command of "ls", and arguments of "|", "grep", and "a". He then runs something like this:

 execlp("ls", "ls", "|", "grep", "a", NULL);

which asks the ls program to display files named "|", "grep", and "a", which he'll complain about when he doesn't find them. Running the following program produces the same output you noted above.

#include <unistd.h>
main() { execlp("ls", "ls", "|", "grep", "a", NULL); }

The reason the "eval" fixes the problem is that it runs the parsing on its arguments twice:

# you type:
eval $COMMAND
 
# (1) look for redirect characters, find none
eval $COMMAND

# (2) resolve variables:
eval "ls | grep a"

# running eval on results gets us back to (1):
## (1) look for redirect characters, find one!
ls | grep a
 
# treat it as a redirected command ...

You can eval() any number of times, each time repeating the parsing with the results of the last round:

# REAL_COMMAND='ls | grep a'
# COMMAND='$REAL_COMMAND'
# $COMMAND
-bash: $REAL_COMMAND: command not found
# eval $COMMAND
ls: |: No such file or directory
ls: grep: No such file or directory
ls: a: No such file or directory
# eval eval $COMMAND
a-file
another-file
...

--TotoBaggins 21:26, 21 May 2007 (UTC)[reply]

Thanks for that answer, I was curious and I couldn't figure it out from the manpage. Also interesting to learn that bash is a he :D -- Diletante 21:42, 21 May 2007 (UTC)[reply]
Big thanks to everyone who contributed, especially TotoBaggins for the big explanation. I always get great answers here, and I'm learning - albeit slowly. Thanks again. --87.194.21.177 22:50, 21 May 2007 (UTC)[reply]

Converting RGB to CMYK in Photoshop edit

Straightforward, easy to understand info please on the best way(s) to convert image files from RGB to CMYK in Photoshop CS.

Mrskyblue999 11:56, 21 May 2007 (UTC)[reply]

Image > Mode > CMYK. You might see some change in colours if they're not in the CMYK gamut. — Matt Eason (Talk &#149; Contribs) 15:32, 21 May 2007 (UTC)[reply]
There's more detailed information here. Looks like it's for an older version of Photoshop, but most of it should still apply. — Matt Eason (Talk &#149; Contribs) 15:40, 21 May 2007 (UTC)[reply]

Excel Conditional Formatting question edit

Hi there wikifans, can anyone tell me if there's a way in Excel to conditionally format a cell so that if it's returning a year number from another cell, it will treat that value in the year (or normal) number format, and if it's returning a month year value, it will treat it with a mmm-yy number format? I've looked at the standard conditioning formatting options but it doesnt seem to let me switch number formatting. thanks for any help!!!

=IF(LEN(A5)=4,TEXT(A5,"YYYY"),TEXT(A5,"MM/YYYY")) (Where A5 is the cell you are assessing) That should get you something close. What you need to do is 'assess' the length of the cell to see if it is a 4-digit-year, and if so format as that, otherwise format as MM/YYYY. Hope this works. ny156uk 17:40, 21 May 2007 (UTC)[reply]

Thanks very much for your suggestion, I will try it!

My friend made a JavaScript message for Firefox on a Mac that can't be closed edit

Hello, I'm at my high school right now in a computer lab, on their eMacs. My friend tells me that he always uses this one computer and he makes Javascript messages pop up when you click the Firefox icon, and this time he went overboard and made this one message that does not go away. He also disabled preferences and I can't see anything that can be done to make this message go away and actually use the Firefox application. Here's a screenshot of what I'm seeing:
File:Endlessjavascriptmessage.jpg
I just keep pressing OK and it keeps reappearing. Anybody know how to get rid of this? Thanks! NIRVANA2764 13:42, 21 May 2007 (UTC)[reply]

It appears he made a local web page on the computer's harddrive that pops up a warning in an infinite loop. He set Firefox's homepage to the page he made. So, when you open Firefox, it opens the page he made. Delete the page he made and Firefox will open with a blank page. Or, change Firefox's homepage. Or, click a link on an email or anything else and tell it to open with Firefox. --Kainaw (talk) 14:15, 21 May 2007 (UTC)[reply]
It might also be a good idea to simply turn of javascript, if you want to ensure that that page doesn't annoy you --Oskar 17:05, 21 May 2007 (UTC)[reply]
Talk about throwing out the baby with the bathwater. --24.147.86.187 23:07, 21 May 2007 (UTC)[reply]
Not if you use NoScript to selectively turn off JavaScript. --cesarb 00:25, 22 May 2007 (UTC)[reply]

NoScript is a good idea. To fix your problem, delete or rename the webpage he made (firefox will start on the page not available error). Then use Edit, Preferences to set your homepage. If you don't know where the file is, try starting Firefox with a specific web page. I'm unfamilier with OSX but you could try dragging a saved webpage or text document onto the firefox icon; or dragging a link to a website onto the firefox icon. If that fails, type firefox http://google.com into the X11 terminal. And if that doesn't work, start in safe mode by typing firefox -safe-mode into an X11 terminal. --h2g2bob (talk) 03:59, 22 May 2007 (UTC)[reply]

Actually, as the person who did it, I'd like to say that none of you have gotten it yet. I just changed the home page to the following-

javascript:var x=0; while(x<101){alert('I\'m waiting...');x++;};alert('I\'m waiting for you to click \'OK\' 100 times!');top.location="http://www.google.com/search?source=ig&hl=en&q=home+page&btnG=Google+Search&safe=active";

--Rainfall10110 14:59, 22 May 2007 (UTC)[reply]

Wow, that was him. Apparently, javascript DOM is built into firefox, so you can use it as a protocol and set the home page to it. This guy is only 16, mind you. And he had the Wiki reference desk completely stumped. Impressive NIRVANA2764 20:21, 22 May 2007 (UTC)[reply]
Kainaw said that the home page had been changed and mentioned workarounds. How is that "stumped"? --LarryMac | Talk 20:27, 22 May 2007 (UTC)[reply]
Also, age has nothing to do with it. I began programming for cash when I was 8. Of course, my hourly charge has gone up a great deal since then. --Kainaw (talk) 00:58, 23 May 2007 (UTC)[reply]
Nobody was "stumped". We told you exactly what the problem was and how to stop it. Maybe you were a little too "stumped" to follow the instructions. --24.147.86.187 12:30, 23 May 2007 (UTC)[reply]
In my original message I outlined how preferences had been disabled. The only way to end the problem would have been to press OK 100 times. There was no page saved on the harddrive. There was nothing to do with NoScript. Who cares any more :) NIRVANA2764 13:02, 23 May 2007 (UTC)[reply]
Lighten up, 24.147.86.187, this isn't the type of place where we answer everything with RTFM. The problem is easy to state, but difficult to solve: I'm pretty sure this has been logged as a DoS vulnerability for some time now at Mozilla. I think we answered pretty well though. --h2g2bob (talk) 22:36, 25 May 2007 (UTC)[reply]
Rainfall10110, it's better to use for than while. --h2g2bob (talk) 22:42, 25 May 2007 (UTC)[reply]

Wireless Router woes edit

I have a Linksys BEFWS11 router - the generic 4-port wireless router. The wireless connection worked fine when I first plugged it in. Then, it died out. I changed it from channel 1 to channel 2. Then, it worked fine for a few months before it got weak again. I changed it from channel 2 to channel 3. It worked fine for a while. Then, it got a weak signal and I had to change it from channel 3 to channel 4. I'm on channel 9 now. Can anyone explain what I'm doing wrong? I don't understand how the channels keep going weak and unusable when I'm not adding new devices - especially things can interfere with wireless signals. The only electronic thing I've purchased in the last two years is a watch - and it certainly isn't causing this problem. --Kainaw (talk) 14:39, 21 May 2007 (UTC)[reply]

Are you (or is anyone near you) using a microwave oven? They will definitely interfere with 2.4GHz wireless devices including 802.11b/g/n WiFi devices. Also, your neighbors may be getting wireless networks of their own; we now see several networks from my house and we compete for channels.
Atlant 15:32, 21 May 2007 (UTC)[reply]
Hmm. You might check the reviews of that particular router — some wireless routers inexplicably have trouble after awhile, going in and out or just needing to be reset periodically. It's really hard to get a good wireless router that lasts a long time. --24.147.86.187 23:50, 21 May 2007 (UTC)[reply]

Basic greasemonkey help edit

Hi,

I'm just getting started with greasemonkey. I have a javascript form that I want to modify. On one specific website I want the following line (its inside a form):

<input type="hidden" name="function" value="f0" />

To have a value of f1 instead of f0. How would I implement a script to do this?

Thanks! St.isaac 16:38, 21 May 2007 (UTC)[reply]

It's been a little while for me since I've used greasemonkey. IIRC it seems if you can get a script to do what you want outside of greasemonkey, you're 90% the way there, you then just have to translate it into something that can work with the wrapped objects greasemonkey has to use for security purposes.
javascript:(function (){var s = document.getElementsByName("search"); var z; for(z=0; z<s.length;z++){s[z].value="tomatoes";} })();
In greasemonkey, you can directly assign to s[z].value and it should be fine, iirc. What you cannot do is use indirect assignment.
javascript:(function (){var s = document.getElementsByName("search"); var z; for(z=0; z<s.length;z++){s[z]["value"]="tomatoes";} })();
Root4(one) 22:02, 21 May 2007 (UTC)[reply]
http://www.diveintogreasemonkey.org/ is a good resource. Root4(one) 22:28, 21 May 2007 (UTC)[reply]

The University accidently published about a decade's worth of student IDs, social security numbers, and student names, then left them, fully visible for about 2 weeks. They claim to have contacted google and had the results removed completely. The question, is it actually possible to fully remove that sort of information from the internet after having it sit in plain view for 2 weeks?--Sunyboardhost 20:06, 21 May 2007 (UTC)[reply]

Doubtful. archive.org may well have picked it up, along with the myriad other search engine crawlers indexing the web. Even if they all remove it, it's probably cached in the computers of anyone who visited the site and could be in the hands of the Bad Guys™ already. — Matt Eason (Talk &#149; Contribs) 21:23, 21 May 2007 (UTC)[reply]
Search engines and archive sites probably have it stored after two weeks, it might be possible to have them remove it from their cache results, but there's no doubt that quite a few criminals have copied down the list. I honestly wouldn't be surprised if quite a few of those people had to change their SSN -- Phoeba WrightOBJECTION! 04:36, 22 May 2007 (UTC)[reply]
If you were one of those people, it's probably not an acceptable risk to just hope nobody's going to steal your identity. Chances are slim that the good guys™ found it first --frotht 04:46, 22 May 2007 (UTC)[reply]
This has happened a few times in the past. The good news™ is that out of the 90 thousand names and SSNs, the odds of any individual person being scammed is low. The bad news™ is that you'll all probably have to have extra caution applied to your accounts of all sorts. Tell your credit card company what happened and get a new SSN to be more sure. In any case it is really atrocious that 1. SSNs are often treated as just identification numbers (rather than as they would be treated if they were, say, medical records), and 2. that universities even both to keep flat files of student IDs, names, and SSNs all in the same place, much less somewhere where they could plausibly end up on the internet. There really is no excuse, it is not exactly rocket science. --24.147.86.187 12:28, 23 May 2007 (UTC)[reply]