Wikipedia:Reference desk/Archives/Computing/2014 April 17

= April 17 =

dies in its sleep?
I have an HP 2000 laptop running Windows 7 which fails to come up when it has been idle (on battery) for an hour or so. Sleep time is set to HP's recommendation, namely 30 minutes. The problem has persisted for a couple of weeks. Can I do anything about this? --Halcatalyst (talk) 00:15, 17 April 2014 (UTC)


 * This seems to be an infernal eternal problem. It boils down I think, to Microsoft always rushing out new buggy software, faster than the hardware manufactures (who have to work to very tight profit margins) can keep up. IBM on the other-hand hones their software to perfection and stick to what has proven to work faultlessly. This ball is really in Microsoft's court. I Don't have an HP but if you know what CPU it has, then have a go at downloading the CPU manufactures chipset drivers from their own website. It is probably caused buy a power management issue that HP hasn't had time to get up to speed on. --Aspro (talk) 01:45, 17 April 2014 (UTC)


 * I forgot to mention that this machine is 3 years old and that the problem is intermittent. Does that make a difference? --Halcatalyst (talk) 03:04, 17 April 2014 (UTC)


 * Gut feeling is, that this has nothing to do with the age of you machine, rather its down to the shoddy rushed out drivers. Unlike IBM that leases software, Microsoft sells software. Thus, they ship out new OS's before they are finished. As I suggested above, there are possibly better drivers now available from the component manufactures. This is not a concern to Microsoft anymore because they are focussed on getting people to cough up money to move on to Windows 8. --Aspro (talk) 22:22, 20 April 2014 (UTC)
 * I called HP for help and had an exasperating session with an agent I could barely understand. Among other things he had me remove and reinsert the battery. I did not believe that would solve the problem, and as a result the next day a "resolution specialist" called. He "temporarily closed" the ticket (I can call back on the issue.). Since then I've had two failures and a number of good wakings from sleep (or hibernation). One more and I call. --Halcatalyst (talk) 14:15, 21 April 2014 (UTC)

USB flash drive sizes -- powers of 2
I wonder why the capacities of USB flash memory drives ("memory sticks" or "thumb drives") and similar media seem to come in powers of 2? Currently, for instance, you can buy USB flash drives with typical capacities of 4 GB, 8 GB, 16 GB, 32 GB, 64 GB, 128 GB etc... Is there a real technical reason behind this, or is this just a marketing device? ("Our drive has the same price as that of our competitors, but stores twice as much!") For example, I've never seen such drives advertised with, say, 20 GB, 30 GB, 40 GB or any such round number... -- 79.237.95.83 (talk) 02:04, 17 April 2014 (UTC)
 * In principle, any sized array of memory storage could be built. There is no requirement to use binary for any of the physical storage processes.  In practice, powers of two lend themselves to optimizations in many respects, because binary is an incredibly compact representation that lends itself to very simple designs.  For example, have a look at Samsung Semiconductor's SSD White Paper.  A modern SSD is made of an array of memory cells.  Each cell has, at its core, a single-transistor circuit with a floating gate on which electrons are stored, taking advantage of the capacitance of the cell.  But that cell circuit isn't "one bit" - not in year 2014, at least!  A state-of-the-art NAND cell is multi-level: it is used to store an analog signal of arbitrary voltage.  A simple digital transistor circuit queries the charge on the cell and quantizes it into three bits... so at the cell-level, we've already got a "power of two," because a cascade comparator circuit is essentially structured like a binary tree.  You could choose to quantize to, say, five or six voltage levels... but you'd be under-utilizing the cascade circuit, which is designed to detect voltages right up to the noise-floor.  Each individual transistor is either "on" or "off," which definitionally makes it operate as close to the noise floor as possible.  So right at the analog-digital divide, the circuits are already storing information in quantities of power-of-two bits.  It would be inefficient use of real-estate to build a three-transistor cascade amplifier, but only use it to detect 5 analog levels; it can fundamentally distinguish 23 states.
 * At the next level up, each cell needs to be addressed. Addressing could be done in serial form, or in raster order.  Arbitrary numbers of scan-lines could be used; but efficient algorithms exist to randomly seek in a binary tree of size n using log(n) steps.  Because the analog designers want the fastest possible signal-path, they choose the most efficient digital structure.  So, in the digital domain, we use another power-of-two multiple of cells.  This also helps the circuit layout engineers, because binary trees lend themselves to very simplistic chip floorplans.  And, because modern semiconductors are highly optimized, engineers have already figured out that they can use bit-level parallelism; they can read two cells at the same time, if the cells are guaranteed to be on different address lines.  A smart architecture makes sure that every read- or write- access exercises as much of the whole circuit as possible, all at the same time.
 * Finally, at the software or controller level, the use of a power-of-two number of addresses means that the address value makes maximal use of all bits; it is more information-dense.
 * The actual SSD uses a little extra storage: in practice, it may use ten bits of storage for each eight-bits of data (for example). Some of those bits are used for error correction at the cell-level.  Some cells are used for block redundancy at the chip level.  Some reserved storage is built in to allow wear levelling.  High performance SSD controllers have extra storage for cache, prefetch, and virtual addressing.  Software and firmware may abstract the physical storage even further.  Layers above, the operating system and the file system may make some memory user-writeable, and reserve other portions of physical storage for file-system management and error-recovery.  The end-result is that a marketing advertisement for 216 bytes might only represent a product with half that much user-writeable storage.  Conversely, a system sold with 8 GB of storage (as seen by a user)  might actually require twice as many NAND chips on its circuit-board.  You've got to pay attention to the gorey details at each level of abstraction.  To add confusion, marketing-ese sometimes mis-uses the mebibyte/megabyte notation - doing double-conversions, converting in the wrong direction, and all kinds of other nonsense!
 * Nimur (talk) 02:56, 17 April 2014 (UTC)
 * Thanks -- that's a really comprehensive and exhaustive answer! I've never realised there's so much complicated stuff behind all this technology. (I mean I knew it was complicated, but I was not aware of all the gorey details.) -- 79.237.83.127 (talk) 03:40, 17 April 2014 (UTC)


 * In my experience 16 GB flash drives report a capacity of roughly 16,000,000,000 bytes, not 234 = 17,179,869,184 bytes. It does seem likely that they have a 234 byte flash chip on board (or two 233-byte chips or four 232-byte chips) and the 7% difference between the power-of-10 and power-of-2 capacity is used for wear leveling and other overhead. That would mean that in the jump from 512 MB to 1 GB capacities the fraction of the total capacity used for wear leveling jumped from 5% to 7%, and it will jump again to 9% when the drives reach 1 TB. It's hard to believe that the engineering choice of the optimal amount of overhead would be dictated by the arbitrary GB/GiB convention, but I suppose weirder things have happened in the name of marketing.
 * Non-power-of-two sizes such as 160GB (= 160 billion bytes) are fairly common for SSDs. I don't know why it's so much rarer to find USB flash drives in those sizes. Maybe because five 32GB chips wouldn't fit in the smaller form factor? I did find a 240GB USB flash drive. -- BenRG (talk) 03:49, 17 April 2014 (UTC)
 * Throwing out some numbers: Samsung's SSD paper I linked above claims "a few bytes per page" (4 kB) of overhead for ECC and overprovisioning. Exact values would be in the data sheets, which are apparently not available unless you contact a sales office.  Nimur (talk) 04:24, 17 April 2014 (UTC)

Cheap (free?) spreadsheet
I am looking for an idiot proof spreadsheet for AppleMac, has anyone suggestions please? "Numbers" is too complicated and unstable for me, "Libre Office" likewise. Help will be much appreciated please.85.211.202.48 (talk) 11:02, 17 April 2014 (UTC)
 * Google Docs is an online office program with a reasonably feature full spreadsheet. You access it through your web-browser and need to be online with a google account to us it. I've found it pretty straight forward to us.--Salix alba (talk): 11:35, 17 April 2014 (UTC)
 * I second that. I've used GDocs for years.  Dismas |(talk) 11:40, 17 April 2014 (UTC)
 * Microsoft has a free, stripped-down version of Excel through Onedrive. OldTimeNESter (talk) 12:15, 17 April 2014 (UTC)
 * Gnumeric maybe? I'd stay away from online spreadsheets because of security and privacy issues.   Note I'm pretty clueless about spreadsheets, yet for the simple ways I use them, LibreCalc has been working fine for me. 70.36.142.114 (talk) 17:19, 18 April 2014 (UTC)


 * Go Linux. Ubuntu has LibreOffice spreadsheet. It is excellent, it is free with a lot of support too. --AboutFace 22 (talk) 15:28, 22 April 2014 (UTC)

Handling Key Violations During Database Import
Can someone please point me to some good references for handling key violations that I discover when importing data? For example, sometimes I receive data from our vendors with duplicate primary keys. There are usually only a few duplicates, but I can't import the file until I do something about them. The data analysis we do is time-sensitive, so returning the file isn't an option. Thanks! OldTimeNESter (talk) 12:26, 17 April 2014 (UTC)


 * Some possibilities:


 * 1) If the key isn't inherently unique: For example, if they are using a customer name as a key, then some dupes might be expected ("John Smith" and such). In that case, creating a new column and adding that to the key might make sense, so you get "John Smith" "1" and "John Smith" "2", etc.)


 * 2) If the key really should be unique, like "customer ID number", then this indicates some type of problem in the data entry process, and more thought needs to go into how to resolve this. Do you reassign one to a new customer ID number or use the same method as above to mask the problem with the underlying data ?  As long as the data doesn't go back to the original users, it may not matter.


 * Also, you could just get rid of the key entirely. You could either use the secondary key, if it doesn't have dupes, or create your own key, or have no key at all.  If you only intend to use the table once and then throw it out, it doesn't make sense to spend too much time fixing it.  You could also just delete the rows with duplicate keys, if the number is small enough to not throw off your data analysis by much.  StuRat (talk) 13:22, 17 April 2014 (UTC)

Using Retro-Bit USB joystick adapter on Linux
I recently bought a Retro-Bit USB joystick adapter and a QuickJoy III SuperCharger joystick from eBay, so I could play my emulated Commodore 64 and Amiga games with a real joystick instead of the keyboard. I plugged the joystick to the adapter and the adapter to my computer's USB port, and FS-UAE recognised the joystick straight away. But when I tested it, only right, down, and one of the fire buttons worked. I couldn't move left or up at all. After some googling, I found that this is a common problem with Linux USB drivers. I found this page claiming to provide a solution, but how am I supposed to use it? Do I just download the Makefile and run  as root?

And furthermore, I also tried VICE, but it didn't recognise the joystick straight away. It provides several different options for "user port joystick adapter", but how do I know which of them to use? Or does VICE support USB joystick adapters at all? J I P &#124; Talk 18:07, 17 April 2014 (UTC)


 * For the hid-atari-retrobit thing, you'll first need to make sure you have the specific kernel headers package for your distribution installed from the repository (don't download the kernel from kernel.org). And you need make and gcc: on Debian/Ubuntu you'd install the package build-essential; for Fedora it seems to need to sudo yum install make automake gcc kernel-devel. You'd git clone the hid-atari-retrobit repository and run make in it, which makes a .ko kernel module (you do all this as an unprivileged user). Only the last line in his readme file (that does rmmod, insmod, and modprobe) should be done as root. -- Finlay McWalterᚠTalk 19:57, 17 April 2014 (UTC)
 * So  will install the kernel headers?  J I P  &#124; Talk 06:11, 18 April 2014 (UTC)

remote sessions - low resolution?
Today I was on tech support to Microsoft for over four hours, where they were controlling my computer. I noticed that often they would move the mouse along things to be read, which I could read easily. On their end, does it show a low-resolution version of my screen, and they have to move the mouse over it to enlarge it or see it in higher resolution? Bubba73 You talkin' to me? 19:01, 17 April 2014 (UTC)


 * I do a lot of remote work. I have my remote tool set to adjust the resolution based on the connection speed. I have clients with a crappy connection and sometimes I have to either expand the screen so I can see the chunk I am interested in or use a magnifying tool- both are built into the remote tool. --  Gadget850talk 20:21, 17 April 2014 (UTC)


 * That is what I was wondering about and surmising. My connection is pretty fast.  I just tested it with DSLReports and I was getting 10 megabits per second down and 13 megabits per second up.  I use 1920x1080.  Bubba73 You talkin' to me? 23:49, 17 April 2014 (UTC)


 * Yes, and they might have the same sized screen, so, they can't show your full screen, at full size, and also see the things on their screen they need. It has a nice side-benefit for you, though, that you can follow what they are reading. StuRat (talk) 18:47, 18 April 2014 (UTC)