instruction
stringlengths
0
30k
null
My POST request isn't working and it's not updating? The error is: TypeError: Cannot read properties of undefined (reading 'username') ```javascript app.post('/create-user', function(req, resp) { const client = new MongoClient(uri); const dbo = client.db("eggyDB"); // Get the database object const collName = dbo.collection("users"); // Get the collection const info = { username: req.body.username, password: req.body.password }; collName.insertOne(info) .then(function() { console.log('User created'); resp.render("main", { layout: "homepage", title: "My Home page" }); }) .catch(function(err) { console.error('Error creating user:', err); resp.status(500).send('Internal Server Error'); }) }); ``` this is my html code (in the partials folder): ```html <form name="signup" action="/create-user" method="POST" class="popup-signup-content" onsubmit="return verifyPassword()" > <h1 onclick="closeSignup()" id="close-login" type="submit">x</h1> <img src="/images/LOGO-YL.png" alt="None" /> <input id="username-signup" name="username" type="text" placeholder="Enter Username/Email" required /> <input id="password-signup" type="password" placeholder="Enter Password" required /> <input id="verify-password-signup" name="password" type="password" placeholder="Re-Enter Password" required /> <button class="login-button bold" type="submit" onclick="console.log('Form Submitted')">Register</button> </form> ``` it won't add a new user to the database but it connects to the database. it also won't show the onclick function when Register is pressed. what should i do? i tried asking chatgpt but i think it was slowly drifting me away from the solution. what do you think should i do here?
``` original_frames = [cv2.imread(os.path.join(original_frames_dir, filename)) for filename in sorted(os.listdir(original_frames_dir))] Traceback (most recent call last): File "d:\python\start.py", line 61, in <module> target_frames = [cv2.imread(os.path.join(target_frames_dir, filename)) for filename in sorted(os.listdir(target_frames_dir))] ``` solving the problem, expected someone will answer me, I don't know what will be the result
Why is it re-rendered when I use expandRowRender? [this is my table before expand row](https://i.stack.imgur.com/Im9fX.png) [this is my table after expand row](https://i.stack.imgur.com/opai1.png) And my code: ``` const expandedRowRender = (record: CategoryState) => { return ( <Table rowKey={(record) => record._id} columns={columns} dataSource={record.children} expandable={{ expandedRowRender, columnWidth: 30 }} pagination={false} showHeader={false} size='small' /> ) } return ( <Table size={sm || xs ? 'small' : 'middle'} columns={columns} expandable={{ expandedRowRender, columnWidth: 30 }} rowKey={(record) => record._id} dataSource={cateList} pagination={{ pageSize: data?.data?.limit, total: data?.data?.totalDocs, onChange: onPageChange, position: ['bottomCenter'] }} loading={isLoading} /> ) ``` How to fix the above problem
Antd tree table re-render
|reactjs|antd|
null
After I updated my React/Next.js App, I get this error: > React does not recognize the `isDisabled` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `isdisabled` instead. If you accidentally passed it from a parent component, remove it from the DOM element. [![enter image description here][1]][1] [1]: https://i.stack.imgur.com/bJmZn.png This is how I use that img: <img src={user?.photoURL ? user?.photoURL : "https://xxxxxxx"} alt="avatar" className="w-8 h-8 rounded-full border-2 border-violet-600 cursor-pointer" /> If I remove that `<img>` and replace it with a, let's say `<span>` the error is gone.
React does not recognize the `isDisabled` prop on a DOM element on img element
|javascript|reactjs|next.js|
I am creating an inline code completion plugin for vscode. I am using the InlineCompletionItemProvider to show the inline suggestions. However, I am making the call to generate suggestion even when an IntelliSense popup is visible. This is an unnecessary call for me as the suggestion I have will not be visible until and unless the user closes the intelliSense popup. I want to reduce this unnecessary cost. Is there a way to identify whether intelliSense popup is visible or not. So that I can not call inline completions when the popup is visible. Any help or direction will be much appreciated.
How can I know if a vscode intelliSense suggestion is visible?
I have a TFlite model which I would like to use in a Flutter app, I decided to use the package [tflite_v2][1] since it seemed the easiest. I wrote a short python program to test the model first and make sure it gives the correct result: ``` import cv2 import numpy as np from PIL import Image import tensorflow as tf tflite_model_path = 'efficientnetb3-Eye Disease-95.26.tflite' class_labels = { 0: 'cataract', 1: 'diabetic_retinopathy', 2: 'glaucoma', 3: 'normal' } def load_and_preprocess_image(image_path): img = cv2.imread(image_path) img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) img = cv2.resize(img, (224, 224)) img = img.astype(np.float32) / 1.0 # Add an extra dimension for the batch (if the model expects batches) img = np.expand_dims(img, axis=0) return img interpreter = tf.lite.Interpreter(model_path=tflite_model_path) interpreter.allocate_tensors() input_details = interpreter.get_input_details() output_details = interpreter.get_output_details() test_image = load_and_preprocess_image('dataset/normal/2702_left.jpg') interpreter.set_tensor(input_details[0]['index'], test_image) interpreter.invoke() output_data = interpreter.get_tensor(output_details[0]['index']) print(output_data) predicted_class_index = np.argmax(output_data[0]) print(f"Predicted class: {predicted_class_index} ({class_labels[predicted_class_index]})") ``` I am having trouble recreating exactly what the `load_and_preprocess_image` function does in dart, and so the model is giving me wrong answers. Here is a function I found in the package doc which converts images into binary list using the image package ``` Uint8List imageToByteListFloat32( img.Image image, int inputSize, double mean, double std) { var convertedBytes = Float32List(1 * inputSize * inputSize * 3); var buffer = Float32List.view(convertedBytes.buffer); int pixelIndex = 0; for (var i = 0; i < inputSize; i++) { for (var j = 0; j < inputSize; j++) { var pixel = image.getPixel(j, i); buffer[pixelIndex++] = (img.getRed(pixel) - mean) / std; buffer[pixelIndex++] = (img.getGreen(pixel) - mean) / std; buffer[pixelIndex++] = (img.getBlue(pixel) - mean) / std; } } return convertedBytes.buffer.asUint8List(); } ``` Problem with this is it seems outdated as there are no such functions as `getRed`, `getGreen`, or `getBlue`. [1]: https://pub.dev/packages/tflite_v2
Prepare image for classification in Dart using TFlite v2
|python|dart|tensorflow|
You can use [yaml][1] NPM package. ```js const YAML = require('yaml'); const jsonObject = { version: "1.0.0", dependencies: { yaml: "^1.10.0" }, package: { exclude: [ ".idea/**", ".gitignore" ] } } const doc = new YAML.Document(); doc.contents = jsonObject; console.log(doc.toString()); ``` Output ```yaml version: 1.0.0 dependencies: yaml: ^1.10.0 package: exclude: - .idea/** - .gitignore ``` Refer this post: [https://www.pujan.net/posts/convert-json-to-yaml/](https://www.pujan.net/posts/convert-json-to-yaml/) [1]: https://github.com/eemeli/yaml
|css|reactjs|
Below is some example code on how to make a `OutlinedDiv`, focusing solely on the label+border aspects. One limitation of this approach is the absence of label shrink functionality. Nevertheless, I'm sharing it in case it proves helpful to someone. ```TSX import React, { ReactNode, CSSProperties } from 'react'; type OutlinedDivProps = Readonly<{ children: ReactNode; label: string }>; const OutlinedDiv: React.FC<OutlinedDivProps> = (props) => { const { children, label } = props; return ( <div style={styles.mainContainer}> <div style={styles.header}> <div style={styles.headerBorderBefore}></div> {label && <div style={styles.headerTitle}>{label && <span>{label}</span>}</div>} <div style={styles.headerBorderAfter}></div> </div> <div style={styles.childrenContainer}>{children}</div> </div> ); }; const borderColor = '#b2b2b2'; const styles: Readonly<Record<string, CSSProperties>> = { mainContainer: { display: 'flex', flexDirection: 'column', maxWidth: '100%', borderLeft: `1px solid ${borderColor}`, borderBottom: `1px solid ${borderColor}`, borderRight: `1px solid ${borderColor}`, borderRadius: '5px', margin: '1em', }, header: { display: 'flex', flexDirection: 'row', width: '100% !important', }, headerBorderBefore: { borderTop: `1px solid ${borderColor}`, width: '1em', borderTopLeftRadius: '5px', }, headerTitle: { display: 'flex', flexDirection: 'row', flexWrap: 'nowrap', alignItems: 'center', gap: '0.25em', width: 'fit-content', height: '2em', margin: '-1em 0.5em 0em 0.5em', overflow: 'hidden', textOverflow: 'ellipsis', fontSize: '1em', fontWeight: 600, }, headerBorderAfter: { borderTop: `1px solid ${borderColor}`, width: '1em', flexGrow: 2, borderTopRightRadius: '5px', }, childrenContainer: { padding: '1em', }, }; export default OutlinedDiv; ```
|typescript|visual-studio-code|plugins|vscode-extensions|code-completion|
We cannot help you without seeing your "some code". You should be able to use [System.in][1] class which provides you access to [STDIN][2] without any issues. Something like: def userInput = System.in.withReader { reader -> OUT.println 'Please enter test parameter' reader.readLine() } OUT.println('You have entered: ' + userInput) vars.put('userInput', userInput) [![enter image description here][3]][3] Be informed that due to multithreaded nature you wil need to provide the input for each thread (virtual user) so the suitable location for the JSR223 Sampler would be [setUp Thread Group][4] with 1 user and iteration. [1]: https://docs.oracle.com/javase/8/docs/api/java/lang/System.html#in [2]: https://en.wikipedia.org/wiki/Standard_streams#Standard_input_(stdin) [3]: https://i.stack.imgur.com/by8QB.gif [4]: https://www.blazemeter.com/blog/thread-group-jmeter
I'v useing LruEvictionPolicyFactory in my CacheConfiguration like blow ```java CacheConfiguration<K, V> cacheCfg = new CacheConfiguration<>(); cacheCfg.setAtomicityMode(CacheAtomicityMode.ATOMIC); cacheCfg.setRebalanceMode(CacheRebalanceMode.ASYNC); cacheCfg.setPartitionLossPolicy(PartitionLossPolicy.READ_WRITE_SAFE); cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.PRIMARY_SYNC); cacheCfg.setEvictionPolicyFactory(new LruEvictionPolicyFactory<>(200000)); ``` and I use DataRegionConfig like this ```xml <bean class="org.apache.ignite.configuration.DataRegionConfiguration"> <property name="initialSize" value="#{512L * 1024 * 1024}"/> <property name="maxSize" value="#{3 * 1024L * 1024 * 1024}"/> <property name="pageEvictionMode" value="RANDOM_LRU"/> <property name="evictionThreshold" value="0.9"/> <property name="metricsEnabled" value="true"/> <property name="persistenceEnabled" value="false"/> </bean> but I can see far more than 2000000 records in my cache, for some times, i can see 800000 records in the cache how to control data size in my cache to avoid one cache using too many memories
null
Here is an example using some made up fields that are much simpler than the example you gave but you will be able to apply the concept. Qlik Script: DESC_MAP: MAPPING LOAD ItemNum as ItemCode, ItemName as Desc FROM [lib://QVData/UserDescriptions.qvd] (qvd); ITEMS: LOAD ItemCode, applymap('DESC_MAP', ItemCode, null()) as UserDesc FROM [lib://QVData/Items.qvd] (qvd); is equivalent to select ItemCode, (Select ItemName FROM UserDescriptions where Items.ItemCode = UserDescriptions.ItemNum) as CommodityClassDesc from Items You should be able to just paste your complicated map creation SQL queries into your CASE query logic, then you still need to add the POSTATUS_KEY to the where clause to make it return a unique line each time
|python|opencv|
I have specified a @Retryable annotation in a spring bean like below. ``` @EnableRetry @Import({GrpcClientRetryConfig.class}) @Retryable(interceptor = "grpcClientRetryInterceptor", label = "ProfileGrpcClient") public class ProfileGrpcClient { public RateLimitConfig getRateLimitConfig() ``` @Component @AllArgsConstructor public class RateLimits { private final ProfileGrpcClient client; // Some method calls client.getRateLimitConfig() } Interceptor is defined in `GrpcClientRetryConfig` ``` @EnableRetry public class GrpcClientRetryConfig { @Bean public RetryOperationsInterceptor grpcClientRetryInterceptor() { val template = new RetryTemplate(); val backOffPolicy = new ExponentialBackOffPolicy(); // Set the exponential backoff parameter val interceptor = new RetryOperationsInterceptor(); template.setRetryPolicy(new SimpleRetryPolicy()); template.setBackOffPolicy(backOffPolicy); template.setListeners(new GrpcClientRetryListener[] {new GrpcClientRetryListener()}); interceptor.setRetryOperations(template); return interceptor; } } ``` In `GrpcClientRetryListener` I am trying to get the label specified in the `@Retryable` ``` @Slf4j @Component public class GrpcClientRetryListener extends MethodInvocationRetryListenerSupport { @Override public <T, E extends Throwable> void onSuccess( RetryContext context, RetryCallback<T, E> callback, T result) { if (callback instanceof MethodInvocationRetryCallback<T, E> methodInvocationRetryCallback) { log.info( "Retry Succeeded: {}, Count: {}", getMethodName(methodInvocationRetryCallback), context.getRetryCount()); } super.onSuccess(context, callback, result); } @Override public <T, E extends Throwable> void onError( RetryContext context, RetryCallback<T, E> callback, Throwable throwable) { if (callback instanceof MethodInvocationRetryCallback<T, E> methodInvocationRetryCallback) { log.info( "Retry Failing: {}, Count: {}", getMethodName(methodInvocationRetryCallback), context.getRetryCount()); } super.onError(context, callback, throwable); } private <T, E extends Throwable> String getMethodName( MethodInvocationRetryCallback<T, E> methodInvocationRetryCallback) { return methodInvocationRetryCallback.getLabel(); } } ``` But during retry, I am seeing getting the label like `public com.abc.proto.v2.common.ratelimit.RateLimits com.abc.grpcclients.ProfileGrpcClient.getRateLimitConfig()`. Complete log is like below ``` Retry Failing: public com.abc.proto.v2.common.ratelimit.RateLimits com.abc.grpcclients.ProfileGrpcClient.getRateLimitConfig(), Count: 5 ``` Is there a way for me to get the `label` as specified in `@Retryable` in `MethodInvocationRetryListenerSupport`?
According to my expirience, you'r right. It looks like 'create_datagram_endpoint' creates a single connection and then works with it. It confused me a lot when I started to experiment with asyncio.DatagramProtocol and expected that every new connection will call 'connection_made', but instead of that, connection was made once, when the server started
Given this text: ``` 25% on $53,501 to $78,100. ``` This [regex][1] captures the 3 numbers into the three capturing groups (as expected) ``` ^(\d+\.?\d+).*?(\d+,?\d+).*?(\d+,\d+)?.$ ``` However, I would expect this [regex][2] to match all 3 groups as well, but the 3rd group is empty. ``` ^(\d+\.?\d+).*?(\d+,?\d+).*?(\d+,\d+)?.*$ ``` The only difference between the first and second regex is that while the first one ends with `.$`, the second one ends with `.*$`. Granted that the second regex can be satisfied without matching anything to the third group, but I would expect the `?` in `(\d+,\d+)?` to match the pattern zero or one times, but one time preferably as it is greedy. In that case the last `.*` matches nothing, and the whole regex should still be satisfied. So, why does the regex engine "skip over" the third group and prefer to match the rest of the string with the `.*`? [1]: https://regex101.com/r/6g52XL/1 [2]: https://regex101.com/r/6g52XL/3
I've been attempting to establish a connection between Thingsboard IoT Gateway and Thingsboard CE/Thingsboard Edge. Initially, I tried using the MQTT demo connector method, which worked well. However, after dynamic IP changes occur, the connection fails, resulting in a "timed out" error, even after updating the IP address in the Docker Compose file same in both connectivity of IoT Gateway either with Thingsboard CE or Thingsboard Edge. Let me share details about the issue below: 1) Here's the setup I've implemented: - ThingsBoard server is deployed on AWS EC Server 1. - ThingsBoard Edge & ThingsBoard IoT Gateway are installed on AWS EC Server 2. 2) Due to AWS's dynamic IP setup, the IP address changes daily. Initially, during the first setup, my IoT gateway device Docker Compose file looked like the following, and it successfully communicated with Thingsboard Server / Thingsboard Edge: Docker-Compose.yml for gateway ``` version: '3.4' services: # ThingsBoard IoT Gateway Service Configuration tb-gateway: image: thingsboard/tb-gateway container_name: tb-gateway restart: always # Ports bindings - required by some connectors ports: - "5000:5000" # Comment if you don't use REST connector and change if you use another port # Uncomment and modify the following ports based on connector usage: # - "1052:1052" # BACnet connector # - "5026:5026" # Modbus TCP connector (Modbus Slave) # - "50000:50000/tcp" # Socket connector with type TCP # - "50000:50000/udp" # Socket connector with type UDP # Necessary mapping for Linux extra_hosts: - "host.docker.internal:host-gateway" # Environment variables environment: - host=xx.yy.zz.aaa #masked for security - port=1883 - accessToken=rwPcmg54xbRr0syBM503 # Volumes bind volumes: - tb-gw-config:/thingsboard_gateway/config - tb-gw-logs:/thingsboard_gateway/logs - tb-gw-extensions:/thingsboard_gateway/extensions # Volumes declaration for configurations, extensions and configuration volumes: tb-gw-config: name: tb-gw-config tb-gw-logs: name: tb-gw-logs tb-gw-extensions: name: tb-gw-extensions ``` 3) However, the very next day, the IP changed, so I manually updated the IP in my Docker Compose file accordingly. Error Encountered: The IoT gateway encountered the following error after updating the IP in docker compose file and run sudo docker-compose up: tb-gateway | 2024-03-29 04:31:18 - |ERROR| - \[tb_client.py\] - tb_client - connect - 270 - timed out tb-gateway | Traceback (most recent call last): tb-gateway | File "/thingsboard_gateway/gateway/tb_client.py", line 265, in connect tb-gateway | self.client.connect(keepalive=keep_alive, tb-gateway | File "/usr/local/lib/python3.11/site-packages/tb_device_mqtt.py", line 451, in connect tb-gateway | self.\_client.connect(self.\__host, self.\__port, keepalive=keepalive) tb-gateway | File "/usr/local/lib/python3.11/site-packages/paho/mqtt/client.py", line 915, in connect tb-gateway | return self.reconnect() tb-gateway | ^^^^^^^^^^^^^^^^ tb-gateway | File "/usr/local/lib/python3.11/site-packages/paho/mqtt/client.py", line 1057, in reconnect tb-gateway | sock = self.\_create_socket_connection() tb-gateway | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ tb-gateway | File "/usr/local/lib/python3.11/site-packages/paho/mqtt/client.py", line 3731, in \_create_socket_connection tb-gateway | return socket.create_connection(addr, timeout=self.\_connect_timeout, source_address=source) tb-gateway | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ tb-gateway | File "/usr/local/lib/python3.11/socket.py", line 851, in create_connection tb-gateway | raise exceptions\[0\] tb-gateway | File "/usr/local/lib/python3.11/socket.py", line 836, in create_connection tb-gateway | sock.connect(sa) tb-gateway | TimeoutError: timed out Troubleshooting Steps Taken: Attempted to resolve the issue by disabling ufw using sudo ufw disable \[HELP\] I cannot connect gateway to thingsboard over getting started guide #1303 , as suggested in another ticket, but it didn't work. Tried removing the docker image and other troubleshooting methods but none were successful. Noticed that creating a new gateway device or deleting connector devices sometimes resolves the issue, but this is inconsistent and not a reliable solution. Request for Assistance: I need assistance in resolving this issue permanently as the current workaround is not reliable. Any guidance or suggestions would be greatly appreciated.
Unable to Maintain connectivity between IoT Gateway & Thingsboard CE server/Thingsboard Edge
|thingsboard|thingsboard-gateway|
null
The error message you're encountering stems from a fundamental misunderstanding of how SwiftUI's environment system is designed to work. The `@Environment` property wrapper is specifically designed to inject environment values into your SwiftUI views. This mechanism ensures that your views automatically update when the environment value changes, adhering to SwiftUI's reactive design principles. Attempting to access an environment value directly without using `@Environment` (or another appropriate mechanism) circumvents this system, leading to the issues you've observed. When you try to create a computed property within an extension on `View` to directly access an environment value, you're bypassing the environment's intended pattern of use. SwiftUI's environment is not just a simple dictionary that you can access values from at any point; it is a managed system that propagates values down the view hierarchy, ensuring updates are efficiently processed. However, if your goal is to reduce boilerplate and make the theme value easily accessible within your views without explicitly declaring an `@Environment` property each time, you have a couple of alternatives: ### 1. Using a Helper View You can create a small helper `View` that injects the environment value into its child views. This approach allows you to abstract away the environment access: ```swift struct WithTheme<Content: View>: View { @Environment(\.theme) var theme let content: (Theme) -> Content init(@ViewBuilder content: @escaping (Theme) -> Content) { self.content = content } var body: some View { content(theme) } } // Usage struct ContentView: View { var body: some View { WithTheme { theme in Rectangle() .fill(theme.color()) } } } ``` ### 2. View Modifier Another approach is to create a custom view modifier that injects the theme into the view. This is more in line with SwiftUI's design philosophy and allows you to use environment values flexibly: ```swift struct ThemeModifier: ViewModifier { @Environment(\.theme) var theme func body(content: Content) -> some View { content .fill(theme.color()) // Assuming the content can be filled with a color } } extension View { func withTheme() -> some View { modifier(ThemeModifier()) } } // Usage struct ContentView: View { var body: some View { Rectangle() .withTheme() } } ``` In both approaches, you're adhering to SwiftUI's intended design by utilizing the `@Environment` property wrapper to access environment values. This ensures your views remain reactive and automatically update when the environment value changes. Directly accessing the environment outside of these patterns is not supported by SwiftUI and, as you've discovered, leads to errors or unexpected behavior. The key is to work within the framework's guidelines to achieve the desired functionality.
If I inspect an element which is in the form of <div class="count">8<div> how to get the value 8 using selenium c# I have tried using below method ``` //Getting text from element public string GetTextFromElement(IWebElement element) { Log.Debug($"{_BrowserName) {element.Text}"); return element.Text; } ``` But is returning null
I'm wondering what's the most effective way of getting smart watch sensor data in intervals (say every 30 mins) in order to show in my mobile app. Due to the restrictions each watch OS has in place, finding the respective SDKs and APIs is more difficult than ever now. I have no problem developing a separate app for making this happen, as long I make sure respective sensors get activated upon fetching data without user intervention. Any suggestions?
Getting Real-Time Sensor Data from Smart Watches
|android|swift|flutter|mobile|watch|
I am using Sabre api https://developer.sabre.com/docs/rest_apis/air/search/bargain_finder_max/versions/v500/reference-documentation#/default/CreateBargainFinderMax scheduleDescs only contains the flight time, how i can tell the flight date? if for example there are connection flights that scheduled a different date from the first flight? [gist][1] with example of response [1]: https://gist.github.com/tomer-yechiel/17564db392841c6f85220f8c0bd3a3f3
Bargain Finder Max v5 - REST API - how to get the flights date time from the response?
|sabre|
The problem here lies in parsing the data:-- to resolve:-- 1)npm install body-parser 2)now require it through express,by {const bodyParser = require('body-parser')} 3)and then {app.use(bodyParser.json())} The undefined will be removed now and you can get the desired change.
What you are trying to do should be done using JavaScript function you cannot bind onchange function directly to php script. you have to use either pure javascript function or using javascript library like jquery to make ajax request call to the php script and add the data to mysql database Check Below code using pure javascript index.html <code> <input type="button" value="Home" class="homebutton" id="btnHome" onClick="add_record();" /> <script type="text/javascript"> function add_record(){ var data= document.getElementById("btnHome").value; // get value from input xhttp.open("GET", "php_file.php?field="+data, true); // get request url with field parameter xhttp.send(); // make request } </script> </code> php_file.php <code> <?php $servername = "localhost:3306"; $username = "deneme"; $password = "deneme"; $dbname = "deneme"; // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $field_data = $_GET['field']; // get field parameter from request url // insert $filed_data into database . You can add as much as fields in request parameter $sql = "INSERT INTO please (field) VALUES ('$field_data')"; if ($conn->query($sql) === TRUE) { echo "New record created successfully"; } else { echo "Error: " . $sql . "<br>" . $conn->error; } $conn->close(); ?> </code> Both You html file and php file should be in same folder. Ex: if your request url on xampp server is http://127.0.0.1/my_project/index.html folder structure should be C:\xampp\htdocs\my_project\ my_project should have both files.
How to get the value of a specific element
|c#|selenium-webdriver|
I tried to follow the [docs][1] and this is what I came to: ```from django.contrib.postgres.forms import BaseRangeField from django.db import models from django import forms from django.contrib.postgres.fields import RangeField from psycopg.types.range import Range from django.utils.translation import gettext_lazy as _ class TimeRange(Range): """Time interval.""" pass class TimeRangeFieldForm(BaseRangeField): """Form for time interval.""" default_error_messages = {'invalid': _('Enter two valid times.')} base_field = forms.TimeField range_type = TimeRange class TimeRangeField(RangeField): """Time interval field.""" base_field = models.TimeField range_type = TimeRange form_field = TimeRangeFieldForm def db_type(self, connection): return 'timerange' ``` But there is also that [range_register()][2] thing and I just don't get how to use it in code. And when I try to do migrations I get `django.db.utils.ProgrammingError: type "timerange" does not exist LINE 1: ...IDENTITY, "days" smallint[7] NOT NULL, "interval" timerange ...`. Please help me understand how to create custom range field. Also I don't get how there is DateTimeRangeField and DateRangeField but no TimeRangeField... [1]: https://docs.djangoproject.com/en/5.0/ref/contrib/postgres/fields/#defining-your-own-range-types [2]: https://www.psycopg.org/psycopg3/docs/basic/pgtypes.html#psycopg.types.range.register_range
I have the following line of code in controller class ```@ResponseStatus(HttpStatus.OK)``` Everything is simple and beautiful when the `HttpStatus` enum has the value I need. But today I needed status code`210`. And there is no such choice between `HttpStatus` enums value. Maybe you know a clean and tidy way (without directly constructing `HttpServletResponse`) how I can set the `210` status code?
I'v useing LruEvictionPolicyFactory in my CacheConfiguration like blow ```java CacheConfiguration<K, V> cacheCfg = new CacheConfiguration<>(); cacheCfg.setDataRegionName("ds_name"); cacheCfg.setAtomicityMode(CacheAtomicityMode.ATOMIC); cacheCfg.setRebalanceMode(CacheRebalanceMode.ASYNC); cacheCfg.setPartitionLossPolicy(PartitionLossPolicy.READ_WRITE_SAFE); cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.PRIMARY_SYNC); cacheCfg.setEvictionPolicyFactory(new LruEvictionPolicyFactory<>(200000)); ``` and I use DataRegionConfig like this ```xml <bean class="org.apache.ignite.configuration.DataRegionConfiguration"> <property name="name" value="ds_name"/> <property name="initialSize" value="#{512L * 1024 * 1024}"/> <property name="maxSize" value="#{3 * 1024L * 1024 * 1024}"/> <property name="pageEvictionMode" value="RANDOM_LRU"/> <property name="evictionThreshold" value="0.9"/> <property name="metricsEnabled" value="true"/> <property name="persistenceEnabled" value="false"/> </bean> ``` but I can see far more than 2000000 records in my cache, for some times, i can see 800000 records in the cache how to control data size in my cache to avoid one cache using too many memories
Try this from **Teminal** `sudo DevToolsSecurity -enable` Source https://developer.apple.com/forums/thread/120282 Or else restart the device and reconnect it once again.
|unicode|utf-8|common-lisp|sbcl|
In Tableau Metadata API by using GraphQL, I can able to extract all information's about the Datasource, but I couldn't able to get the relationships between tables in each Datasource. How can I write the query to extract the relationships metadata? I need to get the GraphQL, how to extract the relationships between tables
Relationships query in Tableau Metadata API by using GraphQL
|c#|graphql|tableau-api|tableau-prep|tableau-cloud|
null
```python original_frames = [cv2.imread(os.path.join(original_frames_dir, filename)) for filename in sorted(os.listdir(original_frames_dir))] ``` ```none Traceback (most recent call last): File "d:\python\start.py", line 61, in <module> target_frames = [cv2.imread(os.path.join(target_frames_dir, filename)) for filename in sorted(os.listdir(target_frames_dir))] ``` solving the problem, expected someone will answer me, I don't know what will be the result
I want to install the C compiler for the LC3. I am following this guide: https://users.ece.utexas.edu/~ryerraballi/ConLC3.html I am on the part where it is written: > At the command prompt (shown as $) type in (Do not type the dollar) > $ cd c:lc3/lcc-1.3 > to change directory to the directory that you previously downloaded the lcc software to. > Run these three commands in order. Do not worry about warnings > $ ./configure --installdir /bin > $ make > $ make install > These commands will take a few minutes to complete at the end of which you will have the software built and installed The specific part I am having trouble with is the command: > $ ./configure --installdir /bin When I run it this happens: > /cygdrive/c/lc3/lcc-1.3 $ ./configure --installdir /bin Cannot locate > make binary. I have removed my computer name from the start. Do you know how to fix this?
Installing the C compiler for LC3
|c|installation|compilation|lc3|
|fb-hydra|hydra-core|
What you are trying to do should be done using JavaScript function you cannot bind onchange function directly to php script. you have to use either pure javascript function or using javascript library like jquery to make ajax request call to the php script and add the data to mysql database Check Below code using pure javascript index.html <code> <input type="button" value="Home" class="homebutton" id="btnHome" onClick="add_record();" /> <script type="text/javascript"> function add_record(){ var data= document.getElementById("btnHome").value; // get value from input xhttp.open("GET", "php_file.php?field="+data, true); // get request url with field parameter xhttp.send(); // make request } </script> </code> php_file.php <code> <?php $servername = "localhost:3306"; $username = "deneme"; $password = "deneme"; $dbname = "deneme"; // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $field_data = $_GET['field']; // get field parameter from request url // insert $filed_data into database . You can add as much as fields in request parameter $sql = "INSERT INTO please (field) VALUES ('$field_data')"; if ($conn->query($sql) === TRUE) { echo "New record created successfully"; } else { echo "Error: " . $sql . "<br>" . $conn->error; } $conn->close(); ?> </code> Both You html file and php file should be in same folder. you cannot add xampp foldr and htdocs folder in url as htdocs is the mail public folder to access by url and anything above this cannot be accessed vis url. please have a look on how to access url on xampp apache server. Ex: your request url on xampp installed on C: drive should be like this http://127.0.0.1/my_project/index.html folder structure should be C:\xampp\htdocs\my_project\ my_project should have both files.
I am working with STM32U575ZIt6 micro and I have a problem with reading data from Flash (one of the last pages) to RAM. Basically what happens is when i execute the code, the checksum of the data read is not matching the one i expect and that is because the data copied from flash to ram is missing some parts. If i execute the same code with the debugger, doing a step by step reading, the data is copied sucessfully and the checksum matches. My thought was that there was some timing problem so i tried adding some delay in the read function but that didnt work. Another thing i noticed is that adding code after the read function and the checksum calculation has an effect on the data read. Any clue what is the problem? Thanks for any answers This is the function i am using to read data stored (correctly) in Flash ``` 1 Read(BACKUP, (void*)&Regs, sizeof(fram_registers)); 2 void Read(uint32_t data_address, uint32_t *data, uint16 len) 3 { 4 if ( len != 0 ) 5 { 6 len/=4; 7 8 while(len--) 9 { 10 *data = *(__IO uint32_t *)data_address; 11 data_address += 4; 12 data++; 13 } 14 } 15 } ``` [This is data stored in backup](https://i.stack.imgur.com/h4HYs.png) [![enter image description here][1]][1] [This is what i get](https://i.stack.imgur.com/ZaoXW.png) [![enter image description here][2]][2] **EDIT:** I have tried the suggestions in the comments but nothing worked. I add some more information that may help. So this is the part of code that i am having trouble with: ``` 16 Read(BACKUP, (void*)&Regs, sizeof(fram_registers));//the function is the same described before 17 checksum = Adler32((const uint8*)&Regs, sizeof(fram_registers) - 4); //the last 4 bytes contain the checksum saved in backup 18 if(checksum != Regs.Cksm) { 19 //checksum = Adler32((const uint8*)&Regs, sizeof(fram_registers) - 4); 20 } ``` 0x080fc000 is the address of BACKUP 0x20004b90 is the address of Regs When i get to line 16 and step over with jlink this is what i get [![enter image description here][3]][3] Rerunning the code, when i get to line 16 and step in the function and cycle trought lines 4 to 15 step by step i get the correct outcome: https://wetransfer.com/downloads/f32dfc6bdfb5819e222220ca7914ddee20240329073959/20f2d8 (i stopped the video just after reading the bytes that were read wrong before, but going on the whole data is read correctly) Rerunning the code again, this time decommenting line 19 without touching anything written before, and stepping over the Read function i get in Regs: [![enter image description here][4]][4] Again rerunning the code with line 19 decommented and this time stepping in the function Read and running it step by step i get the correct data copied in Regs. So the first question is how is this possible that doing a step by step execution is different from free running the code. The second question is how adding code after function call impacts its outcome. Another thing I noticed is when i try to erase the chip i get this error sometimes, but retrying it gets erased successfully : [![enter image description here][5]][5] [![enter image description here][6]][6] [![enter image description here][7]][7] Also when I enter in debugging mode on STMide i get this message (it doesnt block me from debugging): [![enter image description here][8]][8] Setting breakpoints in different points of the code i also get those before entering in debug mode: [![enter image description here][9]][9] [![enter image description here][10]][10] I have also tried running code without debug mode thinking that the debug instructions could somehow influence the code but the outcome is the same. [1]: https://i.stack.imgur.com/euVhz.png [2]: https://i.stack.imgur.com/P0gwc.png [3]: https://i.stack.imgur.com/BD5QJ.png [4]: https://i.stack.imgur.com/qt27d.png [5]: https://i.stack.imgur.com/y7T7O.png [6]: https://i.stack.imgur.com/4mNMK.png [7]: https://i.stack.imgur.com/EMalH.png [8]: https://i.stack.imgur.com/Krn4Q.png [9]: https://i.stack.imgur.com/1h0dQ.png [10]: https://i.stack.imgur.com/8QJ69.png
I want to compute the integral \int_{-1}^{-1} d\cos(theta) \int_{-\pi}^{\pi} d\phi \sin(\theta)*\cos(\phi)*g I have data file giving me values of cos(theta), phi and g. I am trying to solve it using trapezoid method of scipy.integrate. But I am not sure if this is the correct way since it is a double integration and g depends on both cos_theta and phi. The code is as follows : ` ``` nvz = 256 nph = 256 dOmega = (2.0/nvz) * (2*np.pi / nph) dphi = (2*np.pi / nph) dtheta = (2.0/nvz) cos_theta = file[:,0] sin_theta = np.sqrt(1-cos_theta**2) phi = file[:,1] cos_phi = np.cos(phi) sin_phi = np.sin(phi) g = file[:,2] integrate.trapezoid(sin_theta*cos_phi*g, dx = dOmega) ```` Can someone please suggest me a way to solve it correctly?
Solving double integration in python using scipy.integrate
|python|arrays|numpy|scipy|integrate|
null
Hello ladies and gents, I want to modify the behavior of product category links in my WooCommerce store. Currently, when users click on a product category, they see a page displaying subcategories (ie "Cooling and Heating" > "Air cons" & "Heaters"). However, when they click on a subcategory, they're taken to another page displaying further subcategories, if available (i.e "Cooling and Heating" > "Air cons" > "Inverter units" & "1HP units" & "Split units" and do one), instead of directly to the product listing page for that subcategory (i.e "Cooling and Heating" > "Air cons" > Page with all "Air cons" listings. [Talking about this](https://i.stack.imgur.com/Zs2tI.png) Thanks
How to modify WooCommerce category navigation: Directing Subcategory Clicks to Product Listings instead of page with more Subcategories
|php|wordpress|woocommerce|
null
With the assistance of CMake's [CheckCXXSymbolExists][1] module, you can determine whether libc++ or libstdc++ is configured to be used in your project. Here's how you can do it: ```cmake include(CheckCXXSymbolExists) if(cxx_std_20 IN_LIST CMAKE_CXX_COMPILE_FEATURES) set(header version) else() set(header ciso646) endif() check_cxx_symbol_exists(_LIBCPP_VERSION ${header} LIBCPP) if(LIBCPP) # Logic for libc++ endif() check_cxx_symbol_exists(__GLIBCXX__ ${header} GLIBCXX) if(GLIBCXX) # Logic for libstdc++ endif() ``` In this implementation, we use the [\<version\>][2] header if the compiler supports C++20. Otherwise, we resort to the [\<ciso646\>][3] header. Note that while `<ciso646>` is removed in C++20, it may still exist in implementations for backward compatibility purposes. [1]: https://cmake.org/cmake/help/latest/module/CheckCXXSymbolExists.html [2]: https://en.cppreference.com/w/cpp/header/version [3]: https://en.cppreference.com/w/cpp/header/ciso646
I know this is late, but it might be useful to someone. You pass the `arguments` in the wrong place. You need to pass them as a property in the command object not in the code lens itself. The command passed in the code lens now should look like this ```josn { "command": "extensionName.commandName", "title": "Run Test", "category": "CodeLens Sample", "arguments": [1] } ```
This is my DataFrame: import pandas as pd df = pd.DataFrame( { 'a': [10, 14, 20, 10, 12, 5, 3] } ) And this is the expected output. I want to create four groups: a 0 10 1 14 2 20 a 3 10 4 12 a 5 5 a 6 3 From top to bottom, as far as `a` is increasing/equal groups do not change. That is why first three rows are in one group. However, in row `3` `a` has decreased (i.e. 20 > 10). So this is where the second group starts. And the same logic applies for the rest of groups. This is one my attempts. But I don't know how to continue: import numpy as np df['dir'] = np.sign(df.a.shift(-1) - df.a)
I was trying to deploy nginx using kubernetes, I set up all the things accordingly but when I executed command "**minikube service my-app**" it was showing error : ❌ Exiting due to MK_UNIMPLEMENTED: minikube service is not currently implemented with the builtin network on QEMU I followed each step according to tutorial but It went wrong. Did GPT search but it didn't worked for me.
minikube not starting the service
|linux|docker|kubernetes|terminal|minikube|
null
What you are trying to do should be done using JavaScript function you cannot bind onchange function directly to php script. you have to use either pure javascript function or using javascript library like jquery to make ajax request call to the php script and add the data to mysql database Check Below code using pure javascript index.html <code> <input type="button" value="Home" class="homebutton" id="btnHome" onClick="add_record();" /> <script type="text/javascript"> function add_record(){ var data= document.getElementById("btnHome").value; // get value from input xhttp.open("GET", "php_file.php?field="+data, true); // get request url with field parameter xhttp.send(); // make request } </script> </code> php_file.php <code> <?php $servername = "localhost:3306"; $username = "deneme"; $password = "deneme"; $dbname = "deneme"; // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $field_data = $_GET['field']; // get field parameter from request url // insert $filed_data into database . You can add as much as fields in request parameter $sql = "INSERT INTO please (field) VALUES ('$field_data')"; if ($conn->query($sql) === TRUE) { echo "New record created successfully"; } else { echo "Error: " . $sql . "<br>" . $conn->error; } $conn->close(); ?> </code> Both You html file and php file should be in same folder. you cannot add xampp folder and htdocs folder in url as htdocs is the main public folder to access by url and anything above this cannot be accessed via url. please have a look on how to access url on xampp apache server. Ex: your request url on xampp installed on C: drive should be like this http://127.0.0.1/my_project/index.html folder structure should be C:\xampp\htdocs\my_project\ my_project should have both files.
I want to set axisItems to a PlotItem useing pyqtgraph, I encountered an error while running my code. Here is my code: ``` plotItem = pg.PlotItem() plotItem.setAxisItems(axisItems={'bottom':pg.AxisItem('bottom')}) ``` ---------------------------------------------------------------------------------------------------- When I run this code, it shows the error as below: ``` Traceback (most recent call last): File "E:\Workspace\Python\VNPY-master\examples\candle_chart\tick\item\main.py", line 42, in <module> plotItem.setAxisItems(axisItems={'bottom':pg.AxisItem('bottom')}) File "E:\home\.conda\envs\Python310\lib\site-packages\pyqtgraph\graphicsItems\PlotItem\PlotItem.py", line 312, in setAxisItems oldAxis.scene().removeItem(oldAxis) AttributeError: 'NoneType' object has no attribute 'removeItem' ``` I tried to set axises when initialzing PlotItem, it succeeded. but how to set axises after initialized PlotItem? ``` plotItem = pg.PlotItem(axisItems={'bottom':pg.AxisItem('bottom')}) ```
'NoneType' object has no attribute 'removeItem'
|pyqtgraph|
null
I doubt you can drop the column with having `BlockOnPossibleDataLoss=true`. I guess that you can one of the following methods: * Drop the column in pre-deployment script without removing it from the model, then remove it from the model after deployment was made * You can pass `BlockOnPossibleDataLoss=false` when deploying. I assume it should override the values you have in publish profile. I haven't tested it.
Add these query in manifest file... <queries> <intent> <action android:name="android.media.action.IMAGE_CAPTURE" /> </intent> <!-- Gallery --> <intent> <action android:name="android.intent.action.GET_CONTENT" /> <data android:mimeType="image/*" /> </intent> <intent> <action android:name="android.intent.action.PICK" /> <data android:mimeType="image/*" /> </intent> <intent> <action android:name="android.intent.action.CHOOSER" /> </intent> </queries>
### Problem Background - I used UnixBench to test the performance on gcc-8.5.0 and gcc-10.3.0, and found that the performance dropped by about 10%! I finally located that it was because gcc-10.3.0 had -fno-common as the default option. (-fcommon is the default option on gcc-8.5.0). - Looking in the gcc manual I found this description of fcommon: > In C code, this option controls the placement of global variables defined without an initializer, known as tentative definitions in the C standard. Tentative definitions are distinct from declarations of a variable with the extern keyword, which do not allocate storage. > > The default is -fno-common, which specifies that the compiler places uninitialized global variables in the BSS section of the object file. This inhibits the merging of tentative definitions by the linker so you get a multiple-definition error if the same variable is accidentally defined in more than one compilation unit. > > The -fcommon places uninitialized global variables in a common block. This allows the linker to resolve all tentative definitions of the same variable in different compilation units to the same object, or to a non-tentative definition. This behavior is inconsistent with C++, and on many targets implies a speed and code size penalty on global variable references. It is mainly useful to enable legacy code to link without errors. ### Question 1. Why is there such a big performance difference between -fcommon and -fno-common in the same environment? 2. I suspect that the CPU(Sapphire Rapids) in my environment is not adapted to gcc. If so, how can I locate or solve this problem on gcc-10.3.0? 3. What exactly are the risks if you change -fno-common back to -fcommon? I don't know gcc very well. If someone could help answer these questions, even one, it would be greatly appreciated.
This may look as a common question but I was not able to find an answer for this anywhere. In my case it's not the felid of the object but the object name which changers dynamically. when debugged the variable "itemId" get stored with the value "solarPanel" (as intended) what i was expecting was to get "Solar Panel testing" printed to the console ``` function DataBase (name, price, images, discription, shipping, remaining){ this.name = name; this.price = price; this.images = images; this.discription = discription; this.shipping = shipping; this.remaining = remaining; } let solarPanel = new DataBase("Solar Panel testing", 400, ["blankItem.png"], "This is a greate item", 50, 10); let solarLight = new DataBase("Solar Panel", 400, ["blankItem.png"], "This is a greate item", 50, 10); let electricScooter = new DataBase("Solar Panel", 400, ["blankItem.png"], "This is a greate item", 50, 10); let windTurbineDom = new DataBase("Solar Panel", 400, ["blankItem.png"], "This is a greate item", 50, 10); let windTurbinePor = new DataBase("Solar Panel", 400, ["blankItem.png"], "This is a greate item", 50, 10); let waterTurbine = new DataBase("Solar Panel", 400, ["blankItem.png"], "This is a greate item", 50, 10); let solarCharger = new DataBase("Solar Panel", 400, ["blankItem.png"], "This is a greate item", 50, 10); let itemEight = new DataBase("Solar Panel", 400, ["blankItem.png"], "This is a greate item", 50, 10); let itemNinee = new DataBase("Solar Panel", 400, ["blankItem.png"], "This is a greate item", 50, 10); let buyBtn = document.getElementsByClassName("itemAddCartBtn"); console.log(buyBtn); for (let i = 0; i < buyBtn.length; i++){ buyBtn[i].addEventListener("click", function(){ let itemId = this.parentElement.getAttribute("id"); // when I debugged the code it got executed as intended up to this point //the error occured in the line below console.log([itemId].name); //itemId is defined but [itemId].name is undifined }); } ``` chat gpt suggested to replace the "console.log([itemId].name);" with "console.log(window[itemId].name);" but that did not worked ... in the both instances the console was printed with the word "undefined"
How to access objects dynamically?
|javascript|
null
I am currently trying to create a basic chatbot using dialogflow. I created an intent to get order id from the user with numbers trained in it, but when ever i test it with numbers it goes to Default fallback intent. PLease Help!! I have been struggling with this for 2 days and cant proceed further.
Dialogflow failing to dectect the correct intent
|android-intent|nlp|dialogflow-es|dialogflow-cx|
null
There is dataframe with one column disposition --------- NO ANSWER ANSWERED FAILED BUSY ERROR WARNING CANCEL How to replace values according conditions: WHEN disposition = 'NO ANSWER' THEN 0 WHEN disposition = 'ANSWERED' THEN 1 WHEN disposition = 'FAILED' THEN 2 WHEN disposition = 'BUSY' THEN 3 ELSE 9 Wished result is disposition --------- 0 1 2 3 9 9 9
Pandas dataframe : Replace value according case conditions
|python|pandas|
Here's a working solution. As I said in my comment, using regular expressions makes it far easier to retrieve the "highlighted" word. Note that it would be quite easy (by storing the word category delimiters in a dictionary, and replacing the 3 dictionaries with one dictionary of dictionaries) to make the code more flexible (adding new categories) while avoiding the repetition of `if ...` statements. ``` import re sentences = [ "Es (duftete) nach Erde und Pilze", "die [Wände] waren mit Moos überzogen.", "Ihr zerrissenes [Gewand] war wieder wie neu", "Er saß da wie verzaubert und schaute sie an und konnte seine Augen nicht {mehr} von ihr abwenden", "Da sie durchscheinend waren, sahen sie aus wie aus rosa [Glas], das von innen erleuchtet ist.", ] def getWordsSelected(sentences): # the parameter sentences is a list of the previous sentences sample showed verbDict = {} subsDict = {} adjDict = {} for wordSentenceToSearch in sentences: # SUBSTANTIVE if (substantive := re.findall(r'\[([^]]*)', wordSentenceToSearch)): subsDict.setdefault(substantive[0], []).append((wordSentenceToSearch, "substantive")) # VERB if (verb := re.findall(r'\(([^)]*)', wordSentenceToSearch)): verbDict.setdefault(verb[0], []).append((wordSentenceToSearch, "verb")) # ADJ if (adj := re.findall(r'\{([^}]*)', wordSentenceToSearch)): adjDict.setdefault(adj[0], []).append((wordSentenceToSearch, "adjective")) print(subsDict) print(verbDict) print(adjDict) ``` OUTPUT: ``` getWordsSelected(sentences) {'Wände': [('die [Wände] waren mit Moos überzogen.', 'substantive')], 'Gewand': [('Ihr zerrissenes [Gewand] war wieder wie neu', 'substantive')], 'Glas': [('Da sie durchscheinend waren, sahen sie aus wie aus rosa [Glas], das von innen erleuchtet ist.', 'substantive')]} {'duftete': [('Es (duftete) nach Erde und Pilze', 'verb')]} {'mehr': [('Er saß da wie verzaubert und schaute sie an und konnte seine Augen nicht {mehr} von ihr abwenden', 'adjective')]} ``` Edit: here's an improved version following what I wrote earlier: ``` import re sentences = [ "Es (duftete) nach Erde und Pilze", "die [Wände] waren mit Moos überzogen.", "Ihr zerrissenes [Gewand] war wieder wie neu", "Er saß da wie verzaubert und schaute sie an und konnte seine Augen nicht {mehr} von ihr abwenden", "Da sie durchscheinend waren, sahen sie aus wie aus rosa [Glas], das von innen erleuchtet ist.", ] def getWordsSelected(sentences): # the parameter sentences is a list of the previous sentences sample showed word_categories = { 'verb': '()', 'substantive': '[]', 'adjective': '{}' } word_dict = {category: {} for category in word_categories} for wordSentenceToSearch in sentences: for category, delimiters in word_categories.items(): if word := re.findall( fr'{re.escape(delimiters[0])}([^{re.escape(delimiters[1])}]*)', wordSentenceToSearch ): word_dict[category].setdefault(word[0], []).append((wordSentenceToSearch, category)) print(word_dict) ``` OUTPUT: ``` { 'verb': {'duftete': [('Es (duftete) nach Erde und Pilze', 'verb')]}, 'substantive': {'Wände': [('die [Wände] waren mit Moos überzogen.', 'substantive')], 'Gewand': [('Ihr zerrissenes [Gewand] war wieder wie neu', 'substantive')], 'Glas': [('Da sie durchscheinend waren, sahen sie aus wie aus rosa [Glas], das von innen erleuchtet ist.', 'substantive')]}, 'adjective': {'mehr': [('Er saß da wie verzaubert und schaute sie an und konnte seine Augen nicht {mehr} von ihr abwenden', 'adjective')]} } ```
In WooCommerce, I want to modify the behavior of product category links in my WooCommerce store. Currently, when users click on a product category, they see a page displaying subcategories (ie "Cooling and Heating" > "Air cons" & "Heaters"). However, when they click on a subcategory, they're taken to another page displaying further subcategories, if available (i.e "Cooling and Heating" > "Air cons" > "Inverter units" & "1HP units" & "Split units" and do one), instead of directly to the product listing page for that subcategory (i.e "Cooling and Heating" > "Air cons" > Page with all "Air cons" listings. [![Talking about this](https://i.stack.imgur.com/Zs2tI.png)](https://i.stack.imgur.com/Zs2tI.png)
I've read some blogs about MMIO, they say that through MMIO, I can access IO device just as I access normal physical memory. For example, I can read some data from a device by reading a specified physical address, and the CPU will know that I'll access a device instead of real memory and it will go to read data from the device. I'm wondering how can CPU tell whether it's a MMIO access or a normal memory access? I guess that there is a specified physical address space that used for MMIO, but I can't find related official document. (Actually I don't even know what keywords to search for some related documents)
How does CPU tell between MMIO(Memory Mapped IO) and normal memory access in x86 architecture
|x86|intel|pci|memory-mapped-io|
null
error: Multiple commands produce '<APP_NAME>.app/PrivacyInfo.xcprivacy' note: Target 'AppV2Stage' (project 'AppV2') has copy command from '<ProjectPath>/ios/PrivacyInfo.xcprivacy' to '<>.app/PrivacyInfo.xcprivacy' note: That command depends on command in Target 'AppV2Stage' (project 'AppV2'): script phase “[CP] Copy Pods Resources”