magento2 – Convert XML via XSLT

I want to convert & compatible the below XML file structure with Magento 2 via XSLT,
I start handling it but cannot complete it.


        <!(CDATA( A ))>
        <!(CDATA( B ))>
        <!(CDATA( C ))>
        <!(CDATA( ))>
        <!(CDATA( ))>
    <published>2020-03-04 20:05:47</published>


<xsl:stylesheet version="1.0"

<xsl:output method="xml" encoding="utf-8" indent="no"/>
<xsl:strip-space elements="description fabric catalog category subcategory" />

<xsl:template match="products">
    <xsl:element name="product">
        <xsl:for-each select="product">
            <xsl:element name="sku">
                <xsl:value-of select="id"/>
            <xsl:element name="name">
                <xsl:value-of select="code"/>
            <xsl:element name="price">
                <xsl:value-of select="price"/>
            <xsl:element name="qty">
                <xsl:value-of select="stockamount"/>
            <xsl:element name="color">
                <xsl:value-of select="color"/>
            <xsl:element name="description">
                <xsl:value-of select="description"/>
            <xsl:element name="fabric">
                <xsl:value-of select="fabric"/>
            <xsl:element name="categories">
                <xsl:value-of select="normalize-space(concat(catalog,"",category,"",subcategory))"/>


<?xml version="1.0" encoding="utf-8"?>
<categories>Women / Clothes / Dresses</categories>


<?xml version="1.0" encoding="utf-8"?>
size as configurable_variations etc...


text – Convert bulleted and numbered list HTML code to Markdown in AppleScript?

I have this text to manipulate in AppleScript (e.g. the text of a variable):

Example note exported from Apple.

    <li>*Further* indent</li>
      <li>Even **further **indent. With a (link)(</li>

End note.

I’m converting it all to Markdown from HTML. I need to clean up this remaining bit of HTML which is the bullet list, so that the result is:

Example note exported from Apple.

- Indent
    - *Further* indent
        - Even **further **indent. With a (link)(

End note.

It has to be able to cater to nested indenting with some rich text inside the items such as this example. I prefer Markdown output to use hyphens and either a tab or two spaces for the indenting.

It also has to be containable inside the applescript – no external .py files etc, and to not require homebrew or a third party tool to be installed.

shaders – How to convert from frag position to UV coordinates when my viewport doesn’t cover the screen?

So, I’m implementing SSAO as part of my rendering pipeline using OpenGL/GLSL. It works pretty well when I have a camera that takes up the entire screen. However, when my camera is smaller than the full screen size, the SSAO texture doesn’t get sampled correctly. Here is the relevant GLSL shader code:

// Convert from clip-space
vec2 fragCoords = (fragPos.xy/ fragPos.w); // fragPos is MVP * worldPosition
vec2 screenCoords = fragCoords * 0.5 + 0.5; // Convert from (-1, 1) to (0, 1) to sample UV coordinates

// Sample texture
float ssaoFactor = texture2D(ssaoTexture, screenCoords).r;

I know that there is some funkiness going on with the viewport, but the fixes that I’ve tried haven’t worked. My first thought was to scale fragCoords by normalized size of my viewport (e.g. vec2(0.5, 0.5) for a viewport with half of the width and height of the screen), but that just produced a very strange result. Any thoughts?

python – Convert custom image dataset to format

I am following the TF Image Segmentation and wanted to convert my Custom dataset in the same format. There are 4 folders 2 image folder for Train and Validation and 2 label images folder(indexed png) for train and validation.

I’m trying to convert this custom data into a format so that it will be easier to follow the tutorial

My Code:

path_to_train_images = input_img_paths(:10)
buffer_size = 400
train_dataset =
train_dataset = train_dataset.shuffle(buffer_size)
train_dataset =
train_dataset = train_dataset.batch(batch_size)

test_dataset =
test_dataset =
  load_image_test, num_parallel_calls=AUTOTUNE)
test_dataset = test_dataset.batch(batch_size)

load image:

def load_image_train(datapoint):
  input_image = tf.image.resize(datapoint('image'), (128, 128))
  input_mask = tf.image.resize(datapoint('segmentation_mask'), (128, 128))

  if tf.random.uniform(()) > 0.5:
    input_image = tf.image.flip_left_right(input_image)
    input_mask = tf.image.flip_left_right(input_mask)

  input_image, input_mask = normalize(input_image, input_mask)

  return input_image, input_mask

I am not sure how can I get datapoint(‘segmentation_mask’) in the load_image_train() function because takes only one argument i.e. path of a folder at a time.

8 – Imagemagick error convert delegate failed `’cwebp’

i’m following this guide

I’ve installed Imagemagick, run

composer require drupal/imagemagick
drush en -y imagemagick

and all next steps.

After add convert to WEBP to specific image style, receive this error:

ImageMagick error 1: convert: delegate failed `'cwebp' -quiet -q %Q '%i' -o '%o'' @ error/delegate.c/InvokeDelegate/1919. [command: /Applications/MAMP/bin/apache2/bin/convert '/Applications/MAMP/htdocs/mysite/sites/default/files/2020-10/image.png' -resize 406x376! -crop 336x376+35+0! -quality 70 WEBP:'/Applications/MAMP/htdocs/mysite/sites/default/files/styles/image_336x376/public/2020-10/image.png.webp']

But if run this command in my Terminal:

/Applications/MAMP/bin/apache2/bin/convert '/Applications/MAMP/htdocs/mysite/sites/default/files/2020-10/image.png' -resize 406x376! -crop 336x376+35+0! -quality 70 WEBP:'/Applications/MAMP/htdocs/mysite/sites/default/files/styles/image_336x376/public/2020-10/image.png.webp'

convert correctly

My OS is Macos Catalina 10.15.7, i’ve installed yet webp with homebrew

google cloud functions – Typescript convert File to Uint8ClampedArray

Is there a way to convert a File to an Uint8ClampedArray in Typescript?

Or is there maybe a way to convert the File to an Image? That way I could access the ImageData which is of type Uint8ClampedArray.

Also, side question: How can you get a File from the File path?


Unity3D: Convert all game objects to same size irrespective of it’s scale

Suppose I have a reference GameObject, Cube, with scale (1,1,1). There is another GameObject with scale (1,1,1), but the size is 3 times bigger than the Cube. How do I dynamically change the scale of the Game objects to fit the size of the Cube?

krita – Convert multi-layer Paint.NET (pdn) files to Krit (kra)

I am moving to a Mac from Windows and thus moving away from Paint.NET.

I have several multi-layer Paint.NET (.pdn) files that I would like to continue using. How can I move these easily to Krita?

I know I could save each layer as a separate image and create a new Krita project and add each layer one by one. I would prefer a single multi-layer export and import or something simple like that.

I have one solution that I have discovered that I will post as an answer, but welcome any better answers!

In Google Docs, can I highlight a few words or a dozen words and convert it to a table?

For example, if I listed some items in Google Docs:

Cherry Blossom
Pine cone, Acorn
Maple leaf

and now I want to highlight them and convert them to a table with 5 rows with each row having each line above, is it possible? Or do I have to create a new table, and cut-and-paste the 5 lines, or use highlight and drag and drop? So if there are 20 lines, it has to be repeated 20 times?

Convert to list with React

I have the following code:

const appendRowsToFile = async () => {
let cA = customerArticle;
let cL = listSelectCustumer;

let articles = cA.filter(a => a.price && a.price > 0)

/*console.log(cA, cL, articles)

if (articles) {
  let row = => {
    return ( => {
      return { ...a, ...c }
  articles = row
  var tabla = ()
  tabla.forEach(l => { 
    tabla.push(l) })


What I want is to pass cA and cL to setListSelectNewTable to show it in a table, but when I do it it only saves the information of "row" of cA and not of cL

Any solution?