Wikipedia:Reference desk/Archives/Computing/2008 March 11
Computing desk | ||
---|---|---|
< March 10 | << Feb | March | Apr >> | March 12 > |
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. |
March 11
[edit]Software to save memory of an application
[edit]I wonder if there are apps that can "save" the memory usage of another app so that the memory can be loaded back later and the app would think its at the point it was at during savetime.
For example, ability to "save" a dos game that doesn't have a save option.
I need it to be runnable under WinXP.
Thanks!
24.83.195.130 (talk) 03:52, 11 March 2008 (UTC)
- Perhaps there are some debuggers or dump applications that can do that. One issue is preserving the state of all the gadgets in the PC such as the interrupt timer, video memory, sound card etc. Under DOS there is more direct control by programs and so it will be more tricky to interrupt and restore control later. Graeme Bartlett (talk) 04:11, 11 March 2008 (UTC)
- If possible, it would be an acceptable option for me to preserve not the dos prog itself but an emulator running it, such as doxbox. Of course I have no idea what kind of cans of worms that option can open... 24.83.195.130 (talk) 04:14, 11 March 2008 (UTC)
- One option that may be overkill but which is guaranteed to work is to use vmware server (which is free). You could run freedos or windows in the virtual machine. Vmware server allows you to suspend the state of the machine and restart it later. Morana (talk) 10:29, 11 March 2008 (UTC)
- Why not hibernate your whole computer? Then everything would be saved. xxx User:Hyper Girl 14:34, 11 March 2008 (UTC)
- It sounds to me like what you want is a general Savestate feature for DOS programs. No clue if any DOS emulators have them but that'd be the term to search for. Googling for "Dosbox save state" turns up a lot of hits -- some seem to imply you can do it though I don't see instructions how anywhere. I dunno. --98.217.18.109 (talk) 15:01, 11 March 2008 (UTC)
On a related note, how come MAME32 can save memory states but DOSBox can't? Is it a matter of complexity? Or is it simply that noone's bothered to program it into DSOBox yet? Zunaid©® 08:18, 12 March 2008 (UTC)
NEED PSP HELP!!!!
[edit]I have recently downloaded the god of war demo for the psp on the playstationstore.com.I took and put in the removable disk thingy or "psp" then I tried to look for a games file but I could'nt find it. AND NOW I CAN'T PLAY MY DEMO!! whats wrong. Thank you for your and generousity (Computerwookie (talk) 04:14, 11 March 2008 (UTC))
- Downloads are supposed to go onto a memory stick - did you download onto a memory stick? Did you download onto a PC - if so you need to transfer the data to a memory stick.87.102.14.194 (talk) 08:12, 11 March 2008 (UTC)
Thank you for your answer and time but I am 100% sure it went into the psp memory card, I just can't find the game file in the psp.The only files there is the "PHOTO" and "MUSIC" place and I was able to put pictures and music in but since I can't find the "GAMES" file I cant put the game in. (Computerwookie (talk) 21:31, 11 March 2008 (UTC))
- Create it! *Right Click* → "New" → "Folder" —Preceding unsigned comment added by WikiY (talk • contribs) 00:57, 12 March 2008 (UTC)
- I think what the above is saying is you need to make a 'games' folder then download the file to that.
- Can you connect the memory stick to a PC and check if the file is anywhere in there - it looks possible that the PSP hasn't recognised it because it isn't in a specific games folder.87.102.17.32 (talk) 13:11, 12 March 2008 (UTC)
- I remember something from penny arcade recently that you had to make a folder with a crazy numerical name :D\=< (talk) 15:37, 12 March 2008 (UTC)
- Surely the software supports its own downloads in a simple fashion - downloads are an official feature of PSP right??87.102.17.32 (talk) 20:33, 12 March 2008 (UTC)
- Found it:
- Echochrome is something every PSP owner should certainly check out, and it's easy to do so, at any rate its as easy to get on there as any other demo, which is to say that there are elements of dark sorcery. Creating a folder in a specific subdirectory with the title "NPJG90019" is the sort of thing a crazy person would do. That said, I have it on good authority that we will never survive unless we occasionally indulge in madness.
- (from http://www.penny-arcade.com/2008/03/10) :D\=< (talk) 03:10, 18 March 2008 (UTC)
- Found it:
- Surely the software supports its own downloads in a simple fashion - downloads are an official feature of PSP right??87.102.17.32 (talk) 20:33, 12 March 2008 (UTC)
- I remember something from penny arcade recently that you had to make a folder with a crazy numerical name :D\=< (talk) 15:37, 12 March 2008 (UTC)
- found this http://www.us.playstation.com/psp/downloads/systemupdate/pc.html looks like you need to create a folder called 'GAME' hopefully that fixed it.. did it work or are you still having problems?87.102.17.32 (talk) 20:53, 12 March 2008 (UTC)
Cybersquatting for Fraud and Profit
[edit]Does anyone know if there have been published cases of cybersquatting where the squatter mimics a charity site in order to receive donations? AlmostReadytoFly (talk) 09:25, 11 March 2008 (UTC)
- I don't know whether you'd consider Madeleine McCann's disappearance as a "charity" but [1]? x42bn6 Talk Mess 18:33, 11 March 2008 (UTC)
- Thanks for the interesting link, but what I meant was something that mimics the original in appearance, with a "Click here to donate" button that sends money to the squatter. AlmostReadytoFly (talk) 19:38, 11 March 2008 (UTC)
Toshiba Laptop switching itself on
[edit]Last night my fiancé's Toshiba Satellite M30 laptop switched itself on in the middle of the night, despite the fact that she put it in standby mode before going to bed. She got up in the middle of the night, saw a glow coming from the screen, and for some reason it was on, so she had to shut it down again. We'd both been up before then and it was definitely off, so we're somewhat confused. It's actually the second time it's happened. She's worried that it may have a virus and someone is accessing it while she sleeps, and while I know this is unlikely, I can't explain what's happening. Can anyone help? Is there a known explanation for this (other than 'are you sure you turned it off?')? Thanks in advance! Phileas (talk) 12:54, 11 March 2008 (UTC)
- Edit- Maybe I should have mentioned that the laptop is nearly four years old. Phileas (talk) 12:56, 11 March 2008 (UTC)
- I can't think of anything except network boot, which AFAIK requires a hard ethernet connection :D\=< (talk) 12:57, 11 March 2008 (UTC)
- My usb-keyboard kept turning my computer on from stand-by mode until I unallowed it from doing it, but it was not a laptop and that happened quite frequently. You could try the same for all (usb-)devices. --212.149.216.233 (talk) 13:48, 11 March 2008 (UTC)
- For some values of "last night", some machines will change their own clocks for DST, which may for some odd reason start everything else up.... SandyJax (why amn't I logged in?) —Preceding unsigned comment added by 66.55.10.178 (talk) 18:45, 11 March 2008 (UTC)
• Some options exist like 'allow ethernet to wake computer' or similar things including bluetooth. 86.139.91.153 (talk) 11:40, 12 March 2008 (UTC)
- My old Toshiba had a BIOS setting for a timed power-on. --— Gadget850 (Ed) talk - 19:42, 12 March 2008 (UTC)
I need a textfile splitter
[edit]OS: Windows XP
I have thusands ASCII plain text files. Each file consists of up to hundreds of documents. Each document ends with "END OF DOCUMENT". Some individal documents are more than 500 KBytes. Some files are several MBs. These are very large text files.
I need to split the files into separate documents and save them. Naming is not an issue because I can rename them later. They can be indxed by a desktop search engine.
I tried TextWedge. It is buggy. From time to time it fails to split the documents properly. I have no idea why some large files are correctly splited while some others are not.
Is there a good tool for this job?
Most text splitters only split files by size or by line count. Many of them do not support drag-and-drop, batch or multiple files. Some shareware products are simply crap.
I can actually use a line splitter to do this job. I can batch replace all /n to a placeholder and then add /n before and after "END OF DOCUMENT" so the file would look like:
- Very lengthy single-line document 1 ... blah ... blah ... blah ... /n
- END OF DOCUMENT /n
- Very lengthy single-line document 2 ... blah ... blah ... blah ... /n
- END OF DOCUMENT /n
- Very lengthy single-line document 3 ... blah ... blah ... blah ... /n
- END OF DOCUMENT /n
- Very lengthy single-line document 4 ... blah ... blah ... blah ... /n
- END OF DOCUMENT /n
- Very lengthy single-line document 5 ... blah ... blah ... blah ... /n
- END OF DOCUMENT /n
- ... /n
Then I can split the files every other line. I can then restore /n.
Are there GOOD tools for this job? -- Toytoy (talk) 18:12, 11 March 2008 (UTC)
- It would be trivial to do this with a programming language like C, Pascal (Delphi), (Visual) Basic or Perl. I take it you don't know any? I suppose it can be done with a tool that supports macro scripting but I would not be bothered with the effort. I also would not trust shareware to do this. Backup your files! Sandman30s (talk) 18:20, 11 March 2008 (UTC)
- I'd use csplit. I think it is a standard BASH command. I'm sure there are a million other ways to do it. -- kainaw™ 18:23, 11 March 2008 (UTC)
- Right, the problem is that the task you want done is highly specific to your particular needs, though the ways of doing it are relatively easy with scripting languages, so there's not going to be some sort of not-quite-scripting solution out there for this particular task.
- Given what you've told us the easiest way to do it will probably be in Visual Basic, just because you probably already have programs with VBA interpreters in them (e.g. Microsoft Office), so you won't have to install anything new, and VBA (of this sort) is relatively easy to read comparative to other scripting languages. Perhaps someone on here will take the time to write out the code for you but basically what you want to do is have it go through every file in a directory, open the file, loop through the lines of a file and see if it equals END OF DOCUMENT or not and if so take the lines since the last END OF DOCUMENT and put them in a new file (named?). I haven't written VBA in awhile so if I try to do it from scratch it'll probably be buggy (and I don't have time to really try it out), but it's not hard to do if you can find someone who knows VBA. --98.217.18.109 (talk) 18:28, 11 March 2008 (UTC)
- If you grab ActiveState Perl the following command will do the trick:
perl -ne 'sub bump { open STDOUT, ">out" . ++$i . ".txt" } bump unless $i; bump and next if /END OF DOCUMENT/; print' in.txt
- I use HJSplit[2] to split just about anything. --— Gadget850 (Ed) talk - 19:43, 12 March 2008 (UTC)
Anasoft Licence Manager? Nitrogen service? Anybody heard of?
[edit]Has anybody heard of "Anasoft License Manager" or the "Nitrogen" service? Here7ic (talk) 18:22, 11 March 2008 (UTC)
- Other than the fact that the software package -"Anasoft License Manager"- was assigned TCP ports 1083 and 1084 in the IETF's old "Well known ports" list -which makes said package at least 15 years old- a quick Google search doesn't turn up much that's useful. Um, dry nitrogen is often the working fluid of choice for pneumatic systems that must be both inert and cheap, and many machines using it are computerized. Not much help on that one. There, I'm logged in now. -SandyJax (talk) 19:04, 11 March 2008 (UTC)
Windows Vista, suitable directory for standalone command line utility
[edit]I'm trying to help my father-in-law, who bought a new PC with Windows Vista, to get a command line utility working. I've never touched Vista. His hearing isn't too good, and he lives in a different city, so this is (a rather difficult case of) telephone support. So far, he has managed to copy the .exe file to a usb-stick. The question is, where to put it. On XP, I'd simply drop it in C:\Windows or C:\Windows\System32. Is the directory setup the same on Vista, and if so, would copying it there work as it would in xp? Otherwise, what would be the easiest solution? Having him create a directory for it, modify the PATH environment variable etc. to make Vista aware of the program would be *very* difficult. --NorwegianBlue talk 19:52, 11 March 2008 (UTC)
- I believe command line support was removed from Vista. ArcAngel (talk) 21:17, 11 March 2008 (UTC)
- It's still there, just less obvious. Either hit start and search for 'cmd' or go to all programs->accessories->command prompt. Anyway, I just checked the directory structure on my Vista box, it's the same as XP - those paths are still good. Not sure if UAC would take too kindly to it, but unless it does really wierd stuff, it should be fine. What does this program do? CaptainVindaloo t c e 21:29, 11 March 2008 (UTC)
- It's good old grep, which he uses for searching his genealogy data base (a huge collection of huge text files). Unfortunately, the fact that he's working from the command line does not imply that he's computer savvy, just that he started doing this on a CP/M machine... On Vista, we had a hard time even launching a shell, but this site came to the rescue. Will we be able to copy the .exe to c:\windows from an ordinary dos shell, or will we need a shell with special privileges? If special privileges are needed, can these be acquired once the shell is launched (like su in unix)? --NorwegianBlue talk 22:04, 11 March 2008 (UTC)
- I think maybe I found the answer to my preceding question in a subpage of the site I linked to, but I'd be grateful if someone would check it out and confirm:
- Logon to Vista using your normal username and password.
- Click on the Start button
- Click on Start Search.
- Type, cmd.
- Right-click cmd, select 'Run as administrator' from the shortcut menu.
- In the last step, what exactly is meant by right-clicking? Clicking on the blank background of the shell, on the icon at the top left of the window frame (system menu) or something else? If you're thinking, "well why don't you try?", remember: I cannot see the machine, the gentleman I'm trying to help does not communicate very clearly what he is doing, and has problems in hearing what I am saying. --NorwegianBlue talk 22:20, 11 March 2008 (UTC)
- I think maybe I found the answer to my preceding question in a subpage of the site I linked to, but I'd be grateful if someone would check it out and confirm:
- It's good old grep, which he uses for searching his genealogy data base (a huge collection of huge text files). Unfortunately, the fact that he's working from the command line does not imply that he's computer savvy, just that he started doing this on a CP/M machine... On Vista, we had a hard time even launching a shell, but this site came to the rescue. Will we be able to copy the .exe to c:\windows from an ordinary dos shell, or will we need a shell with special privileges? If special privileges are needed, can these be acquired once the shell is launched (like su in unix)? --NorwegianBlue talk 22:04, 11 March 2008 (UTC)
- It's still there, just less obvious. Either hit start and search for 'cmd' or go to all programs->accessories->command prompt. Anyway, I just checked the directory structure on my Vista box, it's the same as XP - those paths are still good. Not sure if UAC would take too kindly to it, but unless it does really wierd stuff, it should be fine. What does this program do? CaptainVindaloo t c e 21:29, 11 March 2008 (UTC)
- That's right, I was just typing up a response to say the same thing. You need to close the command prompt, right click the command prompt icon and select run as admin from the menu. Provided the text files are in his workspace (C:\Users\username), there shouldn't be any more problems from here. CaptainVindaloo t c e 23:04, 11 March 2008 (UTC)
- You definitely should not need elevated privileges to grep. :D\=< (talk) 01:49, 12 March 2008 (UTC)
- Clearly not, the question was whether you need elevated privileges to copy grep.exe from the usb-stick to C:\windows. CaptainVindaloo, you're saying that you need to right-click the cmd-icon in the start-menu, right? Is there no way to elevate the privileges of a shell that is already running? --NorwegianBlue talk 12:54, 12 March 2008 (UTC)
- Yep, it's the start menu icon you're after. I don't think there is a way of elevating cmd's permissions while it's still running. Sorry Froth, I didn't mean to imply you needed elevated permissions to use grep, I just meant you just need it once to install it in system32 without aggroing UAC. CaptainVindaloo t c e 18:27, 12 March 2008 (UTC)
- Resolved
- Thanks a lot! --NorwegianBlue talk 19:22, 12 March 2008 (UTC)
- Clearly not, the question was whether you need elevated privileges to copy grep.exe from the usb-stick to C:\windows. CaptainVindaloo, you're saying that you need to right-click the cmd-icon in the start-menu, right? Is there no way to elevate the privileges of a shell that is already running? --NorwegianBlue talk 12:54, 12 March 2008 (UTC)
- You definitely should not need elevated privileges to grep. :D\=< (talk) 01:49, 12 March 2008 (UTC)
- That's right, I was just typing up a response to say the same thing. You need to close the command prompt, right click the command prompt icon and select run as admin from the menu. Provided the text files are in his workspace (C:\Users\username), there shouldn't be any more problems from here. CaptainVindaloo t c e 23:04, 11 March 2008 (UTC)
Another way to do it: Browse to the desired folder. Hold down shift and right click on the folder. Select "Open Command Window Here". --— Gadget850 (Ed) talk - 19:49, 12 March 2008 (UTC)
Python: extreme index
[edit]My Python-fu is rusty, and I've had surprisingly little luck with available documentation. What's the "standard" way to find the index of the lowest (or highest) element in a list? —Tamfang (talk) 20:57, 11 March 2008 (UTC)
- Something like
L.index(max(L))
. --71.162.233.151 (talk) 23:03, 11 March 2008 (UTC)
- Okay. Seems inelegant, though, as it involves searching the list twice. —Tamfang (talk) 23:38, 11 March 2008 (UTC)
- You could just do it the real way and loop through L, keeping track of the index and highest value. Probabaly no slower than using max() unless functions aren't actually interpreted on the fly, I have no idea how python works :D\=< (talk) 01:14, 12 March 2008 (UTC)
- My goodness, are you suggesting that a programmer actually should manually loop through a list in python! Heresy! Python people are crazy-lazy, I'm just sayin'. It's like two lines, fer chrissakes! --Oskar 10:34, 12 March 2008 (UTC)
- Using builtins will almost always be faster than coding it explicitly, since the builtins are written in C. The following program shows the builtins (even with the double-lookup) to be 4 times faster than searching the list explicitly. --Sean 14:36, 12 March 2008 (UTC)
- You could just do it the real way and loop through L, keeping track of the index and highest value. Probabaly no slower than using max() unless functions aren't actually interpreted on the fly, I have no idea how python works :D\=< (talk) 01:14, 12 March 2008 (UTC)
- Okay. Seems inelegant, though, as it involves searching the list twice. —Tamfang (talk) 23:38, 11 March 2008 (UTC)
#!/usr/bin/python
import random, time
list = [random.random() for x in range)]
iterations = 1000
start = time.time()
for i in xrange(iterations):
list.index(max(list))
end = time.time()
per = (end - start) / iterations
print "%f seconds per loop with builtins" % per
start = time.time()
max_idx = -1
max_val = -1
for i in xrange(iterations):
for idx in xrange(len(list)):
if list[idx] > list[max_idx]:
max_idx = idx
end = time.time()
per = (end - start) / iterations
print "%f seconds per loop by hand" % per
- I get 7.3 times faster, and yet another 10% slower if I actually implement the
max_val
"optimization" you implied that loads each element of the list only once. With -O and (of course) a different list, I get 6.1 times faster, and 8% slower; theindex()
solution, of course, only has to rescan a random-length prefix of the list. It's amazing just how much slower Python is than C — even C that has to test the type of each list element and so on. Of course, no index manipulation has to occur, and I guess the interpreter doesn't even know thatxrange
isn't modifying the list... --Tardis (talk) 23:34, 12 March 2008 (UTC)
- This is slightly better than "by hand":
for j,x in enumerate(thelist):
if x > max_val: ...
- but did
enumerate()
exist in 2008? —Tamfang (talk) 00:57, 21 August 2023 (UTC)