java.util.NoSuchElementException - Scanner reading user input

java.util.NoSuchElementException - Scanner reading user input

I'm new to using Java, but I have some previous experience with C#. The issue I'm having comes with reading user input from console.I'm running into the "java.util.NoSuchElementException" error with this portion of code:payment = sc.next();

Is there a function to extract a 'column' from an array in PHP?

Is there a function to extract a 'column' from an array in PHP?

I have an array of arrays, with the following structure :array(array('page' => 'page1', 'name' => 'pagename1') array('page' => 'page2', 'name' => 'pagename2') array('page' => 'page3', 'name' => 'pagename3'))Is there a bui

Why isn't the size of an array parameter the same as within main?

Why isn't the size of an array parameter the same as within main?

Why isn't the size of an array sent as a parameter the same as within main?#include void PrintSize(int p_someArray[10]);int main () { int myArray[10]; printf("%d\n", sizeof(myArray)); /* As expected, 40 */ PrintSize(myArra

What is a StackOverflowError?

What is a StackOverflowError?

What is a StackOverflowError, what causes it, and how should I deal with them? 1:Parameters and local variables are allocated on the stack (with reference types the object lives on the heap and a variable references that object). The sta

Passing Parameters JavaFX FXML

Passing Parameters JavaFX FXML

How can I pass parameters to a secondary window in javafx? Is there a way to communicate with the corresponding controller?For example:The user chooses a customer from a TableView and a new window is opened, showing the customer's info.Stag

Prototypical inheritance - writing up [duplicate]

Prototypical inheritance - writing up [duplicate]

This question already has an answer here: Javascript object members that are prototyped as arrays become shared by all class instances 3 answers So I h

Unpermitted parameters in rails 4

Unpermitted parameters in rails 4

I read about collection_check_boxes but I don't understand how can I set the checked values.I have the following model:class Objective edit view: the html checkbox are ok but I don't know how to set the values to objective. I was tried d

Constrain multiple sliderInput in shiny to sum to 100

Constrain multiple sliderInput in shiny to sum to 100

I've been struggling with this all day and I've kind of solved it (horrible hack). However there experience is not smooth and displays side-effects.What I want is three sliders with a range of 0 to 100 constrained such that their sum should

Prevent saving files with certain names in Vim

Prevent saving files with certain names in Vim

I type really fast and realize that sometimes I accidentally save a file with the name of ; or : (I type :wq and sometimes a typo is introduced).Is there any way to write a macro that rejects saving files matching certain names? 1:A sim

c++ mark enum value as deprecated?

c++ mark enum value as deprecated?

Is it possible to mark an enum value as deprecated?e.g.enum MyEnum { firstvalue = 0 secondvalue, thirdvalue, // deprecated fourthvalue};A second prize solution would be to ifdef a MSVC and a GCC solution. 1:you could do this:

Is qDebug() thread-safe?

Is qDebug() thread-safe?

Is qDebug() thread-safe? By thread-safe I don't just mean not-crashing, but also if I call qDebug() from different threads, is it possible for the output to become mixed-up? I tested it with this code, and it doesn't appear to be so, howeve

response.writeHead and response.end in NodeJs

response.writeHead and response.end in NodeJs

var https = require('https');var fs = require('fs');var options = { key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem')};https.createServer(options, function (req, res) {

How to combine OnClickListener and OnTouchListener for an ImageButton

How to combine OnClickListener and OnTouchListener for an ImageButton

I need to do something when the user clicks the ImageButton I've tried to create a static class that implements both OnClickListener and OnTouchListenerstatic class ClickListenerForScrolling implements OnClickListener, OnTouchListener that

In Haskell, is there infinity :: Num a => a?

In Haskell, is there infinity :: Num a => a?

I'm trying to implement a data structure where if I had the use of infinity for numerical comparison purposes, it would simply things greatly. Note this isn't maxBound/minBound, because a value can be data Infinite a = Infinite | Only athen

How can I use a Swift enum as a Dictionary key? (Conforming to Equatable)

How can I use a Swift enum as a Dictionary key? (Conforming to Equatable)

I've defined an enum to represent a selection of a "station"; stations are defined by a unique positive integer, so I've created the following enum to allow negative values to represent special selections:enum StationSelector : Printable {

WPF menu item with image

WPF menu item with image

How to define MenuItem.Icon so that the MenuItemHeader text would be placed below the menu item image?Thanks for help! 1:The easy way way is to not use the Icon property but to instead put the icon in the Header:

PrimeFaces Ajax Navigation with Browser History/Hashtag

PrimeFaces Ajax Navigation with Browser History/Hashtag

I have implemented a web application which is a one-page-design. Which basically loads a single page then updates with AJAX the central content. The code is the following: Main Menu

CSS property value from class name

CSS property value from class name

It is possible to pass parameters for CSS in class name? For example:.mrg-t-X { margin-top: Xpx;}TestIn this example X should be 10. 1:No it isn't. The closest we have to this is the attr() function, but that only works within the cont

How can i use a C# dll in a Win32 C++ project?

How can i use a C# dll in a Win32 C++ project?

I am working on a solution, most of its core engine is developed as Win32 C++ (and is Platform independent and is also used on OS X), some time ago we needed to call C++ dll's of core engine from C# and I was able to Load main solution's DL

“Masking” an animation? iPhone SDK

“Masking” an animation? iPhone SDK

I have been looking into ways of masking images on the iPhone. I came across this solution http://iosdevelopertips.com/cocoa/how-to-mask-an-image.htmlwhich works great for still images. What I want to do is mask an animation in a UIImageVie

How to observe individual array element changes (update) with Swift and KVO?

How to observe individual array element changes (update) with Swift and KVO?

Do I need to subscribe/unsubscribe to individual elements of an array?I want to update each table view cell individually to reflect changes in the backing array. By changes I mean not append/remove operations but update of the properties of

understanding the __libc_init_array

understanding the __libc_init_array

I viewed the source code of __libc_init_array from http://newlib.sourcearchive.com/documentation/1.18.0/init_8c-source.html .But I don't quite understand what this function does. I know that these symbols /* These magic symbols are provided

In Tensorflow, what is the difference between a tensor that has a type ending in _ref and a tensor t

In Tensorflow, what is the difference between a tensor that has a type ending in _ref and a tensor t

The docs say: In addition, variants of these types with the _ref suffix are defined for reference-typed tensors.What exactly does this mean? What are reference-typed tensors and how do they differ from standard ones? 1:A reference-type

Running Clojure and other Lisp at the same time on Emacs

Running Clojure and other Lisp at the same time on Emacs

I use Aquamacs, and Aquamacs is pre-equipped with SLIME.(setq inferior-lisp-program "/usr/local/bin/sbcl") #####!!!(add-to-list 'load-path "/Library/Application Support/Aquamacs Emacs/SLIME/contrib")(add-to-list 'load-path "/Library/Applica

DI and Singleton Pattern in one implementation

DI and Singleton Pattern in one implementation

I want to refactor some code using the Windsor IOC/DI framework, but my issue is that I have some Singleton classes and Factory pattern classes and I am not sure that one can implement a Singleton or Factory using DI.Has anyone any ideas if