Categories
Mastering Development

How to use TypeScript with Object.entries()?

I’ve recently began using TypeScript on my own projects, though I’m not sure how I should go about getting my code to work. Object.entries(data[`set_${id}`].tiles).map(([tileType, tiles]) => ( tiles.map(([left, top]), index) => ( //rest of code ) )) TypeScript is complaining that left, top, and index all have ‘any’ type. How can I go about assigning […]

Categories
Ask Engineering

Quadriga Open software

There is a driving course tutorial in Quadriga Software. I would like to use the same tutorial with amendments to simulate a scenario with a single transmitter and eight other receivers. The main purpose of the doing this is to calculate the received power and distance so as to plot them in a graph. After […]

Categories
CMS Mastering Development Wordpress

want to rewrite an URL in wordpress

i want rewrite some urls in wordpress from http://localhost/wordpress/my-page/2/ to http://localhost/wordpress/my-page/part-2/ anyone can help? Now i am using something like this but it not working. add_rewrite_rule(‘^(my-page)/([^/]*)/?’, ‘index.php?pagename=$matches[1]&my-page=$matches[2]’,’top’);

Categories
Mastering Development

Unable to display video in webpage using javaFx Webview (video is live on the given url)

I am trying to display a live webpage in JavaFX Webview . Web page contains a video but that video not playing in javaFX webview . Following is the comple code i am using it also contains the live url of my webpage. I want in my JavaFX web view video should be played through […]

Categories
Mastering Development

What is the VINTF manifest in android studio? Have an error

2020-04-22 16:14:49.759 1809-1809/? E/servicemanager: Could not find android.hardware.power.IPower/default in the VINTF manifest. This keeps popping up. Am coding a camera, that when a button is clicked, an image is cropped. Here is a custom view I am adding to a fragment. public class DrawView extends View { Point[] points = new Point[4]; /** * point1 […]

Categories
Mastering Development

phmagick crop with values from javascript

I got 6 variables and i don’t know how to combine them into values for cropping with phmagick My Javascript has 4 values: cropX for example 0 cropY for example 400 cropW for example 400 cropH for example 400 then i got the original file size: originnalx = 800 originaly = 800 so the image […]

Categories
Linux Mastering Development

Replace one field of CSV file based on entries in a second CSV file

I’m trying to merge 2 files together using awk. I want to print fields 1,2 from file1 as they are and replace field 3 according to a mapping stored in file 2. File1: 1,top,yel 2,dress,bl 3,jeans,bl File2: bl,blue yel,yellow Desired output: 1,top,yellow 2,dress,blue 3,jeans,blue What I tried so far Here’s the awk command I tried […]

Categories
Linux Mastering Development

Awk Merge 2 Files

I’m trying to merge 2 files together using awk. I want to print fields 1,2 from file1 and where field 3 from file1 = field 1 from file2 then print field 2 too. However when bl appears twice the output only includes bl once. File1: 1,top,yel 2,dress,bl 3,jeans,bl File2: bl,blue yel,yellow Desired output: 1,top,yellow 2,dress,blue […]

Categories
Mastering Development

Size to up animation for widgets

In Flutter you suppose I have a simple Container and I would like to change the size of that to up, for example in this simple screenshot I want to change top container in section 1 to up to have a top container in section 2 and top container in section 1 should behave only […]

Categories
CMS Mastering Development Wordpress

Rewrite URL WordPress and Shortcode

I have an unresolved problem, please help me. I use WordPress. Myurl index.php?story=slug_story&chapter=id_parent-slug_chapter My code add_action( ‘init’, function () { add_rewrite_rule( ‘^name/([^/]+)/([^/]+)/?$’, ‘index.php?story=$matches[1]&chapter=$matches[2]’, ‘top’ ); }, 1, 1 ); My result name/slug_story/id_parent-slug_chapter => Working for me. But how can I rewrite URLs => name/slug_story/slug_chapter ?