Jump to content

Wikipedia:Reference desk/Computing

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by FrameDrag (talk | contribs) at 21:37, 15 December 2015 (Video upscaling question). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
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 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]
In the 1980s a pirtated software was detected by updates and demo versions that offered a free user manual when an dongle cracked software was detected. That «user manual» was sent by an attorney and the Coupon code clarified what illegal copy was owned. Today, every computer in use is connected to the internet and software is used to call home. --Hans Haase (有问题吗) 00:07, 15 December 2015 (UTC)[reply]
Are you using Google Translate for your posts Hans? I have difficulties understanding most of it. And I don't se how the bits that I understand relate to my answer. --Denidi (talk) 02:58, 15 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]


December 15

Windows cannot install important updates

Information as of 2009: OS Name Microsoft® Windows Vista™ Home Premium Version 6.0.6001 Service Pack 1 Build 6001 Other OS Description Not Available OS Manufacturer Microsoft Corporation System Name System Manufacturer HP-Pavilion System Model KT369AA-ABA a6512p System Type x64-based PC Processor Intel(R) Pentium(R) Dual CPU E2200 @ 2.20GHz, 2200 Mhz, 2 Core(s), 2 Logical Processor(s) BIOS Version/Date American Megatrends Inc. 5.23, 4/21/2008 SMBIOS Version 2.5 Windows Directory C:\Windows System Directory C:\Windows\system32 Boot Device \Device\HarddiskVolume1 Locale United States Hardware Abstraction Layer Version = "6.0.6001.18000" User Name Time Zone Eastern Standard Time Installed Physical Memory (RAM) 4.00 GB Total Physical Memory 3.99 GB Available Physical Memory 2.15 GB Total Virtual Memory 8.18 GB Available Virtual Memory 6.13 GB Page File Space 4.28 GB Page File C:\pagefile.sys And on 7 August 2009 I was told to always say I HAVE A DSL MODEM.

Last week my computer would not start and I got a message saying I could tell the computer to repair itself. It went through system restore and everything seemed fine. During the time right after the computer is turned on, I have been getting numerous messages, on a blue screen, that the computer had to shut down to protect itself. And that happened again yesterday. I had to restart the computer because of Windows updates, which had also happened prior to the system restore. I waited until I was ready to turn off the computer after the updates finished installation because I didn't want to have to figure out how to get back to what I was working on. But today, the monitor went black and said "no signal", and the computer started beeping. This has happened a couple of times, mostly right after the computer was turned on, but also once when I did the virus scan and left it alone and it was "asleep" after that finished. So I unplugged the computer and when I turned it back on, I was told I should probably do a system restore. Which I did. Everything seemed to work after that, but surprise! The logo in the lower right corner is there again, and when I move my mouse over it, it says "Windows is downloading updates (46% complete)". Earlier, I got a little popup message saying Windows could not install important updates, and to click to find out more. It went away before I could click and I don't know where to click. But obviously I need to stop Windows from installing any more updates until this problem is fixed.— Vchimpanzee • talk • contributions • 20:34, 14 December 2015 (UTC)[reply]

Sorry to say you're having so many issues with your computer.. This is a computer reference desk, it's not really "troubleshoot" your windows issues, I'm sure people will be happy to give you some tips but do you have an actual question? is it just "how to disable automatic updates?" That should be fairly simple, this is the 1st result of a google search. Vespine (talk) 21:39, 14 December 2015 (UTC)[reply]
I'm not sure what my actual question should be. I'm up to 61 percent now and will be turning off the computer soon unless I remember that I want the download to be completed. Though I probably don't. But I'm trying to figure out what could be causing all these problems. I don't really get specific enough error messages when these problems happen. McAfee also downloaded updates and I don't know whether these could be causing the problems. But if they did, that's harder to deal with since I know I need McAfee to be up to date. They have tech support though I don't have time for that today, and if the problem is serious enough they might charge me extra. How to explain all this to them I don't know.— Vchimpanzee • talk • contributions • 22:11, 14 December 2015 (UTC)[reply]
From the symptoms you describe, there's a fair chance a hardware fault is the cause although I'd try and rule out overheating by cleaning any fans first. Nil Einne (talk) 22:28, 14 December 2015 (UTC)[reply]
Thanks, but I'm not sure cleaning a fan is something I can do. The computer doesn't feel hot and I don't feel heat around the vent. Going inside is not something I feel confident about. I'll ask McAfee for help Wednesday and see if there's anything related to their software that can be fixed.— Vchimpanzee • talk • contributions • 23:32, 14 December 2015 (UTC)[reply]
A corrupted update downloads or update database can be fixed by clearing the folders catroot and catroot2, located in Windir or System32. Usually, these services are running and access the files. Stop all services to see the ms knowledgebase to find which services needs to be stopped to release the files in the catroots and allow to delete the files in the folders. When done, restart as the best way to restart all the services. The catroot files wil be rebuild automatically. It will take longer to check for updates the next time, but do not interrupt it. --Hans Haase (有问题吗) 00:00, 15 December 2015 (UTC)[reply]
"The monitor went black and said 'no signal', and the computer started beeping" strongly suggests a hardware problem, possibly with the video card. I doubt that Windows Update is causing the problem, or that disabling it will help, though I suppose it's worth a try. -- BenRG (talk) 00:53, 15 December 2015 (UTC)[reply]

Devices in and out

You know when you put in a device like a cam or such and Windows XP goes "blong bling" and when you take it out, the computer goes "bling blong"? Sometimes when I take it out, it doesn't go "bling blong" for a long time or not at all. Is there anything I can do? Many thanks. :) Anna Frodesiak (talk) 01:34, 15 December 2015 (UTC)[reply]

It is a very low priority process. It isn't necessary, so it tries to play the little tune, but the system is perfectly happy to skip it if the CPU or sound processor is too busy. Why is the CPU busy? If you are running XP, the probability that you have malware on your computer that is using up all your CPU cycles is very very very high. 209.149.113.52 (talk) 13:16, 15 December 2015 (UTC)[reply]

Problem in running a OBB file

I have an OBB file in my pc, but I don't know the exact software to run it. Please, suggest me a software through which I can extract the contents of my file. — Preceding unsigned comment added by 223.176.38.113 (talk) 05:38, 15 December 2015 (UTC)[reply]

We have an article on Opaque binary blob, but you might need an Android emulator to run it on your PC. Do you just want to inspect the file? Dbfirs 10:52, 15 December 2015 (UTC)[reply]

Video upscaling question

When displaying a video (or image) whose resolution is lower than that of the display panel, the video is upscaled. A 720p video on a 720p screen always looks better than the same video on a 1080p screen due to pixel stretching.

Assume that I have 2 monitors of the same physical size but difference resolutions: 720p and 2160p. Is there any difference when they display a 720p video? I think the 2160p monitor just use 3x3 pixel block to simulate a 1x1 block of the 720p video, and there is no pixel stretching at all. 14.177.58.42 (talk) 20:30, 15 December 2015 (UTC)[reply]

There won't be stretching but you might notice the lesser quality of the 720p video. After all, there's less pixels and therefore less detail in the 720p video frames, which are now being displayed at 2160p. FrameDrag (talk) 21:37, 15 December 2015 (UTC)[reply]