Categories
Mastering Development

Is there a way to RUN multiple versions of Node.js simultaneously on Windows?

So, to be clear, I’m not asking about the possibility of INSTALLING multiple versions of Node, or the capability of switching between multiple versions with something like nvm. (The original nvm package for Mac/Linux has an "exec" command that lets you run a command under a particular version of node. I think this would be […]

Categories
Mastering Development

Trying to make a Snake And Ladder game in PHP [closed]

So, im a beginner trying to make a snake and ladder code through php, html and css. The game should ask a question everytime the player rolls the dice. My problem now is : 1)I do not know how to connect the dice to my question page My "code" pastebin.com/p19e02bm from codepen

Categories
Mastering Development

How to move the data that I have called from the Firebase real-time database, in a listview to another activity in android studio?

So, I have a simple listview application. When I click an item, it will send the data to the next activity using Bundle. In the first time, I use this JSON structure "teacher": [ { "name": "Carl", "age": "40" }, { "name": "Johnson", "age": "44" } ], And this is my Java code: Query query […]

Categories
Mastering Development

How do I make c++ read \n inside of a character array?

So, I am a beginner programmer in c++ and I started working on a short word search. I added a bool to the program where I can check if the word is either contained or is an exact word match. The problem is I tried to do this if text[textPos+1]=’\n’ and of course it doesn’t […]

Categories
Mastering Development

Variance and covariance of a bivariate normal distribution

So, I asked a similar question recently and it was about finding variance of a one-variable normal distribution. In that case with given (x,y) we could find mean(mn) and variance(sgm) using^ mn = np.average(x, weights=y) sgm = np.average((abs(x-mn))**2, weights=y) However, I can’t find a way to make an analogical thing for a bivariate normal distribution: […]

Categories
Mastering Development

Firestore denies add operation in web worker with completely open security rules (web-app)

So, I have setup the following web worker to add data to a Firestore Collection. The first part of the web worker code initializes Firebase and get some references importScripts("https://www.gstatic.com/firebasejs/8.3.1/firebase-app.js"); importScripts("https://www.gstatic.com/firebasejs/8.3.1/firebase-auth.js"); importScripts("https://www.gstatic.com/firebasejs/8.3.1/firebase-firestore.js"); // firebase configuration object const firebaseConfig = { apiKey: "XXX", authDomain: "XXX", projectId: "XXX", storageBucket: "XXX", messagingSenderId: "XXX", appId: "XXX" }; // initialize […]

Categories
Mastering Development

angular calling a function from a image.onload

I am working with a component in angular, declared a variable to hold an image, so, later will render the image in canvas context. So, I has in the component, declared a function named Draw_Map();, it expect the "this" context to be the component. but, when I try to call the function from inside an […]

Categories
Mastering Development

parsing skaffold config: error parsing skaffold configuration file

So, I’m trying to automate docker build and push process and as well as the kubectl apply deployment process and for this, I have created a skaffold config file in main folder as follows: apiVersion: skaffold/v2alpha3 kind: Config deploy: kubectl: manifests: – ./infra/k8s/* build: local: push: false artifacts: – image: xyz/client context: client docker: dockerfile: […]

Categories
Mastering Development

Is checking the existence of an objects key considered timing safe?

So, I’m authing a pretty short list of users for a mostly private server, and the login data for these users in stored in an object. The object is structured like {"username":"hash"}. I’d like to know if using something like if(users[username) {timingSafeCompare(hash,users[username])} is considered timing safe. I thought of using something like let u = […]

Categories
Mastering Development

R Shiny Apps – How to stop shell commands which can delete OS files from the eval expression

So, I have found that we can run shell commands which can delete important files from the input text field which performs the eval operation. I am interested in finding an alternative way to run eval expression without executing the shell commands. Below is a reproducible example. Directory Structure |– app.R |– Imp_file.txt app.R library(shiny) […]