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

From Wikipedia, the free encyclopedia
Computing desk
< August 25 << Jul | August | Sep >> August 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.


August 26[edit]

Counter Strike Global Off.[edit]

I am having major lag spikes in the game Counter Strike Global Off., does anyone know how to fix the game (IT IS THE GAME NOT MY INTERNET). — Preceding unsigned comment added by 76.16.47.115 (talk) 02:57, 26 August 2012 (UTC)[reply]

Have you tried a reboot ? StuRat (talk) 04:43, 26 August 2012 (UTC)[reply]

Samsung Series 5 17.3 inch laptop[edit]

Anyone here have this particular model laptop? I need to know if I'm the only one experiencing problems with the touchpad not being sensitive enough so I can know whether to return & exchange it for another one of the same model or get a different one altogether. 70.52.79.25 (talk) 08:55, 26 August 2012 (UTC)[reply]

Fast output of plots in MATLAB[edit]

Hi,

Does anyone know of a quick way to save a MATLAB plot (to png) without actually having to call up a figure? I need to process a large number of frames (1000s) to make up an animation and at the moment I'm creating a figure and then using print(gcf,...) but this is pretty slow... Thanks, --Fir0002 11:26, 26 August 2012 (UTC)[reply]

Per the documentation, specify the figure property 'Visible', off. Also, consider re-using the same figure handle, when appropriate, instead of creating a new figure. You can update the figure contents without creating a new figure. Nimur (talk) 17:28, 26 August 2012 (UTC)[reply]
Thanks for that - I did try updating the figure contents each time, but MATLAB was complaining with:
Warning: Color Data is not set for Interpolated shading
> In C:\Program Files\MATLAB\R2009b\toolbox\matlab\graphics\hardcopy.p>hardcopy at 21
In graphics\private\render at 143
In print at 277
In shifting_fft_plots at 102
In shifting_psdd_full_field at 94
(each frame is a pcolor plot and I want the shading set to interpolated -> and if I set shading to interp outside the loop it doesn't carry through...)
It works despite the warning so I think I'll just ignore it ;) --Fir0002 06:02, 27 August 2012 (UTC)[reply]
That warning means you did not specify color data for the patch using the FaceVertexCData property. Default colors are being used. Nimur (talk) 18:14, 27 August 2012 (UTC)[reply]
Hmm it actually doesn't seem to be that efficient a method at all over the long term as it get slower each iteration - over the first 50 iterations time linearly increased from ~0.5 seconds to ~1.3 seconds. Compare this with calling up a figure each time the times remain at around 0.7 seconds... --Fir0002 02:43, 30 August 2012 (UTC)[reply]
So yes, it seems that the best method is to call up a figure each time but with the visible off figure property (each iteration is ~0.55s) --Fir0002 09:19, 30 August 2012 (UTC)[reply]

Location based reminders in Android[edit]

I need to accept a location from the user, compare it with the current location (using GPS) and give an alarm to the user if it matches. I'm new to android, but I do know that I need to use LocationManager and AlarmServices. Can someone please give me an outline of how to go about it and especially how to integrate alarms into GPS. I'll be most grateful for any help provided. Thank you very much. :) Zebec 15:26, 26 August 2012 (UTC)[reply]

As I understand it, you can do this with just the LocationManager's addProximityAlert call, to which you provide the coordinates of interest and a necessary fudge radius, and it calls you back when the phone is near that place. A simple example of someone writing what you're looking for is here. I don't see why, just to do that, you'd need AlarmManager as well - LocationManager already polls the GPS for you. Note that AlarmManager isn't for user notifications (it's a poor name choice - it should be called ScheduledCallbackManager or something). Notifying the user something has happened is done with Alerts, Toasts, and Notifications (tutorial). -- Finlay McWalterTalk 15:58, 26 August 2012 (UTC)[reply]
This sounds like something you could use Tasker for. - Cucumber Mike (talk) 19:13, 26 August 2012 (UTC)[reply]

Does Playbook's security swipe really work?[edit]

Dear Wikipedians:

I have just performed a security swipe on my Playbook using its "security swipe" feature under the security section of its settings pages. However, the length of time between when I tapped "security wipe" button and when I got the new splash screen asking me to set up my "new" playbook is such that I do not believe my playbook has had the time to go through all the bytes in its 16 GB of permanent memory and reset each one of them to 0x00. I am wondering if any of you could help enlighten me to the true nature of Playbook's security wipe, whether it really does its job, and what else I can do to make sure all my data on my Playbook is fully erased and could not be recovered, even with forensic computer data retrieval expertise, in case Playbook's in-built security wipe does not do the full job.

Thanks a million,

76.68.41.45 (talk) 15:41, 26 August 2012 (UTC)[reply]

If I understand you correctly, you have a BlackBerry PlayBook tablet with 16Gb of on-board NAND flash memory, and you're using the security wipe feature to erase the portion of that which stores user files and data (that also stores the Blackberry OS and built-in applications). One thing to note about flash memory is that it isn't erased by writing bytes to it (it's not like a hard disk) - the memory is organised into larger blocks, which are erased by issuing a block-erase command (which simultaneously wipes all the bytes in that block). To know how long that will take, and to know whether the specific flash part found in the Playbook can concurrently erase blocks, we'd need to figure out what flash part it has, so I can read the datasheet. If anyone can find a good high-res image of a deconstructed Playbook, so we can read the part numbers, that would help a lot. -- Finlay McWalterTalk 16:16, 26 August 2012 (UTC)[reply]
Hmm, I'm quite encouraged. The part is a Sandisk SDIN 5C2-16G device. I found the product information sheet for that here. Talking about the "secure erase" command, the datasheet says "This new command meets high security application requirements (e,g, those used by military and government customers) that once data has been erased, it can no longer be retrieved from the device." As RIM sells a lot into US Government circles, I think they and SanDisk really will be standing behind that claim. But I can't find a programming/timing manual for that part, which would tell me how long the erase should take. Preliminarily, it sounds like they do take properly secure erasure seriously. -- Finlay McWalterTalk 16:29, 26 August 2012 (UTC)[reply]
That sheet does say the erasure is done in "erase groups", and has a place where the size of a group is specified (up to multiples of 8 GB, it seems). I still can't find a real timing diagram, but that too suggests the erasure would be done in one or a handful of operations (depending on how they lay out their use of the flash memory), which you would expect to be a second or two. But an important caveat: this shows Blackberry can do this; it doesn't show they do, and there's little way to find out what they do (bar doing real forensics yourself). -- Finlay McWalterTalk 16:44, 26 August 2012 (UTC)[reply]

I read the question as "Playboy's security swipe" and wondered that there's now such a convenient feature available... JIP | Talk 18:16, 26 August 2012 (UTC)[reply]

Erasure of a filesystem of any size could be done in a split second, if the filesystem was encrypted and the system simply forgets the encryption key. I recall iOS doing such a thing when told to perform a secure wipe, but apparently the playbook doesn't encrypt its entire filesystem[1] Unilynx (talk) 19:20, 26 August 2012 (UTC)[reply]

Question about mounting hard disks on Fedora 17[edit]

After I had upgraded to Fedora 17, I found that when I first booted it up, everything worked, but when I shut the computer down and booted it up again, Fedora went to emergency mode before I could even log in, asking me for the root password, and when I gave it, dropped me to a text-only shell. In panic that I had broken the system, I reinstalled Fedora 17 and everything worked, but after I rebooted, the same problem appeared again.

I decided to google "Fedora emergency mode" and found the cause of the problem. I have additional Lacie external hard drives that I use for back-up, but I keep them powered down when they're not in use. I have written entries for them in /etc/fstab so that I can manually mount and unmount them with a single command. Now what was happening was that on boot-up, Fedora found these entries in /etc/fstab and tried to mount them, but failed because the disks were powered off. This caused Fedora to think "Oh no! Mounting file systems has failed! Let's stop right here and inform the user that something has gone horribly wrong!", which I took as a corrupted system.

Is there any way to write the entries to /etc/fstab telling the computer that the drives should not be mounted on boot-up, they'll be mounted when I say so? JIP | Talk 18:29, 26 August 2012 (UTC)[reply]

Stop reinstalling. :p ¦ Reisio (talk) 20:11, 26 August 2012 (UTC)[reply]
Use the noauto option in fstab (see man fstab). Make sure to mount by UUID and not by device, as rearranging your usb devices (or just plugging in a little flash drive) can cause Linux to assign disks to different devices, messing up your mount scheme. -- Finlay McWalterTalk 18:44, 26 August 2012 (UTC)[reply]
Thanks, that worked. I wrote the same entries into /etc/fstab but this time with the option noauto, and the system was able to boot up normally. JIP | Talk 19:16, 26 August 2012 (UTC)[reply]
I can't speak for Fedora, but on Ubuntu I don't use fstab to mount usb disks. Instead I let udev and Nautilus automatically mount them (as described here). That way they end up at /media/<partitionlabel>, where <partitionlabel> can be set (if you're smart, uniquely) as described here. -- Finlay McWalterTalk 19:08, 26 August 2012 (UTC)[reply]

Move from hotmail to Outlook[edit]

What is the end game plan for @live.co.uk email accounts now that Outlook is being rolled out to replace Hotmail? Will they still exists or will they be migrated to Outlook or what? Thanks. 92.6.144.109 (talk) 18:58, 26 August 2012 (UTC)[reply]

Your email address stays the same (still @live or @hotmail or whatever) and you still log in the same way you did before, with the same password. The only difference is the site you end up at is branded Outlook and has the Outlook interface. So it's a pretty seamless transition, really. -- Finlay McWalterTalk 19:04, 26 August 2012 (UTC)[reply]

Transfer entire Linux system to a new hard drive?[edit]

I just bought a new 2 terabyte hard drive, which I'd like to transfer my entire existing Fedora 17 Linux system to. The current system is on two physical drives with a total of 4 partitions (plus a swap partition), about 800 gigabytes in total. This is becoming too small for me. How can I transfer my entire Linux system to the new hard drive? I could just plug it in, partition it with GPartEd and format all the partitions, and copy all the files across, but how do I get the disk labels right in /etc/fstab on the new disk, and how do I create a bootloader? Would it be easier to simply do a full install of Fedora 17 on the new drive, and then copy all my old files across, either from the original drives or the back-ups I've been creating on my external Lacie hard disks? Can I just back-up the entire root (/) partition to the Lacie drive and restore it to the new disk, but with keeping /etc/fstab intact? It's the exact same version of the operating system, so that shouldn't pose a problem. JIP | Talk 19:58, 26 August 2012 (UTC)[reply]

Taking a simpler case, say I had a single drive /dev/sda (from which my system booted) and I bought a bigger drive to which I wanted to copy everything, and boot from that. Say I plugged it in and it became /dev/sdb. I'd boot from a livecd, then I'd
 sudo dd if=/dev/sda of=/dev/sdb
Be very sure of the ordering: if is the input, of is the output; if you get it wrong, you copy blankness over your good disk - there's no going back from that. That'll grind for a few hours, and at the end of it the start of /dev/sdb will be a bit-for-bit copy of the old disk. Once that's done you can remove the old disk, and the big new one will become the new sda. The system should then boot identically from that, as if it was the old disk. Then I'd boot to a livecd again and use gparted to resize the partitions to take up the space. -- Finlay McWalterTalk 20:08, 26 August 2012 (UTC)[reply]
I'm aware of what dd does, but I don't think this will help me, because my old system consists of two physical drives. These appear on Linux as /dev/sda and /dev/sdb. I don't think it's possible to use dd to transfer both of them to the same new drive. JIP | Talk 20:15, 26 August 2012 (UTC)[reply]
Weeelll: Once you've copied the first lot, use gparted to make two new partitions (of the appropriate size) on the 2TB disk. Then dd the contents of the old partitions (say /dev/sdc1, /dev/sdc2) to their counterparts on the 2TB disk (say /dev/sda4, /dev/sda5). I think that'll work, but I've not done anything like that for a while. If it doesn't, well, you should have rsynced :) -- Finlay McWalterTalk 20:25, 26 August 2012 (UTC)[reply]
If you do this, I think you'd need to change the UUIDs and partition labels of the newly created partitions to match the old ones, so the partition table is coherent. -- Finlay McWalterTalk 20:39, 26 August 2012 (UTC)[reply]
But you've got two disks, each with two partitions. You can certainly copy individual partitions to specific places using dd, but you need to use dd's offset parameter, and (while I have done it) I'd not recommend someone unfamiliar with dd and raw disk addressing do that (again because it's a sledgehammer). If the partitions on old_disk2 are just regular files (music, videos, etc.) I'd personally want to end up with just the existing (resized) partitions on the 2TB disk, and I'd copy (rsync) the regular files to ordinary folders there. But then I personally dislike partitioning more than is absolutely necessary, so others may advise you on keeping the partitions and copying them with something I'm ignorant of. -- Finlay McWalterTalk 20:15, 26 August 2012 (UTC)[reply]
What I usually do is use rsync -av /mnt/old/ /mnt/new/ (which can be resumed [by running the same command again] if interrupted) to copy the data from a liveOS. You can fix /etc/fstab with the information from blkid run as root (using UUID or LABEL values instead of /dev/foo is a good idea), and fix GRUB with grub-install /dev/sdX (where X is the 2TB device name letter). You might also want to reorder the drives (by cable connections) to have your 2TB be the first device before reinstalling GRUB, if you haven't already. If you were changing more than just the hard disk (migrating the system to an entirely different computer, for example), you might also need to alter your kernel/modules for proper driver support. ¦ Reisio (talk) 20:23, 26 August 2012 (UTC)[reply]

rsync --delete question[edit]

I've been using rsync to create back-ups of my system to my external Lacie hard disks. The man page tells me that rsync --delete will delete all files and directories on the destination that are not found on the source. But I found out that it only works for the top level of the source and destination directories. Any files and folders in subfolders of the destination that are not found in the respective subfolders of the source are left untouched. How can I make the --delete option work recursively? JIP | Talk 20:03, 26 August 2012 (UTC)[reply]

You'll need to tell us all the options you're passing to rsync. -- Finlay McWalterTalk 20:09, 26 August 2012 (UTC)[reply]
rsync -rv --delete . /lacie (where /lacie is the mount point of my external hard drive). JIP | Talk 20:15, 26 August 2012 (UTC)[reply]
For a backup I do rsync -av --delete which works fine, and certainly deletes files as I'd expect. -a implies a bunch of useful flags (copies perms, owner and group, etc.). You've not got FAT32 or NTFS on the Lacie, have you? -- Finlay McWalterTalk 20:29, 26 August 2012 (UTC)[reply]
rsync -av --delete seems to work fine. But after I have done it once, I want subsequent calls to skip files that are already present on the destination and haven't been changed on the source. Otherwise it is going to take me hours each time, with all my about one hundred thousand digital photographs stored on both my internal hard disk and the Lacie disks. And no, the Lacie disks are not FAT32 or NTFS, they're ext3. JIP | Talk 18:06, 27 August 2012 (UTC)[reply]
Yes, -a does that. It reads all the directories, stats all the files, compares timestamps, and does the obvious things. 69.228.170.132 (talk) 18:10, 27 August 2012 (UTC)[reply]

Java Book[edit]

I've just finished learning the beginnings of Java with "Java How to Program" by Deitel and Deitel. Can anyone suggest a suitable second book to advance my studies? Thanks. 92.6.144.109 (talk) 20:27, 26 August 2012 (UTC)[reply]

Effective Java by Joshua Bloch. -- Finlay McWalterTalk


Please refer JAVA 2:The Complete Reference By Herbert Schieldt published by McGrawhill.This is a wonderful book on Object Oriented Concept using Java 2. Also it teaches advance techniques in Java.

I don't know anything about this book, but Schildt's books have a terrible reputation in general. I would avoid anything with his name on it. -- BenRG (talk) 19:50, 31 August 2012 (UTC)[reply]

HTTP space between headers and body..[edit]

How do I know where the headers end and where the content begins if I'm parsing raw http? 190.158.212.204 (talk) 21:15, 26 August 2012 (UTC)[reply]

Formally, two consecutive <CR><LF> pairs. Informally, you might occasionally see clients that only send the <LF>s. -- Finlay McWalterTalk 22:29, 26 August 2012 (UTC)[reply]