Wikipedia:Reference desk/Archives/Computing/2007 August 10

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
Computing desk
< August 9 << Jul | August | Sep >> August 11 >
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.

August 10[edit]

Auto Network Config[edit]

We know that the process of pinging a particular address is quite long(~~5 sec).Any idea how WINXP auto configures a network IP address in a short time going through the entire range of addresses??? 03:44, 10 August 2007 (UTC)

I might not be understanding your question, but I'm going to barge ahead, anyway. XP doesn't search an entire range when it picks out an IP address. It sends a message to a DHCP server that says, "Hi! I'm new! Can I have an address?" The DHCP has a range of addresses it is allowed to assign -- often less than 100, for a home network router -- and maintains a list of which machines belong to which addresses. It looks for a free address in its list, and sends it back to XP. "Here's your address! You're allowed to keep it for 24 hours, but you can renew your checkout anytime!" --Mdwyer 03:59, 10 August 2007 (UTC)
Hm, as a little side question, why do home routers still utilize ARP when they have DHCP on every machine connected? --frotht 13:31, 10 August 2007 (UTC)
Because DHCP is responsible for IP level addressing, but doesn't have any ideas about MAC-level addressing. To get from computer 1 to computer 2 via ethernet (especially across a switch), you still need to know the ethernet address. ARP uses broadcast-ethernet packets to figure that out. --Mdwyer 00:36, 11 August 2007 (UTC)
Well DHCP keeps track of what MAC addresses hold leases on what IP addresses, so why not just use that instead of a whole other protocol and separate list? I mean sure it would only work for home routers where the switch -is- the DHCP server but it would be more efficient --frotht 03:47, 11 August 2007 (UTC)
It's possible to set computers plugged into the router to have static IP addresses in the same subnet. Since those computers never ask for an address via DHCP, the DHCP server doesn't know about them. --Bavi H 00:21, 12 August 2007 (UTC)
The poster may be talking about Automatic Private IP Addressing (or link-local). These are IP addresses in the range 169.254.x.x that are assigned automatically when there is no DHCP server present. Wikipedia's article on link-local refers to RFC 3927, which seems to be a have details about how an (IPv4) address is assigned and ensured it is unique. -- Bavi H 04:11, 10 August 2007 (UTC)
Oh, thanks! I was wondering about that. If XP follows the RFC, then it uses a random number generator to pick an address within to There are something like 32,000 possible addresses, so the odds are really good that it will be able to pick an empty address on its first try. Then is sends out packets that say, "Anyone else using this address?" If nobody answers before a timeout, it gets to claim that address. --Mdwyer 04:19, 10 August 2007 (UTC)

Invoking user-preferred file handler in Windows, programmatically[edit]

I want to be able to invoke whatever program the user has registered for a given file type (say, for AVI files, could be WinAmp, or then again something else). The long way I've found is: First look in the registry in HKEY_CLASSES_ROOT\.avi to find the document type (say, "WinAmp.File"), then look in HKCR\WinAmp.File\CLSID to get the CLSID ({25336920-03f9-11cf-8fd0-00aa00686f13}), then look in HKCR\CLSID\{25336920-03f9-11cf-8fd0-00aa00686f13}\LocalServer32 (which, I now see, doesn't exist) to get the path to the application program.

Is there a more robust way? I'm kind of concerned that if the program happens to be installed on a network server, the LocalServer32 key is not going to exist. Perhaps there's just a direct Win32 API that does all the registry lookup for you and invokes the server? --Trovatore 08:25, 10 August 2007 (UTC)

I think LocalServer32 is more to do with local services than anything to do with networks. BUT, I'm no expert here - I could be wrong. 02:28, 12 August 2007 (UTC)
It looks like the AssocQueryString function has options to take a file name extension (like ".avi") and return the associated program name. --Bavi H 05:30, 12 August 2007 (UTC)
Hm, none of my VC++ 6 include files contain this AssocQueryString API. Do I need to install an updated SDK or something? --Trovatore 08:12, 14 August 2007 (UTC)
I'm using Windows 95 and VC++ 5, so I don't have it either. I searched online for the shlwapi.h file mentioned on the AssocQueryString page and found information that it's part of "the Internet Explorer SDK (AKA Microsoft Web Workshop SDK)" [1]. I just looked at that page again now and noticed the last post mentions that "the Web Workshop is a component of the Platform SDK" and has more info about that. (It doesn't appear to be for Windows 95, though, so I can't try it out.) --Bavi H 04:18, 15 August 2007 (UTC)

inverted screen[edit]

what should I do to revert back the inverted screen in my computer?

Try Ctrl-Alt-UpArrow. --LarryMac | Talk 14:38, 10 August 2007 (UTC)
You, or someone else may have changed your Windows appearance or Theme. Right-click on the desktop, choose Properties from the popup list, and see if you reset the Theme and/or Appearance back to standard settings, such as Windows XP. --jjron 14:42, 10 August 2007 (UTC)
By "inverted" do you mean black is white and white is black? or do you mean the text is upside-down? The first could be to do with display themes/appearence settings, or maybe there's an electrical problem with the monitor or the VGA cable. The second could be that some joker has turned your screen over :-P 02:34, 12 August 2007 (UTC)

am trying to get this book so that i can read it offline[edit]

Byte of Python:Downloadable version. how do i download it in pdf format

The author says (here): "This version is much improved over the last publically released download. A downloadable version of this latest version will be made available soon (as soon as I figure out how to export a "book" from the MediaWiki pages)". So your choices are to wait until s/he figures out how to do that, or get an old version from here. --Sean 15:05, 10 August 2007 (UTC)

Entering data into Microsoft Excel[edit]

I know this is probably not the place to ask this type of question, but you people have been very good at answering my questions in the past, so I wondered if you could help me here. I'm using Microsoft Office Excel (2003) to enter in the results of a questionnaire, one of the questions for which was "To which of the following age categories do you belong?" Available answers included 10-19, 20-29, 30-39 and 40-49 (plus <10 and 50+). Unfortunately, whenever I input "10-19" into Excel, it converts it into "Oct-19". It does this even if I include spacing ("10 - 19") and clicking "undo" deletes the lot. The really daft thing is, I'm working from the UK, where "10-19" doesn't even mean the nineteenth of October (that would be "19/10"). The help menus are no use, and it still converts it even when I switch off autocomplete. Is there any way I can input the data without it messing with it? It's driving me mad, so any help here would be much appreciated. RobbieG 12:18, 10 August 2007 (UTC)

(I don't have excel to hand, so this is from memory) - type an apostrophe (') before the 10-19 etc. -- Finlay McWalter | Talk 12:21, 10 August 2007 (UTC)
Perfect! That's some memory you've got there. Thanks for the help! RobbieG 12:34, 10 August 2007 (UTC)
Or use Data Validation on the column (or relevant cells) and only allow entries from a list - then use your list as the source. --Worm 13:17, 10 August 2007 (UTC)
Or select the relevant column, or appropriate cells, from the menus choose Format>Cells..., in the dialogue box go to the Number tab and under the Category select Text. --jjron 14:36, 10 August 2007 (UTC)
This is one of the known risks of using Excel; see Excel garbles microarray experiment data, for instance. --cesarb 11:25, 11 August 2007 (UTC)

Virtual Hard Disks (vhd)[edit]

Can virtual hard disks, like those used with Microsoft Virtual PC, be mounted on a normal operating system so that they act like another hard drive (ie, accessable from Windows Explorer etc)? Think outside the box 13:31, 10 August 2007 (UTC)

There appears to be a program included in MSVPC called VHDMount which does this - see this blog for details and issues. And this page describes how to install VHDMount from the MSVPC installer without installing the whole MSVPC. -- Finlay McWalter | Talk 13:53, 10 August 2007 (UTC)
Thanks Finlay McWalter, I'll check it out Think outside the box 14:44, 10 August 2007 (UTC)

Dreamhost - experiences?[edit]

Does anyone have experiences with the web hosting service Dreamhost? On features alone their hosting offerings look very competitive, but of course the proof of the pudding is in the eating. Reviews seem to be highly polarised; from those it's impossible to tell if the unfavourable (and generally badly spelled, I notice) reviews are from disgruntled cranks or if the (generally rather polished) good reviews are the work of people in their referrer program with something to gain. Does any regular wikipedian have direct experience of Dreamhost? -- Finlay McWalter | Talk 13:33, 10 August 2007 (UTC)

I have a small website hosted on their cheaper plan. Nothing much for me to say besides, well, it runs pretty smoothly. They have some neat-o features, such as being able to put up YouTube-type flash videos with their own tools, and simplified installs of software such as WordPress. Not entirely a fan of their control panel but, hey, it works. From time to time I hear from other people (or see on their status blog) that a number of servers are down; however, I've personally never experienced any downtime myself (knock on wood!). bluemonq 21:25, 16 August 2007 (UTC)

PHP echo() problem[edit]

I'm trying to write a PHP page to save comments to a blog I'm setting up, and I can't get the PHP to echo a quotation mark (") correctly. I tried doing the backslash ignore (\") and the code doesn't generate an error, but it echoes the backslash as well as the quotation mark which prevents the html fron executing properly. (most browers probably won't know what to do with <td class=\"blog\"> Anyway, does anyone know how to solve this problem? 13:41, 10 August 2007 (UTC)

ok, nevermind. I realized what I was doing wrong. (grabbing the source code of my article page, and outputting it in the result. brilliant I know. Well we all have our days...... you do too. (you know you do) 14:08, 10 August 2007 (UTC)

Recognizing media player type/ html object backgrounds[edit]

Is there a way to detect what media player a user has turned on from a website? (using javascript/php/asp/etc.) I know it is possible to detect things about the user's computer (like screensize and browser type) using javascript. Just wondering if you could do the same with a media player.
Also, is there a way to set the background of an html <object> tag to something other than white? Is there a way to make it transparent? (I'd like the latter more than the former, but either is better than nothing.) 13:56, 10 August 2007 (UTC)

SIM Cards[edit]

If I have phone X, and if cellular provider Y does not sell or support phone X on their network, but I have a SIM card from cellular provider Y and place it inside of phone X, will phone X function on cellular provider Y's network? Is there any feature that will allow the SIM card to reject the phone it is placed inside of, barring it from the cellular network? I want to know if the miniOne ( iPhone clone from the People's Republic of China can or cannot be effectively banned from the US, due to IP reasons, through the third-party cellular providers. Thanks. - MSTCrow 15:15, 10 August 2007 (UTC)

Assuming that the phone meets the GSM specs and is not locked to a specific carrier (which is common with many phones sold under contract by US carriers), then you should be able to use it on the cellular provider's network. There's been some discussion surrounding the current bandwidth auction (the frequencies being freed up by the transition to digital TV) about whether to require that providers support any device that follows specs on their networks in that bandwidth. Not sure what the US law is currently on cell phone providers, but I've never heard of them going through the trouble (or having the capacity) to restrict access beyond what they do through locking phones. Donald Hosek 17:45, 10 August 2007 (UTC)
In theory, it could be banned, not by the SIM card but by the network itself, since it knows the phone's IMEI (which also identifies the model). In practice, I think nobody ever does that (other than banning specific phones as stolen). --cesarb 11:08, 11 August 2007 (UTC)

One-page web photo galleries[edit]

Does anyone know of a code that allows a photo gallery to appear on one, narrow page of a website? I'm not looking for those full-fledged gallery software things, just some simple html/CSS/java to do the trick, like this or this. I've tried both code on my site, neither works. -- Zanimum 15:22, 10 August 2007 (UTC)

You can easily do it all with HTML alone, as long as you don't want thumbnails that expand to full-sized pics. (Actually, you can sort of do that by having thumbnails at the top, with links to full sized pics down below, but that still means the page takes a long time to load on slow networks. The more common way to do this with HTML alone would be to have the top page have thumbnails only, and have a subpage with each full sized pic, which are each linked to the corresponding thumbnail on the top page.) StuRat 11:53, 11 August 2007 (UTC)
Yeah, I know all of that stuff, I've done the whole thumbnail page/subpages for enlargements thing for multiple artist's websites. But I'm specifically needing code that can create galleries like those. I've since had limited success with simple JavaScript behavior commands, the whole "Set Text of Layer" thing, but that only works to an extent. -- Zanimum 17:58, 14 August 2007 (UTC)
One thing you may want to try would be using CSS popups, ala Eric Myers [2], but I'm not too sure if that's what you're fully looking for or not. You may have luck with lightboxes as well, although I'm not sure if the code will suit you. Google turns up a fair number of CSS and JS variations on this, perhaps some of those results may be of use? 18:49, 15 August 2007 (UTC)
Thanks, I'll keep these in mind. (The person I'm doing the site for seems to be satisfied with a Flash slideshow I posted, but it's quite possible they won't be in the future.) -- Zanimum 17:45, 16 August 2007 (UTC)

second-level domain traffic counting[edit]

I just noticed that our article Microsoft Office Online is out of date; its traffic statistics are three years old, and I wanted to update them. However, I'm not able to find any (free) statistics that list second-level domains. What would be a good source we can cite? — Sebastian 16:02, 10 August 2007 (UTC)

I question the legitimacy of the original statistics, since there's nothing there that says where THEY came from. 17:06, 10 August 2007 (UTC)

GlovePIE sensitivity[edit]

I have a Wiimote hooked up to my computer, and I'm using GlovePIE. The motion controls are fine on the desktop, but when I start up Halo PC, the aim is super sensitive, even though the one in controls is set on minimum. Is there a script command to reduce the Wiimote's sensitively? 19:23, 10 August 2007 (UTC)

round-robin program.[edit]

Let's say I'm having a really long round-robin tournament with almost 150 competitors. I need a program where I can select the winner of each game and the program will automatically calculate the number of wins for each competitor. These games have no points, only wins are counted. I don't need a whole scheduler. Furthermore, the list of competitors is in MSExcel. Is there a program that will allow me to import this data? Does anybody know of anything like this? Thanks in advance. - Zepheus <ゼィフィアス> 20:43, 10 August 2007 (UTC)

I came up with one on the maths desk a while ago - that was very inefficient - don't recommend it. However if you look at Round-robin_tournament#Scheduling_algorithm you will see that the method is really simple - you barely need a computer - however I'm sure someone else can help more. 21:04, 10 August 2007 (UTC)
Under "File + Save As" you can select "Comma Seperated Values (CSV)" as "Save as type". This format is easily read by any number of program languages, including FORTRAN (my favorite). If you like, I could write you a standalone FORTRAN program to do what you wish, all I would need is a sample CSV file. StuRat 11:41, 11 August 2007 (UTC)
Some experiments in Excel look promising, depending on what you wanted to do. You could for example create a grid 150 x 150, in this case at the top of the first 150 columns you would write each person's name (technically, just their unique number), and in the first colum you would again list each person from 1 - 150. So in the top cells you have "allen, ben, charlie" and on the left running down you've got "allen, ben, charlie". Obviously the first match is "allen vs allen" so you put a null. "ben vs ben" is also a null (null as in 'blank' not '0'. Now you will create a double-entry system, i.e. if Allen beats Charlie, in Allen's column you put a '1' and in Charlie's column you put a '0' (and yes you have to put it in the right row). Ultimately you put an autosum at the bottom of each column which will count the number of wins that the person has (wins are worth 1 and losses worth 0). The tricky thing of course is your data entry, because at the end of every round you have to enter in approximately 150 results (because of the double-entry). With some Excel mastery you could maybe get it to do the double-entry for you, thereby halving the end-of-round data entry to 75.
Speaking of doing this programatically, if you only need to count wins, then excel really is probably the way to go, and simply tally the wins and losses of each player (the "losses" is only as a checksum for integrity purposes, i.e. at the end of the game you should have an equal number of losses and wins (draws excepteD). Programatically to "count" the number of wins is actually very simple, so its unlikely someone's made a program that only calculates the wins of each competitor.
Programatically this would be one way of looking it (you may consider Microsoft Access as an option
Simply create a database table with 4 fields (columns) namely: "UNIQUE PLAYER #" + "NAME" + "WINS" + "LOSSES"
Then the program would ask you who played who, and which player won, and then amend the data for you.
It could then very easily have a feature that would tell you who had the most wins.
This doesn't however help you schedule - there's an entirely different solution for that
Having said all this, it still remain unfeasible to specifically write a program for this (scheduling aside), because you can literally do it on pen and paper with a tally. The scheduling aspect would be a lovely challenge - imagine just being able to push a button and it will print out who is versing who! It's all doable. Let me know if you're desperate and I can look at writing something for you. Are you perhaps imagining more than one point of data-entry (maybe for time purposes, at the end of the round you'll have 2-3 attendants entering in who won?) Rfwoolf 21:13, 11 August 2007 (UTC)

Follow-up: If I were to use Excel... I have all the entrants in a column is there a way to rotate that column so the names also become column headers? - Zepheus <ゼィフィアス> 17:56, 14 August 2007 (UTC)

Yes, I believe that's called transposing. Select all your entrants in the first row, and copy. Then, where you want to paste these as column headers, right-click and select "paste special" and check the "transpose" checkbox. Then click OK. Rfwoolf 11:50, 15 August 2007 (UTC)
Awesome. Thank you so much. That will definitely save time in the future. I looked in Excel's less-than-helpful Help file and found nothing. I guess one has to search for "transpose." Thanks again! - Zepheus <ゼィフィアス> 18:49, 15 August 2007 (UTC)

"Add to cart" button for wikipedia[edit]

Is there any way (using a script or something) I can have an "Add to cart" button on wikipedia, so that I can keep putting into a cart articles I want to read but do not have time to read right now. Technically, it would be something similar to the "watch" feature, but I really want a separate list for articles I want to "watch" and for articles I plan to "read". deeptrivia (talk) 23:27, 10 August 2007 (UTC)

I use my browser to bookmark articles I want to come back to. --Mdwyer 00:30, 11 August 2007 (UTC)
Another way would be to create a new Wikipedia screen name and add any articles you wish to read to that screen name's watch list. StuRat 11:32, 11 August 2007 (UTC)
I guess I'll try Google Bookmarks. deeptrivia (talk) 16:34, 11 August 2007 (UTC)