Wikipedia:Reference desk/Archives/Computing/2008 October 1
Computing desk | ||
---|---|---|
< September 30 | << Sep | October | Nov >> | October 2 > |
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. |
October 1
[edit]Reconstructor and Graphical Chroot?
[edit]Hi, I have the latest version of reconstructor (2.8.1), and I think it already has support for graphical apps in the chrooted environment, (by looking at the source, it seems to automatically do many things needed for that) but I don't know how to start the graphical chroot... I open the chrooted terminal, and now what?!? Is anyone familiar with this program? SF007 (talk) 00:13, 1 October 2008 (UTC)
Winamp tags
[edit]When I add a new play list to winamp all the songs have their file names as the song names in the list. And as I scroll over them they slowly change over to their tagged details. Is there any way to make them automatically show their tagged name before I scroll over them? Thanks 203.202.144.223 (talk) 00:33, 1 October 2008 (UTC)
- In Winamp 5.5, the relevant setting is in Preferences, General Preferences, Titles. There are three choices there that select when Winamp reads metadata: when files are loaded, when files are visible in the playlist window, or only when files are played. It warns that reading the metadata at load can be slow if many files are added at once. --Bavi H (talk) 03:05, 1 October 2008 (UTC)
A Template Metaprogram for the Ackermann Function
[edit]I am trying to write a metaprogram for the Ackermann Function and have written this so far:
template<typename M, typename N> class Ackermann { public: enum{ result = Ackermann<M-1, Ackermann<M, N-1>::result>::result }; };
template<typename M> class Ackermann<M, 0> { public: enum{ result = Ackermann<M-1, 1>::result }; };
template<typename N> class Ackermann<0,N> { public: enum{ result = N+1 }; };
The first error I am getting is that second parameter in the first enum is incorrect, any ideas how that can be fixed? Also, for the other two templates, I am getting "expected a type got 0" error (which makes sense for the third template, but I cant figure out a way to get rid of the third template yet). I have also tried using a conditional '?' in the first enum for the last enum i.e
result = M ? N+1 : Ackermann<M-1, Ackermann<M, N-1>::result>::result
but that too doesn't seem to work. Maybe I am just missing something fundamental. Any comments shall be helpful. Thanks in advance! Aks... (talk) 00:39, 1 October 2008 (UTC)
- First thing, M and N should be "int" instead of "typename". --Spoon! (talk) 03:10, 1 October 2008 (UTC)
Regular Expression for...
[edit]Grabbing the text within <>'s, like: "Mr. John Doe" <johnd@fakeemail.com>
Thanks Louis Waweru Talk 00:40, 1 October 2008 (UTC)
- The syntax depends on what you are programming the regex in. One way to write it is "/<([^>]*)>/". Everything between ( and ) will be a sub-match of the entire match from < to >. -- kainaw™ 00:43, 1 October 2008 (UTC)
- Thank you, I'll see if I can wrap my head around it. I was hoping to do it in Word's Find/Replace box, if you know how to do that it would help because it's a real world problem. But I have Visual Studio and have been meaning to learn regular expressions, so I might wind up creating a sample project. Thanks for giving me something to dissect. Louis Waweru Talk 00:53, 1 October 2008 (UTC)
- The "/" and "/" at the beginning and end are just "this is a regular expression" holders. Everything between them is a regular expression. I don't know what Word uses to encase regular expressions. The < means "look for a <". The ( and ) mean "keep an eye on everything in here because I may want to use it later." The [ and ] mean "I am explaining more than one character here." The ^ means "anything except." The >'s mean "look for the > character." the * means "zero or more repetitions of the previous thing." All put together, this says "look for a <. Then, keep an eye on everything that isn't a > until you find a >." -- kainaw™ 01:33, 1 October 2008 (UTC)
- I don't have the latest version of word, but earlier versions (I still use Word97) have an imcomplete regular expression implementation. In the search and replace dialog, check the "use wildcards" option, set "Find what" to
"[ -~]@" [<]([ -~]@)[>]
and "Replace with:" to\1
. The "[ -~]" is an imperfect attempt to capture spaces and printable ASCII characters (acented or extended characters might not be omitted), but not line breaks. The "@" looks for 1 or more repetitions of the preceeding item. The "[<]" and "[>]" matches just those characters (as opposed to "<" and ">" which matches the beginning and end of a word). The "(...)" captures whatever is matched within, and is represented by "\1" in the replace expression. Hope this helps. If you have a comma or semicolon separated list, you might have to modify the "[ -~] with something like "[- -+.-:<-~]" which includes the ASCII characters excluding the comma and colon (dash, space-to-plus, period-to-colon, and lessthan-to-tilda). See ASCII. I suggest you capture the operation into a macro. Hope this helps. -- Tcncv (talk) 02:11, 1 October 2008 (UTC)- Wow, excellent! Thanks you two. Tcncv, that still works in Word 2007. I was able to change it a bit to catch the lines that were slightly different. I don't think I will be coming up with a single expression to catch them all at once anytime soon though, haha. Confusing stuff, thanks again! For your amusement, here is the only time I wrote a regular expression, behold!
<rewrite url="~/Tagged-(.+).aspx" to="~/Browse.aspx?tag=$1" />
Louis Waweru Talk 03:52, 1 October 2008 (UTC)
- Wow, excellent! Thanks you two. Tcncv, that still works in Word 2007. I was able to change it a bit to catch the lines that were slightly different. I don't think I will be coming up with a single expression to catch them all at once anytime soon though, haha. Confusing stuff, thanks again! For your amusement, here is the only time I wrote a regular expression, behold!
- I don't have the latest version of word, but earlier versions (I still use Word97) have an imcomplete regular expression implementation. In the search and replace dialog, check the "use wildcards" option, set "Find what" to
- The "/" and "/" at the beginning and end are just "this is a regular expression" holders. Everything between them is a regular expression. I don't know what Word uses to encase regular expressions. The < means "look for a <". The ( and ) mean "keep an eye on everything in here because I may want to use it later." The [ and ] mean "I am explaining more than one character here." The ^ means "anything except." The >'s mean "look for the > character." the * means "zero or more repetitions of the previous thing." All put together, this says "look for a <. Then, keep an eye on everything that isn't a > until you find a >." -- kainaw™ 01:33, 1 October 2008 (UTC)
IP subnet mask
[edit]is 0.0.0.0 a valid subnet mask ? —Preceding unsigned comment added by R.srinivaas (talk • contribs) 05:50, 1 October 2008 (UTC)
- That would be one giant subnet. A subnet called "The Internet". That would include all possible IP addresses, so it wouldn't really be a "subnet" per-se. If you're asking if there is something theoretically wrong with it, no, I would guess not. But it's not something you would enter into your router configuration 90.235.17.83 (talk) 12:06, 1 October 2008 (UTC)
- If, by chance, you answered 0.0.0.0 on homework or a test, I would count it wrong. There is no valid use of 0.0.0.0 as a subnet mask that I know of. I would require you to show that you understand what a subnet mask is by showing me a valid use for 0.0.0.0 since answering with 0.0.0.0 indicates that you don't know what a subnet mask is. If you did show me a valid use for it, I would amend the grade and thank you for teaching me something new. -- kainaw™ 17:07, 1 October 2008 (UTC)
- Considering that he asked if it is a "valid" mask and not is it a "useful" mask, I would have to say your conclusion is superficial. In addition, I can think of a perfectly good "use" for an all-0 subnet mask, it would be the equivalent of setting the gateway to 127.0.0.1, that is, traffic is voluntarily sequestered on the local subnet. --66.195.232.121 (talk) 17:01, 2 October 2008 (UTC)
- If, by chance, you answered 0.0.0.0 on homework or a test, I would count it wrong. There is no valid use of 0.0.0.0 as a subnet mask that I know of. I would require you to show that you understand what a subnet mask is by showing me a valid use for 0.0.0.0 since answering with 0.0.0.0 indicates that you don't know what a subnet mask is. If you did show me a valid use for it, I would amend the grade and thank you for teaching me something new. -- kainaw™ 17:07, 1 October 2008 (UTC)
- As I said, if this were on a test, I would have counted it wrong and asked you what a good use for 0.0.0.0 would be. If you answered that it would be the equivalent of setting the gateway to 127.0.0.1, I would have changed it to be correct. My response was based on 90.235.17.83's response and I was just trying further clarify between being "valid" and being "correct". -- kainaw™ 22:51, 2 October 2008 (UTC)
Thanks for answering ....
but RFC 1878 states that
- Subnet all zeroes and all ones excluded. (Obsolete)
- Host all zeroes and all ones excluded. (Obsolete)
but routers still accept 0.0.0.0 as subnet why ? —Preceding unsigned comment added by R.srinivaas (talk • contribs) 07:42, 3 October 2008 (UTC)
- Programmers for them didn't feel like writing extra code to reject obsolete subnets and hosts. There's no deep answer here. -- kainaw™ 12:04, 3 October 2008 (UTC)
- The dictionary would like a word with you... it's "obsolete". --66.195.232.121 (talk) 19:55, 3 October 2008 (UTC)
- I doubt there are many uses for 255.0.0.0 for subnet masks either. Huge corporations, maybe. ---J.S (T/C/WRE) 07:16, 6 October 2008 (UTC)
to write a complex program on multiplication
[edit]How to write a program to print the multiplication table of a number such that it prints
the multiplication table of that number & also the numbers preceding it?Newtondon87 (talk) 07:41, 1 October 2008 (UTC)
- That sounds like a for loop for the multiplication table inside a for loop for each table. ~~ ----
- I meant -- ~~~~ not ~~ ----. -- SGBailey (talk) 17:16, 1 October 2008 (UTC)
- That sounds like a for loop for the multiplication table inside a for loop for each table. ~~ ----
- sounds like homework you mean :) but heres a hint Newtondon87 dont try and solve it all in one go. first just write a function which just prints the multiplication table for a number. e.g. 5. then when you've got that working, modify the function so it'll print the multiplication table for any number you pass to it, then when you've got that bit working modify it again to do the next bit and so on. Mission Fleg (talk) 10:05, 1 October 2008 (UTC)
Edit "Open With" context menu in Windows Explorer
[edit]How do I add, change or remove items in the "Open With" menu? This is the menu that pops up when you right-click a filename displayed in Windows Explorer. (I have Windows XP SP2.)
For example, if I right-click a file with a ".rtf" extension I get options to open it with MS Word and WordPad, but I wish to change the list for that extension and other ones as well.--85.158.137.195 (talk) 10:52, 1 October 2008 (UTC)
- I don't have XP in English, so I might be giving the wrong names for the menu-items. But here's what you do: in the Open With submenu, there's a list of programs that you can open the file with. At the bottom of that submenu, there's an additional item that says something like "Select program" or something (as I said, I don't have it in English). Press that, and it will give you a list of programs that you have installed. Open the file with whatever program you want, and from then on, that program will be in the menu 90.235.17.83 (talk) 12:38, 1 October 2008 (UTC)
- I'm not the OP, but I would also like to know if there's a way to remove options from the Open With and other right-click menus. For example, I have Paint Shop Pro installed. When I right-click on the recycle bin to empty it, the option to "Browse in Paint Shop Pro" is right underneath it. That would be a complete waste of time, so I'd like to get rid of that option. DreamWeaver options also show up in weird places. Matt Deres (talk) 20:12, 1 October 2008 (UTC)
- For your Paint Shop Pro item, I recommend you look in the settings of Paint Shop Pro first.
- Removing items from the Open With menu seems to require a registry edit: How to Remove Programs from the "Open With" List.
- Removing items from the main context menu for a file type can be done via Control Panel, Folder Options, File Types.
- Warning: Do not edit the settings for "Drive", "File Folder", or "Folder" types unless you are technical user comfortable with modifying the registry. If you edit the "Drive" or "File Folder" types, double-clicking on drives or folders will act strange, and you will need to follow this registry modification to correct the problem. Also, the Folder Options control panel doesn't allow you to edit or remove items from these types, even if you added them yourself. If you add items using the Folder Options control panel, you will have to use Registry Editor if you want to remove them later. (In Registry Editor you can go to HKEY_CLASSES_ROOT and find "Drive", "Directory", and "Folder" keys which correspond to the "Drive", "File Folder" and "Folder" types in the Folder Options control panel. In each one, the subkey "shell" contains the context menu items.)
- The "Drive" type contains context menu items for drive icons (root folders) only. The "File Folder"/"Directory" type contains context menu items for other non-root, non-special folders only. The "Folder" type contains context menu items for every drive, folder, special folder, or other container in Windows. The Paint Shop Pro item appearing when you right click on the Recycle Bin will be found in the "Folder" type. However, if you remove it, then it will be removed from the context menus of all folders and containers.
- If you are comfortable modifying the registry, then you can consider the following. Remove the item from the "Folder" type, then add it to the "Drive" and "File Folder"/"Directory" types. If you used the Folder Options control panel, then follow the registry modification mentioned above to get drives and folders working correctly when you double-click on them. These modifications will show the item in the context menu of drives and other normal folders, and remove it from all other special folders and containers. --Bavi H (talk) 04:32, 2 October 2008 (UTC)
- Thanks everyone - most helpful.--92.41.251.222 (talk) 05:35, 2 October 2008 (UTC) (OP)
games in laptop
[edit]hi,i think of buying a computer.i want to play a lot of games.my friend told me that laptops will get damaged if u play a lot of games.if we connect a key board to it,will there be any damage?i mean damage to software,hard drive etc.. —Preceding unsigned comment added by 203.199.213.66 (talk) 13:10, 1 October 2008 (UTC)
- I've never heard of laptops getting damaged from "playing a lot of games". I'm not sure it's something you ought to be seriously worried about. --98.217.8.46 (talk) 13:17, 1 October 2008 (UTC)
- Did he say what kind of damage he was worried about? APL (talk) 13:29, 1 October 2008 (UTC)
- Maybe keyboard/touchpad damage from mashing the keys? It won't damage the hard drive or any other part. Installing a game might cause problems with other software, but that's not any more likely on a laptop than a desktop. -- BenRG (talk) 16:52, 1 October 2008 (UTC)
- If by "playing a lot of games" you mean games like tennis, hockey or boxing, then I would say "yes, your laptop has a good chance of getting damaged, and always wear eye protection if you're throwing the laptop around..." — Sam 21:12, 1 October 2008 (UTC)
- You need quite a good laptop to play games well and it'll probably drain the battery quickly. For the same amount of money you may be better off getting a lower class of portable for word processing and suchlike plus a dedicated games machine.
- Well, most laptops have horrendous cooling capabilities (compared to larger computers such as a desktop or those that are immersed in Fluorinert), so if you are playing a game that stresses the hardware for many hours at a time, that might reduce the lifetime of the laptop if the laptop has a powerful-ish microprocessor and GPU (which most don't) due to heat. Rilak (talk) 09:13, 2 October 2008 (UTC)
- I have been playing games on my laptop for years with no problems (none attribuable to it being a laptop, anyway). However, a few things to note - if you're going to using an external mouse/keyboard, you will likely be plugging and unplugging them more often than with a desktop. USB connectors are fairly solid, but apply too much force and it will break. Also, more importantly, laptops are usually not designed for graphics-intensive activities such as gaming (especially more modern games). You will probably have to pay dearly for a laptop which will play the latest games well, plus, such machines will inevitably run very very hot and go through their battery like there's no tomorrow. — QuantumEleven 14:47, 2 October 2008 (UTC)
- The question then would be what sort of games and what kind of laptop. Playing something like Snakes on a low-power VIA-based laptop with integrated graphics for hours isn't going to do much harm, but if it made the laptop a bit too warm to touch, there might be a problem. Rilak (talk) 08:42, 3 October 2008 (UTC)
- That's true, it obviously depends what kind of gaming you want to do. — QuantumEleven 11:41, 3 October 2008 (UTC)
- Im playing Hockey with my Laptop, and keys fly off whenever I do a slapshot. BaaDUM! ok. Some games, like EA sports which involve hitting the same keys continiously, can damage the keyboard. Playing other games, like Dungeon Siege or Diablo II will not hurt the laptop per sae, might get them a bit hot, but your mind and your schedule are the only things to get trashed. pizzabox13@USWEST(battlenet) A Laptop that plays CRYSYS is now specially built to handle the demanding graphics. Consider getting a fan pad. 173.8.65.213 (talk) 21:22, 9 October 2008 (UTC)--
Tablet PC
[edit]Hellow friends, I am a newcomer in computer field. I am a medical student. I want to buy something computer related/digital device(but neither a laptop nor a fixed PC) that can help me in my studies. I have study material in the form of Power Point presentations, media player files, office word pages, PDF files, pictures, diccionaries. Is there anything that can help me in my studies (excluding a laptop and a fixed PC). What about a Tablet PC? What is this ? Will u help me to know about its peculiarities,its prices and its comparison to a laptop? I will b very thankful. —Preceding unsigned comment added by 201.220.215.13 (talk) 14:44, 1 October 2008 (UTC)
- A Tablet PC is basically a specialized laptop, normally with the ability to flip around the screen so that you may use your handwriting on it.
- Why no laptop or desktop? I would think that a laptop would be the best choice for you if you have Powerpoints, media, office, PDF, pictures and dictionaries to work with. Washii (talk) 15:55, 1 October 2008 (UTC)
- As Washii points out - there are only two things that make a laptop a tablet. First, if you can shut your laptop such that the screen's display is facing out, like a tablet, then it is most likely a tablet. Second, if you can also write on the screen using a stylus, then it is definitely a tablet. Other than those two things, a tablet is just a laptop. They are not smaller, lighter, or cheaper than laptops. They are just laptops with two extra little features. I know a lot of doctors who love them. I know many who don't like them. I know many who refuse to acknowledge that computers exist. -- kainaw™ 16:16, 1 October 2008 (UTC)
Wikipedia on iPod
[edit]I just got an iPod Touch, and I have read somewhere on Wikipedia that there is a way to download a static version of Wikipedia without pictures onto the iPod. Yes, the Touch gets Internet, but I'm not always around Wi-Fi, so it would be nice to have this even though it takes up tons of space. Where might this program be? Thanks, Reywas92Talk 20:29, 1 October 2008 (UTC)
- Encyclopodia. Unfortunately, it's not compatible with the iPod touch. If you happen to have an older iPod lying around, though, give it a go; it's compatible with the iPod mini and 1st through 4th generation (full-size) iPods. --CalusReyma (talk) 22:31, 1 October 2008 (UTC)
Darn, but thanks. Though I'm pretty sure that it was some article in the Wikipedia namespace. I definitely don't remember seeing that website, and it worked with more versions of iPods, so there must be a few different versions of this out there. Reywas92Talk 02:30, 2 October 2008 (UTC)
- Maybe one of these will help: Wikipedia:Database download, Wikipedia:TomeRaider database, mw:Alternative parsers --Spoon! (talk) 03:44, 2 October 2008 (UTC)
Okay, I've done some Googling and I think this Lifehacker article may be what you're looking for. You'll need to jailbreak your iPod, though, and if you've got the new 2nd gen Touch, you'll be out of luck, as these can't be jailbroken just yet. --CalusReyma (talk) 09:29, 2 October 2008 (UTC)
Which Linux distro should I install on Parallels?
[edit]Ok, ok, I know this is a little bit like starting a post entitled "Which is better, Macs or PCs?" but hopefully I'll get a couple ideas and can ignore the flame from everyone else... ;)
I'm a programmer (Java, some web technologies) working mostly on a Mac, and doing a fair but of command-line unixy stuff with it. I'm thinking of installing a Linux ditro on my Parallels in order to improve my unix experience. Which distribution would you recommend (e.g. Fedora, Ubuntu, Debian, etc), both in terms of real-world practicality, and it terms of ease of installing? Any thoughts welcome!
Thanks! — Sam 20:59, 1 October 2008 (UTC)
- The normal recommendation tends to be Ubuntu, mainly for ease of install and its fairly large and supportive community. CentOS isn't a bad choice either, and there are countless others. Really, it's hard to make a "bad choice".
- There's two other related things I want to note though. #1: VMWare Fusion is totally better than Parallels. #2: OS X is a Unix-certified OS, so if that's all you want to get out of it it's right there.
- And FYI, your IP address is still in the page history (history tab at the top). -- Consumed Crustacean (talk) 21:11, 1 October 2008 (UTC)
- Thanks for the recommendation. I was in fact just looking at a fairly simple Ubuntu installation walk-through. And as for the FYI, I just hate that wretched SineBot. I sign my name and timestamp it with tildes as well, every time I post. If I'm vandalizing, someone will find out PDQ, without needing extra junk attached to the end of my signature each time I write a message. It makes those of us who don't feel like logging in or having our IP stuck everywhere feel like we're being cattle branded or something. </end rant> — Sam 21:19, 1 October 2008 (UTC)
- Yeah, there is almost nothing to installing Ubuntu. Download the ISO image. Start VMware, create a new Linux VM, feed it the ISO (in the virtual machine settings, go to the CD/DVD drive options, easy to find), and start the VM. It should boot off the disc, you can proceed with installing Ubuntu (easy to do, just follow instructions), and all will be good in the world. -- Consumed Crustacean (talk) 01:21, 2 October 2008 (UTC)
- Consumed Crustacean is right, Ubuntu is probably the best distro for starters, and I also think VMware software is better than Parallels... SF007 (talk) 21:24, 1 October 2008 (UTC)
- If you want to try a virtualizer that doesn't cost anything, you might give VirtualBox a spin. I haven't used it, personally, though. --98.217.8.46 (talk) 02:47, 2 October 2008 (UTC)