Jump to content

Wikipedia:Reference desk/Computing: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Line 235: Line 235:


:You do know this is a difficult question. The costs are different depending on your circumstances. If you earn $130,000 a year the cost of pirated software is difference than if you are unemployed and earn $0 a year. If you are unemployed, the cost of pirate software is acceptable even if you get malwares because you literally have nothing for the malware owner to steal off you! [[Special:Contributions/175.45.116.66|175.45.116.66]] ([[User talk:175.45.116.66|talk]]) 04:58, 14 December 2015 (UTC)
:You do know this is a difficult question. The costs are different depending on your circumstances. If you earn $130,000 a year the cost of pirated software is difference than if you are unemployed and earn $0 a year. If you are unemployed, the cost of pirate software is acceptable even if you get malwares because you literally have nothing for the malware owner to steal off you! [[Special:Contributions/175.45.116.66|175.45.116.66]] ([[User talk:175.45.116.66|talk]]) 04:58, 14 December 2015 (UTC)

::The malware can steal your computer from you. Imagine that 99% of your computer's processor and 99% of your network bandwidth is used by malware to send out spam. You have effectively had your computer stolen. Now, you have no money (as you claim) and, if you are in this situation, no knowledge of how to remove the malware. So, you have two options: turn the computer off and never use it or turn it on and never be able to use it. [[Special:Contributions/209.149.113.52|209.149.113.52]] ([[User talk:209.149.113.52|talk]]) 20:28, 14 December 2015 (UTC)


:I don't know how independent the study has to be. But Microsoft sponsored a study, which was conducted independently, about the economical impact of software piracy. It was conducted by IDC and the National University of Singapore (NUS) and can be downloaded from [https://news.microsoft.com/download/presskits/dcu/docs/idc_031814.pdf]. --[[User:Denidi|Denidi]] ([[User talk:Denidi|talk]]) 13:54, 14 December 2015 (UTC)
:I don't know how independent the study has to be. But Microsoft sponsored a study, which was conducted independently, about the economical impact of software piracy. It was conducted by IDC and the National University of Singapore (NUS) and can be downloaded from [https://news.microsoft.com/download/presskits/dcu/docs/idc_031814.pdf]. --[[User:Denidi|Denidi]] ([[User talk:Denidi|talk]]) 13:54, 14 December 2015 (UTC)

Revision as of 20:28, 14 December 2015

Welcome to the computing section
of the Wikipedia reference desk.
Select a section:
Want a faster answer?

Main page: Help searching Wikipedia

   

How can I get my question answered?

  • Select the section of the desk that best fits the general topic of your question (see the navigation column to the right).
  • Post your question to only one section, providing a short header that gives the topic of your question.
  • Type '~~~~' (that is, four tilde characters) at the end – this signs and dates your contribution so we know who wrote what and when.
  • Don't post personal contact information – it will be removed. Any answers will be provided here.
  • Please be as specific as possible, and include all relevant context – the usefulness of answers may depend on the context.
  • Note:
    • We don't answer (and may remove) questions that require medical diagnosis or legal advice.
    • We don't answer requests for opinions, predictions or debate.
    • We don't do your homework for you, though we'll help you past the stuck point.
    • We don't conduct original research or provide a free source of ideas, but we'll help you find information you need.



How do I answer a question?

Main page: Wikipedia:Reference desk/Guidelines

  • The best answers address the question directly, and back up facts with wikilinks and links to sources. Do not edit others' comments and do not give any medical or legal advice.
See also:

December 9

android 5 standby low battery notifier

hey! Can you point me to the software for android that can notify you (beeping or by other sound means) when your battery plunges under a certain percentage level, there are a few on goole play, but none of those that I've tried do it while the phone is in sleep(standby) only when you are active...

thanks — Preceding unsigned comment added by 37.200.78.45 (talk) 05:27, 9 December 2015 (UTC)[reply]

Auto-copy the content of a sub-document into the master-document? (MS Office)

I have created an MS Word master-document that contains a piece of content imported from a sub-document, but I have a problem --- Each time I close and reopen the document the text no longer appear there and a blue link to the sub-document's path appears instead so to make it appear again I need to go to View > Outline, and there click "Expand subdocument". I need to do this manually each time anew.

Maybe there is a way to force coping the text from the sub-document or at least make it more permanent, so it won't be collapsed at all? It is extremely important for me for cases when I send this document to others --- I can't expect anyone receiving it to do these steps... It's madness... Ben-Yeudith (talk) 09:04, 9 December 2015 (UTC)[reply]

Is Google's D-Wave 2X Quantum Computer, as it is called, really a quantum computer with qubits inside?

131.131.64.210 (talk) 14:23, 9 December 2015 (UTC)[reply]

The D-Wave does have qubits. However, it is less a computer and more a specialized calculation device. In other words, it is not what we call a "general" computer or a "universal" computer. It handles quantum annealing problems. If you want to work on those, it will do it very quickly. If, instead, you want to calculate correlations between two columns of data, it won't help (unless you can turn that into an optimization problem). The goal is to make a quantum universal computer at sometime in the future. 209.149.113.52 (talk) 14:33, 9 December 2015 (UTC)[reply]
The topic of defining a "qubit" was also discussed on the reference desk in May 2014. I think you will find that "qubit" is so weakly defined that nearly anything can be called a qubit. For example, a violin string may either be silent or vibrating - it can exist in two states (a ground state and an excited state), approximating two energy levels of a non-ideal oscillator system. Because a violin string is pretty strongly resonant, the preferred oscillation frequencies are quantized. Because the individual strings can resonate and supply energy to each other, these four "qubits" can be called "coupled" and some equation can be written to describe how weakly or strongly they effect state-changes in each other. These facts satisfy the (unreferenced) definitions of a qubit as explained in our encyclopedia article. So: is a violin a 4-qubit system? What external circuitry would you need to attach to it in order to call it a "4-qubit computer"? How functional would that "external circuitry" remain if you then proceeded to remove the violin from the computing machine?
The trouble with D-Wave is that it is not obvious how much of the "computer" is inside their refrigerated physics experiment that they call the "quantum" part, and how much of the computation is actually performed by the conventional computer that is attached to that device. I would put forward that their "device" is more similar to a thermal noise generator - similar to the devices sometimes used to generate entropy for secure computing applications. As such, the device might be useful for some experiments - like simulated annealing or monte carlo method computer algorithms. However, I'm not convinced that it's particularly novel - certainly not worth its cost.
Nimur (talk) 16:26, 9 December 2015 (UTC)[reply]
A violin supercomputer definitely sounds like something out of a Douglas Adams novel :) 131.131.64.210 (talk) 17:13, 9 December 2015 (UTC) [reply]
D-Wave doesn't hide their technology. They are using niobium qubits. They make it very clear that it is not a general purpose computer. It is lacking logic gates. It only does optimization of multivariable equations. Further, it doesn't have error correction. They claim that because it works in low energy states, they don't need it. I don't think the issue is "Do they have qubits?" It is "How can we step from this specialized device to a general computing device?" 209.149.113.52 (talk) 17:15, 9 December 2015 (UTC)[reply]
Well, do their sales team ever have an answer for you! Your algorithm, written in MATLAB or Mathematica or Python or FORTRAN (... or just, whatever) simply runs through their software stack, which handles all the hard parts by way of a Quantum Meta Machine. This software - especially the MATLAB interface - definitely exists* - or at least is in a superposition of existing and non-existing. (*Under Development)... since 2009).
Here is their software architecture overview. When I watched their tutorial video on Map Coloring, I was intrigued at first... but after watching to the end, I can only conclude that this product is aimed at people who have an absurd misunderstanding of computer science.
For example, they describe the quantum annealing solution as an alternative to "random solution-guessing." This is a straw man fallacy! It is very true that randomly guessing solutions to the map coloring of the United States would be inefficient. But this is not how we design actual graph-coloring algorithms! If I wanted to write a for loop to iterate over a variable i from one to six... I would not roll a dice six times and hope that statistically I get an ordered sequence! If I did use this method, a quantum computer would beat my algorithm... in exactly the same way that D-Wave correctly found a "needle in haystack" solution. A "randomized" effort to generate a for-loop for i=1 to i=6 would have a one-in-46,656 chance of being right - which is statistically harder than finding a random four-color solution for the map of Canada by random-guesses! We could replace "i" with six qubits; construct, and then solve a constraint-equation so that the objective function is minimized only when bit bn is larger than bit bn-1; then program that into the D-Wave and let that solution anneal... this method would, in fact, yield better results than randomly guessing i six times in a row. But it's not better than a real, actual conventional for-loop.
The point here is that the quantum computer is "outperforming" an absurdly-designed, altogether implausible version of a "conventional" algorithm that we would never actually use.
And this is to say nothing of the conventional optimization algorithm that must be performed to set up the "qubit" connectivity. This optimization problem is a complex one - and it needs to be performed for each qubit, as described in D-Wave's marketing literature. This is the same logical fallacy that I described in 2013 when we discussed why a "spaghetti sort" is not actually, truthfully scalable. If you casually neglect every part of the computation that is difficult to scale, the algorithm sure does appear to be infinitely scalable in constant time! D-Wave even has to serialize its quantum operations - so, that makes its runtime O(n) - linear at best (and probably much much worse for large, complex, or densely-interconnected graphs)! This is exactly a refutation of the supposed benefits of quantum computing. The dream they've been selling is that "super-large" problems could be solved with magic massively-parallel qubit entanglement - except they forgot to emphasize the annoying part where you have to split the problem into n tiny sub-problems and iterate them sequentially. Video, at 10m50s. They leave that annoying part out of the sales pitch, but it snuck into the technical tutorials!
Have you noticed that D-Wave customers have been very reluctant to provide wall-clock times on any of their benchmarks?
I've seen my share of "weird" computers, and this one is way more snake-oil-y than most.
Nimur (talk) 03:55, 10 December 2015 (UTC)[reply]
Nimur, do you know anything about quantum computing? Why do you think you're qualified to talk about this? Most of the text in this thread is by you, but the only useful responses were by 209.149.113.52, who clearly does know what he/she is talking about.
When you say the runtime is linear at best, you seem to be confusing the size of the output with the size of the search space. If the solution is n bits long, there are 2n possible solutions, and a machine that could find the global optimum in O(n) time, or any low-degree polynomial in n, would revolutionize the world. So needing O(n) time to touch all qubits is not a problem.
The theory behind what they're trying to do is described in the article quantum annealing, which is actually pretty readable. It's similar to classical simulated annealing, but there are known problems for which it's asymptotically faster; in at least one case the speedup is quadratic (the same as the speedup of Grover's algorithm over classical brute-force search). Unfortunately, it's not known to be asymptotically faster than classical Monte Carlo simulation of quantum annealing. So this doesn't seem to be a case of a quantum computation offering an asymptotic speedup over the best known classical algorithm. At best it could be faster the way GPUs are faster than CPUs for some tasks. It's expensive now but so were GPUs at one time.
All of this is explained the the preprint that seems to have spawned the current media cycle. Scott Aaronson also has a blog post about it. -- BenRG (talk) 08:11, 10 December 2015 (UTC)[reply]
BenRG, it seems that you are directly questioning my "qualifications" as if you'd like to establish my credentials before I contribute to the encyclopedia. This is not how Wikipedia works. If I am wrong or mistaken, please correct me where I err. That standard applies, irrespective of my credentials or experience. I'm tempted to return the question tu quoque, except that I don't really judge your correctness by your academic degrees. I have met many well-credentialed people who were also wrong.
For example, you are wrong when you write "needing O(n) time to touch all qubits is not a problem." It seems that you failed to notice that for each qubit, an optimization problem must be computed: so that's not O(n) over n qubits - it's n iterations of an optimization problem. This is as-documented in the video tutorial I linked. This wrongness is independent of whether you are "qualified" to write on this topic.
By all means, buy yourself a D-Wave - rather, attach yourself to an organization that already has one - and experience the machine first-hand. I am very curious to see how you would respond after using one.
Nimur (talk) 14:59, 10 December 2015 (UTC)[reply]
The issue here is defining and measuring quantum speedup. So, we are currently in a semantic argument. The data doesn't change. Quantum annealing devices can be faster than conventional silicon devices in solving specific problems. However, if I throw more and more silicon at the problem, the silicon solution will eventually be faster than the quantum solution. 209.149.113.52 (talk) 15:47, 10 December 2015 (UTC)[reply]

What user-experience do non-Linux, non-Windows, non-Mac OSs have?

Does any "exotic" OS give a good user-experience? I mean Plan 9 or OpenBSD and any one you could think about. Are they any good from the user-experience perspective? --Scicurious (talk) 16:53, 9 December 2015 (UTC)[reply]

"Good" is a matter of opinion. We don't do matters of opinion here. --76.69.45.64 (talk) 16:56, 9 December 2015 (UTC)[reply]
I dispute both of your claims. Many aspects of quality can be measured. And there are lots of people around here posting their opinion. --Denidi (talk) 18:40, 9 December 2015 (UTC)[reply]
Both Plan 9 and OpenBSD are POSIX-compatible. Therefore, they run POSIX applications, such as KDE and GNOME. The user (assuming you are referring to the meat-filled skin sack sitting in front of the computer screen) commonly uses a GUI interface. For POSIX, KDE and GNOME are the the most popular. In the end, the usability of any POSIX-compatible operating system is going to be roughly the same as any other. It is not worthwhile to make a distinction for "users". 209.149.113.52 (talk) 17:08, 9 December 2015 (UTC)[reply]
And what makes so many more users choose Linux, and not another POSIX-compabitle OS, as their distribution? What tips the balance? --Scicurious (talk) 18:09, 9 December 2015 (UTC)[reply]
Freedom and availability have made Linux popular. 209.149.113.52 (talk) 18:59, 9 December 2015 (UTC)[reply]
Software range, software availability and software price (ZERO DOLLARS). By software I mean gnuplot and other applications. 175.45.116.66 (talk) 01:25, 10 December 2015 (UTC)[reply]
This deserves a more detailed answer. A lot of software, including your example of Gnuplot, is written for POSIX, which means it will run unmodified on any POSIX-compatible system. It is true that some big proprietary programs like Oracle Database often support Linux but not other Unix family members (Oracle runs on some of the big proprietary Unixes, but not BSD). Apart from said proprietary programs, I would say the main factors behind Linux's popularity are its hardware support and the bandwagon effect. And the hardware support is itself largely a result of the bandwagon effect; if anyone is going to write device drivers for platforms other than Windows and OS X, they're probably going to pick Linux as the other platform, because it has the next largest user share. To understand why, it's useful to understand the history; Linux rapidly attracted support in the 1990s as the free Unix-like for commodity PC hardware while BSD was under the cloud of copyright infringement lawsuits, and also various community conflicts and forks. Linux avoided these potential copyright issues, being written from scratch, and avoided any large forks splitting the community. See History of Unix, History of free software, Unix wars, and I highly recommend The Art of Unix Programming for a more detailed history. --71.119.131.184 (talk) 02:53, 10 December 2015 (UTC)[reply]
There are also lots of special purpose operating systems for applications like avionics and industrial controllers. Many of these systems present a user interface or otherwise provide "user experience." Are you interested in such single-purpose computers?
For example, here is AVWeb's review of the user interface on the GNS530, a navigation computer designed for small airplanes. Garmin doesn't publicize the implementation of the operating system on their higher-end products (for all we know, it could be Linux-like, although that'd be hard to get certified). However, here's an article from Mentor stating that the Nucleus RTOS would be used on the Garmin CNX80, a different product. One might surmise that all of Garmin's products are built on top of similar RTOSes that are quite different from your personal computer software.
Nimur (talk) 02:05, 10 December 2015 (UTC)[reply]

December 31, 4700

I see December 31, 4700 used as a "NULL" value for dates in databases rather often. However, it isn't a numeric limitation that I know of (that takes place in 2038, if I remember correctly). So, I just googled and I didn't find any reason to pick that particular year. Does anyone here know the reason? 209.149.113.52 (talk) 20:16, 9 December 2015 (UTC)[reply]

December 31, 4712 AD is the highest value for a DATE field in Oracle 7: see this table. Later versions of Oracle go up to December 31, 9999. Tevildo (talk) 22:07, 9 December 2015 (UTC)[reply]
In oracle, DATE range used to be Jan. 1, 4712 B.C.E. to Dec. 31, 4712 C.E. and this was merely a number stored with hour/minute/second precision. So that range, if I have calculated correctly, amounts to about 300 billion seconds. Maybe you can translate this to a 32 bit limit or something. Nevertheless it was fixed at 7 bytes per row and NUMBER itself was precision 38. Sandman1142 (talk) 11:12, 11 December 2015 (UTC)[reply]

Are certificates installed in Firefox safe?

In the certificates settings I have Your Certificates, People, Servers, Authorities, Others. 1 in Your..., none in People or Servers, a full list of Authorities, and in Others I have yahoo, google, skype, addons of firefox.

Is it a security risk to install certificates here? How can I know that the certs are all OK? If a user installs a certificate from an attacker, what could the attacker do?--Denidi (talk) 23:31, 9 December 2015 (UTC)[reply]

We need to carefully distinguish between regular certificates and root certificates. A root certificate can be used to authorize a different certificate. A malicious attacker who successfully installs a root certificate could proceed to successfully phish you: your web browser would trust any website that the attacker wanted you to trust.
You can add new certficate authority (i.e. a new root certificate) in Firefox. This is a security risk - but only if you cannot trust the certificate you are adding.
The other category - "regular" certificates - are in some sense less dangerous, because they don't cascade the risk down an entire chain of trust. However, if (somehow) one single certificate is compromised by an attacker, then you will trust that one attacker on that one website.
So, what is the "risk"? Well, when your browser trusts an attacker's certificate - or, trusts a certificate signed by a compromised root authority - then your browser willingly will send encrypted data to that attacker. What data? Any data you send - like your passwords, your bank credentials, or anything else you enter on a web form when you access that specific site. The gotcha is that some web traffic also happens invisibly (without displaying any UI to you). In particular, if you have configured Firefox to save credentials, or if a website relays information to some other website in the background, or if a browser extension or software bug causes sensitive data to be sent... then the attacker could see that data.
Certificates exist in your browser as proof that you trust something. Every time you trust anything, you are exposing yourself to some risk.
Nimur (talk) 02:16, 10 December 2015 (UTC)[reply]

December 11

what am i doing wrong? (java newby)

public class Main {
public static void main(String[] args) {
long a = 3;
long t = 1;
long h = 4;
char d = ' ';
float e = 11.7f;
boolean f = true;
 String output = + t + a + a + "t" + d + h + "a" + "x" + "x" + "o" + "r" + d + e + d + f;
 System.out.println(output);
    }
}
 7t 4axxor 11.7 true

The part at the beginning is supposed to look like "133t" but instead you see the "7t" the rest turned out the way I intended. Where did the 7 come from? what am I doing wrong? 199.19.248.76 (talk) 02:01, 11 December 2015 (UTC)[reply]

I'm not that good with Java myself but you start your string with a + sign. So, I'm guessing, it's adding the first three values 1+3+3 which is where you get 7. Dismas|(talk) 02:04, 11 December 2015 (UTC)[reply]
Even after fixing the + at the beginning I had the same result. I put the letter Z in front and it came up how I intended except I had to put a letter at the beginning in order for it to work. Thank you Dismas. 199.19.248.76 (talk) 02:14, 11 December 2015 (UTC)[reply]
Replace a with String.valueOf(a) and replace t with String.valueOf(t) and replace h with String.valueOf(h) 175.45.116.66 (talk) 02:29, 11 December 2015 (UTC)[reply]
The + operator is left associative, and it means string concatenation if either operand is a string, and numeric addition otherwise. So 1 + 2 + "x" + 3 + 4 = (((1 + 2) + "x") + 3) + 4 = ((3 + "x") + 3) + 4 = ("3x" + 3) + 4 = "3x3" + 4 = "3x34". -- BenRG (talk) 02:40, 11 December 2015 (UTC)[reply]
Just put ""+ at the beginning of the expression. Ruslik_Zero 11:58, 12 December 2015 (UTC)[reply]

On this page: [1] the link to the video-game Hocus pocus links back to the page you just came from... Fact is that this game has no page of his own (wich I regret) but I still think it's pretty useless to have a link there that links back to itself. Oxygene7-13 (talk) 14:32, 11 December 2015 (UTC)[reply]

This question might do better at WP:HELP. I think it's fine as-is. Right now Hocus Pocus (computer game) redirects to 3D Realms, but, in the future, if someone makes a page for the game instead of a redirect, then the current link will work to take you to the new article for the game! Also, while it doesn't serve much purpose in that article at present, the redirect helps me find the scant info we do have on the game by using the search box. So I'd suggest you ignore the link, or start on the game article, but there may be relevant official policies on the matter that I'm unaware of. SemanticMantis (talk) 15:09, 11 December 2015 (UTC)[reply]
OK, thanx! Oxygene7-13 (talk) 15:12, 11 December 2015 (UTC)[reply]
See the guideline Wikipedia:Redirect#Self-redirects. CambridgeBayWeather, Uqaqtuq (talk), Sunasuttuq 16:00, 11 December 2015 (UTC)[reply]

Do internal components need drivers?

Do the battery, RAM, internal wifi, and anything the computer interacts with need some sort of driver? Is it all included in the BIOS?--Scicurious (talk) 16:32, 11 December 2015 (UTC)[reply]

It depends. RAM is managed by the MMU and the OS - I've never heard that being called "a driver". Batteries can be operated as dumb devices, so you don't strictly need a driver. But built-in wifi, keyboard, mouse, and disk drives certainly need drivers. The bios may have some simple drivers for basic functionality, but most drivers come with the OS proper. --Stephan Schulz (talk) 18:01, 11 December 2015 (UTC)[reply]
If you are working with recent Intel-style computers, there is no BIOS. In its place is a different layer of code, called Unified Extensible Firmware Interface, (or sometimes, a brand-name vendor-specific variation on that theme).
EFI can and does contain device drivers for certain hardware. For other hardware, the operating system must provide the device driver.
Even if you want to compile your own "EFI"-style software from source - which is rare even among kernel hackers - you often still need to include binary blob code (for example, Intel provides binary to configure some of its internal devices - see the Pre-EFI Initialization Core documentation). These types of "blobs" are platform-specific device software; they can include or supplement operating system driver software. A good place to start reading is Intel's Firmware Resource Center (if you are interested in Intel-based computer technology).
Nimur (talk) 18:49, 11 December 2015 (UTC)[reply]
At least on a modern PC, even the RAM needs setup, although after that's done it works untended except by the MMU, as Stephan says. When the system starts, it could have a variety of different RAM devices in different slots, which require different timing configurations. So the boot code (BIOS or UEFI) has to check for each using the SPI bus, read the device types and capabilities from the SIMMs/DIMMs, read any RAM configuration parameters from the non-volatile storage (which itself may be a device on the SPI bus), and then sets the corresponding values up in the MMU registers. Only then can the RAM be written to or read from. That's a non-trivial chunk of code, and for a long time it was painful to write because that code itself couldn't, of course, use the RAM it was setting up - so that code had to run with its only data storage being the CPU's (rather few) registers. Luckily Intel and AMD added support (only about 15 years or so ago, I think) to allow the CPU's cache to work as ordinary addressable RAM (in "no evict" mode) which gives a decent amount of working memory for the boot code to do its RAM device initialisation task. Info about this is here and here. Embedded devices can, usually, assume the type, characteristics, and location of their memory devices will remain constant after manufacture (often because the DRAM devices are surface mounted onto the main board, and can't be swapped or upgraded afterwards), and so can safely read RAM config parameters from the non-volatile storage and know a-priori that they'll work. -- Finlay McWalterTalk 20:00, 11 December 2015 (UTC)[reply]

Doing arithmetic in Java with numbers received from another object

New to Java. Can someone help me with a method that adds two numbers, but receives them as message arguments from another object instead of prompting the user or having them hard coded in? I don't know how to have it wait for that input. Thank you. 94.1.49.144 (talk) 20:18, 11 December 2015 (UTC)[reply]

If I understand you correctly, that's just:
int add (int a, int b){
  return a+b;
}
but perhaps I misunderstood. -- Finlay McWalterTalk 20:21, 11 December 2015 (UTC)[reply]
Thanks - I guess my question should have been, is there something I can use as an "automatic" placeholder for each of my numbers, where it's a default part of Java that this placeholder means an integer will be provided as an argument when anything else calls my method? Or do I have to create placeholders myself? I had got as far as:
      int firstNumber, secondNumber;
      firstNumber = _;
      secondNumber = _;
      return firstNumber + secondNumber;
where the underscores are the bits I don't know how to do. 94.1.49.144 (talk) 20:43, 11 December 2015 (UTC)[reply]
When you write int add (int a, int b) {...}, none of the code inside {...} runs until it's called, and when it's called the caller supplies a and b, so there's nothing to wait for. Java methods are not "always alive". Threads are more like what you seem to imagine methods to be. You could create a Java thread that does nothing but wait for inputs on a queue and do some calculation on them and push the result into another queue. That's how a thread pool works, but you probably shouldn't worry about that at this stage of learning Java. -- BenRG (talk) 21:49, 11 December 2015 (UTC)[reply]

December 12

How do I add a printer?

How do I add a printer on Windows 7? — Preceding unsigned comment added by Mikemohr44 (talkcontribs) 04:35, 12 December 2015 (UTC)[reply]

see here 199.19.248.76 (talk) 05:16, 12 December 2015 (UTC)[reply]
How I do it is plug in the printer (both power cord and USB cord to the PC), and turn it on. The PC then detects the printer and offers to search for a driver, but NEVER finds one. I then do my own web search for a driver, download and install that, then it works. Some printers come with an install disk, in which case that's another possibility, although it might not have the latest updates and fixes. Note that this does not apply to installing a network printer, only a standalone. StuRat (talk) 06:47, 12 December 2015 (UTC)[reply]
Some printers come with a CD or DVD. RTFM, most of the printers conncected to USB port, requires to run setup first, making the OS know the device. Printers on a network needs frist to get an IP address. Setup is scanning for known priters. If You have the driver only, You need to use fixed IP settings (no DHCP/BOOTP), define a local LPR port in the procedure of adding the printer. In Windows a network port requires a server computer which might be a workstation with the printer shared on the network. A local network port is requred if there are no other computers in the network or the printer access should not be depending on other computers or You want this this computer to be the windows print server for this printer in this network. --Hans Haase (有问题吗) 15:27, 12 December 2015 (UTC)[reply]

Confused about sed syntax

The sed examples I know are mostly in the form:

sed s/text/newtext/ file.txt

However, I see that:

sed -i '1i prepend this' file.txt

works, producing the same result as:

sed -i '1i\prepend this' file.txt

Why does the man pages talks about i \, when i alone also works? Why are the options within the string? Why aren't they as a flag to the command. I imagine something like:

sed <options like in place, insert>  "string" filename

But when I find something like:

sed <options like in place>  "insert string" filename

I wonder why aren't the insert and string separated? --3dcaddy (talk) 19:24, 12 December 2015 (UTC)[reply]

Your examples of the i command don't work in standard sed. They work in GNU sed, which is what you're probably using, and maybe some other seds. GNU sed lets you play fast and loose with the syntax, and stick text on the same line as an a, c, or i command, because it makes it easier to do a one-line command like yours. In POSIX, the a, c, and i commands must be followed by a \ and then a newline. sed is ancient, and its syntax is extremely picky and terse. It was designed for use on teletypes in the computer labs of yore. You would be expected to be familiar with the documentation. So, you would know that all sed commands are one letter, and that \ is used in Unix for line continuation, so you would know to use \ to tell sed that your text is on the following line. The man pages for sed and a lot of other utilities are not good places to learn how to use them. They're more intended for quick reference when you already know how to use the program. For learning sed, I suggest these:
And there's the sed article, which also has some more links. --71.119.131.184 (talk) 21:31, 12 December 2015 (UTC)[reply]
The syntax requiring multiple lines may make more sense if you consider that it was derived from ed, where the insertion commands a and i were the way you'd switch into text-entry mode. Having done so, you would often type in many lines of text at a time, until you needed to go back and edit something. (Remember, this is in a teletype-style environment.) So, similarly, the i command in sed allows you to enter many lines:
       sed '1i\
       One Ring to Rule them All\
       One Ring to Find them\
       One Ring to Bring them All\
       And in the Darkness Bind them\
       ' file.txt
If you're writing something like that, it looks better without the i cluttering up the first line of the insertion. --76.69.45.64 (talk) 04:02, 13 December 2015 (UTC)[reply]

December 13

How to close current page in HTML/Javascript (on all platforms) ?

Note that the current page is not one that I opened with Javascript (let's say the user clicked on a link after a Google search to get here). I tried:

window.close();

This only seems to work on some platforms. I found many suggestions online, but none that work on all platforms I tested (Chrome, Firefox, Opera, and IE). Any ideas ?

Thanks, StuRat (talk) 02:54, 13 December 2015 (UTC)[reply]

MDN says you're only allowed to call window.close() on a window that was opened with window.open(). So you can't close arbitrary windows with JavaScript. (Thankfully. I don't want scripts closing my windows whenever they feel like it.) --71.119.131.184 (talk) 22:33, 13 December 2015 (UTC)[reply]

Javascript clue?

I have a quiz with 10 questions (each question should bring 10 points if answered correctly). Each question is a yes or no question. Whenever a user clicks on the right answer a string "Y" (Y) appears, and when ever it clicks on the wrong answer an "X" (X) appears.

My question is, if I want that every Y to bring +10 points, and every X to bring -10 points to the total possible sum of 100 hundred points, what is the right way to do that? How could I use each printed Y\X to add or subtract 10 points?

Thanks, Ben-Yeudith (talk) 16:22, 13 December 2015 (UTC)[reply]

You could concatenate them all into a 10 character string, then loop through the string, and examine each character, and add or subtract the points for each. However, it would seem to me that you already have an if-then statement for each Q that decides whether it was answered correctly or not, so you might as well just adjust the total inside that if-then, rather than do it later (initialize the total to 0 at the start of the quiz). Also note that the -10 for a wrong answer is typically done to dissuade quiz-takers from just guessing, and this implies that skipping a Q they don't know how to answer should also be an option. StuRat (talk) 22:11, 13 December 2015 (UTC)[reply]
I just slapped this together a couple weeks ago to help my class study for a final. View the source code to see if it helps. [4] 209.149.113.52 (talk) 14:37, 14 December 2015 (UTC)[reply]

December 14

What is the cost of pirated software for the users?

Is there any reliable and independent source analyzing hidden costs of pirated software? I mean direct costs for the users, not just nebulous costs like less proprietary software available, or less technical support. I am thinking aobut fines if being caught, malware, malfunctioning, time spent trying to find it and cracking. --3dcaddy (talk) 00:35, 14 December 2015 (UTC)[reply]

You do know this is a difficult question. The costs are different depending on your circumstances. If you earn $130,000 a year the cost of pirated software is difference than if you are unemployed and earn $0 a year. If you are unemployed, the cost of pirate software is acceptable even if you get malwares because you literally have nothing for the malware owner to steal off you! 175.45.116.66 (talk) 04:58, 14 December 2015 (UTC)[reply]
The malware can steal your computer from you. Imagine that 99% of your computer's processor and 99% of your network bandwidth is used by malware to send out spam. You have effectively had your computer stolen. Now, you have no money (as you claim) and, if you are in this situation, no knowledge of how to remove the malware. So, you have two options: turn the computer off and never use it or turn it on and never be able to use it. 209.149.113.52 (talk) 20:28, 14 December 2015 (UTC)[reply]
I don't know how independent the study has to be. But Microsoft sponsored a study, which was conducted independently, about the economical impact of software piracy. It was conducted by IDC and the National University of Singapore (NUS) and can be downloaded from [5]. --Denidi (talk) 13:54, 14 December 2015 (UTC)[reply]

Image help

This image appears to be divided into multiple portions and Dezoomify doesn't help. As I'm quite lame in it, could someone help in possible stitching and downloading in maximum resolution over File:H. Piffard - The Thin Red Line.jpg? The image is in public domain, as the artist Harold H. Piffard died 77 years ago. Brandmeistertalk 16:10, 14 December 2015 (UTC)[reply]

I uploaded a full-resolution version. (I used Chrome's network inspector to see what images the page was requesting from the server. The tiles have URLs like ...&DMSCALE=15&DMWIDTH=512&DMHEIGHT=512&DMX=...&DMY=...&..., and by replacing that with DMSCALE=100&DMWIDTH=8192&DMHEIGHT=8192&DMX=0&DMY=0, I was able to download the whole image as one "tile".) -- BenRG (talk) 19:10, 14 December 2015 (UTC)[reply]

Freegate not working

Hi all, I've been using Freegate as a proxy in China, and it has worked fine in the past, but lately it has started playing up rather badly. It won't find any servers, and when it does, it usually cuts out quickly. Then, last night, it started working, eventually. Then I disconnected the internet, and today, it is up to its usual tricks. It usually just says "No server is available. Please try again later." Has something changed with Freegate, has the Chinese government worked out how to defeat it, or am I having an unlucky run? IBE (talk) 17:10, 14 December 2015 (UTC)[reply]

Writing smartphone applications in various languages

Hello,

Will it be possible in the foreseeable future to write a program in any of the major programming language (Python, Javascript, C++ etc.) that would run on different smartphone operating systems such as Android, iOS, etc? Thanks, 109.160.175.221 (talk) 19:02, 14 December 2015 (UTC)[reply]

There are a number of frameworks like Xamarin which allow cross-platform development, and many more which wrap HTML/CSS/JS into applications which can run on a range of smartphone platforms - see Multiple phone web-based application framework. -- Finlay McWalterTalk 19:14, 14 December 2015 (UTC)[reply]