Wikipedia:Reference desk/Archives/Computing/2011 July 10

From Wikipedia, the free encyclopedia
Computing desk
< July 9 << Jun | July | Aug >> July 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.


July 10[edit]

User agent string spoof[edit]

How do I spoof user agent string in Internet Explorer 9? 123.24.106.106 (talk) 00:49, 10 July 2011 (UTC)[reply]

That's not a supported feature of IE 9. Could you explain why you want to do that, and we can help find another way of attacking your issue? i kan reed (talk) 13:37, 11 July 2011 (UTC)[reply]
If you must use Internet Explorer, but insist on pretending that you are not using it, there are other solutions. You can always proxy your web connection, and write a proxy-side script to modify HTTP headers. Here's the official Squid Cache manual section for replacing HTTP headers; (don't forget to specify header access) and here's a fun "hacker" website that instructs you how to randomize your user-agent string using Perl.
As the Squid manual makes abundantly clear: intercepting and modifying HTTP headers "...VIOLATES the HTTP standard. Enabling this feature could make you liable for problems which it causes." In other words, using this feature may (will) break your web browsing experience in interesting ways. Nimur (talk) 00:19, 12 July 2011 (UTC)[reply]

Corrupt master file table[edit]

Hello all, I have a 2 TB external hard drive from Seagate, a FreeAgent. This drive is a tertiary hard drive that is only used for file storage (two others are a 60 GB primary with XP, and a 1 TB Seagate). Yesterday it wouldn't let me do anything with it, XP popping up a systray bubble saying something about $MFT being corrupt and unreadable, and to try chkdsk. I set it to run and fix errors. I left it running overnight, and it was on 23% of Stage 2 when I left early this morning. When I got back home (~12 hours later) it was still at 23% on Stage 2. I decided to exit chkdsk and try again, but now chkdsk tells me:

C:\Documents and Settings\[censored]>chkdsk F: /F
The type of the file system is NTFS.
Volume label is FreeAgent Drive.
Corrupt master file table.  CHKDSK aborted.

It had detected some errors before I exited chkdsk but unfortunately I didn't copy them down.

Any ideas? -- MegaGuy (talk) 01:34, 10 July 2011 (UTC)[reply]

I'm not an expert but someone in the comments here http://www.techsupportalert.com/best-free-data-recovery-file-undelete-utility.htm recommends Test Disk for a corrupted disk. As it is not your main HD, then you don't need to use a LiveCD. 2.101.12.198 (talk) 11:55, 10 July 2011 (UTC)[reply]

SATA drivers[edit]

Hello,

I'm trying to install Windows XP (Pro, 32 bits) on one of the partitions of my main HDD (Hitachi 5450 something). However, the boot CD crashes because I apparently don't have the required SATA drivers. I tried incorporating the XP version chipset drivers with nLite to no avail. My Samsung laptop's mobo is a RF711.

I want to do this to troubleshoot my two iPods who have started freezing during sync at specifc points. HD Tune shows bad sectors but it seems odd that this happened so suddently. CHKDSK doesn't find anything, neither does CopyTrans Doctor. Since I heard iTunes has problems with Windows 7 64 bits, this is pretty much what I haven't tried. Reset, restore, quick format (low-level doesn't work, drive is protected), can't do in-built HDD scan because some dimwit removed the feature for the iPod classics, tried shutting down Zone Alarm and all other security thingies, aso tried downgrading iTunes (reinstalled/uninstalled as well) and trying other .mp3 files and putting the devices on cooling pads during sync, without forgetting compatibility mode and running as administrator, disabling UAC. Tried using Winamp and Media Monkey for sync too.

Sorry for formatting I'm writing on my Kindle. Things I haven't tried include running with everything disabled except required Apple services and processes, CHKDSK during boot through O&O defrag, opening the devices and playing with the HDD wires and shooting both iPods with my Glock, but I'm at work ATM. — Preceding unsigned comment added by 8.18.145.160 (talk) 06:39, 10 July 2011 (UTC)[reply]

I'm not sure the "chipset" download contains the SATA driver. Try the download called "Intel Rapid Storage" (for Windows 7), or this. You can probably set the SATA interface to compatibility mode in the BIOS and avoid the need for a driver entirely. CHKDSK won't scan for bad sectors unless you give it the /R option. I don't think I can help you with the rest of your problems. -- BenRG (talk) 09:59, 10 July 2011 (UTC)[reply]

Java Class[edit]

Suppose i have class named Vehicle. whats the difference between the following two:

Vehicle scooter;

and

Vehicle bike = new Vehicle();

117.201.249.207 (talk) 08:54, 10 July 2011 (UTC)[reply]

scooter and bike are both references (of type Vehicle). bike is a reference to a new concrete instance of Vehicle, but scooter is null (it doesn't refer to any instance). -- Finlay McWalterTalk 09:49, 10 July 2011 (UTC)[reply]

Thanks, that was helpful. I have another question :D:
Do i need to always define the main method as static. if yes, why? 117.201.249.207 (talk) 10:04, 10 July 2011 (UTC)[reply]

Yes. The answer, which is a tad unsatisfactory, is "just because". When you start the java interpreter with a class to run, it looks for a method called main that takes a String[] and is static. That's just the way they defined it when they created Java (I think for some wrong-headed notion of symmetry with C). There's no reason at all that Java couldn't have an abstract base class Application and your application would be a concrete subclass of that (and that's how things work for every other kind of Java program). So "just because". -- Finlay McWalterTalk 10:13, 10 July 2011 (UTC)[reply]
Finlay is absolutely correct: Java's inventors decided to make the program-entry-point static. The benefit, though, is that a Java program may begin execution before the heap is fully initialized. You can read more about JVM internals, and implementation-choices: The Structure of the Java Virtual Machine. Some of these implementation details are specified by the Java language; for example, every Java program will start with a public static method named main whose arguments are an array of strings. Other details are not required by the spec, but are merely common amongst the most popular implementations of Java VMs and compilers. For example, the language requires starting execution in a static method whose offset in the classfile bytecode is trivial to calculate. The language doesn't require, but does allow, that the execution of main() can be executed in parallel with (and before the completion of) the initialization of the heap. Nimur (talk) 17:31, 10 July 2011 (UTC)[reply]

Home routers with good IPv6 support[edit]

Just a few months ago, I read that many home routers had poor support for IPv6 despite being advertised as supporting it. Has the situation changed lately? Are there home routers that are known to have good IPv6 support (and performs well in other respects)? Thanks. — Preceding unsigned comment added by 173.49.11.217 (talk) 09:44, 10 July 2011 (UTC)[reply]

New Partition On Ext HDD[edit]

I have an external HDD, and I am wanting to put a new partition on it and put Win7 on there as a bootable backup/recovery (in addition to the Ubuntu I am currently using for the same reason). The HDD is used alternately between two laptops - one already with Win7 on it, and the other with Vista. Now, I have a couple of questions:

  • Will it be possible to partition the HDD and put Win7 on it, using up 100GB on the partition?
  • More importantly, will this be possible without deleting existing data on the HDD (there are 670GB left on the disk)?
  • If I boot into this new partition, will my data on the existing Vista/Win7 partitions be accessible?

The tools I currently have at my disposal are Vista and Ubuntu (as the Win7 laptop is upstairs being used). Cheers! --KägeTorä - (影虎) (TALK) 11:30, 10 July 2011 (UTC)[reply]

Creating a new partition using unassigned sectors of a hard disk is simple, but shrinking an existing partition to make room for a new partition is not. If that's what you want to do, it may be possible, but this may involve moving data around on that partition, or even copying the data off it, reformatting, then putting it back (there are utilities that do this). As for accessing data on the non-boot partition, that's easy, as long as the partition is in a recognized format. Note that you will need to run a boot manager to select which boot partition you want, each time you start a computer. StuRat (talk) 20:07, 10 July 2011 (UTC)[reply]
Late reply, but use Gparted (comes by default with ubuntu ) after booting from the live CD. you can graphically resize and even move partitions on your Drive.Staticd (talk) 09:20, 15 July 2011 (UTC)[reply]

Scrolling[edit]

My cat has just walked across my keyboard and now I can't scroll using the arrow keys. I don't have a scroll lock button. Any ideas how to fix this (the cat is of no help)? Bradley0110 (talk) 11:57, 10 July 2011 (UTC)[reply]

Is one of your Ctrl keys perhaps stuck down? (Probably not, because that would interfere with typing too.) Details of your system and software would help.  Card Zero  (talk) 12:37, 10 July 2011 (UTC)[reply]
Try pressing the NUM LOCK key. If that doesn't work try the SCROLL LOCK key.--Shantavira|feed me 13:33, 10 July 2011 (UTC)[reply]
Thanks, both. I managed to fix it through Firefox options (would love to know what shortcut the cat managed to trigger to get it like that though!) Bradley0110 (talk) 14:26, 10 July 2011 (UTC)[reply]
It might have been F7 ("caret browsing"). There's a list at " http://support.mozilla.com/en-US/kb/Keyboard shortcuts ". (I'd like to link to that directly, but the URL contains an unencoded space, which I didn't think was even possible. The wiki software has now automagically created the wrong link - you have to add "shortcuts" to the end.)  Card Zero  (talk) 14:49, 10 July 2011 (UTC)[reply]

http://support.mozilla.com/en-US/kb/Keyboard%20shortcuts

URLs containing certain characters will display and link incorrectly unless those characters are encoded. For example, a space must be replaced by %20.

sp " , ' ; < > ? [ ]
%20 %22 %2c %3a %3b %3c %3e %3f %5b %5d

Single apostrophes do not need to be encoded; multiples will be parsed as italic or bold markup ---— Gadget850 (Ed) talk 16:54, 10 July 2011 (UTC)[reply]

Ah, that's how you do it. I knew about percent encoding and originally tried adding the %20 in the address bar, which didn't work because that's not what the page is called on the server.  Card Zero  (talk) 17:32, 10 July 2011 (UTC)[reply]
In case you didn't know this, original poster, the 2000 Ig Nobel Prize in Computing was won by a guy who wrote some software that detects when your cat is walking on your keyboard. It displays a dialog box saying CAT-LIKE TYPING DETECTED and waits for you to click a mouse button. Comet Tuttle (talk) 12:51, 11 July 2011 (UTC)[reply]
If the cat has managed to kill the mouse you'd have a bit of a problem! Roger (talk) 17:15, 14 July 2011 (UTC) [reply]

Email address left on guestbook problem[edit]

Good afternoon, I have a problem (I don't know if you can help me here). I have put a message on the guestbook of somebody with the help of my e-mail adres. Everytime now I go to goggle and I write my name (my name entirely), the beginning of the page and the beginning of the message I have sent appears because I have used my name in my e-mail adres that I needed to send the message. Now everybody can read my message. It attacks my private life. I would like to remove it by my own but it doens't work. Must I wait until (with the years) due to others messages on the guestbook I 'll be put backward (in the last page) and then disappear but it can take years. Thank you very much. — Preceding unsigned comment added by 81.241.70.217 (talk) 13:47, 10 July 2011 (UTC)[reply]

I gave your post a title. Tips: next time, click the "ask a new question" button instead of "edit", and put four tildes at the end to generate a time-and-IP-number signature.  Card Zero  (talk) 14:54, 10 July 2011 (UTC)[reply]

:Try clearing your history and cache. You will find that this is actually your browser auto-completing. Use a different browser, if you want to test this. Ignore me. --KägeTorä - (影虎) (TALK) 15:43, 10 July 2011 (UTC)[reply]

I would suggest you politely write to the admin of the site asking them if they could kindly take down the message or at least obscure your name. Of course there is no guarantee they will respond in the manner you wish, particularly if your original message was rude or attacked them. In that case there is probably not much you can do other then to wait it out (the site may disappear and in any case most people aren't going to hold a single thing a person said 15 years ago against them if they've changed significantly since then). Also take this as a lesson to be more careful in the future when posting on the internet, particularly when using your real name (although many would say often if you don't want people associating what you are writing with your real name you probably shouldn't be writing it in the first place) or any other identity that can be associated with your real name. Of course if you establish a more positive online identity which people link to and admire then this will likely push the unwanted result down in the search results. Nil Einne (talk) 18:05, 10 July 2011 (UTC)[reply]

using a proxy[edit]

I am at a loss. I am in Singapore, and I want to watch shows on websites that do not let me, e.g. formula 1 from the BBC iplayer and Daria from the MTV USA website. Both tell me that I cannot watch in my country/zone. So I hear about proxies, and how people use them to watch whatever they want from whatever website. So I read about them, follow the instructions, and paste in the URL. I try again and again with a bunch of the most popular proxies, but instead of the video playing, no player appears on the screen at all. The rest of the BBC or MTV page is present, but no video player. Can someone please explain how to use these cursed proxies!?! Also in case it's relevant I have a macbook OSX 10.6.4 using safari (I have tried with chrome also to no avail)

Cheers Ballchef (talk) 14:34, 10 July 2011 (UTC)[reply]

Publicly advertised open proxies are overloaded with traffic from people like you as well as people who want anonymity for various reasons. You'll never get good service from them, even if you get them to work. It's possible that the operators of the proxies have deliberately blocked high-traffic sites like the BBC in an attempt to avoid overload. And the BBC and MTV may monitor the same open proxy lists you used and block those IPs.
I'm afraid you will probably have to pay a monthly fee if you want a proxy (or VPN) that doesn't suck. -- BenRG (talk) 17:59, 10 July 2011 (UTC)[reply]

Apparently, it is much cheaper (on a 1:2 relation) to buy a disk enclosure and a HDD to build your external HDD (instead of buying a ready to go external HDD). Is there any recommendation against doing it? Any details to consider? I already know I have to check the type of connection (SATA, IDE, ...) and the size (1T, 2T) of the HDD that the controller can handle. — Preceding unsigned comment added by Wikiweek (talkcontribs) 16:08, 10 July 2011 (UTC)[reply]

You can get a 2TB internal HD from Amazon for about $80 or an external for about $100. Building your own only makes sense now if you already have a drive. ---— Gadget850 (Ed) talk 16:50, 10 July 2011 (UTC)[reply]

It's not really cheaper, I'd only do it if I already had the drive (ask Gadget said) or wanted a very particular setup. With an external that comes with its own enclosure, someone has already (potentially) considered the problem of heat and various other things for you. ¦ Reisio (talk) 23:54, 10 July 2011 (UTC)[reply]

It might be that I got the prices wrong, and that simply at different places, the DIY version was cheaper. Gadget850 must know something about gadgets. Wikiweek (talk) 01:35, 11 July 2011 (UTC)[reply]

Can't delete a corrupted folder[edit]

Resolved

Yesterday, I created a file folder and placed a few images into it, and slightly more than an hour ago, I changed the names of the images in the folder. Just now, I tried to look at the images, only to receive the following message:

[path from C: to the folder] is not accessible.

The file or directory is corrupted and unreadable.

Figuring that there's no point to keeping a corrupted folder and images that I can't access, I tried to delete it, but was greeted by the following message:

An unexpected error is preventing the operation.

"Error 0x80070091: The directory is not empty"

Any ideas how I can delete the folder or uncorrupt the images? I'm running Windows Vista Home Premium; to my surprise, I can't figure out how to find what edition of Windows I'm running — my customisations to restore the look of previous Windows editions means that the Windows Help features tell me to try features whose functions I've changed. Nyttend (talk) 16:18, 10 July 2011 (UTC)[reply]

After I posted this request for help, it occurred to me that I'd not restarted the computer. To my surprise, after the restart I'm able to view the images without difficulty, and I've now uploaded them: 1, 2, and 3. Nyttend (talk) 17:14, 10 July 2011 (UTC)[reply]

If something like that happens again, Unlocker might be able to fix it without having to restart. AvrillirvA (talk) 17:54, 10 July 2011 (UTC)[reply]

defence[edit]

why defence depatment is not using advance technology for storing ammunitation as land are becoming costlier and less day by day and away from civil socities ? — Preceding unsigned comment added by 121.245.134.7 (talk) 17:30, 10 July 2011 (UTC)[reply]

Which defence department, advanced technology and ammunition do you have in mind?  Card Zero  (talk) 17:39, 10 July 2011 (UTC)[reply]
In the United States, Joint Munitions Command is the coordinated service command (operated by the Army) that supplies ammunition to all services of the United States armed forces. They take safety and security very seriously. As far as advanced technologies, numerous facilities that use a variety of technology to stay safe, stay secure, reduce cost, and preserve the environment. All of these potential hazards must be addressed; and the United States has a pretty solid record for preventing major ammunition safety incidents. You can read more at http://www.jmc.army.mil or in our article. Do you have a question about a specific technology? Nimur (talk) 17:46, 10 July 2011 (UTC)[reply]

SFTP double hop[edit]

I have an SFTP (and SSH) machine that I use a lot. However, it isn't connected to the Internet. So, I have to SSH into another machine which is connected to it and then SSH into the machine I want to use. I often open SFTP sessions with servers like this one, but I cannot do it with this particular one because I have to SSH to one server and then SFTP to the one I want. Is there some trick to get a double-hop for SFTP - tell it so ssh to one machine and then sftp to the next? -- kainaw 20:10, 10 July 2011 (UTC)[reply]

Say you're going from A to B to C. You should be able to ssh from A to B with a tunnel set to forward to C:
   ssh -f kainaw@A -L 9999:C:22 -N
Then you can run the sftp on A directed at the forwarded port on B, which should forward it off to C:
   sftp -P 9999 B
I've not tried this particular thing, so let me know how this works out. -- Finlay McWalterTalk 20:22, 10 July 2011 (UTC)[reply]
Haven't tried it yet, but I know it will work. I've used port forwarding before, but not for this task. Sometimes the obvious stubbornly eludes me. -- kainaw 12:42, 11 July 2011 (UTC)[reply]

Pushdown Automaton Formal Definition[edit]

In the formal definitional of pushdown automota it describes the transition function as a mapping from the Cartesian product of the set of states, the set of the input alphabet and the set of the stack alphabet. In my textbook it says the this is because it will pick the next state and new stack based on the current state, input and what's at the top of the stack. But why do we just have to input the value at the top of the stack, surely it should be a function from a list of elements of the stack alphabet, otherwise how does it know what else is on the stack (e.g. when it pop's, how does it know what's below, if that wasn't an input). — Preceding unsigned comment added by SlakaJ (talkcontribs) 23:35, 10 July 2011 (UTC)[reply]

Do you mean that the transition would depend on the entire contents of the stack? Yes, that would make the machine more powerful, but it would actually not be a very useful model: since the stack can be arbitrarily large, the description of the transition function could get very complicated. But the idea of the pushdown automaton model is to make a simple machine that can do complicated things with the aid of a stack. A stack is simple to implement and very fast to use... provided you don't have to go through the entire contents of the stack on every transition step.
However the main problem is that a pushdown automaton that can make a transition on the basis of the entire contents of the stack is just as powerful as an arbitrary function: consider an automaton that simply copies the input to the stack, appends an end-of-input mark, and then looks up the correct result by using the transition function. (Cleaning up the stack afterwards is also easy to arrange.) The interesting thing about the pushdown automaton as defined is that it is a simple machine that is realistically implementable (as long as you don't run out of stack space, but that is another discussion) and that can do more than a finite state automaton, yet less than a Turing machine, or an arbitrary function.
By the way, it is also important to note that a stack element can be defined as a list of a fixed number of input elements (say, the 10 latest input characters). This is useful in practice, does not require unbounded storage space, and does not increase the theoretical power of the model. 188.117.30.209 (talk) 05:49, 11 July 2011 (UTC)[reply]