Categories
Mastering Development

Comparing two datasets using data.table

Consider the following datasets data_00 <- data.table(ID = c(1,1,1,2,2,2,3,3,3,4,5,5,6), COLOUR = c("blue","green","yellow","yellow","red","blue","green","green","white","green","blue","yellow","white")) data_01 <- data.table(ID=c(1,2,2,2,3,3,4,4,5,6,6), COLOUR=c("red","blue","green","white","yellow","blue","white","green","blue","white","pink")) ID COLOUR 1: 1 blue 2: 1 green 3: 1 yellow 4: 2 yellow 5: 2 red 6: 2 blue 7: 3 green 8: 3 green 9: 3 white 10: 4 green 11: 5 blue 12: 5 yellow 13: […]

Categories
Mastering Development

React: how to update a deep property?

I have the simple state: const state = { title: "The title", colorSet: { multiple: true, colors: [ ‘red’, ‘green’, ‘blue’, ‘yellow’, ‘gray’, ‘white’, ], selected: [ ‘green’, ‘yellow’, ], } }; We are to pass into the setState() function only the changes what we need to apply. For example, if I need to update […]

Categories
Mastering Development

center child view within full screen

I’m trying to build a simple loading spinner view on a login page and the button that is used to call the LoginAPI is within a VStack and then a HStack -> placing the Login Button on the bottom of the screen. I also have the screen created all on different extracted views meaning that […]

Categories
Mastering Development

Copy the Contents of Material Table to the Clipboard

I am using Angular 9 and using material table. I want to have a button which can copy the content of the table to the ClipBoard. I have tried using [cdkCopyToClipboard] and bind it to the dataSource but when I copy , the result I get is [object Object]. Can somebody help me here ? […]

Categories
User Help Web Apps

How do I make the query look to the next choice?

I am importing data from a Google Form to a Google Spreadsheet. I have created a query to compile data from the response tab to 4 different tabs in the spreadsheet. I have put a limit on the number of results that can be placed on each tab. The respondent gets 4 choices (red, blue, […]

Categories
Mastering Development

How to repair error in Einstein Zebra in prolog >

I have a problem with zebra puzzle. rightOf(A,B,(B,A,_,_,_)). rightOf(A,B,(_,B,A,_,_)). rightOf(A,B,(_,_,B,A,_)). rightOf(A,B,(_,_,_,B,A)). middleHouse(A,(_,_,A,_,_)). firstHouse(A,(A,_,_,_,_)). nextTo(A,B,(A,B,_,_,_)). nextTo(A,B,(_,A,B,_,_)). nextTo(A,B,(_,_,A,B,_)). nextTo(A,B,(_,_,_,A,B)). nextTo(A,B,(B,A,_,_,_)). nextTo(A,B,(_,B,A,_,_)). nextTo(A,B,(_,_,B,A,_)). nextTo(A,B,(_,_,_,B,A)). house[Nationality,Pet,Sport,Drinks,Colour]. zebra_owner(Owner) :- houses(Houses), exists(house(Owner,zebra,_,_,_), Houses). length(5,Houses), exists(house(british,_,_,_,red),Houses), exists(house(spanish,dog,_,_,_),Houses), exists(house(_,_,_,coffe,green),Houses), exists(house(ukrainian,_,_,tea,_),Houses), rightOf(house(_,_,_,_,green),house(_,_,_,_,ivory),Houses), exists(house(_,snail,tennis,_,_),Houses), exists(house(_,_,chess,_,yellow),Houses), middleHouse(house(_,_,_,mlik,_),Houses), firstHouse(house(norwegian,_,_,_,_),Houses), nextTo(house(_,_,rugby,_,_),house(_,fox,_,_,_),Houses), nextTo(house(_,_,chess,_,_),house(_,horse,_,_,_),Houses), exists(house(_,_,volleyball,orangejuice,_),Houses), exists(house(japanese,_,_,_,_),Houses), nextTo(house(norwegian,_,_,_,_),house(_,_,_,_,blue),Houses), nextTo(house(_,_,_,tea,_),house(_,_,_,milo,_),Houses), exists(house(zebra_owner,zebra,_,_,_),Houses). Under house[Nationality,Pet,Smokes,Drinks,Colour]. show me error: Sngleton variables: house[Nationality,Pet,Smokes,Drinks,Colour]. And when i […]

Categories
Linux Mastering Development

How can I find the most frequent word in a .csv file, ignoring duplicates on each line?

I need to find the 10 most frequent words in a .csv file. The file is structured so that each line contains comma-separated words. If the same word is repeated more than once in the same line, it should be counted as one. So, in the example below: green,blue,blue,yellow,red,yellow red,blue,green,green,green,brown green, blue and red should […]

Categories
Ask Engineering

Use Shimano Steps Charger EC-E6000 with 3rd party battery

a am building a bike battery for a friend with a generic BMS. I also got hold of a EC-E6000 battery charger from the Shimano Steps system. The charger does not charge the battery and I suspect that some magic happens in some smaller wires in the chargers cable (green, yellow, blue). Is there a […]

Categories
Ask Engineering

Unknown induction motor wiring?

I just took apart an old dishwasher for parts. The large motor I got from it seems to be an induction motor. It has 4 wires. Green, yellow, red, and blue. I know for a fact that the green one is ground, so it can be ignored. It also had a 15uF capacitor for the […]

Categories
Mastering Development

How do I make the plotted points be instances of the 2d point class with a random x and y component? [closed]

The program is a 2d point class trying to implement a coordinate system class, so the points can be plotted graphically. I need the points plotted to be instances of the 2d point class, each with a random x and y component that are within the width and height of the canvas. The plotted points […]