Categories
Database Development

SQL: How to get all tables’ columns & keys + the primary key?

I’m trying to get all tables in a database, with their column definitions and keys. Given the following tables create database test; use test; CREATE TABLE authors ( id int NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL UNIQUE, PRIMARY KEY(id) ); CREATE TABLE books ( id int NOT NULL AUTO_INCREMENT, author_id int NOT NULL, title […]

Categories
Mastering Development

Access a JSON inside a function: can’t figure out why I get a type mismatch

I’m calling a function which takes a Json (from the VBA Json library) and some strings as inputs, but I keep getting a type mismatch, but if I access the Json from outside the function (with the original "json" object, not the function parameter "dataJson", it works fine. Here is the code (I skip over […]

Categories
Mastering Development

How can I implement WorkManager within an Activity instead of a separate class so I can use Activity variables?

I want to use most of the variables from my activity in the WorkManager to be able to send notifications even when the user is not on the app. How can I use the variables from my activity in my WorkManager to generate notifications using those variables? public class UploadTask extends Worker { public static […]

Categories
Mastering Development

Building an encrypted html string for trustpilot

as part of a project I have been tasked to build a script that we can use to generate data for our marketing team to use on our sales/marketing platform to send to customer to post reviews on trust pilot. I have done this work previously and it has been working seamlessly however trust pilot […]

Categories
Mastering Development

Angular shared component that extends class is complaining about unknown properties

I hope someone can help; I will try to explain this as best as I can. I have a table component which many components extend. The base table component looks like this: export class DataTableBaseComponent implements OnInit, OnChanges, OnDestroy { @Input() subject: BehaviorSubject<any[]>; @Input() loadingSubject: BehaviorSubject<boolean>; @Input() itemsPerPage: number; @Input() multiSelect = true; @Output() onItemRemoved: […]

Categories
Mastering Development

Check if a set of objects intersect another set of objects

I have an object(LineA) that is composed of 4 children and sub-children. They are Meshes(MeshLineMaterial) and ArrowHelpers. Then I have another set of objects(Other Lines) of the same kind. Sample object: castShadow: false
 children: Array(2) 0: ja {uuid: "B883597B-392D-41EB-A306-33A2F065A5B1", name: "PathA", type: "Mesh", parent: Hc, children: Array(0), …}
1: tb {uuid: "8B507A56-437C-47C5-9A0A-43DE9D8DE0D4", name: "", type: "Object3D", parent: Hc, children: Array(2), …} 
length: 2
 __proto__: Array(0)
 
frustumCulled: true
 layers: Pf {mask: 1}
 matrix: U {elements: Array(16)} 
matrixAutoUpdate: true
 matrixWorld: U {elements: Array(16)} 
matrixWorldNeedsUpdate: false
 nObjType: "Path" 
name: "Path" 
parent: wd {uuid: "20293B1F-868F-4A06-9A24-AF14738955A8", name: "", type: "Scene", parent: null, children: Array(121), …} 
position: n {x: 0, y: 0, z: 0}
quaternion: ua {_x: 0, _y: 0, _z: 0, _w: 1,  _onChangeCallback: ƒ}
 receiveShadow: false
 renderOrder: 0
rotation: Qb {_x: 0, _y: 0, _z: 0,  _order: "XYZ",  _onChangeCallback: ƒ}
 scale: n {x: 1, y: 1, z: 1}
 selectable: true
 type: "Group"
 up: n {x: 0, y: 1, z: 0} […]

Categories
Mastering Development

How do you write data in a specific cell in an excel file without overwriting data (using pandas)?

I have an excel file with column names of "Symbol", "Name", "Industry" etc. I want someone to be able to add a stock symbol under the "symbol" column on the row with an empty cell. I do not want my program to overwrite the data in the excel file. I don’t know if I should […]

Categories
Mastering Development

Data are missing in the component (after resave project in VS Code – all OK)

when I open the page in React, my data are missing in rendering. Refresh is not helpful. If I make some change in my code, for example, I remove the dot and then I add back dot and I resave the project, then my data are correctly fetched. But If I refresh the page, my […]

Categories
Mastering Development

Customised Bubble plot

I am trying to do a bubble plot. My data are: Year<-rep(2001:2005, each = 5) name<-c("John","Ellen","Mark","Randy","Luisa") Name<-c(rep(name,5)) Value<-sample(seq(0,25,by=1),25) mydata<-data.frame(Year,Name,Value) And by far I’ve got to this point: ggplot(mydata, aes(x=Year, y=Name, size = Value)) + geom_point() + theme(axis.line = element_blank(), axis.text.x=element_text(size=11,margin=margin(b=10),colour="black"), axis.text.y=element_text(size=13,margin=margin(l=10),colour="black", face="italic"), axis.ticks = element_blank(), axis.title=element_text(size=18,face="bold"), panel.grid.major = element_blank(), panel.grid.minor = element_blank(), panel.background = element_blank(), […]

Categories
Mastering Development

i got Validation failed for one or more entities. See ‘EntityValidationErrors’ property for more details

I got an error in ASP.NET MVC, the problem is in action method called Save but I don’t know where is it exactly and here is the below error System.Data.Entity.Validation.DbEntityValidationException: ‘Validation failed for one or more entities. See ‘EntityValidationErrors’ property for more details.’ Customer controller using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; using System.Data.Entity; using System.Data.Entity.Validation; […]