Categories
Mastering Development

Comparing 2 CSV files with compare-object to get outdated software

I am writing a script to compare 2 csv files to get the outdated software’s and put them into another csv file. I have a problem when I try to get the outdated softwares, it just shows all the softwares installed again. This is my script. $CurrentList = Import-csv C:\Users\Administrator\CSVReports\InstalledSoftware.csv | select ComputerName, DisplayName, DisplayVersion, […]

Categories
Database Development

SQL Server Indexed View and TOP

I’m struggling to persuade a query plan to behave as I think it should. The addition of a TOP clause when querying an indexed view is causing a sub-optimal plan, and I’m hoping for some help in sorting it. Environment SQL Server 2019 StackOverflow2013 database (50GB version), Compat Mode 150 (problem is not specific to […]

Categories
Mastering Development

Getting undefined for firestore document after .get()

I really don’t know why I’m getting this annoying undefined after using .get() method, (This reafctoring this function as contribution for an open source but there 2 line of code was there for more than a moth and worked fine, I don’t know why its not working for me) This is my function: export async […]

Categories
Mastering Development

Django + React Able to create new user in database, but token-auth returns 400 bad request

So I have an app that I’m writing. It’s working, for the most part, so far. I only currently have a login and signup setup, with a ‘homepage’ that just has a logout button and some text on it so I can test. When I do signup, it posts the user to the database, but […]

Categories
Mastering Development

How to display sender’s and reciever’s photo in imessage app?

In iMessage app I’ve created profile photo for sender and reciever. Only registered users with Google authentication are able to message. On messaging both the sender’s and reciever’s profile photo are displayed. But, the photo isn’t placed as expected besides message bubble, probably minor CSS issue. Following are the required files Message.js import React, { […]

Categories
Mastering Development

Unable to execute Matlab code both in Jupyter and online compiler

I need to see the code output of the following matlab code. %Defining the arrays i=1200; XbFe=zeros(1,i); XbCr=zeros(1,i); XbO2=zeros(1,i); XbFeO=zeros(1,i); XbCr2O3=zeros(1,i); CbFe=zeros(1,i); CbCr=zeros(1,i); CbO2=zeros(1,i); CbFeO=zeros(1,i); CbCr2O3=zeros(1,i); keq_FeO=zeros(1,i); keq_Cr2O3=zeros(1,i); val=zeros(1,i); XiFe=zeros(1,i); XiCr=zeros(1,i); CiFe=zeros(1,i); CiCr=zeros(1,i); JFe=zeros(1,i); JCr=zeros(1,i); MolesTransFe=zeros(1,i); MolesTransCr=zeros(1,i); MolesTransfFeO=zeros(1,i); MolesTransfCr2O3=zeros(1,i); MolesTransO2=zeros(1,i); MFe=zeros(1,i); MCr=zeros(1,i); MO2InMetal=zeros(1,i); Moxy=zeros(1,i); MCr2O3=zeros(1,i); MFeO=zeros(1,i); MassOfFe=zeros(1,i); MassOfCr=zeros(1,i); MassofO2=zeros(1,i); MassOfFeO=zeros(1,i); MassOfCr2O3=zeros(1,i); TotalMolesInMetal=zeros(1,i); TotalMolesInSlag=zeros(1,i); TotalMassOfMetal=zeros(1,i); TotalMassOfSlag=zeros(1,i); […]

Categories
Mastering Development

ignore the following properties in swift Codable?

I have this Account struct. I want to ignore the following properties environments and Id in encoding to JSON object when I send "POST" endpoint and use them return success decoding to swift object struct Account: Codable { let accountID, displayName, managedByID, id: String let environments: [Environment] let contacts: [Contact] enum CodingKeys: String, CodingKey { […]

Categories
Mastering Development System & Network

Why does this powershell command using Get-Service not continue if it encounters an error?

I’ve been tasked with auditing Windows servers to see what services and programs are installed. I though PowerShell would be ideal for this, though I am new to PowerShell scripting. I have a list of servers in a txt file and have been using the following commands. Get-CimInstance -ComputerName (Get-Content .\servers.txt) -ClassName win32_product | Select-Object […]

Categories
Mastering Development

Looping and adding extra properties to a Object

I’m running a simple script to check if several specific services are running on an array of computers. It works fine, except the each ‘row’ appears’ for every iteration of the loop. In this case 3 times. How do I edit/add to a property of an existing object? I.e. I want to add extra properties […]

Categories
Mastering Development

Getting “TypeError: string indices must be integers” when trying to get the user id from firebase (pyrebase)

In my code the user logs in with the email and password method. The user variable is user = str(auth.sign_in_with_email_and_password(email, password)) when trying to get the idToken from this with uidToken = user[‘idToken’] i get the error in the title If i print out user it gives me {‘kind’: ‘identitytoolkit#VerifyPasswordResponse’, ‘localId’: ‘cSZHkRIzGPWfuMmaZ93STFVvdr43′, ’email’: ‘1@1.com’, ‘displayName’: […]