问:
Pupeteer throws ERR exception on goto when in loop
I am trying to open a series of url in an array in a headless browser using puppeteer. It works fine when one url is used, but when a loop is used, puppeteer throws an exception.

```<code>$("a").each(async (index,element)=>{
    if($(element).attr("target") == "_blank"){
        //urls are valid
        let url = "https:"+$(element).attr("href");
        let page = await browserPage.goto(url).then((response)=>{
            console.log(response.status())
        },(error)=>{
                console.log(error)
        })

    }
})
</code>```

An ERR_ABORTED exception is thrown for each element of the array

Is this some kind of rate limiting problem? if so how can i work around it?

Body:
I am trying to open a series of url in an array in a headless browser using puppeteer. It works fine when one url is used, but when a loop is used, puppeteer throws an exception.

$("a").each(async (index,element)=>{
    if($(element).attr("target") == "_blank"){
        //urls are valid
        let url = "https:"+$(element).attr("href");
        let page = await browserPage.goto(url).then((response)=>{
            console.log(response.status())
        },(error)=>{
                console.log(error)
        })

    }
})

An ERR_ABORTED exception is thrown for each element of the array

Is this some kind of rate limiting problem? if so how can i work around it?


来源: stackexchange

问:
react quill not loading on server
My application is built on next js and quill works fine on localhost but on hosting server it does not load first time unless i refresh/reload the page.

```<code>import React, { useState, useEffect, useRef } from "react";
import dynamic from "next/dynamic";

const QuillNoSSRWrapper = dynamic(
  async () => {
  const { default: RQ } = await import("react-quill");
  return ({ forwardedRef, ...props }) => <RQ ref={forwardedRef} {...props} />;
},
{
  ssr: false,
}
);

const quillRef = useRef();

{loadQuillNow && <QuillNoSSRWrapper
              theme="snow"
              ref={quillRef}
              onChange={handleDescription}
            />}
</code>```

It will be very kind of you to help me fix this please, thank you.

ContentLicense: CC BY-SA 4.0

Title: react quill not loading on server

Body:
My application is built on next js and quill works fine on localhost but on hosting server it does not load first time unless i refresh/reload the page.

import React, { useState, useEffect, useRef } from "react";
import dynamic from "next/dynamic";

const QuillNoSSRWrapper = dynamic(
  async () => {
  const { default: RQ } = await import("react-quill");
  return ({ forwardedRef, ...props }) => <RQ ref={forwardedRef} {...props} />;
},
{
  ssr: false,
}
);

const quillRef = useRef();

{loadQuillNow && <QuillNoSSRWrapper
              theme="snow"
              ref={quillRef}
              onChange={handleDescription}
            />}

It will be very kind of you to help me fix this please, thank you.


问:
Can't do anything with npm after upgrading to 9
I upgraded my NPM from 6 to 9 today, and since then, I've been caught in this loop trying to fix the problems that have arisen. When I run any npm command, I get this:

```<code>➜  ~ npm --version
ERROR: npm v9.2.0 is known not to run on Node.js v10.17.0. You'll need to upgrade
to a newer Node.js version in order to use this version of npm. This version of
npm supports the following node versions: `^14.17.0 || ^16.13.0 || >=18.0.0`. You
can find the latest version at https://nodejs.org/.
</code>```

I pulled down and installed the LTS from the Node website, but no matter what I do, I can't change the version of Node being used in my terminal.

```<code>➜  ~ node -v
v10.17.0
</code>```

Running which node gives me this:

```<code>/Users/{MY USER NAME}/Library/Caches/fnm_multishells/72546_1673114415649/bin/node
</code>```

NVM isn't working either:

```<code>➜  ~ nvm use 14
Now using node v14.21.2 (npm v)
➜  ~ node -v
v10.17.0
</code>```

How can I resolve this issue?

Body:
I upgraded my NPM from 6 to 9 today, and since then, I've been caught in this loop trying to fix the problems that have arisen. When I run any npm command, I get this:

➜  ~ npm --version
ERROR: npm v9.2.0 is known not to run on Node.js v10.17.0. You'll need to upgrade
to a newer Node.js version in order to use this version of npm. This version of
npm supports the following node versions: `^14.17.0 || ^16.13.0 || >=18.0.0`. You
can find the latest version at https://nodejs.org/.

I pulled down and installed the LTS from the Node website, but no matter what I do, I can't change the version of Node being used in my terminal.

➜  ~ node -v
v10.17.0

Running which node gives me this:

/Users/{MY USER NAME}/Library/Caches/fnm_multishells/72546_1673114415649/bin/node

NVM isn't working either:

➜  ~ nvm use 14
Now using node v14.21.2 (npm v)
➜  ~ node -v
v10.17.0

How can I resolve this issue?


问:
phpredis scan method laravel
Running my application inside a redis cluster and I stumbled about a strange issue:

```<code>dd(Redis::connection('default')->scan('0', [
    'match' => 'my_application_cache_*',
    'count' => 999,
]));
</code>```

returns:

```<code>array:2 [▼ // app/Http/Controllers/User/ProfileController.php:30
  0 => 1
  1 => []
]
</code>```

Running the same command with redis-cli like:

```<code>127.0.0.1:6379> scan 0 MATCH my_application_cache_* COUNT 9999
</code>```

returns:

```<code>1) "0"
2)  1) "my_application_cache_:SLY6WWj9cymyZzJk0BihOYAm7uNQT9T55bYrvGMB"
    2) "my_application_cache_:IDF8Qe713Y06XOEmaQC7mzyupKgURusIaTxLt1Nx"
    3) "my_application_cache_:4JRZ1Zd8hg2FwQzO5JTRlWuyxIi07V0ERqXtAVer"
    4) "my_application_cache_:GWv8tisv4xQAgBaXdJap62aJh95V5mWvTiw9CQ0X"
    5) "my_application_cache_:hTKTDsUN9YsuuHlxJdFSflL737MvvPZPX0O9uNLQ"
</code>```

Any idea why laravel isn't returning any values inside the 1 element of the array?

Title: phpredis scan method laravel

Body:
Running my application inside a redis cluster and I stumbled about a strange issue:

dd(Redis::connection('default')->scan('0', [
    'match' => 'my_application_cache_*',
    'count' => 999,
]));

returns:

array:2 [▼ // app/Http/Controllers/User/ProfileController.php:30
  0 => 1
  1 => []
]

Running the same command with redis-cli like:

127.0.0.1:6379> scan 0 MATCH my_application_cache_* COUNT 9999

returns:

1) "0"
2)  1) "my_application_cache_:SLY6WWj9cymyZzJk0BihOYAm7uNQT9T55bYrvGMB"
    2) "my_application_cache_:IDF8Qe713Y06XOEmaQC7mzyupKgURusIaTxLt1Nx"
    3) "my_application_cache_:4JRZ1Zd8hg2FwQzO5JTRlWuyxIi07V0ERqXtAVer"
    4) "my_application_cache_:GWv8tisv4xQAgBaXdJap62aJh95V5mWvTiw9CQ0X"
    5) "my_application_cache_:hTKTDsUN9YsuuHlxJdFSflL737MvvPZPX0O9uNLQ"

Any idea why laravel isn't returning any values inside the 1 element of the array?


问:
How do I change the content-type in Spring/Thymeleaf?
I have a Spring/Thymeleaf based site serving dynamically generated HTML pages. I have a JavaScript script with a data structure that I want to fill in with server side data.

I figured out how to make Thymeleaf to serve .js templates:

```<code>@Bean
public static SpringTemplateEngine getTemplateEngine() {
    final SpringTemplateEngine templateEngine = new SpringTemplateEngine();

    templateEngine.addTemplateResolver(htmlTemplateResolver());
    templateEngine.addTemplateResolver(jsTemplateResolver());

    return templateEngine;
}

private static ITemplateResolver jsTemplateResolver() {
    final ClassLoaderTemplateResolver templateResolver = new ClassLoaderTemplateResolver();
    templateResolver.setOrder(Integer.valueOf(1));
    templateResolver.setResolvablePatterns(Collections.singleton("scripts/*"));
    templateResolver.setPrefix("/templates/");
    templateResolver.setSuffix(".js");
    templateResolver.setTemplateMode(TemplateMode.JAVASCRIPT);
    templateResolver.setCharacterEncoding("UTF-8");
    return templateResolver;
}
</code>```

Unfortunately, my browser is not too happy that the scripts are being served with the wrong Content-Type header: text/html;charset=UTF-8

I have found several promising properties to set, but none of them do what I need:

```<code>@GetMapping(value = "/autoscripts/cardLookup",
        produces = "text/javascript")
public String cardDeref(Model model, HttpServletResponse response) {
    model.addAttribute("villainsMap",  villains.getAllById());
    model.addAttribute("henchmenMap",  henchmen.getAllById());

    response.setContentType("text/javascript"); //TODO: This does not actually seem to work. Fix the content-type
    return "scripts/cardSet";
}
</code>```

Body:
I have a Spring/Thymeleaf based site serving dynamically generated HTML pages. I have a JavaScript script with a data structure that I want to fill in with server side data.

I figured out how to make Thymeleaf to serve .js templates:

@Bean
public static SpringTemplateEngine getTemplateEngine() {
    final SpringTemplateEngine templateEngine = new SpringTemplateEngine();

    templateEngine.addTemplateResolver(htmlTemplateResolver());
    templateEngine.addTemplateResolver(jsTemplateResolver());

    return templateEngine;
}

private static ITemplateResolver jsTemplateResolver() {
    final ClassLoaderTemplateResolver templateResolver = new ClassLoaderTemplateResolver();
    templateResolver.setOrder(Integer.valueOf(1));
    templateResolver.setResolvablePatterns(Collections.singleton("scripts/*"));
    templateResolver.setPrefix("/templates/");
    templateResolver.setSuffix(".js");
    templateResolver.setTemplateMode(TemplateMode.JAVASCRIPT);
    templateResolver.setCharacterEncoding("UTF-8");
    return templateResolver;
}

Unfortunately, my browser is not too happy that the scripts are being served with the wrong Content-Type header: text/html;charset=UTF-8

I have found several promising properties to set, but none of them do what I need:

@GetMapping(value = "/autoscripts/cardLookup",
        produces = "text/javascript")
public String cardDeref(Model model, HttpServletResponse response) {
    model.addAttribute("villainsMap",  villains.getAllById());
    model.addAttribute("henchmenMap",  henchmen.getAllById());

    response.setContentType("text/javascript"); //TODO: This does not actually seem to work. Fix the content-type
    return "scripts/cardSet";
}


问:
what is the right way to use distinct in typeOrm?
I want to distinct my table according to  item_id and return all the columns again.

Usage with ale work perfect like that

  .createQueryBuilder('ale')
  .select(
        `DISTINCT ON (itemId) ale.*, ale."originalData"->'source'->>'item_id' as itemId`
      )

```
<p>but when I name my query builder with <strong>activityLogEntry</strong> and retrieve use <strong>DISTINCT</strong>
it does not work.</p>
<pre class="lang-js prettyprint-override"><code>  .createQueryBuilder('activityLogEntry')
      .select(
        `DISTINCT activityLogEntry.*,activityLogEntry.originalData ::jsonb -> 'source' ->> 'item_id' as itemId`
      )

</code>```

Actually  I could not find anything clearly explain usage DISTINCT inside the select with typeorm.

this snippet works but only brings me column of item_id

 .select(
        `DISTINCT activityLogEntry.originalData ::jsonb -> 'source' ->> 'item_id' as itemId`
      )

```

Body:
I want to distinct my table according to  item_id and return all the columns again.

Usage with ale work perfect like that

  .createQueryBuilder('ale')
  .select(
        `DISTINCT ON (itemId) ale.*, ale."originalData"->'source'->>'item_id' as itemId`
      )

but when I name my query builder with activityLogEntry and retrieve use DISTINCT
it does not work.

  .createQueryBuilder('activityLogEntry')
      .select(
        `DISTINCT activityLogEntry.*,activityLogEntry.originalData ::jsonb -> 'source' ->> 'item_id' as itemId`
      )

Actually  I could not find anything clearly explain usage DISTINCT inside the select with typeorm.

this snippet works but only brings me column of item_id

 .select(
        `DISTINCT activityLogEntry.originalData ::jsonb -> 'source' ->> 'item_id' as itemId`
      )


问:
How to log in Evernote desktop browser client if I have a GraphDB error?
I try to sign in (with email and password) Evernote in Chrome, on a Mac. I only see the loader and in console I see an error:

```<code>Uncaught (in promise) Error: Unable to run resolver without valid GraphDB
</code>```

Body:
I try to sign in (with email and password) Evernote in Chrome, on a Mac. I only see the loader and in console I see an error:

Uncaught (in promise) Error: Unable to run resolver without valid GraphDB


问:
Can a OBJ_REF_DELTA object in a git packfile have a base object later in the packfile?
I'm writing a parser for git packfiles (and specifically, git packfiles returned from the smart HTTP API).

When parsing an OBJ_OFS_DELTA object in the packfile, it seems fairly clear from the packfile spec that the base object it refers to to cannot be later in the packfile than the delta object itself, since the offset is used as a negative offset.

However, if an OBJ_REF_DELTA object's base object is in the same packfile, can that be later in the file?

The reason why this is important is that I'm writing a parser that, as much as possible, is "streaming" to use as little memory or local disk as possible.


问:
Invalid feature flag configuration - Amplify React Application
I am a full-stack app with Amplify and React, but it seems like the build is not working with default values in the file amplify/cli.json

      "securityenhancementnotification": false,
      "showfieldauthnotification": false,
      "usesubusernamefordefaultidentityclaim": true,
      "usefieldnameforprimarykeyconnectionfield": false,
      "enableautoindexquerynames": true,
      "respectprimarykeyattributesonconnectionfield": true,
      "shoulddeepmergedirectiveconfigdefaults": false,
      "populateownerfieldforstaticgroupauth": true
    },
```


问:
how to download vitejs with low internet connection
recently I newed my windows so vite js got deleted. I tried to reinstall it but due to bad network connection and filterings from iran government I cant download.I tried many vpns but didnt get it downloaded. can anyone help me. I really got stock. i need it

I tried many vpns but I didnt get the vitejs downloaded


问:
Add rich text editor Learndash answer textarea backend
I'm currently working on a LMS built with Learndash and Wordpress.

The rich text editor is enabled on question textareas but not on answer textareas.

I am grateful if anyone can help me.

Thanks,

`$settings = array(
'tinymce' => array(
'theme' => 'modern',
'plugins' => 'print preview fullpage powerpaste searchreplace autolink directionality advcode visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists textcolor wordcount tinymcespellchecker a11ychecker imagetools mediaembed  linkchecker contextmenu colorpicker textpattern help',
'toolbar1' => 'formatselect | bold italic strikethrough forecolor backcolor | link | alignleft aligncenter alignright alignjustify  | numlist bullist outdent indent  | removeformat | code',
'image_advtab' => true,
'templates' => array(
array( 'title' => 'Test template 1', 'content' => 'Test 1' ),
array( 'title' => 'Test template 2', 'content' => 'Test 2' )
),
'content_css' => array(
'//fonts.googleapis.com/css?family=Lato:300,300i,400,400i',
'//www.tinymce.com/css/codepen.min.css'
)
)
);

wp_editor( $content, $editor_id, $settings );`


问:
Why can't I get my tsconfig paths to work in VSCode?
I'm building a Discord bot and my VS Code project doesn't seem to be able to find my module imports when using tsconfig paths. The bot still loads fine but I imagine none of the code using these paths will actually work.

The errors aren't really super helpful as it's not telling me exactly why it's not working or maybe I just don't understand what exactly it's complaining about; just that I'm getting MODULE_NOT_FOUND errors. I've included the errors themselves and my tsconfig.json  - I've been futzing with includes, baseUrl, rootDir and I've given up googling to try and figure out how all this works. If you are able to help I'd love an explanation on exactly what's going on here?

Debug Console Errors:

```<code>Debugger attached.
Error when loading '/home/tai/dev/FutabaBot/dist/commands/moderation/mute.js': Error: Cannot find module '#util/functions'
Require stack:
- /home/tai/dev/FutabaBot/dist/commands/moderation/mute.js
- /home/tai/dev/FutabaBot/node_modules/@sapphire/pieces/dist/lib/strategies/LoaderStrategy.js
- /home/tai/dev/FutabaBot/node_modules/@sapphire/pieces/dist/index.js
- /home/tai/dev/FutabaBot/node_modules/@sapphire/framework/dist/lib/utils/application-commands/ApplicationCommandRegistries.js
- /home/tai/dev/FutabaBot/node_modules/@sapphire/framework/dist/index.js
- /home/tai/dev/FutabaBot/dist/lib/FutabaClient.js
- /home/tai/dev/FutabaBot/dist/FutabaBot.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/tai/dev/FutabaBot/dist/commands/moderation/mute.js:10:21)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/tai/dev/FutabaBot/dist/commands/moderation/mute.js',
    '/home/tai/dev/FutabaBot/node_modules/@sapphire/pieces/dist/lib/strategies/LoaderStrategy.js',
    '/home/tai/dev/FutabaBot/node_modules/@sapphire/pieces/dist/index.js',
    '/home/tai/dev/FutabaBot/node_modules/@sapphire/framework/dist/lib/utils/application-commands/ApplicationCommandRegistries.js',
    '/home/tai/dev/FutabaBot/node_modules/@sapphire/framework/dist/index.js',
    '/home/tai/dev/FutabaBot/dist/lib/FutabaClient.js',
    '/home/tai/dev/FutabaBot/dist/FutabaBot.js'
  ]
}
Error when loading '/home/tai/dev/FutabaBot/dist/commands/moderation/kick.js': Error: Cannot find module '#util/functions'
Require stack:
- /home/tai/dev/FutabaBot/dist/commands/moderation/kick.js
- /home/tai/dev/FutabaBot/node_modules/@sapphire/pieces/dist/lib/strategies/LoaderStrategy.js
- /home/tai/dev/FutabaBot/node_modules/@sapphire/pieces/dist/index.js
- /home/tai/dev/FutabaBot/node_modules/@sapphire/framework/dist/lib/utils/application-commands/ApplicationCommandRegistries.js
- /home/tai/dev/FutabaBot/node_modules/@sapphire/framework/dist/index.js
- /home/tai/dev/FutabaBot/dist/lib/FutabaClient.js
- /home/tai/dev/FutabaBot/dist/FutabaBot.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/tai/dev/FutabaBot/dist/commands/moderation/kick.js:17:21)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/tai/dev/FutabaBot/dist/commands/moderation/kick.js',
    '/home/tai/dev/FutabaBot/node_modules/@sapphire/pieces/dist/lib/strategies/LoaderStrategy.js',
    '/home/tai/dev/FutabaBot/node_modules/@sapphire/pieces/dist/index.js',
    '/home/tai/dev/FutabaBot/node_modules/@sapphire/framework/dist/lib/utils/application-commands/ApplicationCommandRegistries.js',
    '/home/tai/dev/FutabaBot/node_modules/@sapphire/framework/dist/index.js',
    '/home/tai/dev/FutabaBot/dist/lib/FutabaClient.js',
    '/home/tai/dev/FutabaBot/dist/FutabaBot.js'
  ]
}
Error when loading '/home/tai/dev/FutabaBot/dist/commands/moderation/ban.js': Error: Cannot find module '#util/functions'
Require stack:
- /home/tai/dev/FutabaBot/dist/commands/moderation/ban.js
- /home/tai/dev/FutabaBot/node_modules/@sapphire/pieces/dist/lib/strategies/LoaderStrategy.js
- /home/tai/dev/FutabaBot/node_modules/@sapphire/pieces/dist/index.js
- /home/tai/dev/FutabaBot/node_modules/@sapphire/framework/dist/lib/utils/application-commands/ApplicationCommandRegistries.js
- /home/tai/dev/FutabaBot/node_modules/@sapphire/framework/dist/index.js
- /home/tai/dev/FutabaBot/dist/lib/FutabaClient.js
- /home/tai/dev/FutabaBot/dist/FutabaBot.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/tai/dev/FutabaBot/dist/commands/moderation/ban.js:17:21)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/tai/dev/FutabaBot/dist/commands/moderation/ban.js',
    '/home/tai/dev/FutabaBot/node_modules/@sapphire/pieces/dist/lib/strategies/LoaderStrategy.js',
    '/home/tai/dev/FutabaBot/node_modules/@sapphire/pieces/dist/index.js',
    '/home/tai/dev/FutabaBot/node_modules/@sapphire/framework/dist/lib/utils/application-commands/ApplicationCommandRegistries.js',
    '/home/tai/dev/FutabaBot/node_modules/@sapphire/framework/dist/index.js',
    '/home/tai/dev/FutabaBot/dist/lib/FutabaClient.js',
    '/home/tai/dev/FutabaBot/dist/FutabaBot.js'
  ]
}
Error when loading '/home/tai/dev/FutabaBot/dist/listeners/ready.js': Error: Cannot find module './utils'
Require stack:
- /home/tai/dev/FutabaBot/dist/lib/util/Timers.js
- /home/tai/dev/FutabaBot/dist/lib/ModerationService.js
- /home/tai/dev/FutabaBot/dist/listeners/ready.js
- /home/tai/dev/FutabaBot/node_modules/@sapphire/pieces/dist/lib/strategies/LoaderStrategy.js
- /home/tai/dev/FutabaBot/node_modules/@sapphire/pieces/dist/index.js
- /home/tai/dev/FutabaBot/node_modules/@sapphire/framework/dist/lib/utils/application-commands/ApplicationCommandRegistries.js
- /home/tai/dev/FutabaBot/node_modules/@sapphire/framework/dist/index.js
- /home/tai/dev/FutabaBot/dist/lib/FutabaClient.js
- /home/tai/dev/FutabaBot/dist/FutabaBot.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/tai/dev/FutabaBot/dist/lib/util/Timers.js:6:17)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/tai/dev/FutabaBot/dist/lib/util/Timers.js',
    '/home/tai/dev/FutabaBot/dist/lib/ModerationService.js',
    '/home/tai/dev/FutabaBot/dist/listeners/ready.js',
    '/home/tai/dev/FutabaBot/node_modules/@sapphire/pieces/dist/lib/strategies/LoaderStrategy.js',
    '/home/tai/dev/FutabaBot/node_modules/@sapphire/pieces/dist/index.js',
    '/home/tai/dev/FutabaBot/node_modules/@sapphire/framework/dist/lib/utils/application-commands/ApplicationCommandRegistries.js',
    '/home/tai/dev/FutabaBot/node_modules/@sapphire/framework/dist/index.js',
    '/home/tai/dev/FutabaBot/dist/lib/FutabaClient.js',
    '/home/tai/dev/FutabaBot/dist/FutabaBot.js'
  ]
}
</code>```

tsconfig.json

{
    "extends": "@sapphire/ts-config",
    "compilerOptions": {
        "target": "ES2020",
        "rootDir": ".",
        "outDir": "./dist/",
        "strict": true,
        "skipLibCheck": true,
        "types": ["node"],
        "inlineSources": true,
        "allowJs": true,
        "baseUrl": "./src",
        "paths": {
            "#util/*": ["lib/util/*"],
            "#lib/*": ["lib/*"]
        }
    },
    "include": ["."]
}
```

Body:
I'm building a Discord bot and my VS Code project doesn't seem to be able to find my module imports when using tsconfig paths. The bot still loads fine but I imagine none of the code using these paths will actually work.

The errors aren't really super helpful as it's not telling me exactly why it's not working or maybe I just don't understand what exactly it's complaining about; just that I'm getting MODULE_NOT_FOUND errors. I've included the errors themselves and my tsconfig.json  - I've been futzing with includes, baseUrl, rootDir and I've given up googling to try and figure out how all this works. If you are able to help I'd love an explanation on exactly what's going on here?

Debug Console Errors:

Debugger attached.
Error when loading '/home/tai/dev/FutabaBot/dist/commands/moderation/mute.js': Error: Cannot find module '#util/functions'
Require stack:
- /home/tai/dev/FutabaBot/dist/commands/moderation/mute.js
- /home/tai/dev/FutabaBot/node_modules/@sapphire/pieces/dist/lib/strategies/LoaderStrategy.js
- /home/tai/dev/FutabaBot/node_modules/@sapphire/pieces/dist/index.js
- /home/tai/dev/FutabaBot/node_modules/@sapphire/framework/dist/lib/utils/application-commands/ApplicationCommandRegistries.js
- /home/tai/dev/FutabaBot/node_modules/@sapphire/framework/dist/index.js
- /home/tai/dev/FutabaBot/dist/lib/FutabaClient.js
- /home/tai/dev/FutabaBot/dist/FutabaBot.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/tai/dev/FutabaBot/dist/commands/moderation/mute.js:10:21)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/tai/dev/FutabaBot/dist/commands/moderation/mute.js',
    '/home/tai/dev/FutabaBot/node_modules/@sapphire/pieces/dist/lib/strategies/LoaderStrategy.js',
    '/home/tai/dev/FutabaBot/node_modules/@sapphire/pieces/dist/index.js',
    '/home/tai/dev/FutabaBot/node_modules/@sapphire/framework/dist/lib/utils/application-commands/ApplicationCommandRegistries.js',
    '/home/tai/dev/FutabaBot/node_modules/@sapphire/framework/dist/index.js',
    '/home/tai/dev/FutabaBot/dist/lib/FutabaClient.js',
    '/home/tai/dev/FutabaBot/dist/FutabaBot.js'
  ]
}
Error when loading '/home/tai/dev/FutabaBot/dist/commands/moderation/kick.js': Error: Cannot find module '#util/functions'
Require stack:
- /home/tai/dev/FutabaBot/dist/commands/moderation/kick.js
- /home/tai/dev/FutabaBot/node_modules/@sapphire/pieces/dist/lib/strategies/LoaderStrategy.js
- /home/tai/dev/FutabaBot/node_modules/@sapphire/pieces/dist/index.js
- /home/tai/dev/FutabaBot/node_modules/@sapphire/framework/dist/lib/utils/application-commands/ApplicationCommandRegistries.js
- /home/tai/dev/FutabaBot/node_modules/@sapphire/framework/dist/index.js
- /home/tai/dev/FutabaBot/dist/lib/FutabaClient.js
- /home/tai/dev/FutabaBot/dist/FutabaBot.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/tai/dev/FutabaBot/dist/commands/moderation/kick.js:17:21)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/tai/dev/FutabaBot/dist/commands/moderation/kick.js',
    '/home/tai/dev/FutabaBot/node_modules/@sapphire/pieces/dist/lib/strategies/LoaderStrategy.js',
    '/home/tai/dev/FutabaBot/node_modules/@sapphire/pieces/dist/index.js',
    '/home/tai/dev/FutabaBot/node_modules/@sapphire/framework/dist/lib/utils/application-commands/ApplicationCommandRegistries.js',
    '/home/tai/dev/FutabaBot/node_modules/@sapphire/framework/dist/index.js',
    '/home/tai/dev/FutabaBot/dist/lib/FutabaClient.js',
    '/home/tai/dev/FutabaBot/dist/FutabaBot.js'
  ]
}
Error when loading '/home/tai/dev/FutabaBot/dist/commands/moderation/ban.js': Error: Cannot find module '#util/functions'
Require stack:
- /home/tai/dev/FutabaBot/dist/commands/moderation/ban.js
- /home/tai/dev/FutabaBot/node_modules/@sapphire/pieces/dist/lib/strategies/LoaderStrategy.js
- /home/tai/dev/FutabaBot/node_modules/@sapphire/pieces/dist/index.js
- /home/tai/dev/FutabaBot/node_modules/@sapphire/framework/dist/lib/utils/application-commands/ApplicationCommandRegistries.js
- /home/tai/dev/FutabaBot/node_modules/@sapphire/framework/dist/index.js
- /home/tai/dev/FutabaBot/dist/lib/FutabaClient.js
- /home/tai/dev/FutabaBot/dist/FutabaBot.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/tai/dev/FutabaBot/dist/commands/moderation/ban.js:17:21)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/tai/dev/FutabaBot/dist/commands/moderation/ban.js',
    '/home/tai/dev/FutabaBot/node_modules/@sapphire/pieces/dist/lib/strategies/LoaderStrategy.js',
    '/home/tai/dev/FutabaBot/node_modules/@sapphire/pieces/dist/index.js',
    '/home/tai/dev/FutabaBot/node_modules/@sapphire/framework/dist/lib/utils/application-commands/ApplicationCommandRegistries.js',
    '/home/tai/dev/FutabaBot/node_modules/@sapphire/framework/dist/index.js',
    '/home/tai/dev/FutabaBot/dist/lib/FutabaClient.js',
    '/home/tai/dev/FutabaBot/dist/FutabaBot.js'
  ]
}
Error when loading '/home/tai/dev/FutabaBot/dist/listeners/ready.js': Error: Cannot find module './utils'
Require stack:
- /home/tai/dev/FutabaBot/dist/lib/util/Timers.js
- /home/tai/dev/FutabaBot/dist/lib/ModerationService.js
- /home/tai/dev/FutabaBot/dist/listeners/ready.js
- /home/tai/dev/FutabaBot/node_modules/@sapphire/pieces/dist/lib/strategies/LoaderStrategy.js
- /home/tai/dev/FutabaBot/node_modules/@sapphire/pieces/dist/index.js
- /home/tai/dev/FutabaBot/node_modules/@sapphire/framework/dist/lib/utils/application-commands/ApplicationCommandRegistries.js
- /home/tai/dev/FutabaBot/node_modules/@sapphire/framework/dist/index.js
- /home/tai/dev/FutabaBot/dist/lib/FutabaClient.js
- /home/tai/dev/FutabaBot/dist/FutabaBot.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/tai/dev/FutabaBot/dist/lib/util/Timers.js:6:17)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/tai/dev/FutabaBot/dist/lib/util/Timers.js',
    '/home/tai/dev/FutabaBot/dist/lib/ModerationService.js',
    '/home/tai/dev/FutabaBot/dist/listeners/ready.js',
    '/home/tai/dev/FutabaBot/node_modules/@sapphire/pieces/dist/lib/strategies/LoaderStrategy.js',
    '/home/tai/dev/FutabaBot/node_modules/@sapphire/pieces/dist/index.js',
    '/home/tai/dev/FutabaBot/node_modules/@sapphire/framework/dist/lib/utils/application-commands/ApplicationCommandRegistries.js',
    '/home/tai/dev/FutabaBot/node_modules/@sapphire/framework/dist/index.js',
    '/home/tai/dev/FutabaBot/dist/lib/FutabaClient.js',
    '/home/tai/dev/FutabaBot/dist/FutabaBot.js'
  ]
}

tsconfig.json

{
    "extends": "@sapphire/ts-config",
    "compilerOptions": {
        "target": "ES2020",
        "rootDir": ".",
        "outDir": "./dist/",
        "strict": true,
        "skipLibCheck": true,
        "types": ["node"],
        "inlineSources": true,
        "allowJs": true,
        "baseUrl": "./src",
        "paths": {
            "#util/*": ["lib/util/*"],
            "#lib/*": ["lib/*"]
        }
    },
    "include": ["."]
}


问:
teams tab app - pass deeplink option like subEntityId to appInstallDialog when a user clicks on adaptive card button
Users from our teams tab app can share our app installation link in channel through graph api post request -> https://graph.microsoft.com/v1.0/teams/${teamId}/channels/${channelId}/messages so that other users from that organization can install our app. We're sending the message in channel via adaptive card. In the adaptive card, we added a button which will open app installation dialog if user clicks on it. In the deeplink parameter, we're assigning the referrer id to the subEntityId of the context object so that when a new user install our app, we can know who referred the app to him.

Now the problem is we're not getting the subEntityId from teams context when a new user clicks on the adaptive card button. Microsoft teams open the app installation dialog and after installation, it takes user to our tab app but the subEntityId becomes null.

This is how we're creating the adaptive card.

```<code>{
    "title": "I have just installed the Sample App.",
    "subtitle": "",
    "text": "<p style='line-height:175%'>Click on the below button to install the Sample                  App",
"buttons": [
    {
        "type": "openUrl",
        "title": "Try Sample App",
        "value": "https://teams.microsoft.com/l/entity/app_id/index?context=%7B%22subEntityId%22%3A%22referrlToken%3A%20633fd8ea2dbcfe23c7fa6322%22%7D"
    }
 ]
}
</code>```

Is it possible to pass the subEntityId from app installation dialog to the teams tab app after installation is finished?

Any kind of help is appreciated!

Body:
Users from our teams tab app can share our app installation link in channel through graph api post request -> https://graph.microsoft.com/v1.0/teams/${teamId}/channels/${channelId}/messages so that other users from that organization can install our app. We're sending the message in channel via adaptive card. In the adaptive card, we added a button which will open app installation dialog if user clicks on it. In the deeplink parameter, we're assigning the referrer id to the subEntityId of the context object so that when a new user install our app, we can know who referred the app to him.

Now the problem is we're not getting the subEntityId from teams context when a new user clicks on the adaptive card button. Microsoft teams open the app installation dialog and after installation, it takes user to our tab app but the subEntityId becomes null.

This is how we're creating the adaptive card.

{
    "title": "I have just installed the Sample App.",
    "subtitle": "",
    "text": "
Click on the below button to install the Sample                  App",
"buttons": [
    {
        "type": "openUrl",
        "title": "Try Sample App",
        "value": "https://teams.microsoft.com/l/entity/app_id/index?context=%7B%22subEntityId%22%3A%22referrlToken%3A%20633fd8ea2dbcfe23c7fa6322%22%7D"
    }
 ]
}

Is it possible to pass the subEntityId from app installation dialog to the teams tab app after installation is finished?

Any kind of help is appreciated!


问:
max timestamps for gaps and island sequences
I'm trying to combine sequential rows with the same event_names. This is sort of a "gaps and islands" problem, I'm having trouble deriving the adj_end column.

sql

```<code>select
*
,case when islands = 1
    then max(session_end) over (partition by usr_id order by session_start, island_rank desc rows between current row and unbounded following)
    else null end as adjusted_end
from
(
    select
        usr_id
        ,session_start
        ,session_end
        ,event_name
        ,duration_min
        ,same_event
        ,case when same_event = 1 then
            sum(case when same_event =1 then 1 else 0 end) over (partition by usr_id order by event_name, session_Start rows between unbounded preceding and current row)
            else 0 end as island_rank
    from
    (
        select
            *
            ,case
                when event_name != 'NULL'
                and (event_name = next_event_name or event_name = last_event_name)
                then 1 else 0 end as islands
        from
        (
        select
            usr_id
            ,session_start
            ,session_end
            ,event_name
            ,round(cast(duration as decimal(10,2))/60, 2) as duration_min
            ,ead(event_name) over (partition by usr_id order by session_start) as next_event_name
            ,lag(event_name) over (partition by usr_id order by session_start) as last_event_name
        from Table vg
        )
    )
)
order by usr_id, session_Start asc
</code>```

End Goal:

usr_id
session_start
session_end
event_name
duration_min
islands
island_rank
adj_end

100
12/23/22 9:00:13
12/23/22 9:11:26
A
11.22
0
0

100
12/23/22 9:11:26
12/23/22 9:11:26
NULL
0
0
0

100
12/23/22 9:11:28
12/23/22 9:14:30
B
3.03
0
0

100
12/23/22 9:14:30
12/23/22 9:14:57
A
0.45
0
0

100
12/23/22 9:14:58
12/23/22 9:17:21
B
2.38
0
0

100
12/23/22 9:30:25
12/23/22 9:35:21
NULL
4.93
0
0

100
12/23/22 9:35:21
12/23/22 9:46:23
B
11.02
1
1
12/23/22 9:53:07

100
12/23/22 9:48:24
12/23/22 9:53:07
B
4.7
1
2
12/23/22 9:53:07

100
12/23/22 9:53:07
12/23/22 9:53:07
NULL
0
0
0

100
12/23/22 9:53:07
12/23/22 9:55:59
A
2.87
0
0

100
12/23/22 9:56:00
12/23/22 9:56:48
B
0.8
0
0

100
12/23/22 10:04:37
12/23/22 10:14:33
A
9.93
1
5
12/23/22 10:21:00

100
12/23/22 10:16:05
12/23/22 10:16:17
A
0.2
1
6
12/23/22 10:21:00

100
12/23/22 10:18:00
12/23/22 10:21:00
A
3
1
7
12/23/22 10:21:00

100
12/23/22 10:21:30
12/23/22 10:22:19
B
0.82
0
0

100
12/23/22 10:22:28
12/23/22 10:24:59
A
2.5
0
0

Body:
I'm trying to combine sequential rows with the same event_names. This is sort of a "gaps and islands" problem, I'm having trouble deriving the adj_end column.

sql

select
*
,case when islands = 1
    then max(session_end) over (partition by usr_id order by session_start, island_rank desc rows between current row and unbounded following)
    else null end as adjusted_end
from
(
    select
        usr_id
        ,session_start
        ,session_end
        ,event_name
        ,duration_min
        ,same_event
        ,case when same_event = 1 then
            sum(case when same_event =1 then 1 else 0 end) over (partition by usr_id order by event_name, session_Start rows between unbounded preceding and current row)
            else 0 end as island_rank
    from
    (
        select
            *
            ,case
                when event_name != 'NULL'
                and (event_name = next_event_name or event_name = last_event_name)
                then 1 else 0 end as islands
        from
        (
        select
            usr_id
            ,session_start
            ,session_end
            ,event_name
            ,round(cast(duration as decimal(10,2))/60, 2) as duration_min
            ,ead(event_name) over (partition by usr_id order by session_start) as next_event_name
            ,lag(event_name) over (partition by usr_id order by session_start) as last_event_name
        from Table vg
        )
    )
)
order by usr_id, session_Start asc

End Goal:

usr_id
session_start
session_end
event_name
duration_min
islands
island_rank
adj_end

100
12/23/22 9:00:13
12/23/22 9:11:26
A
11.22
0
0

100
12/23/22 9:11:26
12/23/22 9:11:26
NULL
0
0
0

100
12/23/22 9:11:28
12/23/22 9:14:30
B
3.03
0
0

100
12/23/22 9:14:30
12/23/22 9:14:57
A
0.45
0
0

100
12/23/22 9:14:58
12/23/22 9:17:21
B
2.38
0
0

100
12/23/22 9:30:25
12/23/22 9:35:21
NULL
4.93
0
0

100
12/23/22 9:35:21
12/23/22 9:46:23
B
11.02
1
1
12/23/22 9:53:07

100
12/23/22 9:48:24
12/23/22 9:53:07
B
4.7
1
2
12/23/22 9:53:07

100
12/23/22 9:53:07
12/23/22 9:53:07
NULL
0
0
0

100
12/23/22 9:53:07
12/23/22 9:55:59
A
2.87
0
0

100
12/23/22 9:56:00
12/23/22 9:56:48
B
0.8
0
0

100
12/23/22 10:04:37
12/23/22 10:14:33
A
9.93
1
5
12/23/22 10:21:00

100
12/23/22 10:16:05
12/23/22 10:16:17
A
0.2
1
6
12/23/22 10:21:00

100
12/23/22 10:18:00
12/23/22 10:21:00
A
3
1
7
12/23/22 10:21:00

100
12/23/22 10:21:30
12/23/22 10:22:19
B
0.82
0
0

100
12/23/22 10:22:28
12/23/22 10:24:59
A
2.5
0
0


问:
Pandas: mapping two identifiers to create new columns
My dataset is similar to this dataset:

Order ID
Customer id
Item purchased
Color

1234
1010
Apple
red

1234
1010
Cherry
red

1234
1010
Orange
orange

1234
1010
Banana
yellow

5678
1010
Apple
green

5678
1010
Orange
orange

How can I map the order id and customer id in the dataframe to make my dataframe look like this:

Order ID
Customer id
Apple
Cherry
Orange
Banana

1234
1010
red
red
orange
yellow

5678
1010
green
Nan
orange
Nan

I did try join and group by customerID and orderID but it didn’t give me the expected dataframe


问:
subtraction of 2 sign and magnitude binary numbers in assembly (ex : 11110110 and 10101011)
how can I subtract 2 sign and magnitude binary numbers in assembly (ex : 11110110 and 10101011)

I used SAL then I don't know how to pick out the sign bit, when we shift to left, our signed bit is Carry Flag. then I should use JC or JS? or ...


问:
Code Folding with custom Lexer (ScintillaNET)
The problem is Scintilla control does the folding automatically, which means the folding doesn't work if you do your own lexer.

I'm using this to configure the control if you want to take a look at the code:

https://github.com/robinrodricks/ScintillaNET.Demo

And this explains how to configure the code folder:

https://github.com/jacobslusser/ScintillaNET/wiki/Automatic-Code-Folding

Said that, I have made my own lexer which means the code folder doesn't work. Does anyone know how to make it work with a custom lexer?

I only want the code to fold if { }.

(.NET 7 Winforms C#)


问:
How to extract every line from a stdOut in Kotlin
I'm trying to get all the console outputs from a stream that in this case, the stream is from a Python console. This is a part of a library that I'm doing on GitHub; in it you can find all the code.

I have this function that calls a process:

 @JvmOverloads
    @Throws(SpotDLException::class, InterruptedException::class)
    fun execute(
        request: SpotDLRequest,
        processId: String?,
        callback: ((Float, Long, String) -> Unit)? = null
    ): SpotDLResponse {
        assertInit()
        //Check if the process ID already exists or not.
        if (id2Process.containsKey(processId)) throw SpotDLException("Process ID already exists")

        // disable caching unless it is explicitly requested
        if (!request.hasOption("--cache-path") || request.getOption("--cache-path") == null) {
            request.addOption("--no-cache")
        }
        //MANDATORY!
        request.addOption("--ffmpeg", ffmpegPath!!.absolutePath)

        val spotDLResponse: SpotDLResponse
        val process: Process
        var exitCode: Int = 0

        val outBuffer = StringBuffer() //stdout

        val errBuffer = StringBuffer() //stderr

        val startTime = System.currentTimeMillis()

        val args = request.buildCommand()

        //Full command
        val command = mutableListOf<String>()
        command.addAll(listOf(pythonPath!!.absolutePath, spotdlPath!!.absolutePath))
        command.addAll(args)

        val processBuilder = ProcessBuilder(command)
        val env = processBuilder.environment()
        env["LD_LIBRARY_PATH"] = ENV_LD_LIBRARY_PATH!!
        env["SSL_CERT_FILE"] = ENV_SSL_CERT_FILE!!
        env["PATH"] = System.getenv("PATH")!! + ":" + binDir!!.absolutePath + ":" + ffmpegPath!!.absolutePath
        env["PYTHONHOME"] = ENV_PYTHONHOME!!
        env["HOME"] = HOME!!

        process = try {
            processBuilder.start()
        } catch (e: IOException) {
            throw SpotDLException("Error starting process", e)
        }

        Log.d("SpotDL", "Started process: $process")

        if (processId != null) {
            id2Process[processId] = process
            Log.d("SpotDL", "Added process to map: ${processId[0].code}")
        }

        val outStream: InputStream = process.inputStream
        val errStream: InputStream = process.errorStream
        if(isDebug) Log.d("SpotDL", "Out stream: $outStream")
        if(isDebug) Log.d("SpotDL", "Err stream: $errStream")

        //1 - Default
        /*val stdOutProcessor = StreamProcessExtractor(
            outBuffer,
            outStream,
            callback
        )*/

        //2 - Test
        val stdOutProcessor = com.bobbyesp.library.tests.StreamProcessExtractor(
            errBuffer,
            errStream,
            callback
        )

        val stdErrProcessor = StreamGobbler(
            errBuffer,
            errStream
        )

        exitCode = try {
            stdOutProcessor.join()
            stdErrProcessor.join()
            process.waitFor()
        } catch (e: InterruptedException) {
            try {
                process.destroy()
            } catch (e: Exception) {
                Log.w("SpotDL", "Error destroying process or it was ignored", e)
            }
            if (processId != null) id2Process.remove(processId)
            throw e
        }

        if (processId != null) id2Process.remove(processId)

        val out = outBuffer.toString()
        val err = errBuffer.toString()

        //Delete ANSI (cleaner output)
        val outClean = out.replace("(?:\\x1B[@-Z\\\\-_]|[\\x80-\\x9A\\x9C-\\x9F]|(?:\\x1B\\[|\\x9B)[0-?]*[ -/]*[@-~])".toRegex(), "")
        //Cleaner output
        val errClean = err.replace("(?:\\x1B[@-Z\\\\-_]|[\\x80-\\x9A\\x9C-\\x9F]|(?:\\x1B\\[|\\x9B)[0-?]*[ -/]*[@-~])".toRegex(), "")

        if(exitCode > 0 && !command.contains("--print-errors")) {
            throw SpotDLException("Error executing command: $command, exit code: $exitCode, stderr: $err")
        }

        val elapsedTime = System.currentTimeMillis() - startTime

        spotDLResponse = SpotDLResponse(command, exitCode, elapsedTime, outClean, errClean)

        if(BuildConfig.DEBUG) {
            //INFO/WARN: THE OUT IS EMPTY BECAUSE THE LAST LINE PROVIDED BY THE STREAMPROCESSEXTRACTOR IS EMPTY. Deleting it should make the out/err appear.
            //Update: It doesn't work that way but I think it's that it makes sense. Need to review and compare with youtubedl-android lib.
            Log.d("SpotDL", "Stdout: $outClean")
            Log.e("SpotDL", "Stderr: $errClean")
            Log.d(
                "SpotDL",
                "------------------------------------------------------------------------------"
            )
            Log.d("SpotDL", "Process: $processId finished with exit code: $exitCode")
            Log.d("SpotDL", "Process: $spotDLResponse")
        }

        return spotDLResponse
    }
```
<p>and as you an see I have a StreamProcessExtractor, that is the Kotlin class that gets all the output of the console. The problem is that the stream is not able to get this line that is modified over the time and when it finishes, all the rest of the lines THAT ARE PRINTED appears; that line is the next:</p>
```Alan Walker - Shut Up                    Converting         ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╺━━━━━━━━━━━━━━━  66% 0:00:02
```
<p>As I told, I have tried multiple StreamProcessExtractors but none worked. I leave here some of them. Hope that you can help me.</p>
<ul>
<li>Function used in all the extractors that is in the same class as run function:</li>
</ul>
<pre class="lang-kotlin prettyprint-override"><code>    private fun processOutputLine(line: String) {
        //if is debug, print the line
        if (BuildConfig.DEBUG) Log.d(TAG, line)
        //getProgress and getETA return a random value while I can't extract them from the non-shown line.
        callback?.let { it(getProgress(line), getEta(line), line) }
    }
</code>```

StreamProcessExtractor (it has 3 constructors: [private val buffer: StringBuffer, private val stream: InputStream, private val callback: ((Float, Long, String) -> Unit)? = null])

1

    override fun run() {
        try {
            //Read the stream and get the output line by line on real time
            val reader: Reader = InputStreamReader(stream, StandardCharsets.UTF_8)
            val bufferedReader = BufferedReader(reader)
            var line: String?
            while (bufferedReader.readLine().also { line = it } != null) {
                //Just read the line, cut that line in it's end and add it to the buffer. Then, the buffer will be read by the UI and after that, it will be cleared
                //clean output
                val matcher: Matcher = cleanOutRegex.matcher(line)
                val cleanLine = matcher.replaceAll("")
                if (cleanLine != "") {
                    processOutputLine(cleanLine)
                    //change the line length to 0, not the buffer
                    buffer.setLength(0)
                }
                continue
            }

        } catch (e: IOException) {
            if (BuildConfig.DEBUG) Log.e(TAG, "failed to read stream", e)
        }
    }
```
<ul>
<li>2</li>
</ul>
<pre class="lang-kotlin prettyprint-override"><code>    override fun run() {
        try {
            //Read the stream and get the output line by line on real time
            val reader: Reader = InputStreamReader(stream, StandardCharsets.UTF_8)
            var line: String?
            var nextChar: Int
            var arrayOfChars = ArrayList<String>()
            val currentLine = StringBuilder()
            while (reader.read().also { nextChar = it } != -1) {
                arrayOfChars.add(nextChar.toChar().toString())
                Log.d("StreamProcessExtractor", arrayOfChars.toString())
                if (callback != null) {
                    val line = currentLine.toString()
                    processOutputLine(line)
                    currentLine.setLength(0)
                    continue
                }
                currentLine.append(nextChar.toChar())

            }

        } catch (e: IOException) {
            if (BuildConfig.DEBUG) Log.e(TAG, "failed to read stream", e)
        }
    }
</code>```

3

override fun run() {
        try {
            //Option 1: Read the stream directly
            val reader: Reader = InputStreamReader(stream, StandardCharsets.UTF_8)
            val bytes = mutableListOf<Byte>()
            var c = reader.read()
            while (c != -1) {
                bytes.add(c.toByte())
                c = reader.read()
            }
            reader.close()

            //Option 2: Read the stream (but as Buffered)
            /*val buffer = BufferedInputStream(stream)
            val bytes = mutableListOf<Byte>()
            var c = buffer.read()
            while (c != -1) {
                bytes.add(c.toByte())
                c = buffer.read()
            }
            buffer.close()*/

            //file output stream to write file in the files directory

            val file = File(
                Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS),
                "output.bin"
            )
            val fileOutputStream = FileOutputStream(file)
            //Log the file location
            Log.d("StreamProcessExtractor", fileOutputStream.toString())
            fileOutputStream.write(bytes.toByteArray())
            fileOutputStream.close()
        } catch (e: IOException) {
            if (BuildConfig.DEBUG) Log.e(TAG, "failed to read stream", e)
        }
    }
```
<ul>
<li>4</li>
</ul>
<pre class="lang-kotlin prettyprint-override"><code>    override fun run() {
        try {
            //Read the stream and get the output line by line on real time
            val reader: Reader = InputStreamReader(stream, StandardCharsets.UTF_8)
            val bufferedReader = BufferedReader(reader)
            var line: String?
            while (bufferedReader.readLine().also { line = it } != null) {
                //Just read the line, cut that line in it's end and add it to the buffer. Then, the buffer will be read by the UI and after that, it will be cleared
                //clena output
                val matcher: Matcher = cleanOutRegex.matcher(line)
                val cleanLine = matcher.replaceAll("")
                Log.d("StreamProcessExtractor", line.toString())
                callback?.let { it(1f, 1, line.toString()) }
                buffer.setLength(0)
                continue
            }

        } catch (e: IOException) {
            if (BuildConfig.DEBUG) Log.e(TAG, "failed to read stream", e)
        }
    }
</code>```

And some more deleted...
This has became a real headache for me... I'm trying to the the output of the SpotDL python library (you can find it on GitHub)

Thanks for the time!

Body:
I'm trying to get all the console outputs from a stream that in this case, the stream is from a Python console. This is a part of a library that I'm doing on GitHub; in it you can find all the code.

I have this function that calls a process:

 @JvmOverloads
    @Throws(SpotDLException::class, InterruptedException::class)
    fun execute(
        request: SpotDLRequest,
        processId: String?,
        callback: ((Float, Long, String) -> Unit)? = null
    ): SpotDLResponse {
        assertInit()
        //Check if the process ID already exists or not.
        if (id2Process.containsKey(processId)) throw SpotDLException("Process ID already exists")

        // disable caching unless it is explicitly requested
        if (!request.hasOption("--cache-path") || request.getOption("--cache-path") == null) {
            request.addOption("--no-cache")
        }
        //MANDATORY!
        request.addOption("--ffmpeg", ffmpegPath!!.absolutePath)

        val spotDLResponse: SpotDLResponse
        val process: Process
        var exitCode: Int = 0

        val outBuffer = StringBuffer() //stdout

        val errBuffer = StringBuffer() //stderr

        val startTime = System.currentTimeMillis()

        val args = request.buildCommand()

        //Full command
        val command = mutableListOf<String>()
        command.addAll(listOf(pythonPath!!.absolutePath, spotdlPath!!.absolutePath))
        command.addAll(args)

        val processBuilder = ProcessBuilder(command)
        val env = processBuilder.environment()
        env["LD_LIBRARY_PATH"] = ENV_LD_LIBRARY_PATH!!
        env["SSL_CERT_FILE"] = ENV_SSL_CERT_FILE!!
        env["PATH"] = System.getenv("PATH")!! + ":" + binDir!!.absolutePath + ":" + ffmpegPath!!.absolutePath
        env["PYTHONHOME"] = ENV_PYTHONHOME!!
        env["HOME"] = HOME!!

        process = try {
            processBuilder.start()
        } catch (e: IOException) {
            throw SpotDLException("Error starting process", e)
        }

        Log.d("SpotDL", "Started process: $process")

        if (processId != null) {
            id2Process[processId] = process
            Log.d("SpotDL", "Added process to map: ${processId[0].code}")
        }

        val outStream: InputStream = process.inputStream
        val errStream: InputStream = process.errorStream
        if(isDebug) Log.d("SpotDL", "Out stream: $outStream")
        if(isDebug) Log.d("SpotDL", "Err stream: $errStream")

        //1 - Default
        /*val stdOutProcessor = StreamProcessExtractor(
            outBuffer,
            outStream,
            callback
        )*/

        //2 - Test
        val stdOutProcessor = com.bobbyesp.library.tests.StreamProcessExtractor(
            errBuffer,
            errStream,
            callback
        )

        val stdErrProcessor = StreamGobbler(
            errBuffer,
            errStream
        )

        exitCode = try {
            stdOutProcessor.join()
            stdErrProcessor.join()
            process.waitFor()
        } catch (e: InterruptedException) {
            try {
                process.destroy()
            } catch (e: Exception) {
                Log.w("SpotDL", "Error destroying process or it was ignored", e)
            }
            if (processId != null) id2Process.remove(processId)
            throw e
        }

        if (processId != null) id2Process.remove(processId)

        val out = outBuffer.toString()
        val err = errBuffer.toString()

        //Delete ANSI (cleaner output)
        val outClean = out.replace("(?:\\x1B[@-Z\\\\-_]|[\\x80-\\x9A\\x9C-\\x9F]|(?:\\x1B\\[|\\x9B)[0-?]*[ -/]*[@-~])".toRegex(), "")
        //Cleaner output
        val errClean = err.replace("(?:\\x1B[@-Z\\\\-_]|[\\x80-\\x9A\\x9C-\\x9F]|(?:\\x1B\\[|\\x9B)[0-?]*[ -/]*[@-~])".toRegex(), "")

        if(exitCode > 0 && !command.contains("--print-errors")) {
            throw SpotDLException("Error executing command: $command, exit code: $exitCode, stderr: $err")
        }

        val elapsedTime = System.currentTimeMillis() - startTime

        spotDLResponse = SpotDLResponse(command, exitCode, elapsedTime, outClean, errClean)

        if(BuildConfig.DEBUG) {
            //INFO/WARN: THE OUT IS EMPTY BECAUSE THE LAST LINE PROVIDED BY THE STREAMPROCESSEXTRACTOR IS EMPTY. Deleting it should make the out/err appear.
            //Update: It doesn't work that way but I think it's that it makes sense. Need to review and compare with youtubedl-android lib.
            Log.d("SpotDL", "Stdout: $outClean")
            Log.e("SpotDL", "Stderr: $errClean")
            Log.d(
                "SpotDL",
                "------------------------------------------------------------------------------"
            )
            Log.d("SpotDL", "Process: $processId finished with exit code: $exitCode")
            Log.d("SpotDL", "Process: $spotDLResponse")
        }

        return spotDLResponse
    }

and as you an see I have a StreamProcessExtractor, that is the Kotlin class that gets all the output of the console. The problem is that the stream is not able to get this line that is modified over the time and when it finishes, all the rest of the lines THAT ARE PRINTED appears; that line is the next:

Alan Walker - Shut Up                    Converting         ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╺━━━━━━━━━━━━━━━  66% 0:00:02

As I told, I have tried multiple StreamProcessExtractors but none worked. I leave here some of them. Hope that you can help me.

Function used in all the extractors that is in the same class as run function:

    private fun processOutputLine(line: String) {
        //if is debug, print the line
        if (BuildConfig.DEBUG) Log.d(TAG, line)
        //getProgress and getETA return a random value while I can't extract them from the non-shown line.
        callback?.let { it(getProgress(line), getEta(line), line) }
    }

StreamProcessExtractor (it has 3 constructors: [private val buffer: StringBuffer, private val stream: InputStream, private val callback: ((Float, Long, String) -> Unit)? = null])

1

    override fun run() {
        try {
            //Read the stream and get the output line by line on real time
            val reader: Reader = InputStreamReader(stream, StandardCharsets.UTF_8)
            val bufferedReader = BufferedReader(reader)
            var line: String?
            while (bufferedReader.readLine().also { line = it } != null) {
                //Just read the line, cut that line in it's end and add it to the buffer. Then, the buffer will be read by the UI and after that, it will be cleared
                //clean output
                val matcher: Matcher = cleanOutRegex.matcher(line)
                val cleanLine = matcher.replaceAll("")
                if (cleanLine != "") {
                    processOutputLine(cleanLine)
                    //change the line length to 0, not the buffer
                    buffer.setLength(0)
                }
                continue
            }

        } catch (e: IOException) {
            if (BuildConfig.DEBUG) Log.e(TAG, "failed to read stream", e)
        }
    }

2

    override fun run() {
        try {
            //Read the stream and get the output line by line on real time
            val reader: Reader = InputStreamReader(stream, StandardCharsets.UTF_8)
            var line: String?
            var nextChar: Int
            var arrayOfChars = ArrayList<String>()
            val currentLine = StringBuilder()
            while (reader.read().also { nextChar = it } != -1) {
                arrayOfChars.add(nextChar.toChar().toString())
                Log.d("StreamProcessExtractor", arrayOfChars.toString())
                if (callback != null) {
                    val line = currentLine.toString()
                    processOutputLine(line)
                    currentLine.setLength(0)
                    continue
                }
                currentLine.append(nextChar.toChar())

            }

        } catch (e: IOException) {
            if (BuildConfig.DEBUG) Log.e(TAG, "failed to read stream", e)
        }
    }

3

override fun run() {
        try {
            //Option 1: Read the stream directly
            val reader: Reader = InputStreamReader(stream, StandardCharsets.UTF_8)
            val bytes = mutableListOf<Byte>()
            var c = reader.read()
            while (c != -1) {
                bytes.add(c.toByte())
                c = reader.read()
            }
            reader.close()

            //Option 2: Read the stream (but as Buffered)
            /*val buffer = BufferedInputStream(stream)
            val bytes = mutableListOf<Byte>()
            var c = buffer.read()
            while (c != -1) {
                bytes.add(c.toByte())
                c = buffer.read()
            }
            buffer.close()*/

            //file output stream to write file in the files directory

            val file = File(
                Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS),
                "output.bin"
            )
            val fileOutputStream = FileOutputStream(file)
            //Log the file location
            Log.d("StreamProcessExtractor", fileOutputStream.toString())
            fileOutputStream.write(bytes.toByteArray())
            fileOutputStream.close()
        } catch (e: IOException) {
            if (BuildConfig.DEBUG) Log.e(TAG, "failed to read stream", e)
        }
    }

4

    override fun run() {
        try {
            //Read the stream and get the output line by line on real time
            val reader: Reader = InputStreamReader(stream, StandardCharsets.UTF_8)
            val bufferedReader = BufferedReader(reader)
            var line: String?
            while (bufferedReader.readLine().also { line = it } != null) {
                //Just read the line, cut that line in it's end and add it to the buffer. Then, the buffer will be read by the UI and after that, it will be cleared
                //clena output
                val matcher: Matcher = cleanOutRegex.matcher(line)
                val cleanLine = matcher.replaceAll("")
                Log.d("StreamProcessExtractor", line.toString())
                callback?.let { it(1f, 1, line.toString()) }
                buffer.setLength(0)
                continue
            }

        } catch (e: IOException) {
            if (BuildConfig.DEBUG) Log.e(TAG, "failed to read stream", e)
        }
    }

And some more deleted...
This has became a real headache for me... I'm trying to the the output of the SpotDL python library (you can find it on GitHub)

Thanks for the time!


问:
How to add an href link to material ui TextField?
Has anyone tried to provide the ability to insert href hyper links in material ui text field?

```<code>import TextField from '@mui/material/TextField';
  <TextField
    fullWidth
    label="Your Comment (Min 5 chars)"
    multiline
    placeholder="Say something.."
    variant="outlined"
    defaultValue={prefilledValue}
    inputRef={commentRef}
    onChange={(event) => {
      setComment(event.target.value.length);
    }}
    inputProps={{
      maxLength: 1000,
    }}
  />
</code>```

This way, the text field can only accept plain text. I am trying not to use a third party library such as draftjs for this.

Edit (Adding an example):
This is a text field in material ui. I was able to enter text and also add a Link to a site that I built using material ui. This then saves in a database probably in the format some text and this is the link which I can parse later to display

Body:
Has anyone tried to provide the ability to insert href hyper links in material ui text field?

import TextField from '@mui/material/TextField';
  <TextField
    fullWidth
    label="Your Comment (Min 5 chars)"
    multiline
    placeholder="Say something.."
    variant="outlined"
    defaultValue={prefilledValue}
    inputRef={commentRef}
    onChange={(event) => {
      setComment(event.target.value.length);
    }}
    inputProps={{
      maxLength: 1000,
    }}
  />

This way, the text field can only accept plain text. I am trying not to use a third party library such as draftjs for this.

Edit (Adding an example):
This is a text field in material ui. I was able to enter text and also add a Link to a site that I built using material ui. This then saves in a database probably in the format some text and this is the link which I can parse later to display


问:
expo eas build fails on dependencies
I have an expo project which I want to build an .aab app so that I can submit it on play store. But when I built it I get an error when it installs dependencies. I think the problem is one of the libraries I am using in my app which is react-native-deck-swiper library. I installed it using --force on my project and I think it is the one giving me an error. The reason why I am saying the problem is the library is because when I remove it from the project, the project builds successfully. So how can I force install on EAS build or make the dependencies install so that my app can work?</p>

Title: expo eas build fails on dependencies


问:
calculate the euclidean distance in a json file
how to calculate the euclidean distance in a json file?

i have a error: no match for 'operator+'

```<code>{
    "name" : "att5",
    "comment" : "5 capitals of the US (Padberg/Rinaldi)",
    "type" : "TSP",
    "dimension" : 5,
    "capacity" : 10,
    "edge_weight_type" : "ATT",
    "node_coordinates" : [
        [ 6734, 1453 ],
        [ 2233,   10 ],
        [ 5530, 1424 ],
        [  401,  841 ],
        [ 3082, 1644 ]
    ]

}
</code>```
```<code>s1 = root["node_coordinates"].size();
if (s1 > 0) {
    nodeCoordinates.clear();
nodeCoordinates.resize(s1);
for (int i=0 ; i<s1 ; i++) {
    s2 = root["node_coordinates"][i].size();
    for (int j=0 ; j<s2 ; j++) {
        nodeCoordinates[i].push_back(root["node_coordinates"][i][j].asDouble());
cout << root["node_coordinates"][i][1]+root["node_coordinates"][j][1]
    }
}
}
</code>```

Body:
how to calculate the euclidean distance in a json file?

i have a error: no match for 'operator+'

{
    "name" : "att5",
    "comment" : "5 capitals of the US (Padberg/Rinaldi)",
    "type" : "TSP",
    "dimension" : 5,
    "capacity" : 10,
    "edge_weight_type" : "ATT",
    "node_coordinates" : [
        [ 6734, 1453 ],
        [ 2233,   10 ],
        [ 5530, 1424 ],
        [  401,  841 ],
        [ 3082, 1644 ]
    ]

}

s1 = root["node_coordinates"].size();
if (s1 > 0) {
    nodeCoordinates.clear();
nodeCoordinates.resize(s1);
for (int i=0 ; i<s1 ; i++) {
    s2 = root["node_coordinates"][i].size();
    for (int j=0 ; j<s2 ; j++) {
        nodeCoordinates[i].push_back(root["node_coordinates"][i][j].asDouble());
cout << root["node_coordinates"][i][1]+root["node_coordinates"][j][1]
    }
}
}


问:
How to detect the color mode of the image (Greyscale,CMYK or RGB)
I want to receive a file from the user and check that its color mode is CMYK only

I don't know if this is possible or not


问:
In react-native when using a Flatlist grid, is it possible to have children with higher zIndex?
Context:

I have an app (TinyUX) where people can draw wireframes. It uses a Flatlist grid, where each cell can have a background color, and an icon or text.

The text can be larger than the cell (50x50).

Assuming left text-alignment I created it so the zIndex went down with each cell (data.length - i)

Now I'm trying to add right-alignment.

So for some cells the text needs to overlap the cells to the right, sometimes to the left. But the background of the cell of either left or right (depending how I set the zIndex in relation to i will have the background overdraw the text.

It would seem logical to just make all texts have an zIndex that is higher than the rest of the cell, so they are all above the rest of the cell (icon(s), background colors). But I can't get that to work.

De cell component is nested something like this:

TouchableOpacity (has background color)

Image (positioned absolute, top left to parent)

Image (positioned absolute, top left to parent)

Text (positions absolute, top let to parent.

They have position absolute, so they can overlap.

With my current solution I can make either right or left alignment work.

Main question: How can a child of the renderItem component of a Flatlist grid, have a higher zIndex than every other cell in the grid.

Confusingly.. I just had it working when Metro was not connected, then restarted with Metro and failed again. The component uses React.memo(.. so now I'm not sure if I once was in a state with the fix..


问:
Incorrect "XML Data Binding"
When I want to execute in a new project "XML Data Binding" https://ciselniky.dasta.mzcr.cz/xmlschema/ds_ip-4.12.04.xsd, I get this error:

Type IXMLAutorType_dsCommList is used but not declared

My code:

```<code>{ IXMLTextType }

IXMLTextType = interface(IXMLNode)
['{FE6B9764-30C3-4DF6-8D15-6270D5E71089}']
{ Property Accessors }
function Get_Autor: IXMLAutorType_dsCommList;
function Get_Ptext: IXMLPtext;
function Get_Ktext: IXMLKtextTypeList;
function Get_Priloha: IXMLPrilohaType_dsCommList;
function Get_TextAny: IXMLAnyType_dsComm;
{ Methods & Properties }
property Autor: IXMLAutorType_dsCommList read Get_Autor;
property Ptext: IXMLPtext read Get_Ptext;
property Ktext: IXMLKtextTypeList read Get_Ktext;
property Priloha: IXMLPrilohaType_dsCommList read Get_Priloha;
property TextAny: IXMLAnyType_dsComm read Get_TextAny;
end;
</code>```

If I download the whole xml schema and change a line 123 in the ds_dasta-4.03.25.xsd file

```<code><xs:element name="autor" type="dsComm:autorType" minOccurs="0"/>
</code>```

to

```<code><xs:element name="autor" type="dsComm:autorType" minOccurs="0" maxOccurs="unbounded"/>`
</code>```

Then the type IXMLAutorType_dsCommList is created, but

```<code><xs:complexType name="aType"> from file "ds_dasta-4.03.25.xsd"
</code>```

is not correct.

Thanks in advance for any reply.

Title: Incorrect "XML Data Binding"

Body:
When I want to execute in a new project "XML Data Binding" https://ciselniky.dasta.mzcr.cz/xmlschema/ds_ip-4.12.04.xsd, I get this error:

Type IXMLAutorType_dsCommList is used but not declared

My code:

{ IXMLTextType }

IXMLTextType = interface(IXMLNode)
['{FE6B9764-30C3-4DF6-8D15-6270D5E71089}']
{ Property Accessors }
function Get_Autor: IXMLAutorType_dsCommList;
function Get_Ptext: IXMLPtext;
function Get_Ktext: IXMLKtextTypeList;
function Get_Priloha: IXMLPrilohaType_dsCommList;
function Get_TextAny: IXMLAnyType_dsComm;
{ Methods & Properties }
property Autor: IXMLAutorType_dsCommList read Get_Autor;
property Ptext: IXMLPtext read Get_Ptext;
property Ktext: IXMLKtextTypeList read Get_Ktext;
property Priloha: IXMLPrilohaType_dsCommList read Get_Priloha;
property TextAny: IXMLAnyType_dsComm read Get_TextAny;
end;

If I download the whole xml schema and change a line 123 in the ds_dasta-4.03.25.xsd file

<xs:element name="autor" type="dsComm:autorType" minOccurs="0"/>

to

<xs:element name="autor" type="dsComm:autorType" minOccurs="0" maxOccurs="unbounded"/>`

Then the type IXMLAutorType_dsCommList is created, but

<xs:complexType name="aType"> from file "ds_dasta-4.03.25.xsd"

is not correct.

Thanks in advance for any reply.


问:
Use IFace for Pocket3D in Eyeshot
I'm trying to use the Pocket3D() function. To do this you need to define a Geomtry3D() with the "entList as IFace()" or "Geometry as IFace" constructor.

The idea is to select one or more GBrep.Face and create the Geometry3D() .

My problem is that I have no idea how to get this IFace from GBrep.Face?????

I have no idea what to try. I can't do anything with this iface.

Many Thanks

Title: Use IFace for Pocket3D in Eyeshot


问:
How to set up react routing with a server running Apache?
I have a react app that runs well locally but fails to do so when the build folder is uploaded onto /var/www/____.com. The app is being served from a subfolder, with appropriate changes having been made to the package.json file. Within the public folder of the app, I have a .htaccess file which contains the following lines:

```<code>Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.html [QSA,L]
</code>```

The first page of the app (the authentication page) loads fine, and users are able to successfuly authenticate. However once the next page is loaded ("https://____.com/app/main"), I receive a 404 error. My routing in React is as follows:

```<code><Router basename="/app">
        { isLoggedIn && <Navbar />}
        <Routes>
            { isLoggedIn || <Route exact path = '/' element={<Login setUsername={setUsername}
                setIsLoggedIn={setIsLoggedIn} serverMessage={serverMessage}
                setServerMessage={setServerMessage} />} />
            }
            { isLoggedIn && <Route path='/main' element={<Main />} /> }
            { isLoggedIn && <Route path='/side' element={<Side />} /> }
        </Routes>
</Router>
</code>```

In attempting to resolve the problem, I have attempted to modify my VirtualHost Configuration by adding to it the following:

```<code><Directory /var/www/____.com/app>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^ index.html [L]
  </Directory>
</code>```

This, however, led to me receiving the same 404 error message. I have also attempted to instead add a .htaaccess file with the following lines:

```<code> RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^ index.html [L]
</code>```

to no avail, as this also led to the error 404 message.

Body:
I have a react app that runs well locally but fails to do so when the build folder is uploaded onto /var/www/____.com. The app is being served from a subfolder, with appropriate changes having been made to the package.json file. Within the public folder of the app, I have a .htaccess file which contains the following lines:

Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.html [QSA,L]

The first page of the app (the authentication page) loads fine, and users are able to successfuly authenticate. However once the next page is loaded ("https://____.com/app/main"), I receive a 404 error. My routing in React is as follows:

<Router basename="/app">
        { isLoggedIn && <Navbar />}
        <Routes>
            { isLoggedIn || <Route exact path = '/' element={<Login setUsername={setUsername}
                setIsLoggedIn={setIsLoggedIn} serverMessage={serverMessage}
                setServerMessage={setServerMessage} />} />
            }
            { isLoggedIn && <Route path='/main' element={} /> }
            { isLoggedIn && <Route path='/side' element={<Side />} /> }
        </Routes>
</Router>

In attempting to resolve the problem, I have attempted to modify my VirtualHost Configuration by adding to it the following:

<Directory /var/www/____.com/app>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^ index.html [L]
  </Directory>

This, however, led to me receiving the same 404 error message. I have also attempted to instead add a .htaaccess file with the following lines:

 RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^ index.html [L]

to no avail, as this also led to the error 404 message.


问:
Angular Universal homepage deployed on Vercel doesn't render server side
I deployed an Angular Universal website on Vercel, all routes are rendered in SSR mode except my HomeComponent. When I serve on localhost with ng serve:ssr command all pages are Server Side rendered.

My site is: Site. My Github is: GitHub. Please some help!!


问:
How can a regular React application save video to Android Galery?
I figured out it is not possible to share video content onto Instagram directly on Android in behalf of the user. This was my original intention.

Seems I can not use navigator.share call which works on iOS but not on Android, or only for text and url, but not for video / mp4.

I would not use MediaStore and similar React Nativ solutions as my app is a regular React.

What elso approach do you know?

I have now this:

    const showShareDialog = async () => {
        try {
            log(
                {
                    text: 'setIsDownloadFileInProgress(true) ' + getTempUserShortId(),
                },
                env
            )
            setIsDownloadFileInProgress(true)
            const res = await axios.get(
                `https://t44-post-cover.s3.eu-central-1.amazonaws.com/${imgId}.mp4`,
                { withCredentials: false, responseType: 'blob' }
            )
            setIsDownloadFileInProgress(false)

            const shareData = {
                files: [
                    new File([res.data], `${imgId}.mp4`, {
                        type: 'video/mp4',
                    }),
                ],
                title: 'Megosztom',
                text: 'Mentsd le a képekbe, és oszd meg storyban.',
            }

            //showShareDialog(shareData, 0)

            if (navigator.share && !isDesktop) {
                log(
                    {
                        text:
                            `navigator.share && !isDesktop shareData.files[0].size: ${shareData.files[0].size} ` +
                            getTempUserShortId(),
                    },
                    env
                )

                if (isAndroid()) {
                    const { status } = await MediaLibrary.requestPermissionsAsync()
                    if (status === 'granted') {
                        const asset = await MediaLibrary.createAssetAsync(res.data)
                        await MediaLibrary.createAlbumAsync(`${imgId}.mp4`, asset, false)
                    }
                } else {
                    navigator
                        .share(shareData)
                        .then(() => {
                            log(
                                {
                                    text: `'The share was successful 1 ` + getTempUserShortId(),
                                },
                                env
                            )
                        })
                        .catch((error) => {
                            log(
                                {
                                    text:
                                        `There was an error sharing 1 ${error} ` +
                                        getTempUserShortId(),
                                },
                                env
                            )
                        })
                }
            } else {
                log(
                    {
                        text: 'else ' + getTempUserShortId(),
                    },
                    env
                )
                setIsDesktopDownloadDialogVisible(true)
            }
        } catch (error) {
            console.error(error)
            log(
                {
                    text: `a onclick error 2: ${error} ` + getTempUserShortId(),
                },
                env
            )
        }
    }
```


问:
How to pass multi filters value in grid using asp.net?
about project: I was able to follow example from microsoft documents by building a basic grid with 1 search filter & sorting. (In real project I have about 10 filter values that I want to pass and  have about 12 columns to sort)

Question: I am getting stuck on how to pass multi filter values.

I am guessing it will be using html link. on line below but is it even good idea to pass 10 values here?

 @Html.DisplayNameFor(model => model.MyList[0].Shapes)

Here I have 4 filters (1 searchbar & 3 select). User can search by typing a value or selecting from shapes, Colors, 'Location' filters.

```<code><form asp-page="./Index" method="get">
    <input type="text" asp-for="SearchString"  />

    <select asp-for="Shapes" asp-items="@Model.Shapes_SELECT">
       <option value="Square">Square</option>
       <option value="Circle">Circle</option>
    </select>

    <select asp-for="Colors" asp-items="@Model.Colors_SELECT">
       <option value="Red">Red</option>
       <option value="Black">Black</option>
    </select>

    <select asp-for="Location" asp-items="@Model.Location_SELECT">
       <option value="NYC">NYC</option>
       <option value="LA">LA</option>
    </select>
</form>
</code>```

Basic Grid with 3 columns. Here sort order & multi filters

```<code><table>
    <thead>
        <tr>
            <th>
                <a asp-page="./Index" asp-route-SortOrder="@Model.Shapes_Sort" asp-route-SearchString="@Model.SearchString">
                        @Html.DisplayNameFor(model => model.MyList[0].Shapes) </a>
                </th>
                <th>
                    <a asp-page="./Index" asp-route-SortOrder="@Model.Colors_Sort" asp-route-SearchString="@Model.SearchString">
                        @Html.DisplayNameFor(model => model.MyList[0].Colors)
                    </a>
                </th>
               <th>
                    <a asp-page="./Index" asp-route-SortOrder="@Model.Location_Sort" asp-route-SearchString="@Model.SearchString">
                        @Html.DisplayNameFor(model => model.MyList[0].Locations)
                    </a>
                </th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in Model.MyList)
            {
                <tr>
                    <td>
                        @Html.DisplayFor(modelItem => item.Colors)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.Shapes)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.Locations)
                    </td>
                </tr>
            }
        </tbody>
    </table>
</code>```

This is back-end code where I am building MyList and connecting to front end

```<code>public List<My_Model> MyList { get; set; } = default!;

// Filters
[BindProperty(SupportsGet = true)]
public string? SearchString { get; set; }

[BindProperty(SupportsGet = true)]
public string? Colors { get; set; }
public SelectList? Colors_SELECT { get; set; }

[BindProperty(SupportsGet = true)]
public string? Shapes { get; set; }
public SelectList? Shapes_SELECT { get; set; }

[BindProperty(SupportsGet = true)]
public string? Location { get; set; }
public SelectList? LocationsSELECT { get; set; }

// Sort
public string CurrentSort { get; set; }
public string Colors_Sort { get; set; }
public string Shapes_Sort { get; set; }
public string Loation_Sort { get; set; }

public async Task OnGetAsync()
{
     //get filter & sort data from URL
     CurrentSort = Request.Query["SortOrder"];
     SearchString = Request.Query["SearchString"];
     Colors = Request.Query["Colors"];
     Shapes = Request.Query["Shapes"];
     Location = Request.Query["Loation"];

    // get all data from database
    IQueryable<My_Model> MyList_Temp = from q in _context.My_DbSet
                                       select q;
    //Filters data
    if (!string.IsNullOrEmpty(SearchString)){
        MyList_Temp = MyList_Temp.Where(q => q.Shapes.ToUpper().Contains(SearchString.ToUpper()) || q.Colors.ToUpper().Contains(SearchString.ToUpper()));
     }
     if (!string.IsNullOrEmpty(Shapes)){
         MyList_Temp = MyList_Temp.Where(x => x.Shapes == Shapes);
     }
     if (!string.IsNullOrEmpty(Colors)){
         MyList_Temp = MyList_Temp.Where(x => x.Colors == Colors);
     }
     if (!string.IsNullOrEmpty(Location)){
         MyList_Temp = MyList_Temp.Where(x => x.Colors == Location);
     }

    //Sort data
    Shapes_Sort = String.IsNullOrEmpty(CurrentSort) ? "Shapes_desc" : "";
    Shapes_Sort = CurrentSort == "Shapes_asc" ? "Shapes_desc" : "Shapes_asc";
    Colors_Sort = CurrentSort == "Colors_asc" ? "Colors_desc" : "Colors_asc";
    Locations_Sort = CurrentSort == "Locations_asc" ? "Locations_desc" : "Locations_asc";

        switch (CurrentSort)
        {
            case "Shapes_asc":
                MyList_Temp = MyList_Temp.OrderBy(q => q.Shapes);
                break;
            case "Shapes_desc":
                MyList_Temp = MyList_Temp.OrderByDescending(q => q.Shapes);
                break;
            case "Colors_asc":
                MyList_Temp = MyList_Temp.OrderBy(q => q.Colors);
                break;
            case "Colors_asc":
                MyList_Temp = MyList_Temp.OrderByDescending(q => q.Colors);
                break;
            case "Locations_asc":
                MyList_Temp = MyList_Temp.OrderBy(q => q.Location);
                break;
            case "Locations_desc":
                MyList_Temp = MyList_Temp.OrderByDescending(q => q.Location);
                break;
            default:
                MyList_Temp = MyList_Temp.OrderBy(q => q.Last_Name);
                break;
        }
 MyList = await MyList_Temp.AsNoTracking().ToListAsync();
}
</code>```

Body:
about project: I was able to follow example from microsoft documents by building a basic grid with 1 search filter & sorting. (In real project I have about 10 filter values that I want to pass and  have about 12 columns to sort)

Question: I am getting stuck on how to pass multi filter values.

I am guessing it will be using html link. on line below but is it even good idea to pass 10 values here?

 @Html.DisplayNameFor(model => model.MyList[0].Shapes)

Here I have 4 filters (1 searchbar & 3 select). User can search by typing a value or selecting from shapes, Colors, 'Location' filters.

<form asp-page="./Index" method="get">
    <input type="text" asp-for="SearchString"  />

    <select asp-for="Shapes" asp-items="@Model.Shapes_SELECT">
       <option value="Square">Square</option>
       <option value="Circle">Circle</option>
    </select>

    <select asp-for="Colors" asp-items="@Model.Colors_SELECT">
       <option value="Red">Red</option>
       <option value="Black">Black</option>
    </select>

    <select asp-for="Location" asp-items="@Model.Location_SELECT">
       <option value="NYC">NYC</option>
       <option value="LA">LA</option>
    </select>
</form>

Basic Grid with 3 columns. Here sort order & multi filters

                        @Html.DisplayNameFor(model => model.MyList[0].Shapes)

                        @Html.DisplayNameFor(model => model.MyList[0].Colors)

                        @Html.DisplayNameFor(model => model.MyList[0].Locations)

            @foreach (var item in Model.MyList)
            {

                        @Html.DisplayFor(modelItem => item.Colors)

                        @Html.DisplayFor(modelItem => item.Shapes)

                        @Html.DisplayFor(modelItem => item.Locations)

            }

This is back-end code where I am building MyList and connecting to front end

public List<My_Model> MyList { get; set; } = default!;

// Filters
[BindProperty(SupportsGet = true)]
public string? SearchString { get; set; }

[BindProperty(SupportsGet = true)]
public string? Colors { get; set; }
public SelectList? Colors_SELECT { get; set; }

[BindProperty(SupportsGet = true)]
public string? Shapes { get; set; }
public SelectList? Shapes_SELECT { get; set; }

[BindProperty(SupportsGet = true)]
public string? Location { get; set; }
public SelectList? LocationsSELECT { get; set; }

// Sort
public string CurrentSort { get; set; }
public string Colors_Sort { get; set; }
public string Shapes_Sort { get; set; }
public string Loation_Sort { get; set; }

public async Task OnGetAsync()
{
     //get filter & sort data from URL
     CurrentSort = Request.Query["SortOrder"];
     SearchString = Request.Query["SearchString"];
     Colors = Request.Query["Colors"];
     Shapes = Request.Query["Shapes"];
     Location = Request.Query["Loation"];

    // get all data from database
    IQueryable<My_Model> MyList_Temp = from q in _context.My_DbSet
                                       select q;
    //Filters data
    if (!string.IsNullOrEmpty(SearchString)){
        MyList_Temp = MyList_Temp.Where(q => q.Shapes.ToUpper().Contains(SearchString.ToUpper()) || q.Colors.ToUpper().Contains(SearchString.ToUpper()));
     }
     if (!string.IsNullOrEmpty(Shapes)){
         MyList_Temp = MyList_Temp.Where(x => x.Shapes == Shapes);
     }
     if (!string.IsNullOrEmpty(Colors)){
         MyList_Temp = MyList_Temp.Where(x => x.Colors == Colors);
     }
     if (!string.IsNullOrEmpty(Location)){
         MyList_Temp = MyList_Temp.Where(x => x.Colors == Location);
     }

    //Sort data
    Shapes_Sort = String.IsNullOrEmpty(CurrentSort) ? "Shapes_desc" : "";
    Shapes_Sort = CurrentSort == "Shapes_asc" ? "Shapes_desc" : "Shapes_asc";
    Colors_Sort = CurrentSort == "Colors_asc" ? "Colors_desc" : "Colors_asc";
    Locations_Sort = CurrentSort == "Locations_asc" ? "Locations_desc" : "Locations_asc";

        switch (CurrentSort)
        {
            case "Shapes_asc":
                MyList_Temp = MyList_Temp.OrderBy(q => q.Shapes);
                break;
            case "Shapes_desc":
                MyList_Temp = MyList_Temp.OrderByDescending(q => q.Shapes);
                break;
            case "Colors_asc":
                MyList_Temp = MyList_Temp.OrderBy(q => q.Colors);
                break;
            case "Colors_asc":
                MyList_Temp = MyList_Temp.OrderByDescending(q => q.Colors);
                break;
            case "Locations_asc":
                MyList_Temp = MyList_Temp.OrderBy(q => q.Location);
                break;
            case "Locations_desc":
                MyList_Temp = MyList_Temp.OrderByDescending(q => q.Location);
                break;
            default:
                MyList_Temp = MyList_Temp.OrderBy(q => q.Last_Name);
                break;
        }
 MyList = await MyList_Temp.AsNoTracking().ToListAsync();
}


问:
I have a M1 Pro MBP and was trying to upgrade my default Python from V3.8.8 to V3.11.1 but now can no longer "see" any packages in Anaconda
In changing the symlink to V3.11.1, I've "lost" access to all Python packages installed under 3.8.8. Aanconda can't find any modules either, either under 3.8 or 3.11 and won't let me reinstall Anaaconda.

At the terminal prompt, I can get to V3.11.1 via Python3 command (not Python) and can see a list of modules but none of the packages previously installed. Tried to reinstall Anaconda but the installer says to upgrade instead. When I try to upgrade at the system prompt, "conda" isn't recognized.

I'm know my references are all messed up but not sure how to get my environment working. Appreciate any help/suggestions.


问:
VS Code Hypersnips Extension: snippets defined in math context does not work with rmarkdown (.Rmd) files
I tried to use the VS Code Hypersnips extension (https://github.com/draivin/hsnips) for rmarkdown files. The extension works well with markdown files and latex files, but for some reason I cannot get it to work properly with rmarkdown.

For example, I define the following math contexts in the global setting first:

```<code>     function math(context) {
            return context.scopes.some(s => s.includes("math"));
        }

    // inline & block math

        function inline_math(context){
            return context.scopes.some(s => s.includes("math.inline"));
        }

        function block_math(context){
            return context.scopes.some(s => s.includes("math.block")) || context.scopes.some(s => s.includes("math.display"));
        }
</code>```

However, snippets defined in these math context such as the following do not activate when the trigger is typed:

```<code>context math(context)
snippet `(;;;|cdot)` "cdots" iA
``rv='\\cdots'``
endsnippet

context math(context)
snippet `par` "partial" iA
``rv="\\partial "``
endsnippet
</code>```

In contrast, snippets defined without the context definition activate properly, such as:

```<code>snippet `\\dm` "display math" bA
$$
$1
$$
$0
endsnippet
</code>```

I cannot figure out why. I tried to store the snippets in a rmd.hsnips, Rmd.hsnips, rmarkdown.hsnips, and Rmarkdown.hsnips in the designated directory, but the above issue persists.

Thank you for your help.

Body:
I tried to use the VS Code Hypersnips extension (https://github.com/draivin/hsnips) for rmarkdown files. The extension works well with markdown files and latex files, but for some reason I cannot get it to work properly with rmarkdown.

For example, I define the following math contexts in the global setting first:

     function math(context) {
            return context.scopes.some(s => s.includes("math"));
        }

    // inline & block math

        function inline_math(context){
            return context.scopes.some(s => s.includes("math.inline"));
        }

        function block_math(context){
            return context.scopes.some(s => s.includes("math.block")) || context.scopes.some(s => s.includes("math.display"));
        }

However, snippets defined in these math context such as the following do not activate when the trigger is typed:

context math(context)
snippet `(;;;|cdot)` "cdots" iA
``rv='\\cdots'``
endsnippet

context math(context)
snippet `par` "partial" iA
``rv="\\partial "``
endsnippet

In contrast, snippets defined without the context definition activate properly, such as:

snippet `\\dm` "display math" bA
$$
$1
$$
$0
endsnippet

I cannot figure out why. I tried to store the snippets in a rmd.hsnips, Rmd.hsnips, rmarkdown.hsnips, and Rmarkdown.hsnips in the designated directory, but the above issue persists.

Thank you for your help.