问:
New line TSX textscript issues
I am trying to create paragraphs and new lines so my text doesn't look so cluttered.

I am new to Typescript and I can't seem to get the text to separate my paragraph. Here is what my text looks like

Here is my code:

```<code>export const aboutData: About = {
  profileImageSrc: profilepic,
  description: `Hello! thanks for taking the time to visit my professional website. My name is Jeremiah Dunphy (He/Him) and I work in a Strategic Senior Human Resources at CW Resources Inc. I have always been passionate about helping people and organizations reach their full potential, and I have found a perfect outlet for this passion in the field of HR and People Management.\n" +
               "\n" +
               "I began my career in HR almost a decade ago and have since gained a wide range of experience in various industries and organizations. I have held HR positions in both small and large companies, giving me a well-rounded understanding of the unique challenges and opportunities that different types of organizations face when it comes to managing and developing their human capital.\n" +
               "\n" +
               "I hold a Bachelors in Human Resources and a Masters in Business Administration. I am currently obtaining my doctorate in Human Resources and Business Management.In my current role as HR Director, I am responsible for overseeing all aspects of human resources management in over 20 states.\n" +
               "\n" +
               "Outside of work, I enjoy spending time with my Family, Coding, Data, Running, Website and Game Development. I am also an active member of the Society for Human Resource Management and am always looking for ways to stay up-to-date on the latest HR trends and best practices.\n" +
               "\n" +
               "As a Combat Veteran who has served on two tours of duty, I know firsthand the sacrifices that our military members make to protect our country. That is why I am committed to giving back to the veteran community through my volunteer work at the VA. Whether it is providing support and companionship to Veterans during hospital stays, helping with paperwork and benefits, or just being a listening ear, I am dedicated to doing whatever I can to assist and support our Veterans. It is my way of honoring their service and sacrifices, and I am grateful for the opportunity to give back to those who have given so much for our country.\n" +
               "\n" +
               "While Volunteering, I have had the opportunity to assist Veterans with a variety of tasks and needs. Whether it is providing support and companionship during hospital stays, helping with paperwork and benefits, or just being a listening ear, I am committed to doing whatever I can to help our Veterans.\n" +
               "\n" +
               "I am grateful for the opportunity to give back to those who have given so much for our country, and I am committed to continuing to support and assist Veterans in any way I can. It is a small way to show my appreciation and gratitude for their service and sacrifice."\n" +

               "Thank you for taking the time to learn more about me. I am excited to bring my skills and experience to bear in helping organizations and individuals reach their full potential."`

               aboutItems: [
                 {label: 'Location', text: 'Hartford, CT', Icon: MapIcon},
                 {label: 'Age', text: '27', Icon: CalendarIcon},
                 {label: 'Nationality', text: '', Icon: FlagIcon},
                 {label: 'Interests', text: 'People, Computer Science, Law and Psycology', Icon: SparklesIcon},
                 {label: 'Studying', text: 'Docotorate in Human Resources and Business Management - Capella University', Icon: AcademicCapIcon},
                 {label: 'Employment', text: 'Cw Resources Inc.', Icon: OfficeBuildingIcon},
               ],
             };
</code>```

I have tried

/n

\n

/n

creating concatenate's

it renders it either as a string or it just does nothing and it is not visable.

any help would be greatly appreciated as I have spent all day on this one task and I'd like to move on to the next section.

Title: New line TSX textscript issues

Body:
I am trying to create paragraphs and new lines so my text doesn't look so cluttered.

I am new to Typescript and I can't seem to get the text to separate my paragraph. Here is what my text looks like

Here is my code:

export const aboutData: About = {
  profileImageSrc: profilepic,
  description: `Hello! thanks for taking the time to visit my professional website. My name is Jeremiah Dunphy (He/Him) and I work in a Strategic Senior Human Resources at CW Resources Inc. I have always been passionate about helping people and organizations reach their full potential, and I have found a perfect outlet for this passion in the field of HR and People Management.\n" +
               "\n" +
               "I began my career in HR almost a decade ago and have since gained a wide range of experience in various industries and organizations. I have held HR positions in both small and large companies, giving me a well-rounded understanding of the unique challenges and opportunities that different types of organizations face when it comes to managing and developing their human capital.\n" +
               "\n" +
               "I hold a Bachelors in Human Resources and a Masters in Business Administration. I am currently obtaining my doctorate in Human Resources and Business Management.In my current role as HR Director, I am responsible for overseeing all aspects of human resources management in over 20 states.\n" +
               "\n" +
               "Outside of work, I enjoy spending time with my Family, Coding, Data, Running, Website and Game Development. I am also an active member of the Society for Human Resource Management and am always looking for ways to stay up-to-date on the latest HR trends and best practices.\n" +
               "\n" +
               "As a Combat Veteran who has served on two tours of duty, I know firsthand the sacrifices that our military members make to protect our country. That is why I am committed to giving back to the veteran community through my volunteer work at the VA. Whether it is providing support and companionship to Veterans during hospital stays, helping with paperwork and benefits, or just being a listening ear, I am dedicated to doing whatever I can to assist and support our Veterans. It is my way of honoring their service and sacrifices, and I am grateful for the opportunity to give back to those who have given so much for our country.\n" +
               "\n" +
               "While Volunteering, I have had the opportunity to assist Veterans with a variety of tasks and needs. Whether it is providing support and companionship during hospital stays, helping with paperwork and benefits, or just being a listening ear, I am committed to doing whatever I can to help our Veterans.\n" +
               "\n" +
               "I am grateful for the opportunity to give back to those who have given so much for our country, and I am committed to continuing to support and assist Veterans in any way I can. It is a small way to show my appreciation and gratitude for their service and sacrifice."\n" +

               "Thank you for taking the time to learn more about me. I am excited to bring my skills and experience to bear in helping organizations and individuals reach their full potential."`

               aboutItems: [
                 {label: 'Location', text: 'Hartford, CT', Icon: MapIcon},
                 {label: 'Age', text: '27', Icon: CalendarIcon},
                 {label: 'Nationality', text: '', Icon: FlagIcon},
                 {label: 'Interests', text: 'People, Computer Science, Law and Psycology', Icon: SparklesIcon},
                 {label: 'Studying', text: 'Docotorate in Human Resources and Business Management - Capella University', Icon: AcademicCapIcon},
                 {label: 'Employment', text: 'Cw Resources Inc.', Icon: OfficeBuildingIcon},
               ],
             };

I have tried

/n

\n

/n

creating concatenate's

it renders it either as a string or it just does nothing and it is not visable.

any help would be greatly appreciated as I have spent all day on this one task and I'd like to move on to the next section.


来源: stackexchange

问:
GraallJS simulating integer overflow
```<code>   public static void main(String args[]) {
       int a = 2147483647;
       System.out.println(a + 5);
   }
</code>```

Outputs

-2147483644

```<code>const Integer = Java.type("java.lang.Integer");
const w = new Integer(2147483647)

console.log(w + 5)
console.log(w + new Integer(5));
</code>```

GraalJS with node --jvm .\ex.js outputs

```<code>2147483652
2147483652
</code>```

Which is wrong. I thought GraalJS was supposed to simulate Java? How do I make it handle the overflow correctly?

ContentLicense: CC BY-SA 4.0

Title: GraallJS simulating integer overflow

Body:
   public static void main(String args[]) {
       int a = 2147483647;
       System.out.println(a + 5);
   }

Outputs

-2147483644

const Integer = Java.type("java.lang.Integer");
const w = new Integer(2147483647)

console.log(w + 5)
console.log(w + new Integer(5));

GraalJS with node --jvm .\ex.js outputs

2147483652
2147483652

Which is wrong. I thought GraalJS was supposed to simulate Java? How do I make it handle the overflow correctly?


问:
composer doesn't find package if not using sudo command (root user)
I came across this problem on ubuntu 22 operating system. the problem occurs with composer not finding the packages needed to install, but if I use sudo the packages are found and can be installed without problems.

example command to install laravel :
composer create-project --prefer-dist laravel/lumen blog

error example
Could not find package laravel/lumen with stability stable.

I've solved this problem, but I forgot how. does anyone still remember? Please help me


问:
I am trying to make a multi label text classifier using bert, I am getting the error written below
RuntimeError: The size of tensor a (913) must match the size of tensor b (512) at non-singleton dimension 1

```<code>def evaluator(text):
  loaded_model = joblib.load(filename)
  encoding = tokenizer(text, return_tensors="pt")
  encoding = {k: v.to(trainer.model.device) for k,v in encoding.items()}
  outputs = trainer.model(**encoding)
  logits = outputs.logits
  # apply sigmoid + threshold
  sigmoid = torch.nn.Sigmoid()
  probs = sigmoid(logits.squeeze().cpu())
  predictions = np.zeros(probs.shape)
  predictions[np.where(probs >= 0.5)] = 1
  # turn predicted id's into actual label names
  predicted_labels = [id2label[idx] for idx, label in enumerate(predictions) if label == 1.0]
  # dataset available
  return predicted_labels
</code>```
```<code>data_text = {}
text_data = []
predict = []
for text in train['text']:
  predict.append(evaluator(text))
  text_data.append(text)
data_text['text'] = text_data
data_text['predictions'] = predict
df = pd.DataFrame.from_dict(data_text)
df
</code>```

I can't figure out why isn't it working using for loop but its working fine with single inputs.

Body:
RuntimeError: The size of tensor a (913) must match the size of tensor b (512) at non-singleton dimension 1

def evaluator(text):
  loaded_model = joblib.load(filename)
  encoding = tokenizer(text, return_tensors="pt")
  encoding = {k: v.to(trainer.model.device) for k,v in encoding.items()}
  outputs = trainer.model(**encoding)
  logits = outputs.logits
  # apply sigmoid + threshold
  sigmoid = torch.nn.Sigmoid()
  probs = sigmoid(logits.squeeze().cpu())
  predictions = np.zeros(probs.shape)
  predictions[np.where(probs >= 0.5)] = 1
  # turn predicted id's into actual label names
  predicted_labels = [id2label[idx] for idx, label in enumerate(predictions) if label == 1.0]
  # dataset available
  return predicted_labels

data_text = {}
text_data = []
predict = []
for text in train['text']:
  predict.append(evaluator(text))
  text_data.append(text)
data_text['text'] = text_data
data_text['predictions'] = predict
df = pd.DataFrame.from_dict(data_text)
df

I can't figure out why isn't it working using for loop but its working fine with single inputs.


问:
Any alternative to --openssl-legacy-provider when working with unsupported envelope routines in nuxtjs?
I've generated a nuxtjs project for the first time via this command:

npx create-nuxt-app <project-name>
```
<p>when running both the npm run start, build, and dev commands I get the following output:</p>
<pre class="lang-bash prettyprint-override"><code>node:internal/crypto/hash:71
  this[kHandle] = new _Hash(algorithm, xofLen);
                ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:140:10)
    at module.exports (/home/me/dev/code/Javascript/Nuxt/first-nux-app/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/home/me/dev/code/Javascript/Nuxt/first-nux-app/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/home/me/dev/code/Javascript/Nuxt/first-nux-app/node_modules/webpack/lib/NormalModule.js:471:10)
    at /home/me/dev/code/Javascript/Nuxt/first-nux-app/node_modules/webpack/lib/NormalModule.js:503:5
    at /home/me/dev/code/Javascript/Nuxt/first-nux-app/node_modules/webpack/lib/NormalModule.js:358:12
    at /home/me/dev/code/Javascript/Nuxt/first-nux-app/node_modules/webpack/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/home/me/dev/code/Javascript/Nuxt/first-nux-app/node_modules/webpack/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at Array.<anonymous> (/home/me/dev/code/Javascript/Nuxt/first-nux-app/node_modules/webpack/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
    at Storage.finished (/home/me/dev/code/Javascript/Nuxt/first-nux-app/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
    at /home/me/dev/code/Javascript/Nuxt/first-nux-app/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
    at /home/me/dev/code/Javascript/Nuxt/first-nux-app/node_modules/graceful-fs/graceful-fs.js:123:16
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
</code>```

What I'm mostly looking at is the error:0308010C:digital envelope routines::unsupported portion of the error. It seems that when nuxtjs attempts to generate an ssl certificate there's some sort of error in the process. Though I'm not exactly sure.

Is this a common thing with nuxtjs? Or node? Or an issue on my side? I've made a minimal setup of nuxt and I'm getting the same errors (and by minimal I literally just mean hitting enter on every setting)

I'm running this on a minimal setup of arch linux, I've updated node and openssl, so I'm not sure if there's a dependency I don't have.

--openssl-legacy-provider is a flag that seems to do the trick, but it feels like putting a band aid over a bullet wound. Using a legacy provider for ssl seems like I'm exposing many vulnerabilities. Is there a better solution?

Body:
I've generated a nuxtjs project for the first time via this command:

npx create-nuxt-app <project-name>

when running both the npm run start, build, and dev commands I get the following output:

node:internal/crypto/hash:71
  this[kHandle] = new _Hash(algorithm, xofLen);
                ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:140:10)
    at module.exports (/home/me/dev/code/Javascript/Nuxt/first-nux-app/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/home/me/dev/code/Javascript/Nuxt/first-nux-app/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/home/me/dev/code/Javascript/Nuxt/first-nux-app/node_modules/webpack/lib/NormalModule.js:471:10)
    at /home/me/dev/code/Javascript/Nuxt/first-nux-app/node_modules/webpack/lib/NormalModule.js:503:5
    at /home/me/dev/code/Javascript/Nuxt/first-nux-app/node_modules/webpack/lib/NormalModule.js:358:12
    at /home/me/dev/code/Javascript/Nuxt/first-nux-app/node_modules/webpack/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/home/me/dev/code/Javascript/Nuxt/first-nux-app/node_modules/webpack/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at Array.<anonymous> (/home/me/dev/code/Javascript/Nuxt/first-nux-app/node_modules/webpack/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
    at Storage.finished (/home/me/dev/code/Javascript/Nuxt/first-nux-app/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
    at /home/me/dev/code/Javascript/Nuxt/first-nux-app/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
    at /home/me/dev/code/Javascript/Nuxt/first-nux-app/node_modules/graceful-fs/graceful-fs.js:123:16
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

What I'm mostly looking at is the error:0308010C:digital envelope routines::unsupported portion of the error. It seems that when nuxtjs attempts to generate an ssl certificate there's some sort of error in the process. Though I'm not exactly sure.

Is this a common thing with nuxtjs? Or node? Or an issue on my side? I've made a minimal setup of nuxt and I'm getting the same errors (and by minimal I literally just mean hitting enter on every setting)

I'm running this on a minimal setup of arch linux, I've updated node and openssl, so I'm not sure if there's a dependency I don't have.

--openssl-legacy-provider is a flag that seems to do the trick, but it feels like putting a band aid over a bullet wound. Using a legacy provider for ssl seems like I'm exposing many vulnerabilities. Is there a better solution?


问:
OpenWRT: Internet traffic too slow when mwan3 is active
First of all, sorry for my English.
I've been running around with a problem for a while.

My router is a TP-Link Archer C7 v5. I have two internet providers, with 300Mb each.

When mwan3 is NOT active, speedtest gives me a correct speed of 300Mb, but when mwan3 is active, the speed is almost halved (150Mb).

I really don't know what else to check, I'm suspecting that the problem is the CPU of the TP-Link router.

I appreciate if someone helps me to find the problem.

Here is my /etc/config/network:

```<code>config interface 'loopback'
    option ifname 'lo'
    option proto 'static'
    option ipaddr '127.0.0.1'
    option netmask '255.0.0.0'

config globals 'globals'
    option ula_prefix 'fd17:fa92:082d::/48'

config interface 'lan'
    option type 'bridge'
    option ifname 'eth0.1'
    option proto 'static'
    option netmask '255.255.255.0'
    option ip6assign '60'
    option ipaddr '10.29.22.1'

config interface 'wan'
    option ifname 'eth0.2'
    option proto 'dhcp'
    option mtu '1452'
    option metric '10'

config device 'wan_eth0_2_dev'
    option name 'eth0.2'
    option macaddr '68:ff:7b:c7:37:b6'

config switch
    option name 'switch0'
    option reset '1'
    option enable_vlan '1'

config switch_vlan
    option device 'switch0'
    option vlan '1'
    option vid '1'
    option ports '0t 3 4 5'

config switch_vlan
    option device 'switch0'
    option vlan '2'
    option ports '0t 1'
    option vid '2'

config switch_vlan
    option device 'switch0'
    option vlan '3'
    option ports '0t 2'
    option vid '3'

config interface 'wanb'
    option ifname 'eth0.3'
    option proto 'dhcp'
    option mtu '1452'
    option metric '20
</code>```

'

And my /etc/config/mwan3 configuration:

```<code>config globals 'globals'
    option mmx_mask '0x3F00'
    option rtmon_interval '5'
    list rt_table_lookup '1'
    list rt_table_lookup '2'

config interface 'wan'
    list track_ip '8.8.4.4'
    list track_ip '8.8.8.8'
    list track_ip '208.67.222.222'
    list track_ip '208.67.220.220'
    option family 'ipv4'
    option reliability '2'
    option count '1'
    option timeout '2'
    option interval '5'
    option down '3'
    option up '8'
    option initial_state 'online'
    option track_method 'ping'
    option size '56'
    option max_ttl '60'
    option check_quality '0'
    option failure_interval '5'
    option recovery_interval '5'
    option enabled '1'

config interface 'wanb'
    list track_ip '8.8.4.4'
    list track_ip '8.8.8.8'
    list track_ip '208.67.222.222'
    list track_ip '208.67.220.220'
    option family 'ipv4'
    option reliability '1'
    option count '1'
    option timeout '2'
    option interval '5'
    option down '3'
    option up '8'
    option initial_state 'online'
    option track_method 'ping'
    option size '56'
    option max_ttl '60'
    option check_quality '0'
    option failure_interval '5'
    option recovery_interval '5'
    option enabled '1'

config member 'wan_m1_w3'
    option interface 'wan'
    option metric '1'
    option weight '3'

config member 'wan_m2_w3'
    option interface 'wan'
    option metric '2'
    option weight '3'

config member 'wanb_m1_w2'
    option interface 'wanb'
    option metric '1'
    option weight '2'

config member 'wanb_m2_w2'
    option interface 'wanb'
    option metric '2'
    option weight '2'

config policy 'wan_only'
    list use_member 'wan_m1_w3'
    list use_member 'wan6_m1_w3'

config policy 'wanb_only'
    list use_member 'wanb_m1_w2'
    list use_member 'wanb6_m1_w2'

config policy 'balanced'
    list use_member 'wan_m1_w3'
    list use_member 'wanb_m1_w2'
    list use_member 'wan6_m1_w3'
    list use_member 'wanb6_m1_w2'

config policy 'wan_wanb'
    list use_member 'wan_m1_w3'
    list use_member 'wanb_m2_w2'
    list use_member 'wan6_m1_w3'
    list use_member 'wanb6_m2_w2'

config policy 'wanb_wan'
    list use_member 'wan_m2_w3'
    list use_member 'wanb_m1_w2'
    list use_member 'wan6_m2_w3'
    list use_member 'wanb6_m1_w2'

config rule 'default_rule_v4'
    option dest_ip '0.0.0.0/0'
    option family 'ipv4'
    option proto 'all'
    option sticky '0'
    option use_policy 'wan_wanb'
</code>```

I will be very grateful if you can help me.

Thanks in advance.

Leandro

Body:
First of all, sorry for my English.
I've been running around with a problem for a while.

My router is a TP-Link Archer C7 v5. I have two internet providers, with 300Mb each.

When mwan3 is NOT active, speedtest gives me a correct speed of 300Mb, but when mwan3 is active, the speed is almost halved (150Mb).

I really don't know what else to check, I'm suspecting that the problem is the CPU of the TP-Link router.

I appreciate if someone helps me to find the problem.

Here is my /etc/config/network:

config interface 'loopback'
    option ifname 'lo'
    option proto 'static'
    option ipaddr '127.0.0.1'
    option netmask '255.0.0.0'

config globals 'globals'
    option ula_prefix 'fd17:fa92:082d::/48'

config interface 'lan'
    option type 'bridge'
    option ifname 'eth0.1'
    option proto 'static'
    option netmask '255.255.255.0'
    option ip6assign '60'
    option ipaddr '10.29.22.1'

config interface 'wan'
    option ifname 'eth0.2'
    option proto 'dhcp'
    option mtu '1452'
    option metric '10'

config device 'wan_eth0_2_dev'
    option name 'eth0.2'
    option macaddr '68:ff:7b:c7:37:b6'

config switch
    option name 'switch0'
    option reset '1'
    option enable_vlan '1'

config switch_vlan
    option device 'switch0'
    option vlan '1'
    option vid '1'
    option ports '0t 3 4 5'

config switch_vlan
    option device 'switch0'
    option vlan '2'
    option ports '0t 1'
    option vid '2'

config switch_vlan
    option device 'switch0'
    option vlan '3'
    option ports '0t 2'
    option vid '3'

config interface 'wanb'
    option ifname 'eth0.3'
    option proto 'dhcp'
    option mtu '1452'
    option metric '20

'

And my /etc/config/mwan3 configuration:

config globals 'globals'
    option mmx_mask '0x3F00'
    option rtmon_interval '5'
    list rt_table_lookup '1'
    list rt_table_lookup '2'

config interface 'wan'
    list track_ip '8.8.4.4'
    list track_ip '8.8.8.8'
    list track_ip '208.67.222.222'
    list track_ip '208.67.220.220'
    option family 'ipv4'
    option reliability '2'
    option count '1'
    option timeout '2'
    option interval '5'
    option down '3'
    option up '8'
    option initial_state 'online'
    option track_method 'ping'
    option size '56'
    option max_ttl '60'
    option check_quality '0'
    option failure_interval '5'
    option recovery_interval '5'
    option enabled '1'

config interface 'wanb'
    list track_ip '8.8.4.4'
    list track_ip '8.8.8.8'
    list track_ip '208.67.222.222'
    list track_ip '208.67.220.220'
    option family 'ipv4'
    option reliability '1'
    option count '1'
    option timeout '2'
    option interval '5'
    option down '3'
    option up '8'
    option initial_state 'online'
    option track_method 'ping'
    option size '56'
    option max_ttl '60'
    option check_quality '0'
    option failure_interval '5'
    option recovery_interval '5'
    option enabled '1'

config member 'wan_m1_w3'
    option interface 'wan'
    option metric '1'
    option weight '3'

config member 'wan_m2_w3'
    option interface 'wan'
    option metric '2'
    option weight '3'

config member 'wanb_m1_w2'
    option interface 'wanb'
    option metric '1'
    option weight '2'

config member 'wanb_m2_w2'
    option interface 'wanb'
    option metric '2'
    option weight '2'

config policy 'wan_only'
    list use_member 'wan_m1_w3'
    list use_member 'wan6_m1_w3'

config policy 'wanb_only'
    list use_member 'wanb_m1_w2'
    list use_member 'wanb6_m1_w2'

config policy 'balanced'
    list use_member 'wan_m1_w3'
    list use_member 'wanb_m1_w2'
    list use_member 'wan6_m1_w3'
    list use_member 'wanb6_m1_w2'

config policy 'wan_wanb'
    list use_member 'wan_m1_w3'
    list use_member 'wanb_m2_w2'
    list use_member 'wan6_m1_w3'
    list use_member 'wanb6_m2_w2'

config policy 'wanb_wan'
    list use_member 'wan_m2_w3'
    list use_member 'wanb_m1_w2'
    list use_member 'wan6_m2_w3'
    list use_member 'wanb6_m1_w2'

config rule 'default_rule_v4'
    option dest_ip '0.0.0.0/0'
    option family 'ipv4'
    option proto 'all'
    option sticky '0'
    option use_policy 'wan_wanb'

I will be very grateful if you can help me.

Thanks in advance.

Leandro


问:
TouchableOpacity buttons unpressable on Android but works on iOS
I have buttons (using TouchableOpacity) which I'm displaying next to a couple other elements. On iOS, these buttons work perfectly fine. However, on Android, the buttons show up in the same way, but aren't able to be pressed.

```<code>        <BlurView tint={blurViewTint} intensity={open ? 95 : 0} style={[StyleSheet.absoluteFill, styles.contentEditBlur]}>
      <View style={styles.transparent}>
        <Animated.View style={animatedHeaderViewStyle} key="1">
          <Text variant="h1">{dname}</Text>
        </Animated.View>
        <Animated.View style={[animatedTextFieldViewStyle, styles.transparent, { padding: 15 }]} key="2">
          <Input multiline autoFocus value={value} onChangeText={handleChange} variant="underlined" placeholder={`New ${dname}`} />
        </Animated.View>
        <Animated.View style={[animatedButtonsViewStyle, styles.editCancel]} key="3">
          <Button style={styles.editCancelItem} color='secondary' variant='outlined' onPress={initiateClose}>Cancel</Button>
          <Button style={styles.editCancelItem} color='secondary' onPress={createEdit}>Edit</Button>
        </Animated.View>
      </View>
    </BlurView>
</code>```

Here is the Button component itself:

```<code>function FilledButton(props: StyledButtonProps) {
const {
    color,
    children,
    style,
    onPress,
    loading,
    disabled,
    fontSize,
} = props;
const theme = useContext(ThemeContext);

// const OuterComponent = (disabled ? View : TouchableOpacity) as React.ComponentType<any>;
const bgcolor = disabled ? "rgba(0,0,0,.06)" : theme.colors[color];

return (
    <TouchableOpacity
        style={[{
            width: "90%",
            height: 40,
            backgroundColor: bgcolor,
            borderRadius: 15,
            display: 'flex',
            alignItems: 'center',
            justifyContent: 'center',
            flexDirection: 'row',
        }, style]}
        onPress={onPress}
    >
        {(() => {
            if (loading) return (
                <ActivityIndicator style={{ marginHorizontal: 15, }} />
            );
            return (
                <Text
                    style={{
                        color: theme.complementColors[color],
                        fontSize: fontSize,
                    }}
                >{children}</Text>
            );
        })()}
    </TouchableOpacity>
);
</code>```

}

I'm using the TouchableOpacity from 'react-native' and I've tried changing the z-index.

It seems like something is displaying over the buttons making them unpressable, but I haven't been able to get it to display over.

Body:
I have buttons (using TouchableOpacity) which I'm displaying next to a couple other elements. On iOS, these buttons work perfectly fine. However, on Android, the buttons show up in the same way, but aren't able to be pressed.

        <BlurView tint={blurViewTint} intensity={open ? 95 : 0} style={[StyleSheet.absoluteFill, styles.contentEditBlur]}>
      <View style={styles.transparent}>
        <Animated.View style={animatedHeaderViewStyle} key="1">
          <Text variant="h1">{dname}</Text>
        </Animated.View>
        <Animated.View style={[animatedTextFieldViewStyle, styles.transparent, { padding: 15 }]} key="2">
          <Input multiline autoFocus value={value} onChangeText={handleChange} variant="underlined" placeholder={`New ${dname}`} />
        </Animated.View>
        <Animated.View style={[animatedButtonsViewStyle, styles.editCancel]} key="3">
          <Button style={styles.editCancelItem} color='secondary' variant='outlined' onPress={initiateClose}>Cancel</Button>
          <Button style={styles.editCancelItem} color='secondary' onPress={createEdit}>Edit</Button>
        </Animated.View>
      </View>
    </BlurView>

Here is the Button component itself:

function FilledButton(props: StyledButtonProps) {
const {
    color,
    children,
    style,
    onPress,
    loading,
    disabled,
    fontSize,
} = props;
const theme = useContext(ThemeContext);

// const OuterComponent = (disabled ? View : TouchableOpacity) as React.ComponentType<any>;
const bgcolor = disabled ? "rgba(0,0,0,.06)" : theme.colors[color];

return (
    <TouchableOpacity
        style={[{
            width: "90%",
            height: 40,
            backgroundColor: bgcolor,
            borderRadius: 15,
            display: 'flex',
            alignItems: 'center',
            justifyContent: 'center',
            flexDirection: 'row',
        }, style]}
        onPress={onPress}
    >
        {(() => {
            if (loading) return (
                <ActivityIndicator style={{ marginHorizontal: 15, }} />
            );
            return (
                <Text
                    style={{
                        color: theme.complementColors[color],
                        fontSize: fontSize,
                    }}
                >{children}</Text>
            );
        })()}
    </TouchableOpacity>
);

}

I'm using the TouchableOpacity from 'react-native' and I've tried changing the z-index.

It seems like something is displaying over the buttons making them unpressable, but I haven't been able to get it to display over.


问:
Why does Gradle not pick the Maven repository I specify?
The following build.gradle file gives me a build error:

```<code>plugins {
    id 'java'
}

group 'io.collective'
version '1.0-SNAPSHOT'

repositories {
       mavenLocal{
        allowInsecureProtocol = true
       }
       maven {
            url "https://repository-achartengine.forge.cloudbees.com/snapshot/"
            allowInsecureProtocol = true
        }
    }

dependencies {
    testImplementation group: 'junit', name: 'junit', version: '4.13.2'
}
</code>```

Here's the build error:

What went wrong: Could not resolve all dependencies for configuration
':testCompileClasspath'. Using insecure protocols with repositories,
without explicit opt-in, is unsupported. Switch Maven repository
'maven(http://another.url.com:4587/yyyyyyyyyy/repo/)' to redirect to a
secure protocol (like HTTPS) or allow insecure protocols.

How does Gradle decide what Maven repository to use? I want to use the ''allowInsecureProtocol = true'' option, but I don't know how to add it to the repository Gradle insists to use.

Body:
The following build.gradle file gives me a build error:

plugins {
    id 'java'
}

group 'io.collective'
version '1.0-SNAPSHOT'

repositories {
       mavenLocal{
        allowInsecureProtocol = true
       }
       maven {
            url "https://repository-achartengine.forge.cloudbees.com/snapshot/"
            allowInsecureProtocol = true
        }
    }

dependencies {
    testImplementation group: 'junit', name: 'junit', version: '4.13.2'
}

Here's the build error:

What went wrong: Could not resolve all dependencies for configuration
':testCompileClasspath'. Using insecure protocols with repositories,
without explicit opt-in, is unsupported. Switch Maven repository
'maven(http://another.url.com:4587/yyyyyyyyyy/repo/)' to redirect to a
secure protocol (like HTTPS) or allow insecure protocols.

How does Gradle decide what Maven repository to use? I want to use the ''allowInsecureProtocol = true'' option, but I don't know how to add it to the repository Gradle insists to use.


问:
Call external service using percentage split in java
I have a core service that will get an Order request and I need to call 2 to 3 external services based on Order's Client's configuration. For e.g let us assume there are 3 external services service1, service2 and service3. The configuration might say, service1 - 50%, service2 - 25%, service3 - 25%. Or it could be 40, 30, 30. Also, some clients might say just call service1 and 2 and split equally or do 60, 40.

Do you you have any recommendation for this in java? Also, it would be good to do this without making a DB call as it might affect response time. Any help would be appreciated. Thanks.


问:
How can I handle redis-cluster with Redis Stack (RedisJSON & RediSearch)?
I'm currently having problem dealing with redis-cluster.

creating a redis cluster, I'm using the "redis/redis-stack-server:latest" docker image.

I am doing a query test using RediSearch, but in standalone mode, the number of requests per second is not high than other DBs. so I'm trying to optimize the speed using Redis-Cluster.

When I first started redis-cluster, I thought I would be able to import it across nodes. However, the test results didn't. I can only access the data within the same node and cannot ft.search (RediSearch) across all the nodes.

so I looked through the document again to find a solution. The document related to RediSearch says to use RSCoordinator.

When Running RediSearch in a clustered database, you can span the index across shards using RSCoordinator. In this case the above does not apply.
https://redis.io/commands/ft.create/

but looking at github, it seems that RSCoordinator is already built-in.
https://github.com/RediSearch/RediSearch/tree/638de1dbc5e641ca4f8943732c3c468c59c5a47a

Is there a way for redis-cluster to fetch data across all nodes?

Additionally, I wonder if the reason why Redis does not have higher requests per second than other DBs (MongoDB, PostgreSQL, etc..) in large dataset(about 2,400,000) is because Redis is Single Thread? Are there other factors?


问:
PyDeck in Streamlit - event handling for on_click
Given the following code, the on_click event is not triggered, not certain why.

```<code>def on_click(info):
    print('Testing...')
    st.write("TEST TEST")

chart = pdk.Deck(
        map_style="dark",
        initial_view_state={
            "country": "CA",
            "latitude":45.458952,
            "longitude": -73.571648 ,
            "zoom": 11,
            "pitch": 50,
        },
        layers=[
            pdk.Layer(
                "HexagonLayer",
                data=df,
                #get_position=[-73.571648, 45.458952],
                get_position=['longitude', 'latitude'],
                auto_highlight=True,
                pickable=True,
                on_click=on_click,
                elevation=100,
                elevation_scale=9,
            ),
        ],
    )

st.pydeck_chart(chart)
</code>```

The idea is to print out just for testing to see if the event triggers the on_click event, but nothing happens.

Body:
Given the following code, the on_click event is not triggered, not certain why.

def on_click(info):
    print('Testing...')
    st.write("TEST TEST")

chart = pdk.Deck(
        map_style="dark",
        initial_view_state={
            "country": "CA",
            "latitude":45.458952,
            "longitude": -73.571648 ,
            "zoom": 11,
            "pitch": 50,
        },
        layers=[
            pdk.Layer(
                "HexagonLayer",
                data=df,
                #get_position=[-73.571648, 45.458952],
                get_position=['longitude', 'latitude'],
                auto_highlight=True,
                pickable=True,
                on_click=on_click,
                elevation=100,
                elevation_scale=9,
            ),
        ],
    )

st.pydeck_chart(chart)

The idea is to print out just for testing to see if the event triggers the on_click event, but nothing happens.


问:
error on csl in R Markdown, using American-statistical-association.csl in my YAML
```<code>File american-statistical-association .csl not found in resource path
Error: pandoc document conversion failed with error 99
Execution halted
</code>```

I keep getting this error message

I was trying to knit an r markdown file.

Body:
File american-statistical-association .csl not found in resource path
Error: pandoc document conversion failed with error 99
Execution halted

I keep getting this error message

I was trying to knit an r markdown file.


问:
How do I automate my PowerShell script to read in the clients ID's and their emails - instead of how I have done by having to manually add them?
I have done a PowerShell script where I want to email all the client on the server about their housekeep. I have a document attached for them to read through.

Currently I have it so I have to write in the clients mnemonic and then their email. I want it to be automated -- like have the clients mnemonic and email address stored in a txt folder or excel spread sheet. Have the script read in the details from there?

This is currently what I have.

```<code>$FLMDIR = 'E:\FLM_Mailer
Copy-Item E:\FLM_Mailer\E_MSGFILE.TXT -Destination $FLMDIR\msgfile.txt
$MSG_FILE = 'E:\FLM_Mailer\msgfile.txt'
$ClientID = Read-Host -Prompt 'Enter ClientID'
$EmailAddr = Read-Host -Prompt 'Enter Client Email Address'

# Search and Replace clientID
(Get-Content $MSG_FILE) | Foreach-Object {$_ -replace "AAA","$ClientID"}  | Out-File $MSG_FILE

E:\FLM_Mailer\FTRMail.exe $MSG_FILE -to $EmailAddr -f myemail@email.com.au -server 10.10.10.311 -s "Repository Housekeeping in folder/ifolder system" -attach "$FLMDIR\folder Housekeeping for Hosted Clients.docx" -log E:\FLM_Mailer\FLMmail_log.txt -debug

#Remove-Item $FLMDIR\msgfile.txt
</code>```

Body:
I have done a PowerShell script where I want to email all the client on the server about their housekeep. I have a document attached for them to read through.

Currently I have it so I have to write in the clients mnemonic and then their email. I want it to be automated -- like have the clients mnemonic and email address stored in a txt folder or excel spread sheet. Have the script read in the details from there?

This is currently what I have.

$FLMDIR = 'E:\FLM_Mailer
Copy-Item E:\FLM_Mailer\E_MSGFILE.TXT -Destination $FLMDIR\msgfile.txt
$MSG_FILE = 'E:\FLM_Mailer\msgfile.txt'
$ClientID = Read-Host -Prompt 'Enter ClientID'
$EmailAddr = Read-Host -Prompt 'Enter Client Email Address'

# Search and Replace clientID
(Get-Content $MSG_FILE) | Foreach-Object {$_ -replace "AAA","$ClientID"}  | Out-File $MSG_FILE

E:\FLM_Mailer\FTRMail.exe $MSG_FILE -to $EmailAddr -f myemail@email.com.au -server 10.10.10.311 -s "Repository Housekeeping in folder/ifolder system" -attach "$FLMDIR\folder Housekeeping for Hosted Clients.docx" -log E:\FLM_Mailer\FLMmail_log.txt -debug

#Remove-Item $FLMDIR\msgfile.txt


问:
What is the difference between HttpClient.GetStreamAsync() and HttpClient.GetAsync()
so basically I want to learn a bit of webscraping, and I was excepting that these code-blocks returns the same HTML (as a string).

```<code>var result = await client.GetAsync("https://www.footlocker.at/de/product/nike-dunk-high-damenschuhe/315347028102.html");
var stream = result.Content.ReadAsStringAsync().Result;
Console.WriteLine(stream);
</code>```
```<code>var result2 = await client.GetStreamAsync("https://www.footlocker.at/de/product/nike-dunk-high-damenschuhe/315347028102.html");
var stream2 = new StreamReader(result2).ReadToEndAsync().Result;
Console.WriteLine(stream2);
</code>```

In this type of example, GetStreamAsync() returns the whole html of the website and GetAsync returns also an HTML but it's just an error site. Why is that so? Am I not understanding the difference between these Methods, or just doing something complety wrong?

I tried to look for answers on stackoverflow and read through the documentation, but unfortunately didn't find any specific answer for this example.

Body:
so basically I want to learn a bit of webscraping, and I was excepting that these code-blocks returns the same HTML (as a string).

var result = await client.GetAsync("https://www.footlocker.at/de/product/nike-dunk-high-damenschuhe/315347028102.html");
var stream = result.Content.ReadAsStringAsync().Result;
Console.WriteLine(stream);

var result2 = await client.GetStreamAsync("https://www.footlocker.at/de/product/nike-dunk-high-damenschuhe/315347028102.html");
var stream2 = new StreamReader(result2).ReadToEndAsync().Result;
Console.WriteLine(stream2);

In this type of example, GetStreamAsync() returns the whole html of the website and GetAsync returns also an HTML but it's just an error site. Why is that so? Am I not understanding the difference between these Methods, or just doing something complety wrong?

I tried to look for answers on stackoverflow and read through the documentation, but unfortunately didn't find any specific answer for this example.


问:
HidSharp Never Receives Input Report
I'm attempting to use HidSharp to read reports from a Vendor USB HID device using the below code, but I never manage to poll any input.

```<code>            var device = DeviceList.Local.GetHidDevices().Where(d => /* My Vendor stuff */).First();
            var deviceDescriptor = device.GetReportDescriptor();

            if (device.TryOpen(out var inputStream))
            {
                var inputReport = deviceDescriptor.InputReports.First();
                var inputReportParser = inputReport.DeviceItem.CreateDeviceItemInputParser();
                var inputReportReciever = deviceDescriptor.CreateHidDeviceInputReceiver();
                var inputReportBuffer = new byte[inputReport.Length];

                while (inputReportReciever.IsRunning)
                {
                    if (inputReportReciever.WaitHandle.WaitOne(10000))
                    {
                        while (inputReportReciever.TryRead(inputReportBuffer, 0, out var report))
                        {
                            if (inputReportParser.TryParseReport(inputReportBuffer, 0, report))
                            {
                                if (inputReportParser.HasChanged)
                                {
                                    var data = inputReportParser.GetValue(inputReportParser.GetNextChangedIndex());
                                    Console.WriteLine("Data: " + data.ToString());
                                }
                            }
                        }
                    }
                }
            }
</code>```

I can see in the device manager that the device is recognized as an HID USB device, and Wireshark shows that I am sending periodic reports like so:

(I'm a java developer so I'm really struggling with Visual Studio) I can't step in to the library to see what's happening, but there are no errors being thrown and the 'test' included with the project parses reports from at least one other USB device (a headset) so the library seems ok. I'm not at all sure how to proceed with debugging further. Any direction on this library or USB is appreciated.

Title: HidSharp Never Receives Input Report

Body:
I'm attempting to use HidSharp to read reports from a Vendor USB HID device using the below code, but I never manage to poll any input.

            var device = DeviceList.Local.GetHidDevices().Where(d => /* My Vendor stuff */).First();
            var deviceDescriptor = device.GetReportDescriptor();

            if (device.TryOpen(out var inputStream))
            {
                var inputReport = deviceDescriptor.InputReports.First();
                var inputReportParser = inputReport.DeviceItem.CreateDeviceItemInputParser();
                var inputReportReciever = deviceDescriptor.CreateHidDeviceInputReceiver();
                var inputReportBuffer = new byte[inputReport.Length];

                while (inputReportReciever.IsRunning)
                {
                    if (inputReportReciever.WaitHandle.WaitOne(10000))
                    {
                        while (inputReportReciever.TryRead(inputReportBuffer, 0, out var report))
                        {
                            if (inputReportParser.TryParseReport(inputReportBuffer, 0, report))
                            {
                                if (inputReportParser.HasChanged)
                                {
                                    var data = inputReportParser.GetValue(inputReportParser.GetNextChangedIndex());
                                    Console.WriteLine("Data: " + data.ToString());
                                }
                            }
                        }
                    }
                }
            }

I can see in the device manager that the device is recognized as an HID USB device, and Wireshark shows that I am sending periodic reports like so:

(I'm a java developer so I'm really struggling with Visual Studio) I can't step in to the library to see what's happening, but there are no errors being thrown and the 'test' included with the project parses reports from at least one other USB device (a headset) so the library seems ok. I'm not at all sure how to proceed with debugging further. Any direction on this library or USB is appreciated.


问:
Javascript sweet alert
how write a code alert succes use "sweet alert" on login form , example my code

```<code>if($jum > 0){
            $hasil = $row -> fetch();
            $_SESSION['admin'] = $hasil;
            echo '<script>alert("Login Berhasil");window.location="index.php"</script>';
        }else{
            echo '<script>alert("Login Gagal");history.go(-1);</script>';
        }
    }
</code>```
```<code>if($jum > 0){
            $hasil = $row -> fetch();
            $_SESSION['admin'] = $hasil;
            echo '<script>**contoh()**;window.location="index.php"</script>';
        }else{
            echo '<script>alert("Login Gagal");history.go(-1);</script>';
        }
    }

<script type="text/javascript">

        function contoh() {
           swal.fire({
                title: "Berhasil!",
                text: "Pop-up berhasil ditampilkan",
                icon: "success",
                button: true
            });}</script>

</code>```

if i write code like this, no pop up sweet alert appear

Title: Javascript sweet alert

Body:
how write a code alert succes use "sweet alert" on login form , example my code

if($jum > 0){
            $hasil = $row -> fetch();
            $_SESSION['admin'] = $hasil;
            echo '';
        }else{
            echo '';
        }
    }

if($jum > 0){
            $hasil = $row -> fetch();
            $_SESSION['admin'] = $hasil;
            echo '';
        }else{
            echo '';
        }
    }

if i write code like this, no pop up sweet alert appear


问:
jupyter notebook keeps dying while training
When executing model-training code on jupyter notebook(with cu11.7), the kernel fails to proceed more than 1 epoch and the kernel continues to die as below.

What's strange is that when running the same code in a pycharn venv, the training proceeds without any problems.

Please give me some advice. Thank you.

I also modified the max_buffer_size and reinstalled the jupyter-notebook, but it did not work. I checked through the window task manager that it is not a problem with cpu or memory.

And I also uninstalled and reinstalled ipykernel, ipython, jupyter_client, jupyter_core, traitlets, ipython_genutils. But it didn't work


问:
Accessing image files in public folder after deploying to gh pages breaking
I deployed my react app to gh-pages and my images arent loading anymore. They are held in the public folder and I am loading the them using the react-three-fiber hook useLoader according to their documentation like this:

```<code>const [theImage, 2ndImage] = useLoader(TextureLoader, [
        "/{folderName}/{the-image}.jpeg",
        ".../etc",
    ])

</code>```

Also Ive tried directing to the image using process.env.PUBLIC_URL + "/{folderName}/{the-image}.jpeg"

Gh-pages documentation says best practice is to load the image with the relative path and not the absolute path. But still my page cant seem to access them.

My Console error reads:

```<code>Uncaught Error: Could not load /{myrepo}{folderName}/{the-image}.jpeg: undefined)
 at index-6f0019d1.esm.js:1670:1
</code>```

Ive seen other post on this issue like this one but I dont quite understand the answer marked as correct. Can anyone explain?

Body:
I deployed my react app to gh-pages and my images arent loading anymore. They are held in the public folder and I am loading the them using the react-three-fiber hook useLoader according to their documentation like this:

const [theImage, 2ndImage] = useLoader(TextureLoader, [
        "/{folderName}/{the-image}.jpeg",
        ".../etc",
    ])

Also Ive tried directing to the image using process.env.PUBLIC_URL + "/{folderName}/{the-image}.jpeg"

Gh-pages documentation says best practice is to load the image with the relative path and not the absolute path. But still my page cant seem to access them.

My Console error reads:

Uncaught Error: Could not load /{myrepo}{folderName}/{the-image}.jpeg: undefined)
 at index-6f0019d1.esm.js:1670:1

Ive seen other post on this issue like this one but I dont quite understand the answer marked as correct. Can anyone explain?


问:
react-dom.development.js:4312 Uncaught TypeError: Cannot read properties of undefined (reading 'id')
It's my first time asking for help here (I usually find answers here without the need to post).

This is a very simple application, but I'm struggling with that. Whenever I click on the button to call one of the functions bellow, I'm presented with this error

```<code>index.tsx:23 Uncaught TypeError: Cannot read properties of undefined (reading 'id')
    at handleIncrease (index.tsx:23:22)
    at HTMLUnknownElement.callCallback2 (react-dom.development.js:4164:14)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:4213:16)
    at invokeGuardedCallback (react-dom.development.js:4277:31)
    at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:4291:25)
    at executeDispatch (react-dom.development.js:9041:3)
    at processDispatchQueueItemsInOrder (react-dom.development.js:9073:7)
    at processDispatchQueue (react-dom.development.js:9086:5)
    at dispatchEventsForPlugins (react-dom.development.js:9097:3)
    at react-dom.development.js:9288:12
</code>```

The functions are in the context file. they were supposed to be working, I guess. But It doenst!!

HELP!!

```<code>interface CoffeeContextProps {
  coffee: CartItem
}

export function Checkout({ coffee }: CoffeeContextProps) {

 const {changeCartItemsQuantity, removeCartItem} = useCart()
    const {cartItems} = useContext(CartContext);

 function handleDecrease() {
  changeCartItemsQuantity(coffee.id, 'decrease')
}

function handleIncrease() {
  console.log(coffee.id);

  changeCartItemsQuantity(coffee.id, 'increase')

}
function handleRemovedItem () {
  removeCartItem(coffee.id)
}
</code>```

I've tried to change the type of the coffee.id.  I have no idea whats going on.

Body:
It's my first time asking for help here (I usually find answers here without the need to post).

This is a very simple application, but I'm struggling with that. Whenever I click on the button to call one of the functions bellow, I'm presented with this error

index.tsx:23 Uncaught TypeError: Cannot read properties of undefined (reading 'id')
    at handleIncrease (index.tsx:23:22)
    at HTMLUnknownElement.callCallback2 (react-dom.development.js:4164:14)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:4213:16)
    at invokeGuardedCallback (react-dom.development.js:4277:31)
    at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:4291:25)
    at executeDispatch (react-dom.development.js:9041:3)
    at processDispatchQueueItemsInOrder (react-dom.development.js:9073:7)
    at processDispatchQueue (react-dom.development.js:9086:5)
    at dispatchEventsForPlugins (react-dom.development.js:9097:3)
    at react-dom.development.js:9288:12

The functions are in the context file. they were supposed to be working, I guess. But It doenst!!

HELP!!

interface CoffeeContextProps {
  coffee: CartItem
}

export function Checkout({ coffee }: CoffeeContextProps) {

 const {changeCartItemsQuantity, removeCartItem} = useCart()
    const {cartItems} = useContext(CartContext);

 function handleDecrease() {
  changeCartItemsQuantity(coffee.id, 'decrease')
}

function handleIncrease() {
  console.log(coffee.id);

  changeCartItemsQuantity(coffee.id, 'increase')

}
function handleRemovedItem () {
  removeCartItem(coffee.id)
}

I've tried to change the type of the coffee.id.  I have no idea whats going on.


问:
php undefined index or variables don't throw any error
I came across a fat-free framework where indexes are accessed without checking if there's data present or not.

few e.g.

```<code>e.g.1
$sObj = new Site($db); // this returns null?
$site = $sObj->getById($sessionSiteId)[0];

e.g.2
$ppObject = new Page($db);
$pheader = $ppObject->getByCodeandsiteid($siteid,'Header');
F3::set('headercode',$pheader[0]['description']);

</code>```

so these are just few cases. Most of the practice done is to just access the index.
This throws error in my env. php 8.1 and fat-free 3.8.1.

But running this same code on my colleague's env. : php 5.6.40 and fat-free 3.5.1` this doesn't throw error but simply gives null value.

I also checked with some random unassigned variable on his env. and to my surprise, this also seem to simply give null instead of error.

Is this expected behavior on previous versions?

Also checked in phpinfo() that error_reporting value for both is 22527.

Body:
I came across a fat-free framework where indexes are accessed without checking if there's data present or not.

few e.g.

e.g.1
$sObj = new Site($db); // this returns null?
$site = $sObj->getById($sessionSiteId)[0];

e.g.2
$ppObject = new Page($db);
$pheader = $ppObject->getByCodeandsiteid($siteid,'Header');
F3::set('headercode',$pheader[0]['description']);

so these are just few cases. Most of the practice done is to just access the index.
This throws error in my env. php 8.1 and fat-free 3.8.1.

But running this same code on my colleague's env. : php 5.6.40 and fat-free 3.5.1` this doesn't throw error but simply gives null value.

I also checked with some random unassigned variable on his env. and to my surprise, this also seem to simply give null instead of error.

Is this expected behavior on previous versions?

Also checked in phpinfo() that error_reporting value for both is 22527.


问:
Plotly: how to draw two linecharts with two dataframes with colors
I am trying to draw two subplots (top and bottom) that contains category of 3 colors and values for each date. With the dataset below, I can draw a single plot with data_A (as shown below)

```<code>fig = px.line(data_A,
              x="Date", y="Percent",
              color='Color',
              color_discrete_sequence=['green','red','gold'],
              markers=True)
fig.show()
</code>```

However, I can't seem to draw two plots using add_trace

```<code>from plotly.subplots import make_subplots
import plotly.express as px

fig = make_subplots(rows=2, cols=1, shared_xaxes=True, vertical_spacing=0.05)

fig.add_trace(x = data_A['Date'],
              y= data_A['Percent'],
#               color='Color',
#               color_discrete_sequence=['green','red','gold'],
              markers=True)

fig.add_trace(x = data_B['Date'],
              y= data_B['Percent'],
#               color='Color',
#               color_discrete_sequence=['green','red','gold'],
              markers=True)
</code>```

Here is the sample data:

```<code>data_A = [{'Date': '2022-01-01', 'Color': "Green", 'Percent': 40},
        {'Date': '2022-01-01', 'Color': "Red", 'Percent': 20},
        {'Date': '2022-01-01', 'Color': "Yellow", 'Percent': 30},
        {'Date': '2022-01-02', 'Color': "Green", 'Percent': 45},
        {'Date': '2022-01-02', 'Color': "Red", 'Percent': 30},
        {'Date': '2022-01-02', 'Color': "Yellow", 'Percent': 25},
        {'Date': '2022-01-03', 'Color': "Green", 'Percent': 40},
        {'Date': '2022-01-03', 'Color': "Red", 'Percent': 20},
        {'Date': '2022-01-03', 'Color': "Yellow", 'Percent': 30},
        {'Date': '2022-01-04', 'Color': "Green", 'Percent': 45},
        {'Date': '2022-01-04', 'Color': "Red", 'Percent': 25},
        {'Date': '2022-01-04', 'Color': "Yellow", 'Percent': 30}]

data_B = [{'Date': '2022-01-01', 'Color': "Green", 'Percent': 30},
        {'Date': '2022-01-01', 'Color': "Red", 'Percent': 50},
        {'Date': '2022-01-01', 'Color': "Yellow", 'Percent': 20},
        {'Date': '2022-01-02', 'Color': "Green", 'Percent': 65},
        {'Date': '2022-01-02', 'Color': "Red", 'Percent': 10},
        {'Date': '2022-01-02', 'Color': "Yellow", 'Percent': 25},
        {'Date': '2022-01-03', 'Color': "Green", 'Percent': 40},
        {'Date': '2022-01-03', 'Color': "Red", 'Percent': 30},
        {'Date': '2022-01-03', 'Color': "Yellow", 'Percent': 20},
        {'Date': '2022-01-04', 'Color': "Green", 'Percent': 55},
        {'Date': '2022-01-04', 'Color': "Red", 'Percent': 35},
        {'Date': '2022-01-04', 'Color': "Yellow", 'Percent': 10}]
</code>```

Body:
I am trying to draw two subplots (top and bottom) that contains category of 3 colors and values for each date. With the dataset below, I can draw a single plot with data_A (as shown below)

fig = px.line(data_A,
              x="Date", y="Percent",
              color='Color',
              color_discrete_sequence=['green','red','gold'],
              markers=True)
fig.show()

However, I can't seem to draw two plots using add_trace

from plotly.subplots import make_subplots
import plotly.express as px

fig = make_subplots(rows=2, cols=1, shared_xaxes=True, vertical_spacing=0.05)

fig.add_trace(x = data_A['Date'],
              y= data_A['Percent'],
#               color='Color',
#               color_discrete_sequence=['green','red','gold'],
              markers=True)

fig.add_trace(x = data_B['Date'],
              y= data_B['Percent'],
#               color='Color',
#               color_discrete_sequence=['green','red','gold'],
              markers=True)

Here is the sample data:

data_A = [{'Date': '2022-01-01', 'Color': "Green", 'Percent': 40},
        {'Date': '2022-01-01', 'Color': "Red", 'Percent': 20},
        {'Date': '2022-01-01', 'Color': "Yellow", 'Percent': 30},
        {'Date': '2022-01-02', 'Color': "Green", 'Percent': 45},
        {'Date': '2022-01-02', 'Color': "Red", 'Percent': 30},
        {'Date': '2022-01-02', 'Color': "Yellow", 'Percent': 25},
        {'Date': '2022-01-03', 'Color': "Green", 'Percent': 40},
        {'Date': '2022-01-03', 'Color': "Red", 'Percent': 20},
        {'Date': '2022-01-03', 'Color': "Yellow", 'Percent': 30},
        {'Date': '2022-01-04', 'Color': "Green", 'Percent': 45},
        {'Date': '2022-01-04', 'Color': "Red", 'Percent': 25},
        {'Date': '2022-01-04', 'Color': "Yellow", 'Percent': 30}]

data_B = [{'Date': '2022-01-01', 'Color': "Green", 'Percent': 30},
        {'Date': '2022-01-01', 'Color': "Red", 'Percent': 50},
        {'Date': '2022-01-01', 'Color': "Yellow", 'Percent': 20},
        {'Date': '2022-01-02', 'Color': "Green", 'Percent': 65},
        {'Date': '2022-01-02', 'Color': "Red", 'Percent': 10},
        {'Date': '2022-01-02', 'Color': "Yellow", 'Percent': 25},
        {'Date': '2022-01-03', 'Color': "Green", 'Percent': 40},
        {'Date': '2022-01-03', 'Color': "Red", 'Percent': 30},
        {'Date': '2022-01-03', 'Color': "Yellow", 'Percent': 20},
        {'Date': '2022-01-04', 'Color': "Green", 'Percent': 55},
        {'Date': '2022-01-04', 'Color': "Red", 'Percent': 35},
        {'Date': '2022-01-04', 'Color': "Yellow", 'Percent': 10}]


问:
How to add yoube video in looped swiper?
I made slide in swiper.js.

Each slide has image or youtube video.

I tried youtube api to add iframe to slide but only one element has id but looped slide duplaicate each slide so it add only one video in slide.

How can I add yoube video in looped swiper?

Here is code. https://codesandbox.io/s/icy-thunder-j4ub33