How to make an API call in Angular 2?
Vote count: 0 There are lots of resources out there already but I haven't been able to find one that works for one reason or another. Take a generic example: I want to get the response from http://swapi.co/api/people, which will be a list of people from Star Wars. import {Injectable } from '@angular...
MVVM: ViewModels for bidirectional model elements
Vote count: 0 Assume I have following Model structure: class Team { public string Name {get;set; } public List<Player> players {get;set;} } class Player { public int Age {get;set;} public string Name {get;set;} public Team Team {get;set;} } I wish to create Viewmodels for this model. However, I also...
Accounts setUsername fail with user alaready exists
Vote count: 0 This Meteor 1.4 server code usesaccounts-base@1.2.9accounts-password@1.2.12 is giving the following error: Exception in callback of async function: Error: Use ame already exists. [403] console.log(oldUse ame); //=> abc121111 console.log(newUse ame); //=> abc123333 Accounts.setUse ame(u...
rnpm command not found in terminal after "npm install rnpm -g"
Vote count: 0 I am still new to coding and I ran into a weird problem. enter image description here I am trying to use the facebook SDK in my react native app and I was following the tutorials for installing pm. However, after I installed pm package the " pm" command is still unusable. Can someone p...
Array of column Letters to Array of Column Numbers not working
Vote count: 0 This is more or less my first attempt at writing a Javascript function and I want to convert an array of column numbers to an array of column letters If I run testFunction I get undefined function testFunction() { var ui = SpreadsheetApp.getUi(); aryCLTCN(["A","C","D"]) ui.alert(aryCLT...
pyspark with HCatalog table in Zeppelin
Vote count: 0 I have created a table HCatalog table with partitions mapping to some zip files in S3. In Zeppelin, I created a paragraph using the %pyspark module with the following codes: Paragraph 1: %pyspark from pyspark.sql import HiveContext hc = HiveContext( sc ) f_req_2h = hc.table( "default.f...
Font-family not working in php
Vote count: 0 I'm trying to create a font preview but I can't get the font to change. When I run the code shown below, the output is my Text - Arial.ttf - 1 my Text - Batman.ttf - 1 my Text - Verdana.ttf - 1 So the font is being found. It just isn't working. If I replace the key/data with an actual ...
How to get the Average of a specific category via Python
Vote count: 0 I was wondering how I could calculate the average of a specific category via Python? I have a csv file called demo.csv import pandas as pd import numpy as np #loading the data into data frame X = pd.read_csv('demo.csv') the two columns of interest are the "Category" and "Totals" column...
Canoot resolve symbol 'Database' in android
Vote count: 0 I was importing a old project written on api-level 17(android 4.2), but this problem is not solving anyway. I have searched whole inte et but couldn't find this particular error. It is showing- "Ca ot resolve symbol 'Database'". Please help me out. Here is the code of the file AddFrien...
PHP Todays Date + 1Year
Vote count: 0 I'm putting together a little subscriptions script in PHP which will calculate the expiration date based on todays date and time, but it's giving the result of 0000-00-00 00:00:00 (Datetime) Here is my code: $added = date("Y-m-d H:i:s"); $expiry = strtotime('+ 1 year', $added); How can...
Create subgroups into xcode 7 template
Vote count: 0 I'm making a xcode template with swift files but I want to divide these files in groups: > Group (file template name) > --- Group One > ------ swiftFile > ------ swiftFile > ------ swiftFile > --- Group Two > ------ swiftFile > ------ swiftFile ¿Can you help me? Can you also create fol...
Save SQL queries and execute them later in Laravel 5.2?
Vote count: 0 I have two types of users in my Laravel application and I'd like them to have different permissions. I want the admin to be able to create, retrieve, update and delete some objects stored on my database. And the common user to be able to only retrieve these objects. But, I'd like to ha...
what sort of data duplication does constraints on city_province_country relations cause and which Normalization step solves it?
Vote count: 0 I'm thinking of implementing a billing address model where the user has to fill in city, province, and country as address. However I also have a hierarchical table structure of one to many relationships already available to me where a county has many provinces and a province has many c...