Wikipedia:Reference desk/Archives/Computing/2011 May 29

= May 29 =

Global SIM card but also email
For years I've only used a CDMA phone in Japan (with email, but useless outside Japan) and a prepaid antique during occasional short stays within Britain. Elsewhere I've not used a phone (or computer) and haven't missed it. But as I look at the low prices both of basic GSM 900 phones and of "global" SIM cards (working through Estonia, I believe), as well as the worldwide shriveling of the alternative, payphone service, I start to think that I might equip Mrs Hoary and myself with a pair, for phoning ahead to hotels and restaurants, phoning each other when we're lost, etc. But then of course I start to hanker after "features". After all, every cellphone here in Japan that's marketed to people between the ages of 10 and 80 has email, and it would be so much easier to email a simple question about hotel vacancy than to have a shouted, half-understood multilingual "conversation".

Even if the marginal price of sending a message were ½€ or more, I could stomach it for occasional use. But renting doesn't appeal, and I don't want to buy anything expensive, or carry around an all-singing, all-dancing Japanese-market phone (even if "roaming" allowed email and cost a lot less than I expect) let alone a computer. My guess is that there's no way, but I'm so ignorant of cellphone use that I think I may be overlooking some obvious option. Any tips? -- Hoary (talk) 03:33, 29 May 2011 (UTC)
 * Sorry but what is the question? Do you want a cheap GSM phone that does e-mail? Nil Einne (talk) 07:49, 29 May 2011 (UTC)
 * That's a reasonable counter-question! A cheap GSM900 phone that does email and a moderately cheap way of having it receive email and send a small amount of mail, just about anywhere that GSM900 is usable; analogous to (or as some kind of accessory to) a "Global SIM" card that lets one phone cheaply from just about anywhere. &para; I have a hunch that the answer will be that of course it's impossible or that of course I should google this or that (I'm below averagely informed about these matters). -- Hoary (talk) 12:08, 29 May 2011 (UTC)

low resolution image of Lincoln
I've tried the Google, and failed.

I remember a photograph of Abraham Lincoln at the Boston Museum of Science. It was a low-resolution image -- 16 x 16 maybe -- that demonstrated that faces are recognizable with a minimum of detail or information. I'm fairly certain the image is just of his face, and he's wearing a top hat; the image shows the hat, his face, and his goatee.

Anyone know where I can find a copy of this image (short of going to the MOS and snapping a picture)?

Thanks in advance, 70.116.11.171 (talk) 03:48, 29 May 2011 (UTC)


 * Try this and this. -- Hoary (talk) 05:42, 29 May 2011 (UTC)


 * Thanks for the tip. I saw the Harmon and Julsez image in my search, but I'm almost 100 percent sure that's not the one in the MOS. The one I remember has his signature top hat. It's also a straight on view to his face, not from the side. Any others? TIA, 70.116.11.171 (talk) 14:09, 29 May 2011 (UTC)


 * Sorry, I don't know. Incidentally, he's not "Julsez" but Julesz. (I say this not to nitpick but to facilitate further googling.) There are very many references to the Lincoln simplification by Harmon and Julesz. Although of course one or both of them, or somebody else, may also have used another image of Lincoln, is it possible that your memory has got two things conflated, e.g. this sideways portrait of Lincoln and a head-on portrait of somebody else? -- Hoary (talk) 14:49, 29 May 2011 (UTC)

Naw, it's definitely an image of Lincoln. And I think the Harmon/Julesz image is all over the web because it's an early example of computer art. It may be the image I'm thinking of someone way back when took that portrait from the LOC, hand-drew in a top hat, and rescaled it. I think I'll try contacting the museum, but they may not get back to me in time to do what I need to do. Oh well. :( 70.116.11.171 (talk) 15:25, 29 May 2011 (UTC)


 * Sorry, when I read the initial request I also jumped to the Leon Harmon image and also wanted to challenge your memory! It's a pretty famous image.  Comet Tuttle (talk) 15:26, 29 May 2011 (UTC)

Aeronautical Engineering career
i want to become aerounatical engineer sir.for that what rank must iget in iit.now that i am entering inter 1st year sir.please tell me about aerounatical engineering sir — Preceding unsigned comment added by Nehapriya (talk • contribs) 08:04, 29 May 2011 (UTC)


 * I added a more useful (sub)title. StuRat (talk) 10:21, 29 May 2011 (UTC)
 * This is the Computing RefDesk - perhaps the Science RefDesk might be more appropriate for this question. (But don't cross-post on different sections of the RefDesk.) Someone more knowledgeable is bound to come along and answer your question, but in the meantime you may wish to read Aerospace engineering. Rocketshiporion ♫ 11:00, 29 May 2011 (UTC)

Recovering Lost Windows Password
I have windows vista business edition installed in my computer with 160GB of hard disk, 1GB of ram and dual core CPU in a working condition.

Now my question goes here:

1) I have forgotten my windows startup password and I want to change or delete password but problem is that I does not have password reset disk or any other administrator account which can do it for me. Its my home computer containing my important office files. I don't want to change my operating system or format it. Please help me. Thanks Gopal Mishra Gopalmishra77 (talk) 03:59, 1 June 2011 (UTC)


 * If it's your home computer then it's unlikely that the CMOS too will be "password protected" against you. You can then boot off a CD-R. So, you find somebody with a working computer -- running any operating system -- to download some flavor of Linux and burn it to a CD-R (don't worry, this does not involve Linux at all; it's just like downloading and burning anything else), you get your computer to boot off a CD-R, you boot off this CD-R, you use Linux to read or rewrite the Windows password (but make no other change to the hard drive), you take out the CD and boot off Windows. I did this myself once for Windows XP, but because Vista is not XP and conceivably the process is slightly different I'm not going to rack my memory for the name of the particular distro -- but I can say that it was extraordinarily compact and designed for jobs such as this. Googling "windows vista" password linux will bring specifics. -- Hoary (talk) 12:39, 29 May 2011 (UTC)


 * Ah, of course, it's SystemRescueCD. (Which tells us: The topic of this article may not meet the general notability guideline &mdash; yet another illustration of how the Wikipedia sense and the normal sense of "notability" are utterly different.) See also this about SystemRescueCD. -- Hoary (talk) 11:04, 1 June 2011 (UTC)


 * See here. I've used the first two tools on the list with success (on Xp). Ophcrack recovers your forgotten password, provided it's less than 14 characters, and only consists of alphanumeric characters. It's very easy to use - just boot from the CD, the program searches for a minute or so, and the accounts and passwords are listed. The second tool, Offline NT Password & Registry Editor, is not quite as user-friendly, and should be used only to blank the password. According to the article, both work with Vista. --NorwegianBluetalk 13:52, 29 May 2011 (UTC)

Windows 7 - Recursive Printing of Directory Hierarchy
Hello Everyone, I want to print a complete hierarchy of all directories, sub-directories, and files to a text file. As there is no built-in function in Windows to do this, I've so far come up with the following batch script, which I then simply copy the .bat file to the root of a volume and run. However, it only outputs the list of files and directories in the root volume. How do I get it to output the entire hierarchy? dir > "G:\Lists\VHL.txt" start notepad "G:\Lists\VHL.txt" exit Thanks as always. Rocketshiporion ♫ 11:22, 29 May 2011 (UTC)

tree /F /A > "G:\Lists\VHL.txt" AvrillirvA (talk) 11:58, 29 May 2011 (UTC)


 * dir /s c:\start\directory\file*wildcard.* will search in the directory c:\start\directory and list all files and directories which match the wild card "file*wildcard.*". It will also recursively search ALL directories within the start directory (they don't need to match the wildcard). If you only want the full filenames, use dir /s/b c:\start\directory\file*wildcard.* CS Miller (talk) 12:02, 29 May 2011 (UTC)
 * dir /s c:\start\directory\file*wildcard.* will search in the directory c:\start\directory and list all files and directories which match the wild card "file*wildcard.*". It will also recursively search ALL directories within the start directory (they don't need to match the wildcard). If you only want the full filenames, use dir /s/b c:\start\directory\file*wildcard.* CS Miller (talk) 12:02, 29 May 2011 (UTC)


 * I don't understand any of the complexity suggested above. The command dir /s does print a complete hierarchy of all directories, subdirectories, and files, so dir /s >c:\mytextfile.txt should do just what you want.  Comet Tuttle (talk) 15:21, 29 May 2011 (UTC)


 * You'd want to include /a if you also want to list hidden and system files . Note that this still won't list content in directories you don't have access to but that shouldn't be a surprise. BTW, I don't think either of the earlier examples are complex. They just give different options. tree is useful if you prefer that output. If you only want to list some content or you want a bare output then the suggestions by Csmiller may be useful. Nil Einne (talk) 15:44, 29 May 2011 (UTC)


 * Thank you to everyone. I've changed it to the following script, and it works flawlessly.

@echo off dir /s /b > "G:\Lists\VHL.txt" start notepad "G:\Lists\VHL.txt" exit Rocketshiporion ♫ 05:32, 31 May 2011 (UTC)

VBScript gurus
Hello! I currently have a VBScript I run on my PC once a day via cron job. It basically goes into my Temp directory, checks all the files last-modified date, and if it's older than a week, it deletes it. I am wondering, however, how much data I actually go through. Since I'm not too handy at VBScript myself, I am reaching out. :-) Is there any way to have this script log the total amount of data that was deleted each day? I've provided my current script below.

Option Explicit On Error Resume Next Dim fso, PathToClean, numberOfDays, folder, rootFolder, objFolder, objSubfolders, objFiles, folderToClean, folderToCheck Set fso = CreateObject("Scripting.FileSystemObject")

 'ENTER THE PATH THAT CONTAINS THE FILES YOU WANT TO CLEAN UP  'Path to the root directory that you're cleaning up PathToClean = "M:\TEMP" '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

'' 'ENTER THE NUMBER OF DAYS SINCE THE FILE WAS LAST MODIFIED ' 'ANY FILE WITH A DATE LAST MODIFIED THAT IS GREATER OR EQUAL TO 'THIS NUMBER WILL BE DELETED. '' 'Specify the how many days old a file must be in order to be deleted. numberOfDays = 7 '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

'Check to make sure path is not a drive root If Right(PathToClean, 2) = ":\" or Right(PathToClean, 1) = ":" Then msgbox "Whoa Nelly! Its best not to run this on a drive root.", vbOkOnly, "Don't Do That!" End If

'' 'Start at the folder specified and walk down the directory tree '' Set rootFolder = fso.GetFolder(PathToClean) If Err.Number > 0 Then msgbox "It appears that you have not entered a valid directory path. Please correct the path and run the script again.", vbOkOnly, "Path Not Found" Wscript.Quit End If

GetSubfolders(rootFolder) CleanupFiles(rootFolder) 'Let person know when the cleanup is complete MsgBox "Files have self-destructed.", vbOkOnly, "File Destruction Complete"

'Clean up Set fso = Nothing

Wscript.Quit ''

Sub GetSubfolders(folder) Dim oSubfolder Set objFolder = fso.GetFolder(folder) Set objSubfolders = objFolder.Subfolders Set objFiles = objFolder.Files

For Each oSubfolder in objSubfolders 'Recursively go down the directory tree GetSubfolders(oSubfolder.Path)

'Cleanup any files that meet the criteria CleanupFiles(oSubfolder.Path)

'Delete the folder if its empty CleanupFolder(oSubfolder.Path) Next End Sub

Sub CleanupFiles(folderToClean) dim objFile set objFolder = fso.GetFolder(folderToClean) set objSubfolders = objFolder.SubFolders set objFiles = objFolder.Files

For Each objFile in objFiles If DateDiff("d", objFile.DateLastModified, Now) > numberOfDays Then objFile.Delete End If	Next

Set objFolder = Nothing Set objSubfolders = Nothing Set objFiles = Nothing End Sub

Sub CleanupFolder(folderToCheck) Set objFolder = fso.GetFolder(folderToCheck) Set objSubfolders = objFolder.Subfolders Set objFiles = objFolder.Files

If objFiles.Count = 0 and objSubfolders.Count = 0 Then objFolder.Delete End If

Set objFolder = Nothing Set objSubfolders = Nothing Set objFiles = Nothing End Sub

Thanks. Avic ennasis  @ 14:24, 25 Iyar 5771 / 29 May 2011 (UTC)

This is untested:

Option Explicit On Error Resume Next Dim fso, PathToClean, numberOfDays, folder, rootFolder, objFolder, objSubfolders, objFiles, folderToClean, folderToCheck Set fso = CreateObject("Scripting.FileSystemObject")

 'ENTER THE PATH THAT CONTAINS THE FILES YOU WANT TO CLEAN UP  'Path to the root directory that you're cleaning up PathToClean = "M:\TEMP" '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

'' 'ENTER THE NUMBER OF DAYS SINCE THE FILE WAS LAST MODIFIED ' 'ANY FILE WITH A DATE LAST MODIFIED THAT IS GREATER OR EQUAL TO 'THIS NUMBER WILL BE DELETED. '' 'Specify the how many days old a file must be in order to be deleted. numberOfDays = 7 '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Dim FilesDeleted as Single Dim BytesDeleted as Double

'Check to make sure path is not a drive root If Right(PathToClean, 2) = ":\" or Right(PathToClean, 1) = ":" Then msgbox "Whoa Nelly! Its best not to run this on a drive root.", vbOkOnly, "Don't Do That!" End If

'' 'Start at the folder specified and walk down the directory tree '' Set rootFolder = fso.GetFolder(PathToClean) If Err.Number > 0 Then msgbox "It appears that you have not entered a valid directory path. Please correct the path and run the script again.", vbOkOnly, "Path Not Found" Wscript.Quit End If

GetSubfolders(rootFolder) CleanupFiles(rootFolder)

'Let person know when the cleanup is complete MsgBox FilesDeleted & " files (" & BytesDeleted & " bytes) have been deleted.", vbOkOnly, "File Destruction Complete"

'Clean up Set fso = Nothing

Wscript.Quit ''

Sub GetSubfolders(folder) Dim oSubfolder Set objFolder = fso.GetFolder(folder) Set objSubfolders = objFolder.Subfolders Set objFiles = objFolder.Files

For Each oSubfolder in objSubfolders 'Recursively go down the directory tree GetSubfolders(oSubfolder.Path)

'Cleanup any files that meet the criteria CleanupFiles(oSubfolder.Path)

'Delete the folder if its empty CleanupFolder(oSubfolder.Path) Next End Sub

Sub CleanupFiles(folderToClean) dim objFile set objFolder = fso.GetFolder(folderToClean) set objSubfolders = objFolder.SubFolders set objFiles = objFolder.Files

For Each objFile in objFiles If DateDiff("d", objFile.DateLastModified, Now) > numberOfDays Then FilesDeleted = FilesDeleted + 1 BytesDeleted = BytesDeleted + objFile.Size objFile.Delete End If	Next

Set objFolder = Nothing Set objSubfolders = Nothing Set objFiles = Nothing End Sub

Sub CleanupFolder(folderToCheck) Set objFolder = fso.GetFolder(folderToCheck) Set objSubfolders = objFolder.Subfolders Set objFiles = objFolder.Files

If objFiles.Count = 0 and objSubfolders.Count = 0 Then objFolder.Delete End If

Set objFolder = Nothing Set objSubfolders = Nothing Set objFiles = Nothing End Sub


 * ...but it ought to work? All I did was create two new global variables (FilesDeleted and BytesDeleted), and before a file is deleted, FilesDeleted is incremented, and BytesDeleted has the file's size added to it. Then the two variables are displayed in the final "completion" message box. --Mr.98 (talk) 16:17, 29 May 2011 (UTC)


 * Thanks for the attempt! :-) But I'm getting a error with that.
 * Windows Script Host
 * Line: 23
 * Char: 18
 * Error: Expected end of statement
 * Code: 800A0401
 * Source: Mircosoft VBScript compilation error
 * And I have no idea on how to fix that. Avic ennasis  @ 17:24, 25 Iyar 5771 / 29 May 2011 (UTC)


 * Try it now. --Mr.98 (talk) 21:30, 29 May 2011 (UTC)
 * Same thing. hmm. Avic ennasis  @ 04:18, 26 Iyar 5771 / 30 May 2011 (UTC)
 * Line 23, char 18 is the "as" keyword. I don't think VBScript's got one of those. Try deleting the "as single" and "as double" parts. Card Zero  (talk) 04:29, 30 May 2011 (UTC)
 * That did it! Awesome. :-) Thanks to both of you. Avic ennasis  @ 04:35, 26 Iyar 5771 / 30 May 2011 (UTC)
 * How odd. How do you tell VBScript that the variable should be a Double, rather than a Single? I'd be worried that it would overflow if the number of bytes was very large, if it wasn't a Double. (I usually program VBA, which is obviously very similar, but differs in small ways.) Poking around, I guess it will re-dimension it if it needs to, which seems odd to me, but that's VBScript for you... --Mr.98 (talk) 15:36, 30 May 2011 (UTC)

Older Korean encodings
Hi! Internet Explorer tries to use the Korean EUC encoding to read: The Korean text does not show up with Korean EUC How do I use older Korean encodings (ISO? UTF-8? ASMO? DOS? Unicode?) with this? The page seems to be the same since it was first posted in the late 1990s WhisperToMe (talk) 15:25, 29 May 2011 (UTC)
 * http://www.ntsb.gov/events/KAL801/default_kor.htm


 * You asked this question before. Did you see the answers? -- BenRG (talk) 17:30, 29 May 2011 (UTC)

Lag when updating Wikipedia using PyWikipedia bots ?
When I do such an update, I always get this message (with the tenths of a second varying a bit):

Sleeping for 7.5 seconds, 2011-05-28 18:38:44

I also sometimes get one or more of these message (with the time varying, and going up if I get more than one):

Pausing 9 seconds due to database server lag.

So:

1) What's the cause of the (first) sleep ? Is it needed to wait for some sub-process to catch up, or is it just "throttling", to prevent bots from taking up too many resources ?

2) How are the time increments calculated ? StuRat (talk) 16:59, 29 May 2011 (UTC)


 * I'm not sure how the sleep timers are figured out - believe that's buried somewhere in the wikipedia.py file. I know that it is done to limit the server strain on the wiki it's operating on. (If you were using it on your own wiki and wanted to speed it up, you'd have to set low values for get_throttle and put_throttle in your config.py, I believe.) Avic ennasis   @ 17:32, 25 Iyar 5771 / 29 May 2011 (UTC)


 * OK, thanks, changing the params in config.py seemed to do the trick. StuRat (talk) 06:07, 30 May 2011 (UTC)

What XML document processor software and methodology would you use for home use?
I'd like to make Wikipedia-like pages for personal use, i.e. I'd like to edit in a wiki-like xml language, with the features of Wikipedia XML, such as etc. to document family genealogy.

What software and methodology would you use? — Preceding unsigned comment added by BobFloyd (talk • contribs) 21:39, 29 May 2011 (UTC)


 * I would actually just set up a Linux box with MediaWiki so it'd be almost exactly like editing Wikipedia. This is probably overkill for most people, but, hey, it's the same experience.  Comet Tuttle (talk) 03:16, 30 May 2011 (UTC)

Downloading all the images in a commons category
Is there a way to do this? I'm after the 99 illustrations to Journey to the Center of the Earth, here:. I've been trying using wget: with some difficulty I used regular expressions to turn the category page into a raw list of links to the image pages. I can put those in a file and tell wget to download them all, but that isn't any use: I just end up with all the pages that contain the images, not the images themselves. Recursive mode doesn't seem to work, possibly because wget doesn't think those pages are HTML. Even if it did work, there's a danger of downloading all of wikimedia commons, or many multiple copies of various logos and icons. I considered trying to turn my list of image pages into a list of direct links to the images, but I can't do that because the actual locations of the images don't seem to follow any pattern - they are in directories such as /9/93/ and /b/b2/ - and each image is prefixed with its pixel size, which is data I don't have (it's not in the links to the pages). I've been trying for two and a half hours, I could have done it quicker by hand, grr. edit: I think I've nearly done it - I downloaded all the pages, and got the direct links out of them and concatenated into another file, with a python script. Once I've cleaned them up I can give the file back to wget. For my future reference, though, was there a less insanely time-consuming way to do this? Card Zero (talk) 23:54, 29 May 2011 (UTC)
 * You could use httrack to do this. Add the category page as the starting url, then under Set options -> Scan rules use the follow filters;

-* +http://commons.wikimedia.org/wiki/File:* +http://upload.wikimedia.org/* -*?*=* -*px-*
 * Make sure to select "html in web" as the folder structure under the Build tab otherwise you'll end up with each image in a separate folder according to wikimedias site structure, rather than all together in the same folder. You might need to disable robots.txt rules under the Spider tab and set a different user agent under the Browser ID tab, something like "Mozilla/5.0 Firefox 3.6" should be good enough. AvrillirvA (talk) 10:34, 30 May 2011 (UTC)


 * Doesn't seem to work for me, but I dunno why not. I was thinking you could do this from the API, but it seems I can only get it to pull the URL for the file page on wiki, not the full path. You could pull a list of all the files in a smaller category with an API query like this to get all the filenames.


 * My first thought then was to "brute force" the directory, since all commons URLs are something like:

http://upload.wikimedia.org/wikipedia/commons/*/**/Filename
 * where * is either 0-9 or 1-z. However, if my math is right, you have 46,656 variations there. If you tried every combination and skipped the 404's, you'd eventually have all the files. However, This would take a *very* long time - at 2 tries a minute for a category with 100 entries would take you exactly 27 days. (Not to mention that the Sysadmins might get a little ticked about such crude methods.)
 * Further research led me to Wikix, which may or may not be useful. You could also try asking at the Help desk. Good luck! (And let me know if you find a solution - I've been curious about this myself for some time.) Avic ennasis   @ 11:19, 26 Iyar 5771 / 30 May 2011 (UTC)


 * Simple python+mwclient program:


 * I've not tried to sanitise the imagename into a valid filename (but this shouldn't be an issue with a modern Linux or Windows filesystem) and I've not cleared slashes from it either. -- Finlay McWalter ☻ Talk 17:18, 30 May 2011 (UTC)
 * MWclient, you say. Most interesting. Thanks everybody, I now have a nice armoury of tools for next time. I also found this script: which seems to know how to predict the directories (/f/f6, /0/0c, /1/12) - something to do with md5 based on the filename. I know nothing about md5, but I'll leave this information here for the benefit of future searchers.  Card Zero  (talk) 17:40, 30 May 2011 (UTC)