Wikipedia:Reference desk/Archives/Computing/2012 September 20

From Wikipedia, the free encyclopedia
Computing desk
< September 19 << Aug | September | Oct >> September 21 >
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.


September 20[edit]

Will iOS 5.1.1 -> iOS 6 upgrade strip all my apps and make me manually reinstall them?[edit]

That's my question. Thanks. 67.163.109.173 (talk) 03:19, 20 September 2012 (UTC)[reply]

Nope. Just did it myself. Hot Stop (Edits) 03:22, 20 September 2012 (UTC)[reply]
Although when carrying out any major upgrade such as this, you should assume that 'bad things will happen'(TM) and that all your documents, files, pictures, apps and settings will disappear into the black hole of computing misery. Do a backup just in case so you can restore them if/when it happens. But as Hot Stop says, you should be fine. - Cucumber Mike (talk) 09:51, 20 September 2012 (UTC)[reply]

I just asked because this happened when I upgraded to 5, and apparently to many others on that upgrade, judging by the number of articles giving instructions on how to recover them, which I did then. 67.163.109.173 (talk) 12:27, 20 September 2012 (UTC)[reply]

Interesting. It didn't happen to me (it remembered everything -- safari history, passwords, etc.) when I just updated to iOS 6. But when I updated my blackberry OS a few years back, it wiped out everything. So I guess it wouldn't be bad to backup everything, especially since iTunes does it automatically. Hot Stop (Edits) 12:47, 20 September 2012 (UTC)[reply]
I have heard that the upgrade in question makes the Apple-made YouTube app, the one with the retro TV icon, disappear, and replaces the maps app that is powered by Google Maps with a maps app that is receiving a majority of reviews that calls it inferior to the one that will get replaced if this upgrade is done. (for instance, Berlin being in the middle of Antarctica) 20.137.18.53 (talk) 12:55, 21 September 2012 (UTC)[reply]
Upgrading iOS normally does not strip your apps. Unless you skip at least one generation of the software, all of your apps will remain after the upgrade. Write English in Cyrillic (talk) 16:29, 21 September 2012 (UTC)[reply]

Learning Java[edit]

Hi all. I am currently working my way through my first book on Java and feel like seeing more code would be beneficial. Are there any resources on the web that provide examples of working programs that I could look at, just to help me get a better feel for Java? Thanks. 213.123.215.234 (talk) 12:58, 20 September 2012 (UTC)[reply]

Sure, lots of sites, search the web for things like java examples and java tutorial. If you want to take a peek at real applications, there are e.g. Apache projects in Java and sourceforge. 88.112.47.131 (talk) 13:21, 20 September 2012 (UTC)[reply]

Variable within a python loop[edit]

When I write a loop, like:

for i in mylist:
...a += mylist[i]
...b *= mylist[i]
...print(a)
...print(b)

Do I always have to declare variables a and b beforehand? Or is there any more elegant form of doing that? OsmanRF34 (talk) 16:12, 20 September 2012 (UTC)[reply]

The accepted "pythonic" way of doing it is to declare the starting values of a and b beforehand, outside the loop. While you can have internal testing for the existance of a and b using try/except [1] [2], in no way would I classify it as "elegant". - By the way, if things like summing or multiplying a list of values is what you want to do, the more elegant way would likely be using something like list comprehensions [3] or various builtins like sum(), map(), reduce() and zip() functions [4]:
a_sum = sum(mylist)
b_prod = reduce(lambda x, y: x*y, mylist)
import operator
b_prod2 = reduce(operator.mul, mylist)
If you really need all the intermediate results, there are ways of doing it, but none really are more elegant than the loop with the starting values specified. -- 205.175.124.30 (talk) 18:35, 20 September 2012 (UTC)[reply]

Constructor Calls in Java[edit]

In my book on Java, it says "To call one constructor of a class from another of the same class, you can use the this keyword followed by parentheses containing the constructor arguments.". I am confused as to why you do not need to name the constructor you wish to call. Does this apply exclusively to overloaded constructors? Thanks. 213.123.215.234 (talk) 16:12, 20 September 2012 (UTC)[reply]

If you have a class Parent that has a constructor Parent(int n), in a subclass Child you can have a constructor that calls the Parent(int n) constructor. The syntax is simply "this(10);". You don't need to name the call because there is nothing to name - you can only call Parent's constructors from Child. I suppose they could have made the syntax "Parent(10);" instead of "this(10);" - but they didn't.
(By the way, if you want to discuss Java and ask about it, check out Oracle's Java forums. Lots of Java knowledge there. Now that Oracle owns Java, that's kind of the "official" forum.) 88.112.47.131 (talk) 16:55, 20 September 2012 (UTC)[reply]
Note also that the call to the overloaded constructor (in this case this(10);) must be the first thing you do in the constructor. If you do anything else before it, it will fail to compile. Don't ask me why, but that's the way the language is designed. JIP | Talk 17:44, 20 September 2012 (UTC)[reply]
So that it's safe to assume that you start with an completely uninitialies object when a constructor starts. Taemyr (talk) 13:28, 21 September 2012 (UTC)[reply]
No, it's not. The first code executed by any constructor (other than that for java.lang.Object, which is magic) must be to invoke one of its superclass' instance constructors. If you don't explicitly do this yourself with the super keyword, the compiler will automatically insert a call to the parent class' default constructor. (ref) -- Finlay McWalterTalk 14:32, 21 September 2012 (UTC)[reply]

Battery Voltage[edit]

I have an Asus Eee PC 1015PX netbook. The battery that came with it was a 3-cell 11.1V 2100mA battery. I bought a "genuine" Asus battery from a reputable dealer on eBay, it was a 6-cell 10.8V 4400mA battery. I tried it in my netbook and it seems to work fine, but is it a problem that the voltage is different? Thanks.Acceptable (talk) 18:42, 20 September 2012 (UTC)[reply]

A less than 3% voltage difference, and it works. The answer is a QED yes. IIRC battery voltages dip as they run out of spunk, and power regulators in consumer electronics handle this well (within limits). And you've got a whole lot more amp-hours. All looks good. --Tagishsimon (talk) 23:43, 20 September 2012 (UTC)[reply]

Powerpoint[edit]

I know very little about powerpoint - which I am using (ppt 2003 on XP) to generate some slides. I would like to make it so that the default text size is 20pt. It always inserts at 18pt. How do I change this please? -- SGBailey (talk) 22:16, 20 September 2012 (UTC)[reply]

View / Master / Slide Master ... set your format preferences, exit, done. --Tagishsimon (talk) 22:34, 20 September 2012 (UTC)[reply]
Thanks