Wikipedia:Reference desk/Archives/Computing/2013 June 6

From Wikipedia, the free encyclopedia
Computing desk
< June 5 << May | June | Jul >> June 7 >
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.


June 6[edit]

Disk partioning strategy 1[edit]

I bought a new 750GB hard disk for my laptop. Until now, I have used Windows (Vista) but am preparing to switch to Linux, probably Linux Mint. However, I would still like to use Windows from time to time, perhaps in a dual boot setup. I'm also thinking it might be an idea to have the users home area for both operating systems on the same partition (formatted as NTFS so Windows can read it) - so user documents in Windows will be in D:\astronaut\Documents which will the same place as /home/astronaut/Documents in Linux. Is there somewhere I can read arguments for or against this? Astronaut (talk) 13:00, 6 June 2013 (UTC)[reply]

This partition scheme (Windows system, Linux system, shared data) is fairly common for dual-boot systems. The only issues I can think of are that each OS has a certain amount of hidden data in the user's home directory that won't be hidden when you're running the other OS (so you'll need to be careful not to damage it), and historically Windows hasn't been very happy about filenames with a leading period, which Linux uses in abundance. --Carnildo (talk) 01:30, 8 June 2013 (UTC)[reply]

Disk partitioning strategy 2[edit]

As above, I bought a new 750GB hard disk for my laptop and I'm considering a dual boot system with Windows Vista and Linux Mint. Is it better/easier to install Windows first and then install Linux in another partition letting Grub take over duties as bootloader? Or is it better to install Linux first (leaving the primary partition free), and then install Windows in the primary partition? Astronaut (talk) 13:04, 6 June 2013 (UTC)[reply]

If you are doing something speed-dependent on Windows (like gaming or Photoshop), install Vista and run Linux in a virtual machine. If you only need Windows occasionally for things that aren't time critical (like checking websites you're making on IE) then install Linux and run Windows in a virtual machine. The state of virtualisation is now so good that, with a reasonably decent machine (enough RAM and cpu to handle the overhead) it's the sensible thing to do for most people, and partitioning and dual booting is clunky and inconvenient by comparison. -- Finlay McWalterTalk 14:04, 6 June 2013 (UTC)[reply]
(ec) No. Linux installers know how to deal with a Windows installation, but the installers for Vista and other versions of Windows don't know how to deal with Linux. So you should install Windows first. Looie496 (talk) 14:06, 6 June 2013 (UTC)[reply]

Finlay has brought up another choice for me. I have used a virtual installation of Windows before and was very pleased with the results. However, I'm unsure if I can install my OEM copy of Vista in a VM (ie. can I fool it into thinking the VM is a genuine Dell to avoid activation issues?) I might also need to upgrade the BIOS sometime and I think the BIOS upgrade program provided by Dell is Windows only. However, the one I downloaded from Dell comes with no instructions and the forums are full of various horror stories of totally fucked PCs after BIOS upgrades, so I'm a bit reluctant to try. Any useful advice on Dell BIOS upgrades would also be welcome. Astronaut (talk) 16:08, 6 June 2013 (UTC)[reply]

If everything were not a file in *nix systems[edit]

What would it be? Or what is it in non *nix systems? Is it some information floating in an ethereal area somewhere in the computer? OsmanRF34 (talk) 16:45, 6 June 2013 (UTC)[reply]

The statement that everything is a file in Unix-like systems is really shorthand for the fact that many types of interactions make use of an interface that is closely modeled after the file interface. In principle you could design a different sort of interface that is optimized for, say, hardware devices, and use it to interact with files. Then you could say, everything is a device. Or you could create an interface that is optimized for inter-process communications and use it to interact with files -- then you could say everything is a program. And so on. Looie496 (talk) 16:57, 6 June 2013 (UTC)[reply]
I'm familiar with that line, and I understand your answer. But maybe and Osman and I would understand better with an example. What is X, such that "X is (modeled as) a file on this *nix system", but "X is not (modeled as) a file on this Win7 system"? SemanticMantis (talk) 19:37, 6 June 2013 (UTC)[reply]
The only obvious candidate is the Windows registry, which is frankly not in itself a wonderful argument for breaking out of the file paradigm. --Trovatore (talk) 19:56, 6 June 2013 (UTC)[reply]
Devices and some forms of interprocess communication (eg. named pipes) are files on *nix, but on Windows, devices are their own special class of things, and IPC objects can only be treated as files in a limited set of ways. --Carnildo (talk) 01:36, 8 June 2013 (UTC)[reply]
It's a bit more complicated than that - even within old-school Unix. Unix let's you "mmap" a file to a region of memory - so now files can be imagined as random-access arrays of bytes. It's challenging (and kinda useless - but definitely not impossible) to imagine a keyboard as a random access array of bytes. Remote procedure call (RPC) interfaces are another possibility. I would say that in the modern world, files and devices are now rapidly turning into URLs. My wireless printer has a URL, so does my camera and my WiFi router.
Many modern peripherals are so complicated that you can't really access them as a file-like device - just try using "cat >/dev/video0" to talk to your nVidia graphics card! So in many cases, peripheral interfaces are SDK's with API interfaces (OpenGL, Direct3D). The problem with these things is that they lack universality. Unix lets you do stuff like counting the number of lines of text stored on a paper tape reader and printing the result by saying "wc -l </dev/ptr >/dev/lpr" and it's hard to do things like that with any an API, RPC, mmap or whatever interface. A stream of bytes is really the only universal standard that works for such diverse devices.
If that's all there were to it and unix had just used open()/close()/read()/write()/seek() - then "everything is a file" would be a universal, elegant way to connect devices - but you can't do what you need with just that. Even with something as dumb as a teletype on a serial port, you need to set baud rates, decide which key is the line-terminator, which is end-of-file, whether you want "DEL" to be sent to you as a character or whether it deletes the preceding character. So they added ioctl()...which is basically "pass some random data structure to some device and hope it knows what it means" - and now we have zero compatibility. A program that changes the line termination character for a keyboard doesn't change it for a disk file or a microphone - it makes a nasty mess! Worse, to control something like a text window or a teletype - you need the entire 'termcap/terminfo/curses' mess to cover portability issues.
We've come to mythologize how clever Unix was - but really it was a rather limited paradigm in practice.
SteveBaker (talk) 20:35, 6 June 2013 (UTC)[reply]
We do have an article: Everything is a file. The Unix (and earlier Multics) paradigm has been so successful, and has been around for so long, that operating systems which don't follow this principle (perhaps with a few exceptions) are now rare, but it used to be the case that systems had entirely different methods (APIs) for treating each peripheral device. superuser.com has a reasonable discussion about this.-gadfium 22:37, 6 June 2013 (UTC)[reply]
Also see Plan 9 from Bell Labs for an OS that took the "everything is a file" notion about as far as it could. Andy Dingley (talk) 14:50, 7 June 2013 (UTC)[reply]
And even they do not "copy" processes. "it is possible to push the idea of file-based computing too far. Converting every resource in the system into a file system is a kind of metaphor, and metaphors can be abused." If everything was a file, fork() and exec() would simply be specific arguments to cp; but that is not the case on Unix, Plan 9, or any system I am familiar with. Nimur (talk) 19:29, 8 June 2013 (UTC)[reply]

Dragging between screens[edit]

I'm using a Windows 7 laptop, with a second screen attached. I used to be able to drag maximised browser (chrome or firefox) and MS Word windows across from one screen to the other. As soon as I clicked on the window border and started to drag it around, it de-maximised itself (is that a word?). Suddenly, about a week or two ago, this stopped being possible. I now have to explicitly de-maximise the window before I can drag it. Is this a change imposed on us by the mad scientists in Redmond, or have I inadvertently set an option somewhere? Rojomoke (talk) 17:09, 6 June 2013 (UTC)[reply]

I can confirm that it's not just you. I just tried it, and I'm pretty sure I remember being annoyed by it not working somewhat recently as well. Looking at the latest batch of updates (installed 5/16/2013 for me), there is nothing obvious in the non-security updates that explains the issue. I'll follow up on here if I find any information. 209.131.76.183 (talk) 17:31, 6 June 2013 (UTC)[reply]
And I have it already - for some reason Aero Snap is probably disabled on your system. Search "snap", and open the "Turn off automatic Window arrangement" option in the start menu. The option that disables Snap is "Prevent windows from being automatically arranged when moved to the edge of the screen." I disable it at work because of my monitor setup, but I use it extensively at home, which is probably why I get annoyed by it occasionally not working at work. 209.131.76.183 (talk) 17:34, 6 June 2013 (UTC)[reply]
That did it! (Now if only it worked for Excel) Thanks. Rojomoke (talk) 10:15, 7 June 2013 (UTC)[reply]
Actually, it does work for Excel (if you do a bit of fiddling first) - see http://www.lytebyte.com/2008/05/13/how-to-open-two-excel-files-side-by-side-in-separate-monitors/ - Cucumber Mike (talk) 18:34, 7 June 2013 (UTC)[reply]
Thanks, Mike. That's something I've found annoying in the past. However, it's a different problem to the one I asked about. Excel (2007 at least) just doesn't work properly with the Snap feature. You can maximise a window by nudging it against the top of the screen, but you can't reverse the process by dragging the title bar down. Rojomoke (talk) 23:49, 7 June 2013 (UTC)[reply]

Gas mileage readout[edit]

The fuel mileage indicator in my Subaru only increases/decreases in increments of .3 MPG. For instance, it goes from 29.1 to 29.4 to 29.7 to 30.0. It will never read 29.8. Would there be a programming reason for this? Dismas|(talk) 20:43, 6 June 2013 (UTC)[reply]

There is no software reason that an MPG could not be calculated more precisely. Likely it has to do with the limitations of the instrument measuring gas consumption. Googling, the is a known issue. --Mark viking (talk) 21:38, 6 June 2013 (UTC)[reply]
Thanks for the link and the response. The first page of that thread seems to hold a clue. Someone points out that .3 miles is .5 km. So, if the readings are done every .5 km, then it translates to a .3 mile drop/rise. Dismas|(talk) 23:55, 6 June 2013 (UTC)[reply]
No, it doesn't, because the question seems to refer to an indicator of fuel consumption; no-one would program consumption in kilometres per US gallon or imp. gallon. More likely to just be some rounding question. 86.174.106.54 (talk) 11:01, 7 June 2013 (UTC)[reply]
The system would be initially programmed to report in something involving kilometres and litres, because that's what's used in Japan. How that gets converted for the US market might be the question. HiLo48 (talk) 12:14, 7 June 2013 (UTC)[reply]
Seems like it's dividing by some multiple of 3 and then truncating the result. HiLo's suggestion would explain that, or something similar might be happening with other variables. It would be interesting to know exactly how it's programmed, it's possible it's not a floating point processor. The math desk people might have some interesting ideas. Those instantaneous mileage readouts are based on engine air-flow (I think...). Shadowjams (talk) 14:08, 8 June 2013 (UTC)[reply]
Although it is possible to calculate how many km you drove and how many liters you consumed, cars are not awfully precise about both aspects. So, why output a number with several decimal places which is mostly a guess? OsmanRF34 (talk) 16:11, 8 June 2013 (UTC)[reply]
I'm not wondering why there aren't more decimal places. I realize it's not going to be extremely precise. What I am curious about is why it only ever increments by .3 MPG. If the calculation is 29.6, I don't see why it rounds to 29.7. Why not just display the 29.6 and be done with it? If it were a question of floating point vs non-floating then I could see it rounding everything to the last whole number but it doesn't do that and I don't think it's a question of using floating point math. Dismas|(talk) 17:41, 8 June 2013 (UTC)[reply]
If there is rounding happening before the conversion to US units, there may not actually be any values in existence between 29.4 and 29.7 once they're converted. I recently set some Mathematics students of mine an exam question about growth in membership at a gymnasium over a number of years. The trick was that they had to round the result off to a whole number for every year, because a gym cannot have 0.59 of a member. Rounding creates some interesting results. HiLo48 (talk) 18:01, 8 June 2013 (UTC)[reply]