Wikipedia:Reference desk/Archives/Computing/2007 March 26

From Wikipedia, the free encyclopedia

Computing desk
< March 25 << Feb | March | Apr >> March 27 >
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] March 26

[edit] Eaves of Erastothenes

I am having some problem in finding two prime numbers that when multiplied together would equal to a 400 digit number. I have an a assignment dealing with the Eaves of Erastothenes and Im having difficulty finding those two prime numbers.72.40.60.1 00:48, 26 March 2007 (UTC)jc

I's actually called Sieve of Eratosthenes. Maybe that'll help you on finding information about it. — Kieff | Talk 00:59, 26 March 2007 (UTC)
Unless I'm badly mistaken, the Sieve (elegant though it is) is unsuitable for numbers in the hundreds-of-digits range, so there's something fishy about this assignment... --Steve Summit (talk) 01:12, 26 March 2007 (UTC)
Yeah, maybe he's actually talking about the General Number Field Sieve, but I can't imagine how that'd be confused with Erastothenes'. — Kieff | Talk 02:22, 26 March 2007 (UTC)
I have never heard of using the Erastothenes for such large numbers. Would the Sieve of Atkin be appropriate? And are you sure it must yield a 400 digit number? Seems similar to the 30,000 word summary my Latin professor assigned on a 20 minute film... Freedomlinux 02:36, 26 March 2007 (UTC)
Wouldn't this question be better on the Math desk? [Mαc Δαvιs] (How's my driving?) ❖ 07:10, 26 March 2007 (UTC)No, I'm not an idiot, I thought it said 400, not 400-digit.

Basically you want to find two 200 digit prime numbers (or one 199-digit and one 201-digit, etc.). The most straightforward way is to pick two pseudo-random 200 digit numbers, then find the first prime number greater than or equal to each.

It is pragmatically impossible to test a 200 digit number for primality by dividing it by every prime less than its square root (there are roughly 10^98 such primes), so one must use a better primality test; see Primality_test. There are both deterministic and probabilistic primality tests, but the probabilistic ones are, to date, vastly faster than the deterministic ones, and hence almost always preferably for pragmatic use.

Primality tests are nonetheless somewhat expensive, so for starting pseudo-random number N, instead of running one on N, N+1, N+2, etc, one can speed things up by not bothering with any of the even numbers, nor any divisible by three, etc. In other words, skip the ones divisible by small primes, and apply the expensive primality test only to the numbers that are not divisible by any small primes.

That's where the Sieve of Eratosthenes comes in. Pick the largest small prime to use for pre-screening, say 101 for specificity, and set up a sieve over e.g. N and N + 101^2. Search sequentially through that sieved interval, and run the primality test only on numbers that were not sieved out.

The resulting algorithm will find two 200 digit primes in a fraction of a second (assuming a reasonably fast indefinite-precision math library or tool -- including the not-particularly-fast Unix "bc" program -- running on a modern processor). Dougmerritt 01:41, 27 March 2007 (UTC)

[edit] Computer help!!!

I think I deleted Windows. Please help. —The preceding unsigned comment was added by 71.175.125.196 (talk) 03:50, 26 March 2007 (UTC).

In that case, reinstall it from CD. StuRat 04:57, 26 March 2007 (UTC)
Unlikely --frotht 06:29, 26 March 2007 (UTC)
I don't understand. Is there a problem? Rfwoolf
hah --frotht 16:11, 26 March 2007 (UTC)
Yes, perhaps I should have said "Congrats, you've taken the first step to improving your computer by deleting Windows, now install a nice version of Linux to complete the process". :-) StuRat 17:49, 26 March 2007 (UTC)
If you think you deleted Windows, my next question would be how you managed to ask for help in the first place. Cernen Xanthine Katrena 11:15, 31 March 2007 (UTC)

[edit] Windows XP trouble

Hi there.!? I got Win XP on a Pentium III machine (yeah, back from the 17Superscript textth) Trouble is the thing keeps on rebooting when I'm working. I keep sending "reports" 2 microsoft, but I still have the problem. 2nd: I need the password file name on win XP. Someone help me PLEASE... —The preceding unsigned comment was added by 41.207.126.37 (talk) 06:23, 26 March 2007 (UTC).

Try running antivirus and anti spyware programs to fix the rebooting problem. Sending reports to microsoft does absolutely nothing for you, although apparently MS engineers appreciate it. And passwords aren't stored in a file, they're stored in the SAM hive- you need pwdump or samdump/bkhive to extract it. --frotht 06:36, 26 March 2007 (UTC)
Is there any warnings or errors that appear before rebooting? Such as a blue screen? If so, what does it say? YThe problem could also be a hardware issue. - Akamad 08:01, 26 March 2007 (UTC)
Try this program to find your password Password recovery via Life Hacker If you dont mind starting fresh I would recommend re installing windows or using a recovery disk if you have one - Nerdd 09:04, 26 March 2007 (UTC)

I'm surprised you can even get Windows XP to run at all on a Pentium 3 machine. Does it meet all the recommended system requirements ? If not, perhaps you need to upgrade your hardware or go with an earlier O/S. StuRat 13:40, 26 March 2007 (UTC)

You might need to tick off Automatically restart when a BSoD occurs to see the error code. Splintercellguy 15:28, 26 March 2007 (UTC)
There was nothing wrong with XP running on Pentium 3, when it first came out Pentium 4 was really rubbish and was even slower than Pentium 3 (Socket 423 times). --antilivedT | C | G 08:13, 27 March 2007 (UTC)

[edit] Copy Protection

Can anybody tell me how to copy a copy-protected disc, please? Dudforreal 09:44, 26 March 2007 (UTC)

An LP disk? TOTB
A frisbee? UkPaolo/talk 11:23, 26 March 2007 (UTC)
What methods have you tried, and where do they go wrong? For example in the case of a CD that is copy-protected, you could try putting it into Nero (if you have it) and simply saying Copy Disc. Rfwoolf
Some copy protected disks are physically modified I.E. I have one that although the CD plastic casing is there, the edge of the CD where the data is stored is burned off somehow. Of course, the CD was required to have the software run. And I believe what they did was burn a file to that with certain portions allocated to the missing data sectors. You could never copy the disk file-by-file, and you could never copy the disk as a whole using very basic methods. (like even "dd" in linux) It wasn't like I was trying to act as a pirate, I just wanted a backup CD! But I understand why the software makers went to the lengths that they did to protect the CD, given, how small the software package was and how many people do pirate.
I have heard certain CD-modification methods do the trick, but if you mess up your CD, tough luck. I never tried them. That's all I will say.
Root4(one) 12:39, 26 March 2007 (UTC)
StarForce talks directly to the drive firmware and measures the physical angle between frames/sectors of data. Maybe this is what you're thinking of? --frotht 16:10, 26 March 2007 (UTC)
I couldn't say if they might have used this additional trick (never heard of this one!), but probably not. When I did try to figure out to what extents they protected the CD, the first thing is pretty obvious... they burnt away the outer sectors of the CD data! Second thing I noticed was there's a single file on the iso that cannot be copied. Knowing a few things about filesystems, I suspected that certain (many) filenodes had been allocated to the burnt off sectors and only a few necessary and key filenodes used to "open" the software were actually available on the remaining disk. To ascess those nodes, just ask the operating system to seek to the proper position in the file.
If your operating system is unlucky enough to seek into the wrong portion of the CD, well, tough luck. On systems I tried, you had to reboot the system to get the CD reader to work properly again.
I never did prove my hypothesis beyond a reasonable doubt (I think I would have felt guilty had I did, after all, it was a good program, and had I accomplished it, I also knew I'd be tempted to do the same for some software I didn't legally own). But I became so enamored with my hypothesis that I decided to consider the problem "closed" if not solved. After all, just finding the right nodes would take a lot of time and research. It certainly accomplished their goal, which is to make the act of copying the CD harder than it is "worth". I found a simple ellegance to it.
Root4(one) 05:20, 27 March 2007 (UTC)

There's always the strategy of, if it's an audio CD, to play it, and find a way to record the audio and recompress it back into mp3 format. Sneaky... and difficult... and you lose quality. And probably illegal Rfwoolf 12:53, 26 March 2007 (UTC)

If it's a disc with copy protection on it any attempt to circumvent this is, by definition, surely illegal... UkPaolo/talk 13:50, 26 March 2007 (UTC)
Yes unfortunately that's basically most of the DMCA in a nutshell, but it's a stupid law and most countries have nothing of the kind. I'd suggest ripping an image of the disk, mounting the image with Daemon Tools which can emulate a lot of copy protection, and then using nero or something to copy it onto a real disk from the mounted disk. For games you'll probably need a no-cd crack for the weirder protections. --frotht`
If the media is a CD and the copy protection is something like SafeDisc, use Alcohol 120% or CloneCD. Splintercellguy 15:00, 26 March 2007 (UTC)
copyright law is sketchy, but unless you plan to sell the copied material, it is most likely legal. if you have nero, select "copy disk" and hold down shift when you click "start" of what ever it is (cant remember) Most of the time, the disk will begin to copy at around 1/2 to 2/3 the maximum possible write speedJ.delanoy 15:38, 26 March 2007 (UTC)
"copyright law is sketchy" — not always it isn't. The DMCA is very clear on this point: title I, section 103 declares illegal "circumvent a technological measure that effectively controls access to a work". Hard to be more direct than that in this case. Lousy law, alas.. --24.147.86.187 12:21, 27 March 2007 (UTC)
What I was saying is that unless you try to sell you copied discs, it is almost impossible for the manufacturer to bring legal action against you.J.delanoy 16:19, 27 March 2007 (UTC)

[edit] Civilization Franchise?

though i'm not an expert, i don't believe that "Wikipedia:Reference desk/all", "Wikipedia:Reference desk/Computing", or "Wikipedia:Reference desk/Archives/Computing/2007 March 21" should be in the "Civilization Franchise" Category. i know this doesn't exaaactly belong here, but atleast it's somewhat on-topic, and i figure somebody here will know how to fix it. (i don't!) --64.0.112.38 13:00, 26 March 2007 (UTC)

That's typically caused by someone including that category in a question or answer as an example, not realizing that it is live for this page. The problem should go away as soon as that question is archived. StuRat 13:23, 26 March 2007 (UTC)
Found it ! It was in the last question for March 21, which I've now fixed with the "nowiki" format. StuRat 13:32, 26 March 2007 (UTC)
I suitly emphazied your fix by using the [[:Namespace:page]] link format to force a non-magic link (see Help:Category). --Tardis 16:16, 26 March 2007 (UTC)
You just put a colon in front of the word "category" ? That looks better, but could cause probs if somebody copies it with the colon included. I guess that's not likely in this instance, so yours is a good solution. StuRat 17:46, 26 March 2007 (UTC)
Woops, that was my fault! − Twas Now ( talkcontribse-mail ) 05:53, 27 March 2007 (UTC)

[edit] Linking to a specific point in html or pdf

I want to eventually link to specific point in a html o pdf file online. (With the purpose of commenting this). Putting an anchor is not an option. How can it be done?132.231.54.1 16:08, 26 March 2007 (UTC)

You say putting an anchor is not an option, but, what constitutes an anchor? When you generate a PDF file you can similarly put anchors in them - would that count? Other than that, my guess would be a java solution, or I don't know Rfwoolf 16:21, 26 March 2007 (UTC)

Maybe it's none of my business, but out of sheer curiosity, why are anchors not an option? That would be the easiest way. The only other way is with the Javascript scrollto() function (or whatever it's called) but that wouldn't be very portable. Curtmack of the Asylum 16:54, 26 March 2007 (UTC)
I would assume they want to link to somebody else's document, and don't have access to edit it and add an anchor. I suppose they could make a copy and add an anchor to that, but they might run into copyright issues. StuRat 17:38, 26 March 2007 (UTC)
Thas is. I want to point to external documents, freely available, but I cannot download them and save them in my site. Since many are some pages long, I would like to have a way of point to page 4 paragraph 3 or something like that. As said processing the file is not an option. They are not on my server and cannot be.132.231.54.1 17:48, 26 March 2007 (UTC)
If there is no anchor on the page, you cannot magically make one up. An anchor has to exist to link to it. Again, there is no such thing as a link with a hidden "move down three paragraphs" option. Check the page's source code to see if they already put anchors in there. If not, you must link to the page and have the user scroll down. --Kainaw (talk) 19:55, 26 March 2007 (UTC)

I generally handle this by giving directions ("go to 3rd paragraph of the 7th page for the relevant info"). It's not ideal, but better than having them read the entire document. StuRat 20:56, 26 March 2007 (UTC)

Isn't a way of a kind of link that matchs a text string? Within html, without scripts. 132.231.54.1 21:19, 26 March 2007 (UTC)
No. There are two and only two types of links. There are links to pages that go to the top of the page and there are links to anchors inside a page. Even with a script, you could not do what you want. Scripts do now allow you to look at the text on pages that aren't yours - unless you are using something with no concept of protection, like IE3. But then, you won't have much in the way of scripting. The only way to do what you want is to write your own web browser that has some new kind of link definition and tell people that they have to use your new web browser to use your website. --Kainaw (talk) 00:12, 27 March 2007 (UTC)
I believe that in the earliest days of the web, under some web servers (or perhaps it was under the web server, since of course there was a time when it was singular :-) ), the trailing "?..." syntax in a URL meant to do a search. But it was a search for documents and subdocuments that matched the query, not a request to magically jump to the searched-for string in the returned page.
(Since then, of course, the "?..." syntax has been generalized, and is now typically "?key=value&key2=value2...". But since the interpretation of a query string is server-dependent, as far as I know a modern web server could still implement the old behavior, if it wanted to.) —Steve Summit (talk) 00:52, 27 March 2007 (UTC)

In theory, you could simply use XPointer, which is designed to be able to do precisely that, if the target document is a XHTML document or other XML format. In practice, I doubt many (if any) user agents understand it. --cesarb 00:31, 27 March 2007 (UTC)

[edit] Wireless connection, an MMO, and Windows Vista

When I'm running Voyage Century Online, I often have trouble maintaining connection to the server when I'm on my home wireless connection. I never lose connection to the internet, I am merely booted from the game server, and the problem is only on my home wireless connection; other wireless networks and broadband give me no problem. This mainly happens if I stop playing for a few minutes to browse the internet or grab something to eat, and I leave the game running. If I maintain activity, however, I rarely have a problem. Could there be some sort of feature, either for Vista, my for my wireless card, for my router, or for my modem, that blocks connection when there is a lack of activity? If not, what could be causing this problem? —Akrabbimtalk 17:50, 26 March 2007 (UTC)

[edit] ls for executables

Is there a way to execute ls to list only executable files? Also, how can I do a list with every folder in $PATH? —The preceding unsigned comment was added by Alph Tech STUART (talkcontribs) 17:55, 26 March 2007 (UTC).

For the first part of the question,
ls -l | grep -e '^-..x'
should work. To do this across all directories in your path, you could wrap it in something like
for d in `echo $PATH | sed 's/:/ /g'`; do echo $d:; (cd $d; ls -l | grep -e '^-..x') done
(This assumes sh or bash, and Unix/Linux, of course.) --Steve Summit (talk) 18:56, 26 March 2007 (UTC)
For the first part: ls -l *exe
For the second: ls -l `echo $PATH | sed 's/:/ /g'`
Or for exe's only: ls -l `echo $PATH | sed 's/:/ /g'` | grep -e '.exe$'
Johnnykimble 19:18, 26 March 2007 (UTC)
The example using "exe" assumes executables end in "exe". In Unix/Linux, they rarely do. The previous example with grep is better. --Kainaw (talk) 19:53, 26 March 2007 (UTC)
Heck, exe's don't just end in "exe" in the DOS/Windows world, either! There, the appropriate glob pattern would be *.exe, or for grep, '\.exe'. (Though this last is somewhat of an oxymoron, since a regexp matcher like grep is decidedly nonstandard in the DOS/Windows world.) --Steve Summit (talk) 20:37, 26 March 2007 (UTC)
They make a grep for Windows, but what's all this about executables not ending in .exe? .coms? --Alph Tech STUART 02:08, 27 March 2007 (UTC)
I was just nitpicking. Johnnykimble said "ls -l *exe", but that would find a file named, say, "flexe". And, for a different reason, "ls | grep '.exe'" would, too. —Steve Summit (talk) 02:35, 27 March 2007 (UTC)
I think ".msi" is a proper executable suffix (installs). I'm sure more are out there. The weirdest thing I've seen is double clicking on a javascript file and windows wanting to execute it instead of open it (like any scripting language in unix). But I have doubts that it would run from the command line. Root4(one) 20:43, 27 March 2007 (UTC)
Lol, quite right. My mistake was a symptom of being a Windows desktop user most of the time and a linux server user some of the time... Johnnykimble 21:04, 26 March 2007 (UTC)

This bit of Perl will show all the commands in your $PATH. --TotoBaggins 23:04, 26 March 2007 (UTC)

 perl -le 'for (split /:/, $ENV{PATH}) { for (<$_/*>) { print if -x && -f } }'
ls -F | grep '\*$' works too. —The preceding unsigned comment was added by 129.78.64.102 (talk) 03:29, 27 March 2007 (UTC).
file * | grep {whatever} is another way of finding all the odd executibles. Remember, lots of scripting languages (such as Perl, Awk, etc.) may be executible also. And if you're on Unix/Linux, just look for the "eXecutible" bit in the protections mask.
Atlant 16:06, 27 March 2007 (UTC)
I'm not a big fan of using ls to generate file lists for consumption in other programs except in quick, flying by the seat of your pants instances. You can use "find" and some xargs notion, but even then you have to consider that in unix (at least this used to be the case), filenames can contain any character except for '/' and '\0'. Filenames with spaces require special attention. (You could name a file " ". That one's a bit creepy.) One potentially dangerous character would happen to be the pipe character. Possibly some others would be characters less than 0x20 (hex) for what they may do to the console.
EDIT: Not that Windows doesn't have its own problem. I remember naming a directory "π" (read as ascii π) and it giving some version of windows all kinds of troubles. Root4(one) 21:01, 27 March 2007 (UTC)

[edit] Software notability

At what point does an article about a software product become acceptable for Wikipedia? I stumbled across an article about a Quest Software product, found someone had set up a category for the company (with 21 entries), and the ones I looked at (e.g. Benchmark Factory) were written by a single user. Clarityfiend 20:23, 26 March 2007 (UTC)

From what I understand, the smallest requirement is that it has to be made by a known company. If all 21 entries and the parent company are not notable, then probably all of them aren't. --Wirbelwindヴィルヴェルヴィント (talk) 22:18, 26 March 2007 (UTC)
Okay, the company seems large enough and has been around long enough. Saves me the trouble of tagging lots of articles. Clarityfiend 00:11, 27 March 2007 (UTC)

[edit] Odd disclaimer

THE APPLE SOFTWARE IS NOT INTENDED FOR USE IN THE OPERATION OF NUCLEAR FACILITIES, AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL SYSTEMS, LIFE SUPPORT MACHINES OR OTHER EQUIPMENT IN WHICH THE FAILURE OF THE APPLE SOFTWARE COULD LEAD TO DEATH, PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE.

In updating to iTunes 7.1.1, I noticed this in the disclaimer thingy. Is it in all Apple disclaimers, or do they really think there is a chance people will try to run life support machines on iTunes? Skittle 21:33, 26 March 2007 (UTC)

It's good ol' boilerplate. Splintercellguy 21:57, 26 March 2007 (UTC)

I suppose it's possible some nuclear plant might put instructions for dealing with an emergency in a format to be played by iTunes, and Apple doesn't want to be legally liable after their software fails and causes a meltdown. StuRat 22:49, 26 March 2007 (UTC)

Haha I love it! the plant is about to melt down and madonna comes over the PA becuase someone overwrote the shared playlist;) Vespine 01:53, 27 March 2007 (UTC)
Or this - X201 09:26, 27 March 2007 (UTC)
Plus the fact it's not that hard to make a bomb and an iPod can easily be turned into a timer. Gives a new meaning to "The Final Countdown". x42bn6 Talk 01:58, 27 March 2007 (UTC)
Clearly there's only one song appropriate for nuclear holocaust. :) --TotoBaggins 12:41, 27 March 2007 (UTC)
Whaaaat? It's clearly, "the soundtrack to world war three" [Mαc Δαvιs] (How's my driving?) ❖ 15:55, 27 March 2007 (UTC)
Sounds like we've got the plot for a movie here...I'll sketch out the screenplay. And maybe we can fit Blinded by the Light in the song track somewhere. :-) StuRat 15:07, 27 March 2007 (UTC)

Everybody in the electronics business does this. Look at any data sheet for any IC or other electronic component and you'll probably find this disclaimer. Honestly, it appears that all that fancy electronic equipment in hospitals must be made with baling wire and chewing gum, 'cause it sure can't have any semiconductor devices in it!

Atlant 16:08, 27 March 2007 (UTC)

Thanks. Wondered whether it was software engineers (or lawyers) mucking about or whether it was standard. Interesting thought that safety intructions, or suchlike, could be loaded on iTunes. I like the idea of employees at a nuclear power plant walking about with their iPods, searching their 'work' playlist for 'big shiny dial in the red'. Skittle 00:00, 28 March 2007 (UTC)

[edit] Windows XP highlight color

Selected icons/text used to be highlighted in blue, but now they're highlighted a yucky turquoise color. How do I change it back to blue? Thanks. --Anakata 23:12, 26 March 2007 (UTC)

right click on desktop, properties -> appearance -> advanced -> item -> selected items, probably. --Wirbelwindヴィルヴェルヴィント (talk) 01:38, 27 March 2007 (UTC)