Wikipedia:Reference desk/Archives/Computing/2012 July 26

From Wikipedia, the free encyclopedia
Jump to: navigation, search
Computing desk
< July 25 << Jun | July | Aug >> July 27 >
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 26[edit]

Hard drives[edit]

I'm checking out new computers, and what I notice is that a lot of the ones that have lots of storage space (anywhere between 500GB and 1TB) seem to only come with 5400rpm, most of which don't even come with the option to upgrade to 7200rpm (which should be the default if it's upwards of 750GB) or add an SSD (you have to buy and install one yourself or at least get someone to install it for you). Even if you're ordering from the manufacturer's site where you can choose custom options, only few of them offer the 7200rpm/SSD upgrade as an option. Even then, they seem to limit the 7200rpm option to 640GB or lower. What gives? Why aren't manufacturers realizing that hard drives with that much space cannot function properly with only 5400rpm! It's slow as hell! I even tried explaining this to employees at Best Buy, and some of them don't seem to even have clue as to what RPM is or what it does! (talk) 06:38, 26 July 2012 (UTC)

I imagine it's a physical limitation, that those large disks can't be spun that fast. My suggestion, buy two 640GB disks, if you need both space and speed. StuRat (talk) 06:42, 26 July 2012 (UTC)
Large drives easily run at 7200 rpm stu. [1] Stop commenting your first instinct on stuff you don't know about.
It's a simple business decision. Most consumers don't care/notice. There's a lot of irrelevant info on those displays, and a lot of missed actual information. And arguing with clerks at big box stores about the merits of a corporate decision is about as useful as arguing on wikipedia. Shadowjams (talk) 08:31, 26 July 2012 (UTC)
Finding that they exist at that speed doesn't mean it's "easy" (whatever that means) and saying "it's a simple business decision" doesn't explain it. There must be some advantage to slower large drives, or they wouldn't continue to sell them. Perhaps it's power consumption, cost, longevity, heat generation, etc., but there must be some physical reason why they are reluctant to use higher speeds on larger drives, if this is indeed the case, as the OP claims (and I assumed good faith, that the OP was telling the truth). You seem to be doing exactly what you accuse me of, commenting on something you know nothing about, since, from your vague answer, it's quite apparent you are not an engineer involved in the design of hard drives. StuRat (talk) 18:22, 26 July 2012 (UTC)
5400rpm is still the standard for laptop drives, I assume for power consumption. 7200rpm drives are available, but are usually part of the premium lines and cost significantly more. Although it isn't as convenient, you can always buy a computer with a small, slow drive and then upgrade it yourself to the one you want (after making the recovery disks). Sometimes the price increase for the upgrade is more than the cost of the disk, so you save money in the end as well. What I'm curious about now is if you get better performance out of a 5400rpm 1TB disk than a 7200rpm 160GB disk because of the higher data density. (talk) 12:55, 26 July 2012 (UTC)
Also, the fact that Best Buy employees know little about technical specs should be pretty obvious. They are the bottom of the barrel when it comes to technically-savvy people. They know enough to fool people who don't know much ("No, you really do need this whiz bang feature, even though all you do is check e-mail") but they aren't any kind of barometer for informed people. You should not discuss serious technical decisions with them, unless you are just looking to spend money pointlessly. They aren't paid much (even their repair technicians are paid less than $20 an hour) — take pity on them. --Mr.98 (talk) 14:29, 26 July 2012 (UTC)
It's probably due to the fact that the average consumer doesn't need a fast spinning hard drive for their data. I'd imagine that viewing photos and watching videos is a less concentrated and possibly less intense use of a hard drive than intends out of theirs. I'd also imagine that 7200 RPM hard drives are more expensive to manufacture than 5400 RPM ones/cost more to run/possibly wear out sooner, though again speculation.
As for the question on a 5400rpm 1TB disk or a 7200rpm 160GB disk: there is a method out known as stroking that can answer this. By only using the faster, outer parts of the disk, a fast partition can be created. This article provides a much better explanation of the idea, and this blog entry goes into some calculations. Sazea (talk) 18:25, 26 July 2012 (UTC)
Half the answers here are ridiculous. The lower 5400 rpm drives are cheaper. You're probably looking at "mainstream" laptops. If you buy the cheapest "gaming" laptop, it'll come with a 7200 rpm, but the price for those laptops are a couple hundred higher. Why would they offer SSDs? A 640GB SSD will likely more than double the cost of the laptop, in today's prices. A consumer would pay maybe $80 for a 640GB 5400 rpm 2.5" hdd, or about $650 for a 640GB SSD. Why would they offer it, and who would buy it? Furthermore, I don't know where the OP got the notion that a 500GB 5400rpm drive is ok, but not for a 640GB drive. Size doesn't determine much. And there are 5400rpm 2.5" drives that are faster than many 7200rpm drives, so that point is moot too. If you actually know you need something faster, then yes, you should do it yourself. Edit: And yes, power does come into play. Most casual users care more about getting 2 hours more battery life, than 2 seconds faster load time when booting into Windows. --Wirbelwindヴィルヴェルヴィント (talk) 23:04, 26 July 2012 (UTC)
Well as you said, the question starts of with the ridiculous assertation that 'What gives? Why aren't manufacturers realizing that hard drives with that much space cannot function properly with only 5400rpm! It's slow as hell!' so perhaps the answers aren't that surprising. In reality while 5400RPM drives can be a fair amount slower depending on what you're doing [2], they are far from unusuable and as you mentioned issues like platter density may mean they are faster in some cases. (Concentrating on one spec and saying something must be slower because of it is usually a good way to be wrong.) And as you also said the power consumption and cost advantage is likely to be more important for the majority of consumers, so it isn't surprising they are the majority of drives. I mean even desktop (3.5") drives briefly re-turned to slower drives being the mainstream for power, noise and cost reasons. (With the duopoly that now exists, WD are still doing the green ones but Seagate abandonded it.) Nil Einne (talk) 23:23, 26 July 2012 (UTC)
I'm the OP here, sorry for my late reply to this discussion. I plan on editing and storing videos and photos, so speed is pretty important to me. I'm just wondering which would be more economical: buying a 1TB computer with 5400rpm capacity then adding an SDD or buy a 500GB computer with 5400rpm and buy external hard drives for extra storage? If I plan on partitioning the hard drive, would 1TB be the better choice? (talk) 01:20, 27 July 2012 (UTC)
Are you getting a laptop or a desktop? It's more economical to buy a 500GB computer with a 5400rpm and buying external hard drives... but it'd be faster with an SSD. --Wirbelwindヴィルヴェルヴィント (talk) 03:15, 27 July 2012 (UTC)
I'm getting a laptop. (talk) 03:51, 27 July 2012 (UTC)
Have you considered the feasibility of your first proposal? As far as I know, most laptops only have one 2.5" bay. While a SSD doesn't have to be in that form factor, I don't believe they're generally small enough and most laptops are well packed enough that it's likely not easy if possible to fit an SSD in unless your laptop has an optical drive bay (used that you plan to remove the optical drive from or unused) [3] or is otherwise designed for an SSD in addition to a HDD. If the HDD is particularly thin perhaps you could fit a thin SSD under or on top of it but this is unlikely with a 1TB drive. So unless you're limiting your search for laptops which can somehow fit an SSD in addition to your HDD you may be in for a surprise. You can of course remove the HDD, but I don't get why you'd bother geting a laptop with a 1TB drive unless you plan to keep it in the laptop or have some other use from it and it's really cheaper. You can use an SSD externally but this seems a bit naff with the laptop and in many cases will probably not gain the expected advantages. Nil Einne (talk) 08:09, 27 July 2012 (UTC)
You want your fast drive to be the internal one. External drives will be limited by USB transfer rates, unless you are getting USB3.0 hardware. I'm not sure what sort of premium you pay for that, I haven't priced anything recently with USB 3.0 in mind. A fast internal drive will let you do everything you want at the highest rate, then back it up to the slower disk when you don't need the performance. It also means you won't have to lug around an external drive with your laptop - your important work will be on the internal drive. Some laptops have two internal disk bays, but you're more likely to find one with a regular disk bay and an mSATA slot you can use for an SSD. The people at Best Buy almost certainly won't be reliable to ask about the availability of an mSATA slot. (talk) 15:05, 27 July 2012 (UTC)
Original poster, I hope you realize that, as data densities increase, transfer rates increase also at any given rotation rate, so a 5400 rpm drive with a higher density platter can easily be faster than a 7200 rpm drive with a lower density platter. At any given time there are drives with a fairly large range of platter densities on the market. Also, a physically larger drive (3.5" vs 2.5") will be faster at a given bit density and rotation rate, because the bit rate at the outer edge of the platter (where the first data is recorded on a newly formatted drive) will be faster. Also, all else being equal, a 7200 rpm drive is only 33% faster than a 5400 rpm drive in sustained transfer, whereas two lower-capacity 5400 rpm drives in a RAID 0 configuration is 100% faster and may be no more expensive. Basically, you are looking at the wrong number. You should look instead at sustained read and write rates, either from independent review sites or the manufacturer's own specs (but ignore the burst transfer rate, which is meaningless). And if you really care about the highest possible transfer rates, you need to use RAID. There's no point even considering a non-RAID solution. -- BenRG (talk) 21:04, 27 July 2012 (UTC)

How are strings stored?[edit]

Also, what does exactly the % does in cmd?

I'm curious about how strings are stored in c, apparently in windows the %d, displays the numeric value of a variable, and doesn't really care about it's type, which it's very useful when studying types...

Below I'm trying to print "Hello World!" as a number.

#include <stdio.h>
        printf("%d\n" ,"Hello World!");
//output: 4206634

When running in cmd the output is 4206634 for any string, why? When you work with singles characters it gives the ASCII value of a character, so why not with strings? How are they stored?

Also, %d, %f ,%c ,%s is windows only, why? what it is calling? thanks. (talk) 15:17, 26 July 2012 (UTC)

When you create that string "Hello World!", you're creating a const string in the const data segment (which different object formats call text or cdata or rodata or something like that). In your case that's an anonymous string (it doesn't have a name in the symbol table). Let's create another const string, but this we'll also have a named variable pointing to it, foo:
#include <stdio.h>
const char* foo ="greetings";
int main(){
  printf("%x\n" ,"Hello World!");
  printf("address of const string: %p\n", foo);
Now foo (which is not a constant) points to "greetings", which is. I've changed your print to print in hex, and then I'm printing out what foo points to. You'll find the two are close to one another. So your code printf("%d\n" ,"Hello World!"); means "print the address at which the const char Hello World! is located"); that is, you're printing the value of the pointer (not what it points to).  %d, %f ,%c ,%s are not Windows only. -- Finlay McWalterTalk 15:34, 26 July 2012 (UTC)
Thanks!, but then, is there anyway to get the value of the pointer, and then get the value of the address, the pointer points to? Also, how do the os know when it is a pointer or it's the value itself? (talk) 16:17, 26 July 2012 (UTC)
int p = (int)&"Hello World!" or (slightly shorter and to my mind clearer) int p = (int)"Hello World!"
The OS has nothing to do with it; the compiler knows the type of things, and generates code appropriately. If you were to wilfully cast one thing to another (as you've implicitly cast a char* to an int with your code above) then you're telling the compiler to override what type it thinks something is, and use another. You'll get a warning with an implicit cast (the compiler saying "that looks wrong, I hope you know what you're doing") but when you explicitly cast, the compiler will let you get on with it, and reap the consequences if you're doing something wrong. -- Finlay McWalterTalk 16:30, 26 July 2012 (UTC)
Wow, It seems that a "string" is actually a pointer to an address, and all the addresses ahead until the \0 character... Thanks a lot. (talk) 18:06, 26 July 2012 (UTC)
Strictly speaking, no it isn't. It behaves like one though, when used as an rvalue. However, it only behaves like a pointer to the first address. It's the %s specifier in printf() (and other similar string handling mechanisms in C) that expand this to addresses ahead of it until the \0 character. printf("%c\n", *"Hello world!"); would print H instead of Hello world! because the %c specifier expects a single character, not a string. JIP | Talk 18:24, 26 July 2012 (UTC)
Note that all this is C-specific. In particular, both the fact that strings are represented as pointers to the first characters, and the fact that pointers and ints can be cast into each other, are particular to C and, to a degree, even the particular implementation. The example also is questionable style, and most modern compilers will warn if a pointer is provided as an argument to a %d. To print the value of a pointer portably, use %p. Unfortunately, while that will print a pointer value, its not specified how it is printed. --Stephan Schulz (talk) 12:39, 27 July 2012 (UTC)
So.. Strings in another computer languages are stored in a different way? How so? (talk) 13:40, 27 July 2012 (UTC)
It depends. See String (computer_science)#String_datatypes. Most common are zero-terminated (the C method) or some variant of length+array, although others exist. Length+array has some advantages (fast concatenation, zero can be in the string) and some disadvantages (somewhat more complex algorithms for some things). --Stephan Schulz (talk) 13:53, 27 July 2012 (UTC)

Programming (computer) languages[edit]

I am unable to understand programming languages in computer. I know that I can read Wikipedia article on Programming language, even after reading I could not understand generation of languages. I want to know features of languages and differences between Machine language, Assembly language, High level language, and 4GL. 16:31, 26 July 2012 (UTC) — Preceding unsigned comment added by (talk)

That article, and the related articles of those subjects, is very good. It seems you just want someone to do your homework. (talk) 18:06, 26 July 2012 (UTC)
While that article may be comprehensive, perhaps you will find the Simple English version easier to understand. Alternatively, perhaps the Computer programming article is a better place to start, since it explains about the "...process of designing, writing, testing, debugging, and maintaining the source code..." rather then trying to take an abstract view of a very large topic.
Another approach may be to take a look at one programming language and get at least a basic understanding of how it instructs the computer what to do. Once you have this as a reference point, you can then expand your knowledge to other programming languages. In some ways that approcach is a bit like learning a foreign language, by making specific links between terms in your mother tongue and the foreign language - it is easier trying to learn one language at a time than learn all of them at the same time. Astronaut (talk) 18:37, 26 July 2012 (UTC)
The 4GL article isn't very good, actually.  Card Zero  (talk) 18:56, 26 July 2012 (UTC)

I don't want to learn programming. I, only, want to learn what programming and generation of languages is. Sunny Singh (DAV) (talk) 18:55, 26 July 2012 (UTC)

I give you: Machine code, Assembly language, Low-level programming language, and High-level programming language. They should get you most of the way there. Fourth-generation programming language is a bit 1990s, nowadays. I'd head more in the direction of Software framework. --Tagishsimon (talk) 19:03, 26 July 2012 (UTC)

But still after reading these articles, I don't have clear concept about computer languages. Tell me simple difference between Machine language, Assembly language, High level language, and 4GL in this section so that I have a clear concept. Please, bear me. Sunny Singh (DAV) (talk) 14:34, 27 July 2012 (UTC)

Machine code is the actual bytes that the CPU executes. Assembly language is (more or less) a human-readable version of those bytes. High-level programming languages hide the details of what the computer is doing, with the amount of hiding varying depending on how high-level the language is (eg. Perl hides far more detail than C does). 4GL refers to a particular set of high-level languages. --Carnildo (talk) 01:06, 28 July 2012 (UTC)

Getting Windows 7 working on a new computer[edit]

It's been 8 days since I built a new computer. Every install of Windows has either refused to install, not worked, or bluescreened constantly. I'd suspect a hardware issue, except Ubuntu 12.04 is installed on there and runs fine, no issues at all that I've noticed. I've run checks on the temperatures (through BIOS and using SpeedFan) and some of the hardware, including the RAM (through using some software a friend installed, I've no idea what it was, though). Here's the story as a whole:

A friend of mine built a computer for me, with my assistance. The parts are on

  • Case: 47777
  • Power Supply: 47037
  • CPU: 41578
  • Motherboard: 47109
  • RAM: 41882
  • HDD: 43780
  • Optical Drive: 49545
  • Graphics card: Nvidia GT430 1GB - I didn't get this from Aria, I harvested it from my old computer.

All operating systems are 64-bit.

  1. Try to install Windows 7 from friends' USB drive - "files corrupt or missing"
  2. Install Ubuntu 12.04 from disc - Works, albeit with extremely unstable Internet connection
  3. Install Windows 7 from disc (burned on Ubuntu) - Installs, but I can only get to the desktop and then when I try to access anything, it says I don't have permission
  4. Install Windows 7 from a second disc (burned on a friend's computer) - Installs, but bluescreens everywhere
    1. Find software online to test my hardware. Test RAM and CPU, seems fine
    2. Use the BIOS screens and SpeedFan to check temperatures - all fine (nothing above 45 degrees C)
    3. Play video games to stress the system - doesn't seem to cause a crash. After my longest period without a bluescreen (3.5 hours) the computer eventually gives up while on Skype
  5. We notice that crashes happen most often while using the internet connection. We Google for solutions and decide to...
    1. Unplug a Belkin wifi dongle which has been known to cause bluescreens in 64-bit Windows
    2. Remove graphics card (use onboard graphics instead)
    3. Reinstall Windows 7 from disc 2 - Lasts longer, but eventually, still bluescreens
  6. Install Ubuntu 12.04 (dual-booting, disc burned using a different computer) - works fine using a wired connection (This is the first time so far we've had a fully functional OS on this computer)
  7. Try to reinstall Windows 7 from a third disc (Burned on Ubuntu using better software than last time) - "files corrupt or missing"
  8. Try to reinstall Windows 7 from a fourth disc (Obtained from parts unknown) - "files corrupt or missing"

At this point I have no idea where to turn. It seems like it can't be a hardware issue because Ubuntu works fine, but it seems like it can't be a software issue because five different Windows installs have all failed...

Any suggestions would be appreciated. I'm thoroughly stumped. My next few steps are likely to consists of removing the RAM from the computer I'm using now and putting it in the new computer to see if it works, installing Windows XP instead of Windows 7, and an exorcism. (talk) 18:34, 26 July 2012 (UTC)

You might have some hardware issues, but I think it is more likely is problems with the hardware drivers. So where did you get all these versions of Windows 7? If you burned you own disks from some dodgy download that was incomplete, didn't have the drivers, and/or came infested with malware, then I'm not surprised you are having all kinds of problems. Astronaut (talk) 18:44, 26 July 2012 (UTC)
The first 7 was from the friend that built the computer. The second 7 was a pirate copy I downloaded. The third 7 was a pirate copy a different friend downloaded (that works on his own computers at home - though he only tested 32 bit). The fourth copy was an official Microsoft download (not pirate - I would never have used pirate copies if I'd realised I could have done this from the start). The fifth copy was obtained, as I mentioned, from parts unknown. To be clear, I'm only downloading pirate copies for ease because I thought it was the only way - I have a legit and legal activation key, I just didn't have Windows. (talk) 18:50, 26 July 2012 (UTC)
Oooh, I've just remembered. At some point towards the end, I attempted to update the BIOS. But the BIOS did not recognise the file I downloaded. (talk) 19:02, 26 July 2012 (UTC)
Did you ever try a different reader (preferably with a different data cable)? Did you at least verify all the burnt images verify to the original ISO after burning, preferably on the target reader? If not, I would't rule out a problems with the reader or the discs used. If I understand you correctly, you did try one USB hard drive or memory stick, the issue here is you only tried once and getting bootable images put on USB disks to work properly can sometimes be tricky (although the problem is more commonly with booting although I believe I had a similar issue with Windows install giving a funny error once when using something I put on USB). If you are going to put the content on a USB disk, I'd recommend you start with the Microsoft tool first. Also what checks were run on the RAM? I'd memtest86 2 complete passes at a minimum and perhaps more before coming to any conclusion about the possibily of RAM causing errors. Put did you use memtest 86at all? Memtest isn't generally installed but you said your friend installed some software. Memtest86 and memtest86+ are the gold standards for memory testing on an consumer PC, I wouldn't trust anything running in more complicated OS given the access issues. Similarly what did you use for CPU testing? I may be somewhat out of date here but probably somnething like [[superPI], prime95 or OCCT or perhaps more then one or at least with different options and four an hour or two each. (As with memtesting, when it comes to the CPU you want something which verifies the result is as it should be not simply tries to cause crashes.) Note that while it's likely something so consistently causing errors would happen fast, it can be complicated since doing certain things can cause crashes far faster then other things and it's not always consistent what causes a crash (meaning doing a certain thing with the memory or CPU may cause a crash fast in one computer but doing a different thing with the memory or CPU in another). This problem is particularly acute for memtesting. Nil Einne (talk) 23:05, 26 July 2012 (UTC)
Another thought, did you verify any of your downloads? If it's just an ISO image, it obviously can't self verify, so obtain a reliable hash of what you expect and confirm it by that. If you use torrents this shouldn't be necessary in terms of making sure you receive the exact content in the original torrent since the built in ECC is normally enough, but if you're getting from a questionable source, it would be wise to verify what you downloaded is what you expected to download if possible (and with MS stuff from MSDN it often is if the ISO is unmodified). If you use HTTP/FTP/whatever, verifying large downloads is always wise particularly for something as critical as the OS, don't rely on TCP error correction since there are still many things which can go wrong somehow (as many people including me have experienced). It's a bit strange that you would get errors multiple times with multiple downloads on different computers from different locations unless both you and your friend are using the same internet connection (or possibly the same buggy network drivers), but verification is still wise. Nil Einne (talk) 02:28, 27 July 2012 (UTC)
Thank you for the advice. We're pretty sure by now that the media used to install Windows aren't at fault; half of them have installed successfully on other computers. The DVD drive is possible, but installing from a flash drive (one verified to install fine on other computers) has also failed; I'll use Memtest to test the RAM, try out the CPU tests, and then go from there. (talk) 20:34, 27 July 2012 (UTC)

Excel Conditional Formating[edit]

Ok, let's say that I have hundreds of Excel documents. Across all the documents columns A, B, and C are the same. I want to create a new spreadsheet with the count of each of the different the possible combinations of text from columns A, B, and C. Is this possible and if so, how do I best go about doing it? Do I use conditional formatting, and if so, what, or do I use a macro? Thank you in advance. -- (talk) 22:21, 26 July 2012 (UTC)

Because you have hundreds of input files, a macro would likely be a more efficient approach. It can be done more laboriously by hand using simple formulii. Conditional formatting does not enter into it, and I worry about seeing it as an option in your question. Doing a count of the number of each unique combination is relatively easy once you've constructed a single list composed of the contents of the hundreds of files. --Tagishsimon (talk) 23:04, 26 July 2012 (UTC)
How do you best do this on a single list?-- (talk) 16:46, 30 July 2012 (UTC)