How to reuse service calls in Angular 2

Javascript
I have two components using the same service. On FirstComponent, I get some data from a service: getLiveData() { Observable.interval(1000) .mer...
8 months ago

How to hide spring boot banner.txt in junit test with SpringJUnit4TestRunner?

Java
When I configure an Spring Boot Application, I can disable the banner via run configuration in the static main method. So far so good. But what if I ...
8 months ago

How to you test an angularjs module defined inside an IIFE with jasmine?

Javascript
how do I test this module on jasmine ? The problem is that it's very difficult to test the $controller because the function is hidden inside a closu...
8 months ago

javafx gui using ellipses's issues

Java
I am new to javafx and am trying to make a GUI that has rings of ellipses of different sizes/colors similar to a dart board. the end goal is to make i...
8 months ago

make an option selected when input attribute equals 0

Javascript
I have this html select below: <select name="options[35]" id="select_35" class=" required-entry product-custom-option" title="" onchange="opConfig...
8 months ago

Spark job became incompatible with Google Dataproc

Java
I have this code that was working fine for months and stopped working about 2 months ago with Google Dataproc although I hadn't changed a single line....
8 months ago

mapStateToProps() in Redux app nesting state within state?

Javascript
I've hit a wall trying to figure out why the JSON data I'm fetching and storing on state isn't being mapped to my component props, yet appears when co...
8 months ago

Why cant a RandomAccessFile be casted to Inputstream?

Java
I get compilation error when I do this cast: RandomAccessFile raf = new RandomAccessFile(...) InputStream is = (InputStream)raf; RandomAccessFile i...
8 months ago

If Statement that Tests Multiple Ternary Operators Javascript

Javascript
I'm wondering why my solution doesn't work. I have the following: //tells if type should be included in the row data isInReport = {factual: true, eac...
8 months ago

Data Structure of the Periodic Table of Elements

Java
My goal is to use the periodic table of elements (or a list) to get information about a specific element in Java. I want to search it by atomic number...
8 months ago

Bypass open links js limitation

Javascript
I pretty often need to open ~40-50 links from some page in tabs in firefox. I'm curently writing user script for this, but have a problem. Firefox si...
8 months ago

SQLite - Java - onCreate and onUpgrade - Android

Java
Hello i have created my first application which collect some basic information in its local private database using my own class which inherits the SQL...
8 months ago

How to remove Overlays from L.control in leaflet

Javascript
On the client Im getting a bunch of polygons from a postgres database and then I am adding them as an overlay into a layers control. At the moment thi...
8 months ago

JavaScript function return is empty after file read

Javascript
this code var fs = require("fs"); var freeApps = readFile(); console.log('4' + freeApps.toString()); function readFile () { var content = ''; ...
8 months ago

Is hiding code inside null like this safe?

Javascript
Can you get the key after it's injected? var outside=[]; var NULL=(function(){ var key=''; console.log("Hi, I'm null!"); window.injectke...
8 months ago

I am just starting in code academy. I am getting the error "SyntaxError: Unexpected token"

Javascript
My code is : // Define quarter here. var quarter = function(number); { return number / 4; } if (quarter(12) % 3 === 0 ) { console.log("The sta...
8 months ago

How to use plt.text() function to type special symbols into a plot produced by python3?

LaTeX
I am trying to type a text (which includes some astrophysical symbols like solar mass and Hubble's Parameter) inside an empty figure in a python scrip...
8 months ago

Updating Laravel Eloquent mutator values on save in the correct order

PHP
Suppose I have five fields in a table: price, cost, handling, shipping, profit The fields shipping and profit have mutators because they are based of...
8 months ago

regular expression to match tag with or without close tag?

PHP
I am struggling with detect these patterns in a content body: [tagname blah blah blah]blah blah blah[/tagname] // pattern 1: with close tag [...
8 months ago

When i run the code, even if i type in a film on the list, it says that its not there and fails.What do i do?

Python
def FilmSelection(): list1=["The Magnificent Seven",'Wreck It Ralph','James Bond','Now you see me 2','Captain America:The Winter Soldier'] cho...
8 months ago