Categories
Mastering Development

Trying to get the column populated for a scenario in sql

I have a scenario where my table looks like this, ID cal planned date 1DE 26-jun-2020 08-Dec-2020 1DE 31-july-2020 17-feb-2020 1DE 24-aug-2020 17-feb-2020 Expected table ID cal planned date flag 1DE 26-jun-2020 08-Dec-2020 1 1DE 31-july-2020 17-feb-2020 1 1DE 24-aug-2020 17-feb-2020 0 I want to create a flag column where I compare the planned dates […]

Categories
Mastering Development

Rundeck Static Token not loaded when Rundeck Service is started

I think my Rundeck does not load my tokens.properties file. I can’t see it on my service.log being loaded. Here is a screenshot of the log That’s why when I restart the service or the server my scheduled jobs, that triggers Rundeck API, always get this error {"error":true,"apiversion":35,"errorCode":"api.error.item.unauthorized","message":"Not authorized for action \"Run\" for Job ID […]

Categories
Mastering Development

how to get root directory folder name in php instead of path

I want to get the root directory folder name in php. I know its possible to get the root directory path using _DIR_ but i need the folder name. Do we have a php function that can do this? In case the solution is using regular expressions on directory path, is it compatible in all […]

Categories
Mastering Development

How to write a Haskell function that determine if a number is even or odd?

i m trying to understand the haskell language and i m so confused with it, because i have the following exercise and can t even start with it: evenNat :: Integer -> Bool, which takes a non-negative integer as input and determines whether it is even. even :: Integer -> Bool, which takes any integer […]

Categories
Mastering Development

WebGL Reading pixels properly from offscreen canvas

I know there are a lot of resources on this, but none of them have worked for me. Some are: webgl readpixels is always returning 0,0,0,0, and this one: https://stackoverflow.com/questions/44869599/readpixels-from-webgl-canvas\ as well as this one: Read pixels from a WebGL texture but none of them have been either helpful or successful. The goal: Render an […]

Categories
Mastering Development

How to use a single modal with form across all components in Angular 9?

Angular Version :9 (using ngbModal & ngbootstrap) I am working on a way to create login & register functionality in my angular application As of now, I have the login code inside my NavbarComponent which is visible throughout all other components. NavbarComponent.ts constructor( private formBuilder: FormBuilder, private userService: UserService, private sessionService: SessionStorageService, private constant: AppConstants, […]

Categories
Mastering Development

How to convert multiple columns headers to a new column in pyspark?

Given the following dataframe schema df_base: root |– contact: struct (nullable = true) | |– id: string (nullable = true) | |– description: string (nullable = true) |– dept: struct (nullable = true) | |– finance: struct (nullable = true) | | |– id: string (nullable = true) | | |– description: string (nullable = […]

Categories
Mastering Development

How to POST file upload using axios to ASP.NET Controller?

I render image uploader in html using this function. which correctly display image in page. How should I post this FileReader to controller? showCoverImage(e) { var file = e.target.files[0]; var imageType = /image.*/; if (!file.type.match(imageType)) { return; } var img = document.getElementById("thumbnail"); img.file = file; const fileName = document.querySelector(‘#cover-image .file-name’); fileName.textContent = file.name; var reader […]

Categories
Mastering Development

Filling area under two bezier curves on html5 canvas

This is my first time using html canvas, and I am a little stumped with this one. I am trying to build an image like this on an html canvas: Html canvas This is what I have tried so far, and I can’t seem to fill the areas beneath the lines with the appropriate color. […]

Categories
Mastering Development

How can I prevent the value of a fixture to be printed?

I’ve created a pytest fixture which gets a token. When the tests which use this fixture fail, then the token will be printed in the logs. On the one hand that is not helpful, on the other hand it is a security issue. How can I prevent the fixtures content to be printed? MVCE import […]