Wikipedia:Reference desk/Archives/Computing/2009 October 29
Computing desk | ||
---|---|---|
< October 28 | << Sep | October | Nov >> | October 30 > |
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 29
[edit]Google customising searches based on cookies/preferences/previous searches?
[edit]I'm noticing what appears to be a curious correlation between what I've been searching for and what I've previously been searching for. It's as though it's playing mind games with me and trying to outsmart me. For example, you could search for specific things and it will target your search results in a specific area of interest or using certain keywords. This has just been occurring recently as in within the past month or two.--Lul Luii! (talk) 00:04, 29 October 2009 (UTC)
- I would suspect this is just in your head—in the sense you are seeing patterns where there aren't any (which is something we are all prone to, as our brains are evolved to be pattern-matching machines that err on the side of inclusiveness). I don't think Google is playing games with you, trying to outsmart you, or even customizing your searches based on prior searches.
- But hey! You can find out. Download Tor, get it set up in Firefox, and the next time you get a "playing with you" search result, log on through a proxy (at which point Google thinks you live on the other side of the world and have no cookies), and see if you get the same result. It's an easy enough thing to do once you get Tor set up. --Mr.98 (talk) 01:19, 29 October 2009 (UTC)
- I remember seeing disclaimers on some of my Google search results pages that said "Results customized based on recent activity". You could click a link for more information, and another page would come up showing recent searches you did that were used to influence the current search. If I remember correctly, that information page also had a link to turn off the customizations. Here's Google's description of this feature: Google Web Search Help - Search customization details. --Bavi H (talk) 01:47, 29 October 2009 (UTC)
Background music in JAVA
[edit]I'm programming a video game in JAVA, and I want it to have background music that loops in the background. I know how to do this, but the problem is that I also want a short introduction to play at the beginning of the music the first time but for it to be skipped once it repeats (similarly to most of the background music in Pokémon). How do I do this? --75.28.53.240 (talk) 01:25, 29 October 2009 (UTC)
- Put it outside the loop!
The Successor of Physics14:10, 29 October 2009 (UTC)- The problem is, how do I have the program detect when the intro is done playing in order to start the loop? --75.25.103.119 (talk) 21:32, 29 October 2009 (UTC)
- The Clip interface has a setLoopPoints(int, int) method that will do that, if your loading the audio data into Clips. I think it would be easier to split the sound file into two (the intro and part to loop) and have the program handle them separately. You can do that easily with FOSS like Audacity.--el Aprel (facta-facienda) 22:25, 29 October 2009 (UTC)
- The problem is, how do I have the program detect when the intro is done playing in order to start the loop? --75.25.103.119 (talk) 21:32, 29 October 2009 (UTC)
Windows 7 upgrades (Dell)
[edit]Does anyone know if there will be a deadline when Dell would no longer recognize the upgrade to Windows 7 in recently Vista-purchased setups? I bought my laptop in August, and it came with a free upgrade to Win7. I could get the upgrade kit right now, but I don't want to just because I want to give them time to work the first bugs out and stabilize it from the initial release. Will there come a time when I have waited too long and it will be too late to order the upgrade? —Akrabbimtalk 02:50, 29 October 2009 (UTC)
- From ther FAQ page: Registration deadline is January 31, 2010. There isn't any reason to wait for this though. The DVD will be exactly the same whether you order it now or on 31st Jan, and you do not have to install it right away once you receive the kit. If you are afraid of bugs (I've been using it since Beta and I haven't experienced many), let it sit for a while or until SP1 comes out or whatever, but delaying your order certainly doesn't help. --antilivedT | C | G 03:58, 29 October 2009 (UTC)
- Don't delay. Win 7 is way better than the rubbish masquerading as an operating system called Vista. As Antilived mentioned, the DVD would be exactly the same. F (talk) 05:23, 29 October 2009 (UTC)
Oh, OK. Thanks for the advice. —Akrabbimtalk 12:07, 29 October 2009 (UTC)
Letting computer A use computer B's hard drives?
[edit]Hello all, and thanks in advance for answering my question. While I'm sure there's an answer somewhere on the internet (and probably a very simple one, at that), it's difficult to find the exact magical search terms to hit paydirt - and, so, what better way to go than to ask Wikipedia? =)
I'll try to make this simple. I recently bought a new computer. It works very well and I have no complaints, save for one: there is a severe lack of case space. I'm a hard drive maniac, and collect hard drives like kids in the 50s collected baseball cards. External enclosures are not an option - not enough desk space, not enough power outlets, and quite frankly it'd be a low-fi solution to a high-fi problem!
However, I have a second computer, inadequate for my hardware demands, but chock full of drive bays and SATA connections! Both computers are networked through a typical home LAN.
What I want to do, in a nutshell, is use computer B as basically nothing more than a zombified filestore. But (there's always a but =)) - I live in a shared house, and would rather my housemates not discover my love for Britney Spears and As the World Turns episodes. So I would like computer A to see the hard drives located on computer B as, well, hard drives - able to be accessed and written to from and by any program that should wish to. But other computers on the network? I would rather they not see any extra hard drives! Hence, Windows Network Sharing (or whatever it's called) doesn't seem to be an option - mere password protection is simply not enough. One does not need to listen to Britney Spears - Oops I Did It Again.mp3 to know that the possessor of said file demands maximum ridicule. Not to mention that I would rather not clutter up the other computers with superfluous hard drives in their file explorers. So a typical "network share" or "media storage center" would seem to be an inadequate solution - I don't just want to transfer files back and forth, I want to be able to "Save As" directly to computer B's hard drives.
Both computer A and computer B run Windows XP Professional. I could run a Linux LiveCD on computer B, but computer A must remain tethered to the nourishing teat of XP Pro. I would prefer free software if software is needed - open source being a plus.
So, just to restate, as succinctly as my logorrhea will permit: Is there a simple, preferably free way for computer A to recognize the various hard drives physically contained within computer B, and read, write, and generally molest them as it would its own (quite puny) local hard drive - while computers C, D, E, and even F all remain merrily humming along, completely oblivious to aforementioned disk drives?
I don't need too detailed an answer - just a mere point in the right direction should be enough, once I'm on the right track I'll be as good as gold! Badger Drink (talk) 06:30, 29 October 2009 (UTC)
- Windows file sharing with mounted drives + TrueCrypt for hiding your Britney collection? If you can put B next to A, you can run some extra long SATA cables from B to A. Or you can just store everything on a few 2TB hard drives instead of spreading them over a couple of hard drives (more power efficient too). --antilivedT | C | G 07:24, 29 October 2009 (UTC)
- Wouldn't TrueCrypt still show that something's there? (for an analogy: parking a car on the street, in full view, without the keys - people can still see that there's a car there, even if they can't hop in and take it for a test drive. What I'm looking for is more like keeping the car in the garage where only I even know it's there) As far as the extra-long SATA cables - I actually considered that option, but Computer B is one of those Dell Optiplexes with the surrealistic hinge-like opening that consumes a lot more real estate opened than it does when closed. Badger Drink (talk) 19:12, 29 October 2009 (UTC)
- Nope, without a password an encrypted volume is just an ordinary file (or partition, or a whole drive). TrueCrypt even allows you to create an encrypted volume inside another encrypted volume for deniable encryption so that even if you're held at gun point to unlock it you can unlock the outer volume showing some harmless files with the existence of the inner volume unable to be proven. --antilivedT | C | G 02:19, 30 October 2009 (UTC)
- Why would the content of a shared SMB/CIFS drive even be visible without mounting it (which is password-protected)? Sure, if you name your shares "My pinky girl Britney collection", you will give some hints, but then you deserve the ridicule. --Stephan Schulz (talk) 13:24, 29 October 2009 (UTC)
- It looks like, OP is trying to hide these files from users of machine containing disk which holds these files. This does not involves any network activity. -Yyy (talk) 16:06, 29 October 2009 (UTC)
- Sorry for the confusion - no, it's okay if computer B can see the files. Computers A and B are both mine, and years of therapy have taught me that I cannot hide my Britney addiction from myself. =) It's computers C, D, and occasionally E and F (none of which are mine) that I don't want seeing the drives. Badger Drink (talk) 19:12, 29 October 2009 (UTC)
- If you really want the drives to look like local drives, you could probably use FreeNAS on Computer B as an iSCSI target, and run Microsoft iSCSI Initiator on Computer A. I don't have any experience doing this, though. -- Coneslayer (talk) 13:35, 29 October 2009 (UTC)
- Gotcha! And if I'm okay with having the drives appear on Computer A as folders, would that change anything? Badger Drink (talk) 19:12, 29 October 2009 (UTC)
- This seems the right way, only this will require that computer to run linux (or other unix), which might render that machine unuseable for other purposes. There is no iSCSI target functionality in winxp (but there is in some windows server versions), that probably is not a viable solution either. -Yyy (talk) 16:06, 29 October 2009 (UTC)
- Computer B can run Linux just fine. Computer A is the one that must remain tethered to XP Pro. Badger Drink (talk) 19:12, 29 October 2009 (UTC)
Unstoppable Loop!
[edit]Help! The loop in the code below is unable to stop! How can I fix it?The Successor of Physics 14:14, 29 October 2009 (UTC)
Public Sub GSim_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
If e.KeyData = Keys.F3 Then
Dim credits As Form = New Credits()
credits.Show()
End If
If e.KeyData = Keys.F2 Then
ObjVoice.Speak("Simulation Stops")
sim = False
End If
If e.KeyData = Keys.F1 Then
ObjVoice.Speak("Simulation Starts")
sim = True
Do
gravact()
Loop Until sim = False
End If
End Sub
- In the short term, I believe you can Ctrl-Break to stop loops as they are running in VB.
- It looks to me like your loop is in the Do/Loop column. Have you declared sim correctly so it is accessible by "gravact"? (Otherwise, how is sim going to ever be false?). Or, if you are trying to make it so that F1 starts and F2 stops, you will need to set it up differently. If it were me, I would make the simulation a separate thread (not a function), and have that thread started or stopped based on the pressing of the button. That way you will be able to interrupt the program as it runs. In any case, using Do/Loop with a function in between like that is probably not what you want. --Mr.98 (talk) 14:42, 29 October 2009 (UTC)
- And just to add... if your gravact() function runs continuously, it will not ever let the keyboard buffer be processed, which means you can never make sim=false. In VB6 we used to have a nice function—DoEvents—that let you process the keyboard buffer (in exchange for some performance). In VB.NET, I believe you have to do it as threads (which is better to know how to do anyway—DoEvents is kind of cheating and does not teach good programming). --Mr.98 (talk) 01:20, 31 October 2009 (UTC)
Exporting contacts from Outlook Web Access
[edit]Here's the situation: due to the wonderful little economy we're having, my mother has been been given notice and will be let go very soon. Luckily, she was able to find a new position in another company, and she would like to bring her Outlook adress-book with her as it contains many dear friends who's contact information she would like to keep (specifically, she would like to export it to gmail). Not being the worlds most computer-literate person, she asked me to help her. Ordinarily this wouldn't be so hard, you'd just export it directly from Outlook, but the thing is that in her workplace, they use Outlook Web Access for email, not the Outlook software, and as far as I've been able to find out, you can't export the entire adress-book from the web interface.
Is there any way this can be done? I figure that if I can connect her Exchange-account to an Exchange-client, it wouldn't be so hard, but I don't know what information you need to connect an Exchange-account to a client, and I don't know if I can find out that information from the web interface. Any ideas on how to do this would be very welcome. 83.250.228.169 (talk) 14:25, 29 October 2009 (UTC)
- The only real client that connects to Exchange proper is Microsoft Outlook (not, I stress, Outlook Express). The connection info for that is really rather convoluted, and is more than can easily be determined from the webmail address alone. But Evolution (software) connects to Exchange using OWA as a wire protocol (rather than the full Exchange protocol) so you don't need any more info than the OWA web address and the account's login details. I've not used Evolution for this, but its article does say it supports contacts, so it's worth a shot. I'd caution, however, that it'd be very wise indeed to make sure that your mother's boss is okay with y'all doing this, as many companies are sensitive about departing employees taking information with them when they leave, or connecting up unauthorised programs to the company's systems. -- Finlay McWalter • Talk 14:52, 29 October 2009 (UTC)
Device file in windows
[edit]There must be something analog to linux /dev/sda1 (sda2, sdb1, etc) device files in windows. There were one partially related topic here (months ago, cannot find now)(that was about transfering large files from mac to windows using external hdd; one of proposed methods involved using raw disk device).
I remember only that the path to device file began with something like \\?\ or //?/. Article device file system, has no information on these files. (this is quite obscure topic, probably). -Yyy (talk) 16:12, 29 October 2009 (UTC)
- Take a look at the instructions for a popular Windows version of dd here for some basic examples; I don't know of a general specification for the format of these things, but I'll look. -- Finlay McWalter • Talk 16:28, 29 October 2009 (UTC)
- For the double backslash notation, see Path_(computing)#Uniform_Naming_Convention. As for windows device files, they don't really exist in the unix sense. In DOS, however, the old device names CON: (and I believe also PRN:) are still supported. If you from the command line type
copy con: t.txt
- then whatever you type will go into the text file t.txt, which will be closed when you type ctrl-Z. --NorwegianBlue talk 17:02, 29 October 2009 (UTC)
- NT actually has a single-rooted pathname hierarchy much like Unix, but the root exists only in memory. Concepts like "drive letters" and "DOS devices" are specific to the user-mode Win32 subsystem. It translates c:\path\file to \??\c:\path\file before sending it to the kernel. (Yes, that's a folder whose name is two question marks.) \??\c: is a symlink to the actual disk device, which handles the parsing of the rest of the path. (Well, the attached filesystem handles it—I'm not sure how that works.) If you pass a path beginning \\?\ to Win32, it changes the second backslash to a question mark and passes it to NT otherwise unchanged. You can use this to open raw disk devices, create files named con, and generally wreak havoc. You can view the whole NT object hierarchy with the utility WinObj. I'm not sure how \\.\ path parsing works, but they seem to be interchangeable with \\?\ paths in many cases. -- BenRG (talk) 17:50, 29 October 2009 (UTC)
- Thanks for the answers! NT single root pathname hierarchy was the thing i was looking for (and the raw disk copy method was by dd). -Yyy (talk) 19:04, 29 October 2009 (UTC)
Word-to-PDF mangled
[edit]As part of a transcription project, I typed a manuscript document into Microsoft Word format, converted it into PDF with Adobe Acrobat 9 Professional, and proceeded to begin proofreading by having Acrobat read back the transcription while I looked at the original. To my surprise, it only read a little bit of each line: perhaps half of the words per line, perhaps less, and the first word/letter of each line was missing. Sometimes, it would read the second half of a word — thus producing very unusual sounds! — but not the first, and proceed to read the rest of the line and part of the next, etc. Any idea what would be causing this? I did nothing unusual with the formatting of the Word document; while I changed fonts and page margins occasionally, the same effect happened when I converted just parts of the document that are all written in the same font and format. I've done this exact process with many similar documents in the past — type, convert, use the Read function — with the same computer, and never had this problem before. Restarting didn't help, and I observed that a previously-created document that had once Read Aloud fine continued to read aloud fine, so it's apparently an error with this document. Any idea what possible errors I could have made? I've been reduced to copying it into Notepad and converting that into PDF; it reads aloud without problems (thus making me think that I made some odd formatting error), but I've obviously lost some formatting details in the Notepad version. Nyttend (talk) 17:08, 29 October 2009 (UTC)
- I have no idea how to solve your original problem, but here are a few suggestions for workarounds: Try saving it into rich text format (.rtf) or open document format (.docx) or even into a previous MS Word format. Heck, try opening it in OpenOffice or even WordPad and saving it from inside these programs. Then export the resulting file into PDF. Another option, instead of converting to PDF in Acrobat, try installing one of the free PDF writer software (CutePDF, pdf995 or PDF Creator etc.) which appears as a PDF "printer". Print to PDF from inside your program and check if that helps? It sounds like a strange formatting issue, do you have any columns, text boxes, graphics, headers & footers or any non-text data in your doc? Also try checking your template (usually normal.dot) although I wouldn't be able to tell you what to look for. By the way, your solution of using notepad should suffice if all you're interested in is proofreading the text. Zunaid 17:29, 29 October 2009 (UTC)
- I was wondering, too: Why do you need formatting for a reader? Anyways, I suggest you get OpenOffice, which comes with its own "export to PDF" functionality, and give it a try. --Stephan Schulz (talk) 17:48, 29 October 2009 (UTC)
- Sorry for not explaining; my wording does sound a bit odd, now that I read it again :-) The reason that I want the formatting is that I'm transcribing this for an archive: as much as I can, I'm producing a diplomatic transcription, complete with strikethrough for text stricken in the original, a cursive font for official signatures, etc., and I use the Comments feature for situations that need explanation. When I finish the transcription, I send the archive the PDF and also the original Word document, so that any errors that I make in the PDF can be corrected without having to modify the PDF directly; I'm not too excited about perhaps sending them a defective Word document. By the way, I bought Acrobat Professional for another purpose, so I'm not using it simply to convert text to PDF. I'll try your proposed OpenOffice idea on a family member's computer that already has OpenOffice; hopefully that will work better, so that I need not use the Notepad version more. Please check back for an update :-) Nyttend (talk) 20:00, 29 October 2009 (UTC)
- I was wondering, too: Why do you need formatting for a reader? Anyways, I suggest you get OpenOffice, which comes with its own "export to PDF" functionality, and give it a try. --Stephan Schulz (talk) 17:48, 29 October 2009 (UTC)
- Have you tried just copying and pasting the text from one Word document into a new, blank one, and exporting that? Just a thought. --Mr.98 (talk) 01:46, 30 October 2009 (UTC)
- No updates yet, but...yes, I did try this, and the result was identical. Nyttend (talk) 03:24, 30 October 2009 (UTC)
- Hmm, that's very odd. I would try converting it to PDF by other means. OpenOffice is one solution; CutePDF is another. --Mr.98 (talk) 15:23, 30 October 2009 (UTC)
- I've tried converting it with OpenOffice; it reads fine, but OpenOffice didn't carry over my (frequent) use of the Comment feature. It's more important to have the comments than to have it read aloud properly, so I'm not going to go with that. Thanks for the suggestions! Nyttend (talk) 00:57, 2 November 2009 (UTC)
- By the way, I discovered why it reads as it does: when I tell it to read a specific paragraph, it always shows a small and thin (all sides are a single pixel wide) box around the paragraph, and in this document, the box is too far right and too low. Consequently, it chops off the top line or two and the letters at the beginning of each line, and it reads the first line or two of the paragraph below this one. It's somewhat like if you imagine a stamp with a production error: the holes around the edges are misplaced so much that they cut into the design, so when you tear the stamp out of the sheet, you don't get all of your stamp, but you get part of the next one. I don't know why it's misplaced like this, let alone how to place it properly. It seems to be an issue simply with this documenbt, as other similar documents (which I've created since this one) have all turned out well. Nyttend (talk) 01:01, 2 November 2009 (UTC)
- I've tried converting it with OpenOffice; it reads fine, but OpenOffice didn't carry over my (frequent) use of the Comment feature. It's more important to have the comments than to have it read aloud properly, so I'm not going to go with that. Thanks for the suggestions! Nyttend (talk) 00:57, 2 November 2009 (UTC)
- Hmm, that's very odd. I would try converting it to PDF by other means. OpenOffice is one solution; CutePDF is another. --Mr.98 (talk) 15:23, 30 October 2009 (UTC)
WinTv7
[edit]WinTV7 records stuff as large .ts files, with only 20 mins of video reaching 1GB, even when supposedly at "fair" quality (the lowest setting). How can I make it less space hungry? I can't find anything on either the website or the program itself. Many thanks —Preceding unsigned comment added by 82.44.55.2 (talk) 17:49, 29 October 2009 (UTC)
WinVista -> Win7
[edit]I have a modern-ish computer which currently runs Windows Vista. Are the benefits in system stability worth the inevitable loss of speed from running Windows 7 on a Vista machine? —Preceding unsigned comment added by 82.44.55.2 (talk) 17:52, 29 October 2009 (UTC)
- I thought Windows 7 is supposed to run faster than Vista. --164.67.235.128 (talk) 18:08, 29 October 2009 (UTC)
- 164 is correct; your computer will supposedly run faster; but I expect games won't be affected. Comet Tuttle (talk) 18:10, 29 October 2009 (UTC)
- I don't think you'd see either an increase in stability or a decrease in speed going from Vista to Win7. There was a huge improvement in stability in the switch from Win9x to NT, but not much change since then. You might see an increase in speed. Unless you have a specific problem with Vista that's solved in Win7, there's probably no reason to switch. (Unless, perhaps, if you can get Win7 for free.) Features new to Windows 7 and List of features removed in Windows 7 may be helpful. -- BenRG (talk) 18:22, 29 October 2009 (UTC)
Thanks. My main problem with Vista is Windows Explorer seems very unstable; copying large files freezes the entire machine until it's finished copying, browsing folders will often lockup for up to 1 min before unlocking etc, basically Vistas explorer seems extremely crap. I never had these problems with XP explorer and it's using the same files and hard drives etc. I just wondered if Win7 had any noticeable improvements in the system stability area. Thanks for all the advice —Preceding unsigned comment added by 82.44.55.2 (talk) 19:16, 29 October 2009 (UTC)
- Have you installed SP1? There were some infamous problems with file copying in Explorer in the original Vista. I don't know if there were any further changes between Vista SP1 and Win7. It might also be a driver issue; you could try looking for updated drivers from your computer vendor. I've heard people say that Windows 7 has better hardware support than Vista, but I assume that's simply because it bundles newer drivers, and those can also be found online. If you don't mind spending the time and money then there's probably no reason not to upgrade to Windows 7, but I wouldn't trust it to solve your problem. Win7 is not very different from Vista. -- BenRG (talk) 20:50, 29 October 2009 (UTC)
- I've been using Windows 7 for about six months, and I find it much more responsive and stable than Vista. Indeterminate (talk) 07:11, 30 October 2009 (UTC)
Thanks again. I haven't got SP1, I'll install that and hope it fixes the problems. —Preceding unsigned comment added by 82.43.88.201 (talk) 15:38, 30 October 2009 (UTC)
Data recovery!!
[edit]Which is the best software in the internet to download for data recovery after the hard disk has been formatted twice..virtual library takes lot of time and not able to recover the past data. is there a way out to recover data reliably with some other softwares from my laptop's harddisk?..anyone please help —Preceding unsigned comment added by 203.122.36.6 (talk) 19:32, 29 October 2009 (UTC)
- I've never used SpinRite but that's an option. Note that recovery from a disk formatting is unlikely, in my experience. Comet Tuttle (talk) 19:47, 29 October 2009 (UTC)
- If the disk has been quick-formatted, there may be large amounts of the data left, but with the meta-information that describes it removed. A professional data-recovery company may be able to make something of it, but it's not fast and not reliable and assuredly not cheap (essentially they pull all the blocks that are still readable and use heuristics to try to reassemble chains of them, hoping to get decent files or file-fragments out of that). If the format was thorough (i.e. it wrote to every byte on the disk surface), the data is essentially gone - people will make vague claims about the capabilities of the CIA and STEMs and SQUIDs and so forth, but there's no evidence that anyone can get back data that's genuinely been overwritten. -- Finlay McWalter • Talk 21:42, 29 October 2009 (UTC)
- And even the wildest claims for being able to recover data under such circumstances would be much less likely to be successful after formatting the disk twice. So you don't stand a chance unless these were "quick format" operations. SteveBaker (talk) 23:59, 31 October 2009 (UTC)
"Guinness" Internet records?
[edit]A two-part question: 1) is there any semi-significant webpage/organization that keeps internet-related world records (most visited webpage, biggest webpage, most pageviews in 1 day, whatever?) and 2) if there is such a list, then what is the longest blog comment ever posted? 165.91.174.108 (talk) 19:57, 29 October 2009 (UTC)
- There is Alexa Internet which tracks traffic, and Google Trends, among other statistics sites. I doubt anyone has tried to keep track of the "longest blog comment ever posted"—which would be easy to beat, anyway. ("Did you read this <paste entire contents>"—record beaten.) --Mr.98 (talk) 01:44, 30 October 2009 (UTC)
Windows question
[edit]Inspired by the question "Device file in Windows" above, is it true that modern Windows versions are not really inherently backward-compatible with old pre-Windows MS-DOS, and only maintain the illusion of backward-compatibility (for example, drive letters when the file system really is single-root-based) out of hysterical raisins? On a related note, I find it stupid modern GUI-based Unix command line windows still only offer CLI-based text editing, when full GUI-based text editing has been around for over a decade. But Windows goes further - it still desperately tries to perfectly emulate a 1980s text-only display as the only option for a command line. JIP | Talk 21:16, 29 October 2009 (UTC)
- Well, a 32 bit (or 64 bit) protected mode OS can't perfectly emulate a 16-bit real mode OS like DOS, but Windows generally does a pretty good job (and through dint of a heck of a lot of work; there's certainly nothing inherent about what compatibility there is). DOS (and 16 bit windows) programs are run in Virtual 8086 mode containers, with varying degrees of emulation of legacy hardware (e.g. your old video game expects a soundblaster audio card and a VGA graphics card, so Windows has to emulate these in software and reflect this back to the real audio and video technologies in your real machine). This afforts a great deal of compatibility, but it's not perfect - in particular it falters when the application tries to do special things like install TSRs, VxDs, or muck around too much either with the hardware it imagines there or the OS internals that it was written to run on. For that reason later versions of Windows feature full virtualization, allowing a copy of the old OS (warts and all) to run within the new one - that's what Windows 7 Professional's "XP mode" does. Even this isn't perfect, but really it's pretty incredible that Windows 7 will still run CP/M .COM programs, for which the source has long been lost and the original authors long dead, on a system with radically different hardware. -- Finlay McWalter • Talk 21:32, 29 October 2009 (UTC)
- It's not clear, really what major improvements to the command line are possible, although the cmd.exe window (at least as far as XP, which is where my real experience ends) is lagging a bit. The only thing recent terminal windows on (say) Linux offer that Windows' one doesn't is (mostly) decent cut-and-paste and the ability to click on URLs that appear in the window. As for cmd.exe itself, some people use monad instead. Beyond that I don't know what you'd really add. -- Finlay McWalter • Talk 21:37, 29 October 2009 (UTC)
- Incidentally, Raymond Chen (a senior engineer in the MS Shell (that's Explorer, not cmd.exe) team) writes an interesting windows compatibility blog The Old New Thing. It's clear that MS is struggling somewhat under the burden of compatibility layers, and probably wish they'd had virtualisation a major release or two ago, leaving them free to purge and regularise their APIs more aggressively. -- Finlay McWalter • Talk 22:08, 29 October 2009 (UTC)
- NT was designed from scratch (by some of the original architects of VMS) without any thought to backward compatibility, except inasmuch as it should be possible to write compatibility layers on top of it. The NT kernel has POSIX-like fork() with shared copy-on-write, which is not exposed through the Win32 API. NTFS supports case-sensitive file names, also not available through Win32, and allows attaching essentially arbitrary attributes to files. NT originally shipped with Win32, POSIX, and OS/2 "subsystems", i.e. API layers running in user mode. That's why Wine Is Not an Emulator: it's an implementation of Win32 on top of POSIX, on approximately the same footing as Microsoft's implementation on top of NT.
- The POSIX and OS/2 subsystems were basically DOA, though. I think they were too anemic to be useful (the whole Windows GUI was specific to the Win32 subsystem, for example). They were last shipped with Windows 2000. The NT kernel has also accumulated some Win32-specific hacks, and large portions of the GUI have been moved into kernel mode for speed (though that doesn't really make them part of the kernel; NT kernel space looks a lot like user space except without memory protection and other security restrictions). And, of course, desktop users typically ran with full administrative privileges, rendering NT's complicated security model largely moot.
- The story of Win32 console windows is interesting. In Unix, command-line apps have their standard input and output attached to OS pipes, and at the other end of the pipe is a terminal emulator (or, of course, an actual terminal in the old days). Input of special keys like the arrow keys and output of cursor-positioning commands and color and the like are handled through special byte sequences usually beginning with ESC. In Win32, though, when an application runs in a console window the input and output handles are not real handles, but magical values that only have a meaning to the Win32 subsystem. Uses of these handles in functions like WriteFile are intercepted at the Win32 level and sent to csrss.exe via a private interface (using LPC). It's csrss that actually draws the console window. Arrow keys and colors are such are handled with dedicated functions like ReadConsoleInput, which go through the same private interface and have no encoding in bytes. Microsoft hasn't documented the interface or provided any way to hook it, and that's why there are no third-party console replacements. Many console apps will still work with their standard handles attached to pipes, but they're limited to a dumb-terminal interface because the console-specific functions will fail. Of course, nothing prevents you from inventing a set of escape sequences and doing things the Unix way, as Cygwin does, but it will only work with apps that were designed to work with it. And nothing forces you to use CRLF as a line terminator in Windows except the continued existence of programs that don't recognize LF alone (like notepad.exe). It's all about tradition. -- BenRG (talk) 01:37, 30 October 2009 (UTC)
- "hysterical raisins"?? --LarryMac | Talk 18:26, 30 October 2009 (UTC)
- It's a pun on "historical reasons". JIP | Talk 08:08, 31 October 2009 (UTC)