Jump to content

Wikipedia:Reference desk/Archives/Computing/2012 June 14

From Wikipedia, the free encyclopedia
Computing desk
< June 13 << May | June | Jul >> June 15 >
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 14

[edit]

Global and local variables in JavaScript

[edit]

Is an if block considered a function for the purposes of determining whether a variable declared with the var keyword is global or local? — Preceding unsigned comment added by 203.116.187.1 (talk) 01:59, 14 June 2012 (UTC)[reply]

While not an authoritative reference, this site indicates that the answer is no. -- Tom N (tcncv) talk/contrib 03:26, 14 June 2012 (UTC)[reply]

Are there time machines?

[edit]
No. :-) StuRat (talk) 02:34, 14 June 2012 (UTC)[reply]

Are technological devices intended to travel into the past (time machines) available now? 117.5.13.52 (talk) 02:35, 14 June 2012 (UTC)[reply]

What's your hurry? --Trovatore (talk) 02:55, 14 June 2012 (UTC)[reply]

not to anyones knowledge. but they may exist, secretly. 70.114.254.43 (talk) 01:02, 16 June 2012 (UTC)[reply]

Theoretically, you can't go back in time in your own time-line, as that causes temporal paradoxes (like preventing yourself from being born). And, even if there weren't paradoxes, presumably somebody with a time machine would have remade the world into their version of perfection, but our world doesn't seem perfect by any definition. However, you could possibly "go back in time" in a parallel time line. In the many worlds hypothesis, there may be an infinite number of universes just like ours, but offset in time, so you could just step into one of those. StuRat (talk) 19:28, 16 June 2012 (UTC)[reply]
Answer Deleted by Temporal Accord Edict 34.55.a, Stardate 196944.2
The following discussion has been closed. Please do not modify it.
μηδείς (talk) 20:07, 16 June 2012 (UTC)[reply]
Yes, they do exist. matt (talk) 12:18, 17 June 3452 (UTC)[reply]

If you are right I would love to be able to stop myself being born. (Don't ask why, it is too complicated)--85.211.222.224 (talk) 20:18, 18 June 2012 (UTC)[reply]

How long will a modern computer take to break an Enigma cipher?

[edit]

--113.105.70.226 (talk) 03:54, 14 June 2012 (UTC)[reply]

That depends on what you mean by "break." Do you intend to provide a program to perform the decryption, and measure how long it takes to try "all possible inputs"? Nimur (talk) 04:13, 14 June 2012 (UTC)[reply]
Let's say we have the settings of the scramblers and some ciphertext already and what we need to do is to determine the Key setting.--211.162.75.201 (talk) 08:14, 14 June 2012 (UTC)[reply]
This page suggests that a mostly brute-force search of the entire key-space for a 4-rotor enigma would take 4 days CPU time on 2006 hardware. In practice, guessing a crib would enormously reduce the search space. This 2005 paper by Geoff Sullivan and Frode Weierud seems to be frequently cited. Gandalf61 (talk) 09:09, 14 June 2012 (UTC)[reply]
If you have the programming skills and tools you can try it yourself. There are plenty Enigma simulators available online that you can use to generate an encrypted source text. Roger (talk) 09:31, 14 June 2012 (UTC)[reply]
There's a difference between "how long would it take to break" and "how long would it take to guarantee a break". While it's tiny, there's a chance that your first random guess would be correct and thus you'd break it immediately. Nyttend (talk) 11:06, 14 June 2012 (UTC)[reply]
"How long would it take" usually means the average time to break given a random key, and for brute-force attacks, is half the time needed to exhaust the keyspace. --Carnildo (talk) 01:47, 15 June 2012 (UTC)[reply]

Playing .swf file in Powerpoint (.pptx)

[edit]

I've inserted a .swf file into a .pptx presentation after going to much trouble. But now, everytime I play the slideshow, the video keeps getting stuck. If it plays properly once, it gets stuck on all the subsequent trials, because the "Play" parameter in teh .swf file's properties keeps getting reset to false. Is there any way I can fix this? Thanks 204.4.182.16 (talk) 05:36, 14 June 2012 (UTC)[reply]

Video to GIF in Ubuntu 11.10

[edit]

Can anyone suggest me any software which can covert video to gif? Ubuntu software centre software will be better! Please add a tb in my talk page if possible! --Tito Dutta 08:30, 14 June 2012 (UTC)[reply]

FWIW, we prefer to answer here so that others can see the answer. Asking for the answer to be reserved to your talk page is a little, how to say, selfish. --Tagishsimon (talk) 14:41, 14 June 2012 (UTC)[reply]
There are several ways to do it -- if you Google for "video to gif linux", the first four links each spell out a method. (Tagishsimon, the OP is only asking for a talkback notice, not an answer on the talk page.) Looie496 (talk) 17:03, 14 June 2012 (UTC)[reply]

ffmpeg foo.video bar.gif ¦ Reisio (talk) 02:54, 16 June 2012 (UTC)[reply]

IPv1, IPv2, IPv3, IPv5

[edit]

IPv1, IPv2, and IPv3 redirect to Internet Protocol, while IPv5 redirects to Internet Stream Protocol. Why is v5 different from the rest — was it simply an editorial decision, or is the protocol substantially different? And if the latter, in what ways? I notice the edit summary here, but the article text says nothing of that, unless I'm overlooking something. Nyttend (talk) 11:13, 14 June 2012 (UTC)[reply]

I suspect it's because IP protocoll number 5 is Internet Stream Protocol. See List of IP protocol numbers. But, with the exception that IPv4 has number 4, I don't think protocol number is the same as protocol version. Taemyr (talk) 11:47, 14 June 2012 (UTC)[reply]
I might be wrong. According to Internet Protocol IPv5 is Internet Stream Protocol, so the difference between IPv5 and IPv1-3 is that we have a seperate article for the former. Taemyr (talk) 11:49, 14 June 2012 (UTC)[reply]
As Taemyr says, Internet Protocol seems to explain this resonably well even if unsourced. Do you have reason to believe it's wrong? Nil Einne (talk) 05:47, 15 June 2012 (UTC)[reply]
See also [1] [2] (one of the comments is interesting) and [3] all of which seem to partially confirm the details. Incidentally, I don't understand your comment on the edit summary. The article Internet Stream Protocol clearly says 'ST2 distinguishes its own packets with an Internet Protocol version number 5, although it was never known as IPv5' and since it hasn't been modified since June 9th, I presume it said that when you read it. Nil Einne (talk) 06:05, 15 June 2012 (UTC)[reply]

Macbook Specs

[edit]

I am preparing to buy a computer, and I'm wanting to buy an Apple, for several reasons. I'm wondering what specs I need to max out on my Macbook, and which ones I can stand to not max out in order to save some cash. What I'll be using my computer for: spreadsheets, powerpoints, typing and saving papers, documents, watching movies/videos, lots of music storage, lots of music editing, and I do some on-the-side gaming such as League of Legends, Medeival Total War and the likes. I want my computer to be fast enough and with good enough graphics in order to run what I need. My biggest pet peeve is slow click-to-run ratio, or super lagging screen/graphics. Ziggums (talk) 13:56, 15 June 2012 (UTC)[reply]

If you're looking to customize a computer, a Macbook isn't the answer. The options are going to be basically how fast do you want the processor (as far as possible) and how much RAM do you want (quite a bit). Personally I've found you can usually buy RAM cheaper if you don't buy it through Apple. But other than that, I can't think of too many other work-arounds to shelling out a lot of cash. I can think of a few faster tweaks that would involve shelling out more cash (e.g. a solid state hard drive), but not too much you can hold back on. --Mr.98 (talk) 16:58, 14 June 2012 (UTC)[reply]
When you say buy RAM cheaper, are those the "kits" I've glanced at before for upgrading RAM? And if so, aren't there still intrinsic limitations to the computers RAM? Essentially I'm wondering if this- 2.4 GHz Quad-Core Intel Core i7 Processor

4 GB 1333MHz DDR3 SDRAM 750GB 5400rpm Hard Drive; 8x DVD/CD SuperDrive 15.4-Inch LED-backlit Display, 1440-by-900 Native Resolution; AMD Radeon HD 6770M with 1GB GDDR5

would be enough for my needs? And if I get one of those RAM kits for 8GB would that increase it to 12GB, or replace it with 8GB rather than 4GB? Feel free to explain any of these things as well. My knowledge is rudimentary and I'm not too confident in it. Ziggums (talk) 13:56, 15 June 2012 (UTC)[reply]

The latest Macbooks (the ones with the Retina display) have no user-upgradable parts. The RAM is soldered on, the battery is glued in place, and the SSD uses a non-standard form factor. --Carnildo (talk) 01:50, 15 June 2012 (UTC)[reply]
I'm avoiding the new Retina displays for that very reason, and because I don't think a visual upgrade is worth quite that much. I feel its much more practical to pay more for that type of display for something like the iPad. I just need to know a bit more about if those specs would satisfy my needs, and if I would need a RAM upgrade. Ziggums (talk) 13:56, 15 June 2012 (UTC)[reply]

In attempting to minimize my questions... 1) In comparison, for my needs would I need this computer, or this beefier version? 2) I've decided I'll upgrade my RAM regardless, I enjoy the idea of maxing out whatever computer I have. So which brand would be better to use? I find Corsair quite a bit on Amazon, but the price differences between it and other brands aren't significant 3) Would I be better purchasing this computer from a store (Best Buy, etc.), or from somewhere such as Amazon? I'm currently looking in to my College's programs for discounts and such.

Thanks in advance, I hope this clears up what I need to know! Ziggums (talk) 14:47, 15 June 2012 (UTC)[reply]

So far nothing you've mentioned seems to require an Apple computer. If you want one just because they're pretty there's no shame in that. All Apple computers are decent enough in their classes in terms of processing power, memory, and graphics power; but if it's money you want to save, you should seriously rethink buying an Apple at all, as they are consistently 2-3 more expensive than equivalent non-Apple hardware offerings. ¦ Reisio (talk) 02:59, 16 June 2012 (UTC)[reply]
Another thing that the OP should consider is whether he'll be booting into Windows as well: League of Legends dropped support for Macs a long time ago. He'd need to switch to Heroes of Newerth if he wanted a similar experience. Brammers (talk/c) 16:19, 18 June 2012 (UTC)[reply]

Average Number of Citations in Wikipedia Articles

[edit]

Hi, I can't seem to find data anywhere about the average number of citations found on Wikipedia pages. Any ideas about data or where to look? (Isn't on any of the wikipedia statistics pages)

Thanks! --Cucumbergelato (talk) 14:35, 14 June 2012 (UTC)[reply]

Previously, the Reference Desk Talk Page entertained the idea of statistically aggregating "number of references" per contributor. Here's (one of the numerous) discussions: from Reference Desk Talk Archive 80, circa January 2011. If I may reiterate my objections: "what about references that are not hyperlinks? (I often cite textbooks and academic papers from my library or personal collection, without always linking to any web resources). What about hyperlinks that are not references?" These issues present difficult technical obstacles to meaningful statistical aggregation of "citation count." Nimur (talk) 16:28, 14 June 2012 (UTC)[reply]
These are valid points for regarding that previous silliness, but the OP's question is quite different, and there is no technical challenge. 1) create list of all WP pages that have a "References" section. 2)store the number refs in each of these articles. 3) take the mean or plot a histogram. Checking random WP pages leads me to believe that it is typical to have non-hyper linked refs(e.g. to books, as you decribe) , and non-ref links (e.g. many internal WP links), but in general, it seems fair to assume that the numbered lists in the "References" section do indeed contain references that have been cited in the article. Sure, there are probably spurious refs and vandals specializing on the reference sections, but that should work itself out. Thus, it seems completely reasonable to say "The average number of references contained in WP article (among those that have a refs section) is X (as of a certain date)". SemanticMantis (talk) 18:07, 14 June 2012 (UTC)[reply]
(I should also note that I'm assuming the OP is more interested in number of references than the number of citations, despite what they wrote.)
There are still many problems. The list in the references section may not be numbered. The reference section in the source code may be nearly empty, containing only <references/>. A single source may appear several times with different pages cited. And so on. Jc3s5h (talk) 19:21, 14 June 2012 (UTC)[reply]

Sounds like what you're saying is that it's not at all a trivial question and that it's not so bad that I didn't find an answer elsewhere. You are indeed correct -- I am looking for the number of references rather than the number of citations. (I think I probably meant to say "number of sources cited" rather than "citations.") While it would be interesting to know just how many references are able to be visited via hyperlink, I'm guessing that's really the next step after determining the total (or average) number of references.

Until then, though, any estimates? I looked through 75 random articles and found them to average about 6.4 references, but this certainly isn't a large enough sample size, especially since one of them had 164 and many of them had none. What do you think the actual amount might be? (Or even, what feels right?)

Despite no numbers out yet, helpful nonetheless. --Cucumbergelato (talk) 20:31, 14 June 2012 (UTC)[reply]

I recently read a Ph.D. thesis that cited 194 references. I have seen Wikipedia articles with similar reference-counts, which seems preposterous: a Ph.D. thesis is the accumulation of several years of in-depth domain-specific work; whereas an encyclopedia article should present a more general review of a topic. It seems unlikely that a Wikipedia reader could actually follow up on more than two or three sources unless they invoke a considerable amount of time and effort. Too often, I've seen cherry-picked resources: a web-search-engine result contains a key phrase, and so the "reference" is considered valid. This is just silly! Referenced material should be read, not string-matched. In practice, to even glance at two hundred cited reference sources would take almost three hours, if each source requires even one minute to read.
As a reasonable comparison, the World Book Encyclopedia used to list its references and "additional reading" section only on the most important articles; for all other articles, the author or editorial team was listed in an appendix, and they were the reference. My 1967 edition even provided contact information so you could write a paper letter to an article's author seeking more source material and information. Wikipedia, being a community-created, web-based digital encyclopedia, has a very different content creation model, and our anonymous editing model necessarily requires a little more precision in attributing claims to sources; but even still, I think it's really unlikely that an article reader will follow up on five or ten references, read them all thoroughly, and then form an independent judgement about the article content.
So we arrive at a fundamental question of purpose: is a reference or citation meant to be used as a part of an arsenal in a "citation-needed" debate, or is it actually intended to help the reader understand the content and background? If it's the former, why even bother having a citation? And if it's the latter: a subject-matter expert ought to list three or four good texts, newspaper articles, or other reliable sources. Three thorough references of sufficient quality are worth more than two hundred useless attributions. This is why I don't really think a "statistical aggregation" of reference-count is useful: it caters to the lowest-common-denominator of attention-deficient readers who believe that a Google-hit implies reliability; and that ten google-hits imply ten times as much reliability. Nimur (talk) 15:43, 15 June 2012 (UTC)[reply]

Syllogism as the first address bar suggestion for en.wikipedia.org using Firefox: why?

[edit]

I was wondering why always when I start typing into my address bar en.wikiepdia.org using Firefox (after I have dumped all history and cookies), the first dropdown suggestion is always Wikipedia's article on syllogism, i.e., I type en. (that's as far as I get), and then the drop down menu provides as a first suggestion:

W Syllogism – Wikipedia, the free encyclopedia
  en.wikipedia.org/wiki/syllogism

My computer is pretty much scrubbed regularly (and my browser history and cookies are scrubbed constantly) so I can't imagine this would be so consistent (it's been this way for a long, long time) and come from something from my computer's settings – but I have no idea. Thanks in advance for any replies.--108.14.195.239 (talk) 16:13, 14 June 2012 (UTC)[reply]

When that happens to me, it usually transpires that I've accidentally bookmarked a page (with some ham fisted keymash that I didn't notice I'd done). Firefox's completion also completes on bookmarks, as well as history. 90.198.88.8 (talk) 20:07, 14 June 2012 (UTC)[reply]
Oh man, so ridiculously simple. Yes. It was in "unsorted bookmarks" – somehow (which don't display when you click on bookmarks). Thanks for clearing up the mystery of the century.--108.14.203.159 (talk) 22:27, 14 June 2012 (UTC)[reply]
A feature you can disable in its prefs, FYI. ¦ Reisio (talk) 03:01, 16 June 2012 (UTC)[reply]

Question about Linux security

[edit]

This might open up a can of worms, but I just felt I should ask it. I read on a Finnish Linux wiki site that Linux bootloaders offer a "single-user boot mode", where the user is dropped straight into a shell, run by root. The user now has full root privileges over the computer without ever having to type the root password. Doesn't this mean that anyone who has physical access to a Linux computer has full access to all data stored within it, even if he/she doesn't know anything about its configured usernames and passwords? Is this considered a security risk? JIP | Talk 19:19, 14 June 2012 (UTC)[reply]

That's how all computers work; if someone has physical access to the machine they have access to the data stored on it. And, just like on Windows and Macs, if someone uses disk encryption then the attacker can only see the cryptogram, not the plain data. It's no more, and no less, of a security risk than the same circumstance on Windows or Mac. 90.198.88.8 (talk) 20:01, 14 June 2012 (UTC)[reply]
For kiosk operation (where an attacker has access to the keyboard and mouse, and maybe a usb port, but can't open the case) one can configure the bootloader (and the BIOS) to require a password before allowing a boot from anything other than the internal disk. Again this is no different between Linux, BSD, MacOS, and Windows. 90.198.88.8 (talk) 20:05, 14 June 2012 (UTC)[reply]
Yes. But if you have encrypted your hard-drive you are safe, if you have not they could just pull the hard-drive out and plug it into a different computer. --80.112.182.54 (talk) 01:43, 15 June 2012 (UTC)[reply]
Also, there is a command called sulogin which can be used to provide a prompt requiring the root password at the start of single user mode. It's meant to be run from /etc/inittab. It's been around for a long time, long enough that I think of it as the standard/traditional way of handling single user mode. 98.226.12.79 (talk) 04:11, 15 June 2012 (UTC)[reply]
Some of the above comments mentioned encryption, I think I mentioned this before on the RD but if not, it's worth remembering encryption may not provide any protection if the attacker has regular unmonitored access to the computer. For example, if they decryption key solely consists of a password, all they have to do is install hardware to monitor keystrokes. This is more difficult on a laptop (presuming you only ever use the built in touchscreen, keyboard or pointing device) then a desktop but not impossible and there are always the other options mentioned at Keystroke logging. These may not be simple so are less likely for some adverseries (say a suspicious spouse) but of course if they have physical access, it's possible they can also install a camera or similar which may not be difficult. While some of these could be detected (e.g. many plugin loggers or a poorly hidden spycam) few people check and if the adversary isn't concerned about detection then you have little protection. If the decryption key relies on part in something stored in a removable USB key then again all they have to do is either steal or copy that. There's also the risk of someone just tampering with the bootloader, things like BitLocker Drive Encryption are supposed to make it more difficult by relying on the TPM to verify no one has tampered with the bootloader or hardware (but this doesn't protect against hardware keyloggers) and is also not foolproof [4]. BTW as our article on bitlocker mentions there is also the possibility of cold boot attacks relying on the fact RAM isn't instantly volatile. Of course all these complexities are pointless if you don't properly secure the computer against physical or networked attacks while it's running (and both the keys and data are exposed). This doesn't mean whole disk encryption is useless, it will probably be enough to discourage many adversaries, but it only really prevents data being compromised when the computer is randomly lost or stolen (presuming things like a cold boot attack or bruteforcing aren't possible). See also [5] [6] Nil Einne (talk) 05:40, 15 June 2012 (UTC)[reply]
for anyone with physical access to the the machine, it can be compromised in the following ways:
scope of access attack defence comment
non root user access through network or local terminal carry out privilege escalation exploits against OS /software and become root update software regularly. GNU/Linux is pretty decent in this regard, holes are few and get closed rapidly. BSD is even better. They stop the casual attacker and thwart practically all user level malware from touching the system or other users
access at boot time at the bootloader stage use the single user mode available by default or edit the kernel boot parameters to boot to a root terminal (fairly trivial) set a grub password unfortunately this isn't usually insisted upon by default making most linux systems vulnerable in their default install. However enabling it is a trivial step.
machine is bootable using CD/USB boot into an OS (any Live linux) that gives full accces to the disk, run cold boot attack software that can get the encryption keys from the RAM BIOS password this attack is again fairly easy to carry out against almost all machines as users fail to set BIOS passwords
unlimited physical access remove harddrive and plug it into another computer encrypt drive
unlimited physical access immediately following (abrupt) shut down manipulate hardware (chill and move RAM to another motherboad to carry out a cold boot attack and get encryption keys in RAM, use them on hard drive don't let the situation arise

Hope this helps. Staticd (talk) 12:11, 15 June 2012 (UTC)[reply]