Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

// request.cf · coarse context

A page that knows where it met you.

Only coarse request metadata is shown. This demo does not display or persist visitor IP addresses.

Country
US
Cloudflare location
CMH
Connection
HTTP/2
Language
Not provided

Ray ID: a26c0d9bcf6fcf5f

Jump to content

Wikipedia:Reference desk/Archives/Computing/2015 February 15

From Wikipedia, the free encyclopedia
Computing desk
< February 14 << Jan | February | Mar >> February 16 >
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.


February 15

[edit]

why the system doesn't understand the mother tounge language?

[edit]

I've moved this question from the top of the page where it was originally posted by Chandra prashad mishra, into a separate section. Mitch Ames (talk) 10:15, 15 February 2015 (UTC)reply

Do you mean the operating system on your PC doesn't understand Hindi, or another human language ? StuRat (talk) 16:15, 15 February 2015 (UTC)reply
Generally see Internationalization and localization. You may need a "localized" installation of the system you are using. Because there are so many languages, the language files are often not installed by default. Wnt (talk) 16:23, 15 February 2015 (UTC)reply

Why do Europeans are more diverse regarding hair and eye color?

[edit]

DVDs won't play in some players

[edit]

My girlfriend and I recently bought The Walking Dead Season 4 online. We watched the first two disks on our Xbox 360, as we watched all the previous seasons. But when we stuck the third disk in, it just started spinning really loud and fast, and didn't play. Likewise with the fourth and fifth disks. Her laptop does the same thing with those disks, but my laptop plays them just fine.

I've been looking this up online, and it looks like the problem most people have with playing DVDs is the region, but all the disks in the set would have the same region, wouldn't they? Why is it doing this? 50.245.232.211 (talk) 19:29, 15 February 2015 (UTC)reply

There are numerous other possible explanations - other than DVD region coding - that could explain this symptom. We would need much more information to even begin to triage this. To begin, what is the make and model of the two laptops (and the make/model of their respective DVD drives)? What software runs on these two laptops? What DVD player application software is being used? Nimur (talk) 19:35, 15 February 2015 (UTC)reply
Both laptops are using the same software: GNOME-Mplayer. They were both booted from the same live USB disk, so software is completely identical. They're both Compaq laptops. The laptop that works is a Presario C700 with what I believe is the stock drive. It's usually the more unreliable of the drives -- I'm writing this on that laptop, and the operating system isn't detecting it. The other laptop is at home at the moment, so I can't give you any details from memory, beyond it being a Compaq, and a few years old. 50.245.232.211 (talk) 19:48, 15 February 2015 (UTC)reply
This could be an example of the "double tolerance problem", say, if the laser pits burnt in the DVD are slightly out of spec, but the one device is still able to read them that far out of spec, while the others are not. StuRat (talk) 19:54, 15 February 2015 (UTC)reply

Help with strings in Java

[edit]

I keep getting a null pointer exception error on one of the lines of my code and I'm not sure why. (Strings vex me!) Could someone explain why I'm getting this error?

Code sample
	
public static void main(String[] args) {
		
String[] names;
names = new String[10];
String name;

for (int count = 0; count <= 9; count++) {
System.out.print("Name:");
name = person.toString();
System.out.println("");
System.out.print("Grade:");
grade = number.nextDouble();
System.out.println("");
			
names[count] = name;
}
}

The error is on the name = person.toString(); line. There's more to the program, it also takes in grades and prints out the two arrays, but I just kept it to what I think is relevant to the question. Thanks, Dismas|(talk) 19:30, 15 February 2015 (UTC)reply

Dismas, your code does not compile - which means we can't meaningfully find your bug. It's very probable that you removed the bug in your effort to simplify the code! I modified your code to some that does compile:
A variation on the sample code
class Program
{
public static void main(String[] args) {
 
	String[] names;
	names = new String[10];
	String name;
 
	for (int count = 0; count <= 9; count++) {
		Object person = new Object();
		java.util.Random number = new java.util.Random();
		System.out.print("Name:");
		name = person.toString();
		System.out.println("");
		System.out.print("Grade:");
		double grade = number.nextDouble();
		System.out.println(grade);
 
		names[count] = name;
		}
	}
}
... but this code does not throw a java.lang.NullPointerException on my Java(TM) SE Runtime Environment (build 1.8.0_31-b13).
Perhaps if you figure out how to "put the bug back in," you will be able to figure out how to "take the bug out" of your original, full-form code. (Hint: where does the variable person come from, and how are you ensuring that it is guaranteed to be valid?)
Nimur (talk) 19:47, 15 February 2015 (UTC)reply
the full source code
/*
 * Ian Schulze
 * 14 February 2015
 * Assignment 5
 * CIS-2271
 * 
 * For each student in a class, the instructor will enter a numeric grade between 
 * 0 and 100 and a program will determine the corresponding letter grade.
 * 90-100: A
 * 80-89.99: B
 * 70-79.99: C
 * 60-69.99: D
 * Below 60: F
 */

import java.util.Scanner;

public class App {
	
	private static Scanner person;
	private static Scanner number;

	public static void main(String[] args) {
		
		String[] names;
		String[] grades;
		
		names = new String[10];
		grades = new String[10];
		String name;
		double grade;
		String letterGrade;
		
		System.out.println("There are 10 students in class.");
		System.out.println("Please enter each student's name and numerical grade.");
		for (int count = 0; count <= 9; count++) {
			System.out.print("Name:");
			name = person.toString();
			System.out.println("");
			System.out.print("Grade:");
			grade = number.nextDouble();
			System.out.println("");
			
			names[count] = name;
			
			letterGrade = ConvertToGrade.convertGrade(grade);
			grades[count] = letterGrade;
		}
		
		for (int count = 0; count <= 9; count++) {
			System.out.println(names[count] + "  " + grades[count]);
			
		}
		

	}

}

Here's the full code. Thanks, Dismas|(talk) 20:25, 15 February 2015 (UTC)reply

The problem is that you've not initialized person or number. It looks as though you're missing a line (or two) after the second println statement, where you get the input from the user and create the Scanner objects. If the intention is to only have one input which contains both the name and grade, you only need one Scanner object, on which you can use the .next method to get the name and the .nextInt method to get the grade. See the official documentation. Tevildo (talk) 21:17, 15 February 2015 (UTC)reply

Thank you both for your help. I ran into more errors at runtime but I'll take a look at them later when I have more time. Dismas|(talk) 13:54, 16 February 2015 (UTC)reply