Categories
Mastering Development

Error: inject() must be called from an injection context but can’t find origin

I’m using angularfire’s authentication service to register and login users to my application but when I trigger the register or signin method, I get the following error: Error: inject() must be called from an injection context I’ve tried setting preserveSymlinks in my angular.json file to be true, but still no avail. How is it that […]

Categories
Mastering Development Software

PHP Building customer class with extends, am I doing it correctly?

I am trying to build my own customer class. Customer data is separated in 4 MySql tables. I am not sure if this is idiotic or not yet. The tables are securities, customer, address and contact. The 4 tables are related by Customer_ID I created securities class and I created a customer class extending on […]

Categories
Mastering Development

pandas to find match in column1 and update corresponding row on a column2

import pandas as pd import re df = pd.read_csv("df.csv") df _id,column1,column2 1,FullName, 2,xyz, 3,custname, 4,FullNm, 5,FirstName, 6,abc If any value in column1 is made up of only given set of keywords in this case(full, name, nm, txt, dsc) and here keyword "full" is mandatory exists then update "column2" as "Full Name" other wise leave it […]

Categories
Mastering Development

Pass files with json payload in single requests to web2py endpoint

I wrote endpoint called foobar in default.py controller of web2py, it looks like @service.json def foobar(*args, **vars): payload = request.vars.student print(payload) #Above payload prints [rollNo, firstName, lastName] #Expected is {"rollNo": 6299857, "FirstName": Prasad, "LastName": Telkikar} fileObj= request.vars.video studentActivity = fileObj.file.read() #Currently I am unable to do it from unit test, but it works from postman […]

Categories
Linux Mastering Development Ubuntu

awk adding up two rows if the rows have a matching name

I am trying to take a csv file that looks like customerID,firstname,lastname,charge 5efc522,Romo,goodrick,37.89 4a7f057,jeny,vel,38.39 5efc522,Romo,goodrick,39.00 and make it into firstname,lastname,chargetotal,customerID ROMO,goodrick,76.89,5efc522 jeny,vel,38.39,4a7f057 so far I know that I can do awk ‘{arr[$1]+=$4;} END{ FOR (i in arr) { print i, arr[i];} ‘< file any help would be appreciated

Categories
CMS Drupal Mastering Development

D8: Theming Subscriber Field in Simplenews Issues

I need to address my subscribers in a more personal way. Thus I added fields for Mr./Mrs., firstname, lastname to the subscription block, and data gets collected nicely. However, I can’t see how to theme these fields in simplenews-newsletter-body.html.twig In the header of this template there’s an example printing the subscriber’s (built-in) mail: But trying […]

Categories
Mastering Development

Spring Bactch writes empty file

I am new to batch programming and I am using Spring Batch. tried to use some online examples but after fixing lot of errors i am getting an empty file. I am trying to read from a simple MySql database and writing to a CSV file. users.csv is located in resource folder. Spent a lot […]

Categories
Mastering Development

laravel 7 adding radio in register form

i want to add radio in register form. For when someone want to register he need to choice if its man or woman and when i try to register its not work dont save in database Someone can helping me add the radio for choice man or woman. create user table : use Illuminate\Database\Migrations\Migration; use […]

Categories
Mastering Development

Vue not refreshing computed property due AJAX Call

my frontend consists of vue, vue-router and vuex. I have a view, wich, on mounted, does 2 AJAX calls and a calculation: get a list of all players get a list of all matches in promise of 2, calculate the stats for every player This is my “Scores.vue” <template> <v-app> <table class=”table is-striped is-fullwidth scoreboard”> […]

Categories
Mastering Development

Search for key inside nested lists inside nested dictionaries

The original post is Go through json line by line including unkown nested arrays and objects I am trying to search for a specific value in all nested lists and nested dictionaries inside a JSON dictionary. The structure of the dictionary is not always known. The nested dictionary can have a nested list. The key […]