Recent Questions - Stack Overflow |
- Is ASP.Identity user id public?
- React: Component name based on prop
- jquery html duplicating on drag and drop
- Can't write file using FS
- Azure B2C Custom Policy Email Verification re-order items
- matplotlib: Is it possible to artificially expand the chart axis in a color chart?
- Ms sql report builder percentage
- Retrieve selection from a List
- Trouble calling function via pthread
- Open and read text file
- Can't find the dbo for television series (dbpedia, sparql)
- Authorization token Bearer through javascript security
- python pandas is giving a keyerror for a column I group by, even though a boolean expression shows that the column is part of the dataframe
- Terminating a .net-core WebApp if there is a critical error
- Why $request is Unefined?
- Elasticsearch results order is changing on the frontend
- React component doesnnt re render
- returns an array of objects that contains the product names
- How to require to fill up forms before submitting it by the user? empty() and !isset is not working
- How to compute very large numbers without a list
- mysql will make more connections than allowed
- How can I post form data from react to an express.js server and use it as part of a url string
- JavaScript v8 Optimization Compiler | Monomorphism, Polymorphism?
- How to constrict your problem to allow a custom-defined "cool-off period"?
- Find truck name and sume the duration time
- Compare two table ids and get results where does not exist in one table
- Get MAX inputted date within sub query
- Limit character length of database field name?
- ArangoDB Cursor Timeout
- Python xml ElementTree from a string source?
Is ASP.Identity user id public? Posted: 20 Sep 2021 08:34 AM PDT I suppose it's safe to say user id is a public value and there is nothing wrong with exposing it as a parameter to my web api endpoint? My reasoning it is already made public since it's included in JWT. Am I correct? |
React: Component name based on prop Posted: 20 Sep 2021 08:34 AM PDT I am trying to load a component in React via a prop. It is an icon that I want to pass from the parent component. Dashboard (parent): Button (child): Unfortunately, I can't find an easy way to make this work since I'm not allowed to use props in the component name. |
jquery html duplicating on drag and drop Posted: 20 Sep 2021 08:34 AM PDT I am using jQuery and using a drag and drop function. My image keeps duplicating and I have no idea why. Any help would be great. I am pretty sure my issue is at line: Here is my function: |
Posted: 20 Sep 2021 08:33 AM PDT So, I have a NodeJS API using express and I want to get data from a HTTP request and store it in a local JSON file. This is the file that contains the function to write the local file: And this is the part of the code I use to call the function with the Post route When I send the HTTP request, using Insomnia, I don't get any errors and the data is logged in the console, but the file isn't written. |
Azure B2C Custom Policy Email Verification re-order items Posted: 20 Sep 2021 08:33 AM PDT In an Azure B2C Custom Policy that uses the default email verification process, is it possible to re-order how the items within the email verification section are displayed? Current after entering an email address and clicking on the send code button, a message is displayed to the user which is above the email input. Is it possible to change the position of this, so it is displayed between the email input and the verification code input? |
matplotlib: Is it possible to artificially expand the chart axis in a color chart? Posted: 20 Sep 2021 08:33 AM PDT I have created pcolor plot, based on Result: Is it possible to artificially expand the chart on the x-axis to always 40 fields, and on the y-axis to 60 fields and leave these fields blank? Note: Sometimes I have data with incomplete axis ranges as the picture below: Is it possible to transform the data/plot in such a way that the axis always shows values from 1 to 40, and the axis shows values from 1 to 60? |
Ms sql report builder percentage Posted: 20 Sep 2021 08:33 AM PDT I need to create charts that represent % downtimes of equipment. But i have trable with percentage. I need percentage for grouped by month reasons of downtime |
Retrieve selection from a List Posted: 20 Sep 2021 08:33 AM PDT I am new and I would like to retrieve the user's response when I submitt a List in the console? For example: I ask him to make a choice among the different proposals: 1 for head 2 for legs 3 for stomach When he presses 1, 2 or 3, I want to submit another list from the head, legs or stomach for example for the head (answer 1 in the Cons.Read), display him eyes, ears, mouth, etc I don't know if it's clear enough cause i've very bad english but I would really like to know how to do it. Regards EDIT: Basically, how to make a list from a list of a list (tree structure of several levels) and retrieve the answers each time to finally propose an object (OOP) with diferents characteristics? |
Trouble calling function via pthread Posted: 20 Sep 2021 08:33 AM PDT I have a function that counts the number of occurences of a string in a char array. Calling this function normally with findword(copy, "polar") works perfectly fine and prints an int that's the number of times the string "polar" occurs in the char array "copy". Calling the function via a pthread however gives me compilation issues and I don't know why. This is my first time implementing multithreading. Here is the function I want to call: And here is the thread I'm trying to create that is supposed to call the function: whenever I compile using g++ and the -pthread flag I get this compile error: All the necessary header files are included, thank you for the help. |
Posted: 20 Sep 2021 08:33 AM PDT try to Open and read text file but I got error FileNotFoundError: [Errno 2] No such file or directory However I have Data.txt in Server/www/ Why I got this error? with open('Server/www/Data.txt') as creds: FileNotFoundError: [Errno 2] No such file or directory: 'Server/www/Data.txt |
Can't find the dbo for television series (dbpedia, sparql) Posted: 20 Sep 2021 08:33 AM PDT I hope you are having a lovely day. I am trying to find all the relationships between two television shows. Right now, I have SELECT ?r1 ?r2 WHERE { } However, I seem to be getting a syntax error at '?show3' before 'dbo:tvShow'. Does anyone have any advice to fix this query? Thank you so much!! |
Authorization token Bearer through javascript security Posted: 20 Sep 2021 08:33 AM PDT I'm a bit confused about authentication throuhg token. If I need to call web api authenticated from a web application I need to add the token to all call to the apis: but in this case the token can be easily copied and used to makes authenticated calls. For example: if I have a .netcore apis backend and web application that use the apis to render informations, the token must be added in javascript calls... or not? Where I'm wrong? Thank you! |
Posted: 20 Sep 2021 08:33 AM PDT I cannot seem to print the following line: without getting the error: I have checked that Tag is included as a column in the summarydata dataframe by the following: which prints out as true. Therefore I am not sure why a key error is being thrown when the column is in the dataframe. |
Terminating a .net-core WebApp if there is a critical error Posted: 20 Sep 2021 08:33 AM PDT In order to make deployment easier I want my application to self create pre-defined roles on the database. If for some reason it is the first time running on the current database but it fails to create the roles, PE, there was a connection error, the application immediately terminates with an Is this a bad practice? If yes, why? What are my alternatives? |
Posted: 20 Sep 2021 08:33 AM PDT i have a web appliction where i'm testing custom login and registration but in the CustomAuthController i tried to pass the data to the dashboard but $request is no defined |
Elasticsearch results order is changing on the frontend Posted: 20 Sep 2021 08:33 AM PDT I'm working with magento 2.4.2 and elasticsearch 7.10.2 What I'm seeing is that even though the results in elasticsearch are ordered correctly in the backend, on the frontend are wrongly displayed. Here's an example, the language is spanish so "lapices de colores" means "Colored Pencils". If I run this command: I get the following results (for convenience I'm only showing the first hit) But if I run the same query on the store, being the url: The results although related are not the ones given by elasticsearch. In the admin panel, in stores->Catalog->Catalog->"Product Listing Sort By" is set by Position. I'm guessing that is a template issue but I don't know how can I fix this. Here's the sorter.phtml file used by the template: I'm not sure where or what to look for, any ideas? |
React component doesnnt re render Posted: 20 Sep 2021 08:33 AM PDT im passing values using react redux evreything is passed but the component i want to render only renders 1 time and when i save my code in vscode (it renders again)the data renders on page like it should return ( on the log the data updates but the trenary function dont trigger same goes for useEffect |
returns an array of objects that contains the product names Posted: 20 Sep 2021 08:33 AM PDT I am working on a javascript snippet for Google tag manager where i have to display the output like below.
Attached datalayer. |
How to require to fill up forms before submitting it by the user? empty() and !isset is not working Posted: 20 Sep 2021 08:33 AM PDT I am working on a small activity of using forms to insert data to the database and displaying those data. I want the form to be filled and not empty before inserting it to the database but using PS. I commented my previous codes of each table to try the empty() and soon replaced it with !isset but nothing works. This is my process.php |
How to compute very large numbers without a list Posted: 20 Sep 2021 08:33 AM PDT I am trying to complete a coding challenge which requires me to count all of the digits between 1 and X, where can reach up to 400,000,000,000,000,000 My approach was to iterate over a list and add the amount of digits to my result in the end, like so: but obviously creating a list of every digit between 1 and that big number requires a lot of storage and running this returns 'MemoryError Line 2' How else could I go about this? or Avoid the problem |
mysql will make more connections than allowed Posted: 20 Sep 2021 08:33 AM PDT I'm using Sequelize ORM for my nodejs project and it seems there is a mistake in configuration or I'm doing something really awry with the queries... The problem is that our client will make more than 60 connections sometimes when the user is requesting a lot of information at once (graphql request with deep structure and data loaders on top for a lot of records fetched from MySQL). The pool settings should not let do that since it is configured for 10 max connections at once. The main question is how those connections appear? The app is being hosted at AWS using ELB, for MySQL we are using RDS and we can have up to 2 app instances at once, so no more than 20 connections at all. Sequelize config: once there are >50 connections on our RDS client we can see that our ELB can't perform health check since it can't make new connections and return positive status from MySQL. so our app becomes unreachable. After bombing the backend with this particular query I've fetched processlist for MySQL. Some sleeping queries will go to more than 1000 "time". What I'm missing here? |
How can I post form data from react to an express.js server and use it as part of a url string Posted: 20 Sep 2021 08:33 AM PDT Just to make this clearer. I have a form where the user inputs a name which is passed to the apiUrl const to become part of the URL string. The form input data is passed through state as {this.state.input}. After the user inputs the form with the name he wants to search for, he clicks a button which calls the onButtonSubmit function that fetches the data with the updated apiUrl parameters. The catch is, this is running on the front-end and as this is a proprietary api, I don't want to expose the api key (which is part of the url) to the user. I have set up an express.js server but I'm still unsure on how I can post the form data to it and then use that in the same manner used in my code below. So the output I'm looking for would follow something like this: 1 - Post form data from frontend after the user submits it with a button click 2 - Through the backend, use the form data to update the apiurl and then fetch the data from the api 3 - Send the api data back to the frontend |
JavaScript v8 Optimization Compiler | Monomorphism, Polymorphism? Posted: 20 Sep 2021 08:34 AM PDT Chrome V8 Optimization Compiler Is there still a difference between Monomorphism, Polymorphism, and Megamorphism in speed, or not anymore? |
How to constrict your problem to allow a custom-defined "cool-off period"? Posted: 20 Sep 2021 08:34 AM PDT I am making use of CVXPY and CVXOPT to solve a problem that allows us to control the running of motors in the cheapest possible ways. We have existing constraints which consist of, cost, volume, and level which need to be maintained (all of which work, and is only to give a further definition of the problem at hand). We use this to minimize the cost and provide an optimized approach. Recently, we wish to add a new constraint that will allow for a cool-off period. Which we can set. So if the selection value is 1, the next two periods should be a 0 if this makes sense. Essentially, if the pump runs for a period it should be off for the next two to cool down. Please see below for a current function that is being used. Currently, no cool-off constraint has been implemented, and wish to get a push in the right direction of how best to implement such a solution. Sample of data which we work with Here is our And here is our I hope my problem has been well defined for anyone to understand what I wish to do at the moment. If anything else is needed, I can happily provide this for anyone. Thanks in advance. |
Find truck name and sume the duration time Posted: 20 Sep 2021 08:33 AM PDT Hi everybody I'm working on a productivity analisis by truck, and I want to get the truck name and sum the duration time. I get this error: Here is my code Thank you in advance |
Compare two table ids and get results where does not exist in one table Posted: 20 Sep 2021 08:32 AM PDT I am trying to compile a list of "None Sellers", I am getting a list of distinct seller_id's and comparing that to the "list of sellers" aka Table Table Expected Result: This snippet is running but not returning any results. |
Get MAX inputted date within sub query Posted: 20 Sep 2021 08:33 AM PDT I have a script which is working but not as desired. My aim is to select the most recently inputted record on the The current issue with the script below is: It is returning the oldest record rather than the newest, for example: it is selecting a record in 2016 rather than one which has a timestamp in 2018. (eventually I need to change the WHERE clause to get all Simple Database Samples.
Current Code Used SummaryUsing the code and example tables above, this code would return these 3 results, whilst we do expect 3 results, the MAX( |
Limit character length of database field name? Posted: 20 Sep 2021 08:33 AM PDT an explanation of my question here in the example, how many lengths of field |
Posted: 20 Sep 2021 08:33 AM PDT Using ArangoDB 2.3.1. It seems my cursors are expiring within a couple minutes. I would like them to last for an hour. I've set up my AQL query object with the TTL parameter as follows: My understanding is that the TTL parameter should tell the server to keep the server for 3600000 milliseconds or 1 hour. But it expires within about 60 seconds. In fact, I've tried changing the TTL to several different numbers and it doesn't seem to do anything. Any ideas? UPDATE: the actual error I receive from arango is "cursor not found" |
Python xml ElementTree from a string source? Posted: 20 Sep 2021 08:33 AM PDT The ElementTree.parse reads from a file, how can I use this if I already have the XML data in a string? Maybe I am missing something here, but there must be a way to use the ElementTree without writing out the string to a file and reading it again. |
You are subscribed to email updates from Recent Questions - Stack Overflow. To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google, 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States |
No comments:
Post a Comment