content
stringlengths
86
88.9k
title
stringlengths
0
150
question
stringlengths
1
35.8k
answers
list
answers_scores
list
non_answers
list
non_answers_scores
list
tags
list
name
stringlengths
30
130
Q: I can access API data until I refresh the page, then it becomes inaccessible When trying to access my api data with this code: const lastActivity = data[data.length - 1]; console.log(lastActivity); const lastActivityTime = lastActivity.time; console.log(lastActivityTime); It works initially, then when I r...
I can access API data until I refresh the page, then it becomes inaccessible
When trying to access my api data with this code: const lastActivity = data[data.length - 1]; console.log(lastActivity); const lastActivityTime = lastActivity.time; console.log(lastActivityTime); It works initially, then when I refresh the page I get this error: Uncaught TypeError: Cannot read properties of u...
[ "It looks like the error is thrown when data is undefined. This can happen if the data hasn't been loaded yet from the API. In this case, you can avoid the error by checking if data is defined before accessing its length property and the last element in the array.\nHere is an example of how you can modify your code...
[ 0 ]
[]
[]
[ "api", "backend", "javascript", "reactjs" ]
stackoverflow_0074680895_api_backend_javascript_reactjs.txt
Q: How to send audio file from front end to django backend through websockets for processing at the backend I have made a website in django that uses websockets to perform certain tasks as follows : From frontend I want to take audio using MediaRecorder as input api through javascript I want to send this audio back ...
How to send audio file from front end to django backend through websockets for processing at the backend
I have made a website in django that uses websockets to perform certain tasks as follows : From frontend I want to take audio using MediaRecorder as input api through javascript I want to send this audio back to the backend for processing and that processed data is again send back through the connection in realtime. ...
[ "It looks like the issue is with the bytes_data that you are receiving in the receive method of your ChatConsumer class. The MediaRecorder.ondataavailable event returns a Blob object containing the recorded audio data, which needs to be converted to a bytes object before it can be written to a file.\nYou can conver...
[ 0 ]
[]
[]
[ "django", "javascript", "stream", "web_mediarecorder", "websocket" ]
stackoverflow_0074680879_django_javascript_stream_web_mediarecorder_websocket.txt
Q: How to make zsh keybind between emacs mode and vi mode? I want to bind a key to toggle emacs mode and vi mode,which I use oh-my-zsh plugins(vi-mode). I tried Is there a way to switch Bash or zsh from Emacs mode to vi mode with a keystroke? I also try to bindkey like bindkey '^[e' 'set -o emacs' bindkey '^[v' 'se...
How to make zsh keybind between emacs mode and vi mode?
I want to bind a key to toggle emacs mode and vi mode,which I use oh-my-zsh plugins(vi-mode). I tried Is there a way to switch Bash or zsh from Emacs mode to vi mode with a keystroke? I also try to bindkey like bindkey '^[e' 'set -o emacs' bindkey '^[v' 'set -o vi' But it's not work for me. Does any way to toggle vi...
[ "bindkey is used for binding keys to ZLE widgets not any random command. So what you have guessed at is not going to work. You could write a custom ZLE widget to switch keymaps:\nselect-emacs() { set -o emacs }\nzle -N select-emacs\nbindkey '^[e' select-emacs\n\nIn practical terms, I wouldn't recommend this. If you...
[ 3, 0 ]
[]
[]
[ "oh_my_zsh", "zsh" ]
stackoverflow_0065606241_oh_my_zsh_zsh.txt
Q: how to fix 'pylint too many statements'? Is there a way to condense the following code to remove the pylint too many statements error. All this code is contained within a single function: - selection = input("Enter 1, 2, 3, 4 or 5 to start: \n") if selection == "1": print("\nYou have selected "+"'...
how to fix 'pylint too many statements'?
Is there a way to condense the following code to remove the pylint too many statements error. All this code is contained within a single function: - selection = input("Enter 1, 2, 3, 4 or 5 to start: \n") if selection == "1": print("\nYou have selected "+"'"+question_data[0][0]+"', let's begin!") ...
[ "One obvious way is to create a function for each selection:\nselection = input(\"Enter 1, 2, 3, 4 or 5 to start: \\n\")\nif selection == \"1\":\n treat_one()\nelif selection == \"2\":\n ...................................................\nelif selection == \"3\":\n ...........................................
[ 0 ]
[]
[]
[ "pylint" ]
stackoverflow_0074679030_pylint.txt
Q: is there a way to grant permissions in redshift so that other users of the group can run dbt models? We have a group of users that have access to our data warehouse dev environment and I am trying to grant this group access to modify and/or locally run the dbt models I have made. I tried using a post-hook to grant...
is there a way to grant permissions in redshift so that other users of the group can run dbt models?
We have a group of users that have access to our data warehouse dev environment and I am trying to grant this group access to modify and/or locally run the dbt models I have made. I tried using a post-hook to grant all users of the schema access to the schema but users of the groups are still getting a permission denie...
[ "You need to probably first check if the dbt user has permissions to grant access to all users of a particular schema. Additionally, you will also need to grant them CREATE along with USAGE on a particular schema\n" ]
[ 0 ]
[]
[]
[ "amazon_redshift", "amazon_web_services", "dbt" ]
stackoverflow_0074658656_amazon_redshift_amazon_web_services_dbt.txt
Q: Convert typo3 internal url to external url I've been looking for the way to convert the typo3 internal urls whose format is t3://page?uid=xx to a human readable url http://mydomain/page-slug. I'd want to do the same thing that the ViewHelper link.typolink does but in the php context (outside of the Extbase context...
Convert typo3 internal url to external url
I've been looking for the way to convert the typo3 internal urls whose format is t3://page?uid=xx to a human readable url http://mydomain/page-slug. I'd want to do the same thing that the ViewHelper link.typolink does but in the php context (outside of the Extbase context, I'm not in a controller). The context is that ...
[ "Actually a content was needed but I had no clue which value to set in it and...\nI found it, in the cObject, there is the method\ntypoLink_URL($conf)\n\nThat takes the same parameter as stdWrap_typolink, calls the typolink method as well but with the $content variable already set which in this case is a pipe |.\nS...
[ 0 ]
[]
[]
[ "external_url", "typo3", "typolink" ]
stackoverflow_0074671129_external_url_typo3_typolink.txt
Q: How to use @next/mdx with NextJS 13 app directory? With the new app directory, all route directories must have a page.js, page.jsx or a page.tsx file to be visible publicly (eg: mywebsite.com/about requires a file app/about/page.js). But when I try with MDX file app/about/page.mdx, and use nextMDX @next/mdx, I got...
How to use @next/mdx with NextJS 13 app directory?
With the new app directory, all route directories must have a page.js, page.jsx or a page.tsx file to be visible publicly (eg: mywebsite.com/about requires a file app/about/page.js). But when I try with MDX file app/about/page.mdx, and use nextMDX @next/mdx, I got a 404 not found. Here is my next.config.mjs configurati...
[ "// To fix this, you have a couple of options:\n\n// Use a page.js, page.jsx, or page.tsx file for your page, and import and render your .mdx file within that page file.\n// Don't use the appDir feature, and instead structure your pages in the traditional way (i.e., pages/about.mdx instead of app/about/page.mdx).\n...
[ 0, 0 ]
[ "To use the @next/mdx package with the new app directory in Next.js, you need to add the .mdx file extension to the pageExtensions array in your next.config.mjs file.\nHere is an example of how you can modify your next.config.mjs file to include the .mdx file extension:\n import nextMDX from \"@next/mdx\";\nimport ...
[ -1, -1, -1 ]
[ "mdxjs", "next.js", "reactjs" ]
stackoverflow_0074493702_mdxjs_next.js_reactjs.txt
Q: How to make my CustomButton stretch and shrink like a ElevatedButton Does someone know why my CustomButton keeps stretching while the ElevatedButton doesn't. It looks like both components are using similar constraints.. Elevated button: 64.0<=w<=Infinity, h=48.0 Custom button: 32.0<=w<=Infinity, h=32.0 Only the ...
How to make my CustomButton stretch and shrink like a ElevatedButton
Does someone know why my CustomButton keeps stretching while the ElevatedButton doesn't. It looks like both components are using similar constraints.. Elevated button: 64.0<=w<=Infinity, h=48.0 Custom button: 32.0<=w<=Infinity, h=32.0 Only the elevated button doesn't stretch when CrossAxisAlignment.stretch is disable...
[ "It is likely that the ElevatedButton widget is using a ConstrainedBox to set the constraints on its child, while your CustomButton widget is not. The ConstrainedBox widget enforces the given constraints on its child, so the child will not be able to exceed those constraints.\nTo fix this, you can wrap your CustomB...
[ 0 ]
[]
[]
[ "flutter" ]
stackoverflow_0074680819_flutter.txt
Q: Reverse words in a given String in Python3.8 using functions We are given a string and we need to reverse words of a given string how do i do that? i tried, but the compiler doesnt work properly. something wrong with the syntax instead A: I don't know what you tried, but that works: s = "this is a string" rev = ...
Reverse words in a given String in Python3.8 using functions
We are given a string and we need to reverse words of a given string how do i do that? i tried, but the compiler doesnt work properly. something wrong with the syntax instead
[ "I don't know what you tried, but that works:\ns = \"this is a string\"\nrev = \" \".join(s.split(\" \")[::-1])\nprint(rev)\n\noutput:\nstring a is this\n\n" ]
[ 0 ]
[]
[]
[ "python" ]
stackoverflow_0074680589_python.txt
Q: SVG Icons causing huge lag (Google Maps) i have a problem with google markers, they lag so much (replacing path with url to svg fixes the problem but rotation isnt working if i use url) is there any way to make it lag less, or make svg icon with url rotate like i have rotated the icon with path icon: { path: "M1...
SVG Icons causing huge lag (Google Maps)
i have a problem with google markers, they lag so much (replacing path with url to svg fixes the problem but rotation isnt working if i use url) is there any way to make it lag less, or make svg icon with url rotate like i have rotated the icon with path icon: { path: "M14 8.947L22 14v2l-8-2.526v5.36l3 1.666V22l-4.5-...
[ "I found a way to fix this,\nso there is a variable with svg, and it works the same as with .svg file but i can edit style, and change its rotation - thats what i wanted to achieve with icon url.\nheres the code:\nlet template = [\n '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" preserveAspe...
[ 0 ]
[]
[]
[ "google_maps", "google_maps_markers", "javascript" ]
stackoverflow_0074677366_google_maps_google_maps_markers_javascript.txt
Q: What does the error "Le.Subject is not a constructor" refer to? I hosted a website using Firebase and Angular Material but when testing the various screens I noticed that one is not working. That screen is a calendar using the Angular Material's schedule component. A: The error "Le.Subject is not a constructor" ...
What does the error "Le.Subject is not a constructor" refer to?
I hosted a website using Firebase and Angular Material but when testing the various screens I noticed that one is not working. That screen is a calendar using the Angular Material's schedule component.
[ "The error \"Le.Subject is not a constructor\" suggests that there is a problem with the way the Angular Material schedule component is being used in your website. This error usually occurs when the code that is trying to create a new instance of the Le.Subject class is not referencing the class correctly, or if th...
[ 0 ]
[]
[]
[ "angular", "angular_material", "firebase", "firebase_hosting" ]
stackoverflow_0074680882_angular_angular_material_firebase_firebase_hosting.txt
Q: Sender address rejected: not owned by user (Laravel) I have faced a problem when i worked on contact us form , i used hostinger This is the action code $request->validate([ 'fullname' => ['required', 'string', 'min:5'], 'email' => ['required', 'email'], 'subject' => ['required'...
Sender address rejected: not owned by user (Laravel)
I have faced a problem when i worked on contact us form , i used hostinger This is the action code $request->validate([ 'fullname' => ['required', 'string', 'min:5'], 'email' => ['required', 'email'], 'subject' => ['required', 'string', 'min:5'], 'message' => ['required'...
[]
[]
[ "Mail::to('support@me.com')->send(new ContactUs($request->fullname, $request->email, $request->subject, $request->message));\n\nThis will send the email to the address specified in the to() method, which is support@me.com.\n" ]
[ -1 ]
[ "contacts", "email", "laravel", "php" ]
stackoverflow_0074680874_contacts_email_laravel_php.txt
Q: swap alternate in an array You have been given an array/list(ARR) of size N. You need to swap every pair of alternate elements in the array/list. You don't need to print or return anything, just change in the input array itself. #include <iostream>; using namespace std; void printArr(int arr[], int n) { for (...
swap alternate in an array
You have been given an array/list(ARR) of size N. You need to swap every pair of alternate elements in the array/list. You don't need to print or return anything, just change in the input array itself. #include <iostream>; using namespace std; void printArr(int arr[], int n) { for (int i = 0; i < n; i++) c...
[ "I'm not sure what are you exactly expecting the output to be (pls edit it and show the expected output) but I think this is what you need to do\n#include <iostream>\n#include <iomanip>\nusing namespace std;\n\nvoid UpdateArray(int Arr[], size_t n) {\n for (size_t i = 0; i < n / 2; i++) {\n int Holder = A...
[ 0 ]
[]
[]
[ "alternate", "arrays", "c++", "swap" ]
stackoverflow_0074675238_alternate_arrays_c++_swap.txt
Q: How to disable Log4j configuration from external Maven dependency? I have Spring Boot application with Log4j2 XML configuration file placed in resources/log4j2.xml. One external library I use is installed via Maven dependency and have own logging configuration in logback.xml.It seems that this file overwrites my L...
How to disable Log4j configuration from external Maven dependency?
I have Spring Boot application with Log4j2 XML configuration file placed in resources/log4j2.xml. One external library I use is installed via Maven dependency and have own logging configuration in logback.xml.It seems that this file overwrites my Log4J2 configuration and logging is now controlled by this config file. I...
[ "In order to disable the external library's Log4J2 configuration, you can specify the -Dlog4j.configurationFile system property when starting your Spring Boot application, pointing it to the location of your own Log4J2 configuration file. For example, if your configuration file is in the resources directory of your...
[ 0, 0 ]
[]
[]
[ "java", "log4j2", "maven", "spring_boot" ]
stackoverflow_0074624355_java_log4j2_maven_spring_boot.txt
Q: How to skip errors in stored procedure of redshift tables I have bunch of sql queries inside the stored procedure. Is there any idea to skip the exception and proceed with next set of queries inside stored procedure? Note: I have gone through documentation of AWS, it says stored procedure ends if there is a except...
How to skip errors in stored procedure of redshift tables
I have bunch of sql queries inside the stored procedure. Is there any idea to skip the exception and proceed with next set of queries inside stored procedure? Note: I have gone through documentation of AWS, it says stored procedure ends if there is a exception. Also there we can also create UDF, let me know how to crea...
[ "you can use a TRY & CATCH block to handle the errors and continue processing the rest of the stored procedure.\nHere is an example of how you can use a TRY...CATCH block to skip errors in a stored procedure:\nBEGIN\n -- Main body of stored procedure\n BEGIN TRY\n -- Statements that may cause errors\n END TRY...
[ 0 ]
[]
[]
[ "amazon_redshift", "sql", "stored_procedures" ]
stackoverflow_0074654194_amazon_redshift_sql_stored_procedures.txt
Q: str_word_count() function doesn't display Arabic language properly I've made the next function to return a specific number of words from a text: function brief_text($text, $num_words = 50) { $words = str_word_count($text, 1); $required_words = array_slice($words, 0, $num_words); return implode(" ", $re...
str_word_count() function doesn't display Arabic language properly
I've made the next function to return a specific number of words from a text: function brief_text($text, $num_words = 50) { $words = str_word_count($text, 1); $required_words = array_slice($words, 0, $num_words); return implode(" ", $required_words); } and it works pretty well with English language but whe...
[ "Try with this function for word count:\n// You can call the function as you like\nif (!function_exists('mb_str_word_count'))\n{\n function mb_str_word_count($string, $format = 0, $charlist = '[]') {\n mb_internal_encoding( 'UTF-8');\n mb_regex_encoding( 'UTF-8');\n\n $words = mb_split('[^\\...
[ 3, 2, 1, 1, 0, 0 ]
[]
[]
[ "function", "php" ]
stackoverflow_0013884178_function_php.txt
Q: PySpark error: java.net.SocketTimeoutException: Accept timed out I am getting error "java.net.SocketTimeoutException: Accept timed out" while running pyspark using python 3.9.6 and spark 3.3.1. Source code: import json from pyspark.sql import SparkSession from pyspark.sql.functions import * from pyspark.sql.type...
PySpark error: java.net.SocketTimeoutException: Accept timed out
I am getting error "java.net.SocketTimeoutException: Accept timed out" while running pyspark using python 3.9.6 and spark 3.3.1. Source code: import json from pyspark.sql import SparkSession from pyspark.sql.functions import * from pyspark.sql.types import StringType with open('config.json') as cfg: json_data =...
[ "The solution is to import \"findspark\"\nimport findspark\nfindspark.init()\n\n" ]
[ 0 ]
[]
[]
[ "apache_spark", "pyspark", "python" ]
stackoverflow_0074679957_apache_spark_pyspark_python.txt
Q: Centering text within an centered element, Css I'm trying to center a card on the page and center the text within that card. Here is the CSS I've attempted below. And It seems to do nothing. I am trying to use JS for the first time with CSS. Confusion about where I'm messing up, so not entirely sure what part to i...
Centering text within an centered element, Css
I'm trying to center a card on the page and center the text within that card. Here is the CSS I've attempted below. And It seems to do nothing. I am trying to use JS for the first time with CSS. Confusion about where I'm messing up, so not entirely sure what part to isolate to share. sample here: https://rrrhhhhhhhhh.g...
[ "Just notice this without js\n\n\n.testclass {\n font: 10px courier,courier new;\n background: #ffffff;\n z-index: 10;\n layer-background-color: #ffffff;\n}\n\n#test {position: absolute;\n top: 10px;\n left:10px;\n padding: 0px;\n}\n\n#rel {position: relative;\n ...
[ 1 ]
[]
[]
[ "css", "html" ]
stackoverflow_0074678130_css_html.txt
Q: Heroku completely messed up my Laravel login (Laravel 9) I am currently trying to host my Laravel 9 project on Heroku. Everything works more or less fine, until it comes to the Login. The first thing which is horrible is the fact that the login style is completely messed up, my login has been fully made with the l...
Heroku completely messed up my Laravel login (Laravel 9)
I am currently trying to host my Laravel 9 project on Heroku. Everything works more or less fine, until it comes to the Login. The first thing which is horrible is the fact that the login style is completely messed up, my login has been fully made with the laravel default login implementation and in local everything wo...
[ "Go to resources/views/layouts/app.blade.php and include bootstrap.css in header of the page:\n<link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.2.3/css/bootstrap.min.css\" />\n\nAnd include bootstrap.js in scripts section:\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/boot...
[ 0 ]
[]
[]
[ "authentication", "heroku", "laravel", "laravel_9" ]
stackoverflow_0074679746_authentication_heroku_laravel_laravel_9.txt
Q: Images aren't showed in tabs in tkinter python I'm trying to show a picture using canvas or directly in the tab, but it doesn't work, it doesn't show an error but picture is not displayed, what am I doing wrong? I need to use a vertical scrollbar and add some widgets, I tried using canvas.create_image and labels b...
Images aren't showed in tabs in tkinter python
I'm trying to show a picture using canvas or directly in the tab, but it doesn't work, it doesn't show an error but picture is not displayed, what am I doing wrong? I need to use a vertical scrollbar and add some widgets, I tried using canvas.create_image and labels but pictures aren't being showed This is my main code...
[]
[]
[ "It looks like you are trying to display an image in a Tkinter canvas widget. However, you are not keeping a reference to the img object that you create, which means that it will be garbage collected and will not be displayed in the canvas.\nTo fix this, you need to keep a reference to the img object. You can do th...
[ -2 ]
[ "canvas", "image", "python", "scrollbar", "tkinter" ]
stackoverflow_0074680916_canvas_image_python_scrollbar_tkinter.txt
Q: React/Next.js site doesn't load properly in Safari (blank page) I know this is very general but I have a bug in my Next.js website, where when I open my site in Safari, it sometimes loads and sometimes doesn't (almost 50/50 chance - shows a blank page, but I can see outlines of some of my components, no text thoug...
React/Next.js site doesn't load properly in Safari (blank page)
I know this is very general but I have a bug in my Next.js website, where when I open my site in Safari, it sometimes loads and sometimes doesn't (almost 50/50 chance - shows a blank page, but I can see outlines of some of my components, no text though). It happens on both iOS/macOS versions of Safari. I read about Cac...
[ "For me it was a simple hard refresh (CTRL + SHIFT + R) to solve this.\n" ]
[ 0 ]
[ "There could be several reasons why a React or Next.js site may not load properly in Safari. Some possible reasons include:\nThe site may be using features that are not supported by Safari, such as certain JavaScript or CSS features.\nThe site may be experiencing technical issues, such as server errors or connectiv...
[ -1 ]
[ "javascript", "next.js", "node.js", "reactjs", "safari" ]
stackoverflow_0063055442_javascript_next.js_node.js_reactjs_safari.txt
Q: How can I create a window in python? Write a program that displays a rectangle whose frame consists of asterisk ' * ' characters, the inner part of ' Q ' characters. The program will ask the user to indicate the number of rows and columns of the rectangle, these values ​​cannot be less than 3. I tried to create va...
How can I create a window in python?
Write a program that displays a rectangle whose frame consists of asterisk ' * ' characters, the inner part of ' Q ' characters. The program will ask the user to indicate the number of rows and columns of the rectangle, these values ​​cannot be less than 3. I tried to create various print() one below the other but I do...
[ "# Ask the user for the number of rows and columns\nnum_rows = int(input(\"Enter the number of rows: \"))\nnum_cols = int(input(\"Enter the number of columns: \"))\n\n# Make sure the values are at least 3\nnum_rows = max(num_rows, 3)\nnum_cols = max(num_cols, 3)\n\n# Print the top row of asterisks\nprint(\"*\" * nu...
[ 1 ]
[]
[]
[ "python" ]
stackoverflow_0074680867_python.txt
Q: Filter timeseries data based on multiple criteria I have a table where I store timeseries data: customer_id transaction_type transaction_date transaction_value 1 buy 2022-12-04 100.0 1 sell 2022-12-04 80.0 2 buy 2022-12-04 120.0 2 sell 2022-12-03 120.0 1 buy 2022-12-02 90.0 1 sell 2022-12-02 70.0 2 buy 202...
Filter timeseries data based on multiple criteria
I have a table where I store timeseries data: customer_id transaction_type transaction_date transaction_value 1 buy 2022-12-04 100.0 1 sell 2022-12-04 80.0 2 buy 2022-12-04 120.0 2 sell 2022-12-03 120.0 1 buy 2022-12-02 90.0 1 sell 2022-12-02 70.0 2 buy 2022-12-01 110.0 2 sell 2022-12-01 110.0 ...
[ "You could use a CTE with row_number and chech out the last transactios\nWITH CTE as (SELECT\n\"customer_id\", \"transaction_type\", \"transaction_date\",\n \"transaction_value\",\nROW_NUMBER() OVER(PARTITION BY \"customer_id\", \"transaction_type\" ORDER BY \"transaction_date\" DESC) rn\nFROM tab1)\nSELECT \"cus...
[ 0, 0 ]
[]
[]
[ "postgresql", "sql" ]
stackoverflow_0074680018_postgresql_sql.txt
Q: NextJS - Haveibeenpwned API Fetch error 401 I'm using a valid key that I paid for, yet I keep getting a 401 when trying to fetch? What am I missing here? const checkCompromised = async (email: string) => { const secret = process.env.NEXT_PUBLIC_HAVEIBEENPWNED_API_KEY; const url = `https://haveibeenpwned.co...
NextJS - Haveibeenpwned API Fetch error 401
I'm using a valid key that I paid for, yet I keep getting a 401 when trying to fetch? What am I missing here? const checkCompromised = async (email: string) => { const secret = process.env.NEXT_PUBLIC_HAVEIBEENPWNED_API_KEY; const url = `https://haveibeenpwned.com/api/v3/breachedaccount/${email}`; const res...
[]
[]
[ "set the hibp-api-key header value to use the actual value of your API key instead of the variable name.\nheaders: {\n \"hibp-api-key\": secret,\n \"User-Agent\": \"test\",\n},\n\n" ]
[ -1 ]
[ "api", "next.js", "typescript" ]
stackoverflow_0074680915_api_next.js_typescript.txt
Q: Netbeans 11.3 and Java 14 Preview Features I am using Java 14 as the default Java platform for Netbeans 11.3 (netbeans_jdkhome is set to my Java 14 JDK) and trying to use a preview feature in a simple Java application. I set the source level to 14 and set --enable-preview as a compiler argument. The code compile...
Netbeans 11.3 and Java 14 Preview Features
I am using Java 14 as the default Java platform for Netbeans 11.3 (netbeans_jdkhome is set to my Java 14 JDK) and trying to use a preview feature in a simple Java application. I set the source level to 14 and set --enable-preview as a compiler argument. The code compiles without errors. However, when I try to run it ...
[ "As well as setting --enable-preview as a compiler option, it should also be set as a VM Option when running the code: \n\nHowever, that doesn't fix the problem, and unfortunately this looks like a NetBeans 11.3 bug. I reproduced your problem with a Java with Ant project, and created Bug Report NETBEANS-4049 Unsupp...
[ 4, 2, 0, 0 ]
[]
[]
[ "java", "java_14", "netbeans" ]
stackoverflow_0060790646_java_java_14_netbeans.txt
Q: blocking access to wp-login.php through cloudflare I'm trying to block access to my wp-login.php through cloudflare WAF. I created a firewall rule with the following content: URI path equals /wp-login.php AND IP source address equals <my_ipv4> Action: block As you can see, I'm testing this rule by blocking my ow...
blocking access to wp-login.php through cloudflare
I'm trying to block access to my wp-login.php through cloudflare WAF. I created a firewall rule with the following content: URI path equals /wp-login.php AND IP source address equals <my_ipv4> Action: block As you can see, I'm testing this rule by blocking my own IP-address. This does not work, I can see wp-login.php...
[ "I think you can start from checking the Security Events, for make sure that you trying to block right IP address.\nAnd second one - need to check your DNS setup. Cloudflare can protect yours endpoint only if you have “Proxied” DNS records: .\n" ]
[ 0 ]
[]
[]
[ "cloudflare" ]
stackoverflow_0074679729_cloudflare.txt
Q: Access packages outside of current package setup.py I am trying to access packages outside of the current package using setup.py. My project structure looks like this. Example1/ |-- submodule1/ | |-- __init__.py | |-- main/ | |-- __init__.py | |-- hello.py | |-- setup.py |-- submodule2/ ...
Access packages outside of current package setup.py
I am trying to access packages outside of the current package using setup.py. My project structure looks like this. Example1/ |-- submodule1/ | |-- __init__.py | |-- main/ | |-- __init__.py | |-- hello.py | |-- setup.py |-- submodule2/ | |-- __init__.py | |-- main/ | |-- __ini...
[ "It looks like the setup.py file you provided is not correct. In the packages parameter of the setup function, you are trying to include the ../../utils directory as a package, but this directory does not exist relative to the setup.py file.\nIn order to include the utils package, you should include it as utils ins...
[ 0, 0 ]
[ "The issue is that the package_dir parameter in your setup.py file is not correctly specifying the path to the utils package. The package_dir parameter should be a dictionary that maps package names to the directories where the packages are located. In your case, you could add the following to your setup.py file to...
[ -1 ]
[ "python", "python_packaging", "setup.py", "setuptools" ]
stackoverflow_0074652871_python_python_packaging_setup.py_setuptools.txt
Q: Bash: iterate over json array and stringyfy the json value I have a json file(test.json) with following structure [ { "key1" : "value-1", "key2" : { "key3" : "value3" } }, { "key1" : "value-2", "key2" : { "key4" : "value4" } } ] I want to covert the file content...
Bash: iterate over json array and stringyfy the json value
I have a json file(test.json) with following structure [ { "key1" : "value-1", "key2" : { "key3" : "value3" } }, { "key1" : "value-2", "key2" : { "key4" : "value4" } } ] I want to covert the file content into following given structure [ { "key1" : "value-1", ...
[ "jq 'map(.key2 |= tostring)'\n\nOutput\n[\n {\n \"key1\": \"value-1\",\n \"key2\": \"{\\\"key3\\\":\\\"value3\\\"}\"\n },\n {\n \"key1\": \"value-2\",\n \"key2\": \"{\\\"key4\\\":\\\"value4\\\"}\"\n }\n]\n\nDemo on jq play\n" ]
[ 2 ]
[]
[]
[ "arrays", "bash", "json" ]
stackoverflow_0074680431_arrays_bash_json.txt
Q: VBA to find and delete all highlighted text in an email I need to use VBA to find and delete all highlighted text in an email body. I was trying to use WordEditor in Outlook VBA to do so. I know the following would work in a Word document because I recorded the macro in Word: .Find.ClearFormatting .Find.Hig...
VBA to find and delete all highlighted text in an email
I need to use VBA to find and delete all highlighted text in an email body. I was trying to use WordEditor in Outlook VBA to do so. I know the following would work in a Word document because I recorded the macro in Word: .Find.ClearFormatting .Find.Highlight = True .Find.Replacement.ClearFormatting With ...
[ "To deal with the Word editor in Outlook you need to use the Inspector.WordEditor property which returns the Microsoft Word Document Object Model of the message. You can use the following ways to get an instance of the Inspector class:\n\nUse the ActiveInspector method to return the object representing the currentl...
[ 0 ]
[]
[]
[ "email", "find", "outlook", "replace", "vba" ]
stackoverflow_0074680713_email_find_outlook_replace_vba.txt
Q: How to run an alter table migration with alembic - taking too long and never ends I'm trying to run a migration with alembic (add a column) but it taking too long - and never ends. The table has 100 rows and i don't see an error. This is my migration code in python """ from alembic import op import sqlalchemy as s...
How to run an alter table migration with alembic - taking too long and never ends
I'm trying to run a migration with alembic (add a column) but it taking too long - and never ends. The table has 100 rows and i don't see an error. This is my migration code in python """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'd6fe1dec4bcd' down_revision = ...
[ "Get the active locks from pg_locks:\nSELECT t.relname, l.locktype, page, virtualtransaction, pid, mode, granted\nFROM pg_locks l, pg_stat_all_tables t \nWHERE l.relation = t.relid \nORDER BY relation asc;\nCopy the pid(ex: 14210) from above result and substitute in the below command.\n\nSELECT pg_terminate_backend...
[ 0 ]
[]
[]
[ "google_cloud_platform", "postgresql", "python" ]
stackoverflow_0074680825_google_cloud_platform_postgresql_python.txt
Q: Prevent immintrin.h from including avx512 headers when compiling without avx512 support I am compiling without AVX512 support, but I have noticed that immintrin.h drags in ton of LOC for AVX512 , e.g. /usr/lib/gcc/x86_64-linux-gnu/11/include/avx512fintrin.h I have tried to check if specifying march option helps,...
Prevent immintrin.h from including avx512 headers when compiling without avx512 support
I am compiling without AVX512 support, but I have noticed that immintrin.h drags in ton of LOC for AVX512 , e.g. /usr/lib/gcc/x86_64-linux-gnu/11/include/avx512fintrin.h I have tried to check if specifying march option helps, but it does not seem to help. cat avx512_include.cpp #include <immintrin.h> int main() {} ...
[ "GCC/clang support __attribute__((target(\"avx512f\"))) for use of AVX-512 stuff in a file compiled without a -march= that implies -mavx512f. So immintrin.h still has to pull in AVX512 definitions.\nBut you'll still get compile errors from GCC and clang if you try to use __m512i v = _mm512_set1_ps(1.0); without en...
[ 1 ]
[]
[]
[ "avx512", "g++", "gcc", "intrinsics" ]
stackoverflow_0074680139_avx512_g++_gcc_intrinsics.txt
Q: how to use type correctly in a function? I am trying to write numerical methods for calculating the integral module NumericalMethods( trapezoidal_method ) where type Func = Double -> Double type Interval = [Double] type N = Integer trapezoidal_method:: Func -> Interval -> N -> Double trapezoidal_method f inte...
how to use type correctly in a function?
I am trying to write numerical methods for calculating the integral module NumericalMethods( trapezoidal_method ) where type Func = Double -> Double type Interval = [Double] type N = Integer trapezoidal_method:: Func -> Interval -> N -> Double trapezoidal_method f interval n = h*((f (head interval) + f $ tail inte...
[ "One issue is your use of $ in f (head interval) + f $ tail interval.\nThe $ operator has the lowest precedence of almost everything, so it will be interpreted as (f (head interval) + f) $ (tail interval). It is trying to figure out what you mean with f (head interval) + f.\nYou probably just want to use parenthese...
[ 2 ]
[]
[]
[ "haskell" ]
stackoverflow_0074680807_haskell.txt
Q: Undefined variable when calling a service I have a service that call two method of and webapi. Here's the implementation: geo.service.ts import { HttpClient, HttpHeaders } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; import { environment } from 'src/en...
Undefined variable when calling a service
I have a service that call two method of and webapi. Here's the implementation: geo.service.ts import { HttpClient, HttpHeaders } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; import { environment } from 'src/environments/environment'; import { CountryRespon...
[ "The problem is simple, you have to synchronize the two async call. When you call the state the country is not ready yet. The simplest think you can do is :\n this.geo_service\n .getCountry()\n .subscribe(\n (data) => {\n this.country = data\n ...
[ 1 ]
[]
[]
[ "angular", "angular12", "typescript" ]
stackoverflow_0074680957_angular_angular12_typescript.txt
Q: Creating as many files as the number of arguments to bash script Two arguments will be entered. One of these arguments will be the name of the file and the other will be the number to be generated. $./Project1.sh ./One.dic 4 -- Created: One-1.dic One-2.dic One-3.dic One-4.dic #!/bin/bash echo "name": $1"; ech...
Creating as many files as the number of arguments to bash script
Two arguments will be entered. One of these arguments will be the name of the file and the other will be the number to be generated. $./Project1.sh ./One.dic 4 -- Created: One-1.dic One-2.dic One-3.dic One-4.dic #!/bin/bash echo "name": $1"; echo "number: $2"; for ((i=1;i<=number;i=i+1)) do touch ??? done
[ "Assumptions:\n\nextension of the name (.dic in this case) is not known in advance\nthe name will always include an extension\nif the name has multiple extensions (eg, .dic.orig) we want to place the number before the last extension (eg, .dic-1.orig)\nwhile OP's expected output shows the (relative) path removed (./...
[ 1, 0, 0 ]
[]
[]
[ "bash", "linux", "linux_kernel", "ubuntu" ]
stackoverflow_0074680750_bash_linux_linux_kernel_ubuntu.txt
Q: External CSS not always displaying For some odd reason all my external CSS does work fine except for this one. It does work if I add it internally to my html page but not if it is linked to the external sheet in the external sheet .title { font-size: 30px; font-family: Bebas Neue, cursive; } but <span c...
External CSS not always displaying
For some odd reason all my external CSS does work fine except for this one. It does work if I add it internally to my html page but not if it is linked to the external sheet in the external sheet .title { font-size: 30px; font-family: Bebas Neue, cursive; } but <span class="title">hello</span> does not work...
[ "Try to add Internal StyleSheet :\n\n\n<span class=\"title\" style=\" font-size: 30px;font-family: Bebas Neue, cursive;\" >Hello </span>\n\n\n\n" ]
[ 0 ]
[]
[]
[ "css" ]
stackoverflow_0074672431_css.txt
Q: How to delete all rows from pandas dataframe1 that do NOT exist in pandas dataframe2 I have two pandas dataframes, data1 and data2. They each have album and artist columns along with other columns that are different attributes. For the sake of what I'm trying to do, I want to delete all of the rows in data2 that D...
How to delete all rows from pandas dataframe1 that do NOT exist in pandas dataframe2
I have two pandas dataframes, data1 and data2. They each have album and artist columns along with other columns that are different attributes. For the sake of what I'm trying to do, I want to delete all of the rows in data2 that DO NOT exist in data1. So, essentially I want all of the album and artists in data2 to matc...
[ "To remove all rows from a dataframe that do not exist in another dataframe, you can use the merge() method from pandas, along with the indicator parameter. The indicator parameter allows you to specify whether you want to keep only the rows that exist in both dataframes (the default behavior), only the rows that e...
[ 0, 0, -1 ]
[]
[]
[ "dataframe", "pandas", "python" ]
stackoverflow_0074680948_dataframe_pandas_python.txt
Q: Function to split a list of strings into group of strings on specific element value I'm trying to create a function for the following: Given a list of strings ["abceadfapaq"; "asdqwedasca"; " "; "asdasqyhgahfgasdsadasda"] and a string separator " " returns another list with sublists splitted on the desired separat...
Function to split a list of strings into group of strings on specific element value
I'm trying to create a function for the following: Given a list of strings ["abceadfapaq"; "asdqwedasca"; " "; "asdasqyhgahfgasdsadasda"] and a string separator " " returns another list with sublists splitted on the desired separator. [["abceadfapaq"; "asdqwedasca"]; ["asdasqyhgahfgasdsadasda"]] I've implemented two fu...
[ "this should work:\nlet splitWhen predicate list =\n let folder state t =\n if predicate t then\n [] :: state\n else\n (t :: state.Head) :: state. Tail\n\n list \n |> List.fold folder [ [] ] \n |> List.map List.rev\n |> List.rev\n\n" ]
[ 0 ]
[]
[]
[ "f#", "list", "split" ]
stackoverflow_0074675697_f#_list_split.txt
Q: React Custom 404 NotFound page isn't working in production I have my 404 NotFound custom page properly working in development version, all other routes are perfectly fine, but after I built a production version I cannot get custom 404 page only a default one. My route for 404 is: <Routes> <Route path={"/*"} elem...
React Custom 404 NotFound page isn't working in production
I have my 404 NotFound custom page properly working in development version, all other routes are perfectly fine, but after I built a production version I cannot get custom 404 page only a default one. My route for 404 is: <Routes> <Route path={"/*"} element={<NotFound />} /> </Routes> I used version only asterisk to...
[ "Try using an Asterisk, like this, it should work:\n<Routes>\n <Route path={\"*\"} element={<NotFound />} />\n</Routes>\n\nor\n<Routes>\n <Route path=\"*\" element={<NotFound />} />\n</Routes>\n\n" ]
[ 0 ]
[]
[]
[ "javascript", "reactjs", "routes" ]
stackoverflow_0074679986_javascript_reactjs_routes.txt
Q: Design Patterns: Factory vs Factory method vs Abstract Factory I was reading design patterns from a website There I read about Factory, Factory method and Abstract factory but they are so confusing, am not clear on the definition. According to definitions Factory - Creates objects without exposing the instantiati...
Design Patterns: Factory vs Factory method vs Abstract Factory
I was reading design patterns from a website There I read about Factory, Factory method and Abstract factory but they are so confusing, am not clear on the definition. According to definitions Factory - Creates objects without exposing the instantiation logic to the client and Refers to the newly created object throug...
[ "All three Factory types do the same thing: They are a \"smart constructor\".\nLet's say you want to be able to create two kinds of Fruit: Apple and Orange.\nFactory\nFactory is \"fixed\", in that you have just one implementation with no subclassing. In this case, you will have a class like this:\nclass FruitFactor...
[ 348, 30, 22, 22, 13, 12, 2, 2, 0 ]
[]
[]
[ "design_patterns", "factory", "factory_method", "java", "language_agnostic" ]
stackoverflow_0013029261_design_patterns_factory_factory_method_java_language_agnostic.txt
Q: pyenv deletes python after installing I tried installing python with pyenv install 3.11.0 (though this happens no matter the version) on my Raspberry Pi. When the install was running, there was a 3.11.0 directory in ~/.pyenv/versions, pyenv versions recognized it, and the installed python is actually usable, but ...
pyenv deletes python after installing
I tried installing python with pyenv install 3.11.0 (though this happens no matter the version) on my Raspberry Pi. When the install was running, there was a 3.11.0 directory in ~/.pyenv/versions, pyenv versions recognized it, and the installed python is actually usable, but the dir disappeared after the installation ...
[ "#It sounds like something went wrong with the installation of Python on your Raspberry Pi. The first thing you should try is running the pyenv install command with the --verbose flag, which will provide you with more detailed output and may help you identify the issue. For example:\n\npyenv install 3.11.0 --verbos...
[ 0 ]
[]
[]
[ "linux", "pyenv", "python", "raspberry_pi" ]
stackoverflow_0074648670_linux_pyenv_python_raspberry_pi.txt
Q: Installing Cartopy error on Windows 10 with VSCode I al trying to install Cartopy on my laptop. I have Windows 10, and use VSCode. When installing Cartopy with pip install cartopyI get the following error: ` lib/cartopy/trace.cpp(767): fatal error C1083: Cannot open include file: 'geos_c.h': No such file or dir...
Installing Cartopy error on Windows 10 with VSCode
I al trying to install Cartopy on my laptop. I have Windows 10, and use VSCode. When installing Cartopy with pip install cartopyI get the following error: ` lib/cartopy/trace.cpp(767): fatal error C1083: Cannot open include file: 'geos_c.h': No such file or directory error: command 'C:\\Program Files (x86)\\Mi...
[]
[]
[ "Yes, you can install Cartopy without Anaconda by using the pip package manager. However, the error you are getting indicates that the geos_c.h header file is missing, which is required for Cartopy to build and work properly.\nIn order to fix this issue, you will need to install the GEOS library, which provides the...
[ -1 ]
[ "cartopy", "cmake", "geos", "python" ]
stackoverflow_0074680953_cartopy_cmake_geos_python.txt
Q: discord.py limiting a command to only be a slash command I am trying to make a command that is only a slash command however my bot uses hybrid commands and normal prefix commands and Im not sure how to make it just a slash command. @client.event async def on_message(message): if message.content.lower() == ";re...
discord.py limiting a command to only be a slash command
I am trying to make a command that is only a slash command however my bot uses hybrid commands and normal prefix commands and Im not sure how to make it just a slash command. @client.event async def on_message(message): if message.content.lower() == ";report" or message.content.lower() == ";suggest": return...
[ "To make a command that can only be used as a slash command, you can use the is_slash_command attribute of the Interaction object in your command function. This attribute will be True if the command was called using the slash command syntax, and False if it was called using a prefix or hybrid command.\nHere is an e...
[ 0 ]
[]
[]
[ "discord", "discord.py", "python" ]
stackoverflow_0074680538_discord_discord.py_python.txt
Q: Unity Photon Doesnt Sync Hey guys I want to make a multiplayer game with unity. But I cannot sync players. I use Photon Transform View and Photon View. I have attached Photon Transform View to Photon View but still it doesnt work. This is my player movement code: using System.Collections; using System.Collections....
Unity Photon Doesnt Sync
Hey guys I want to make a multiplayer game with unity. But I cannot sync players. I use Photon Transform View and Photon View. I have attached Photon Transform View to Photon View but still it doesnt work. This is my player movement code: using System.Collections; using System.Collections.Generic; using UnityEngine.UI;...
[ "If by whatever means it doesn't work, try using OnPhotonSerializeView().\nHere is what you can put\npublic void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)\n {\n if(stream.isWriting)\n stream.SendNext(transform.position);\n }\n else if(stream.isReading)\n ...
[ 0 ]
[]
[]
[ "photon", "unity3d" ]
stackoverflow_0061990965_photon_unity3d.txt
Q: Why isn't my page re-rendering when props change? React newbie beating his head against the wall for two days I'm working on my first React app (a simple blog site) after doing a few tutorials, and I've been struggling with this issue for two days now. Would love some help on this one! My site lists blog posts whi...
Why isn't my page re-rendering when props change? React newbie beating his head against the wall for two days
I'm working on my first React app (a simple blog site) after doing a few tutorials, and I've been struggling with this issue for two days now. Would love some help on this one! My site lists blog posts which it pulls from the database, and I have an edit button next to a list of posts. When I push the button I query th...
[ "You should not write the props.postToEdit on the useState hook, simply execute the function and pass on the post id you would like to edit. You're currently using the state for the function and for manipulating your state, this wont simply work.\n" ]
[ 2 ]
[]
[]
[ "javascript", "reactjs" ]
stackoverflow_0074680935_javascript_reactjs.txt
Q: Load random image react native I try to randomly load a gif from an array. I tried several ways to do it but none works. I either get an error message or the image just won't appear. Version 1 (result: image doesn't appear): var myPix = new Array("../assets/class/emojis/correct/clapping_hands.gif", "../assets/clas...
Load random image react native
I try to randomly load a gif from an array. I tried several ways to do it but none works. I either get an error message or the image just won't appear. Version 1 (result: image doesn't appear): var myPix = new Array("../assets/class/emojis/correct/clapping_hands.gif", "../assets/class/emojis/correct/beaming_face_with_s...
[ "Make sure you have implemented the right environment to display GIF as explained below:\n\nFor RN < 0.60\n\nBy default the Gif images are not supported in android react native app. You need to set use Fresco to display the gif images. The code:\nEdit your android/app/build.gradle file and add the following code:\n...
[ 1, 0 ]
[]
[]
[ "image", "react_native" ]
stackoverflow_0073820588_image_react_native.txt
Q: Getting custom elastic beanstalk logs into cloudwatch group Having issues and been unable to create a custom cloudwatch log group from .ebextentions/logs.config Here are different files I have tried. 1 --- files: /opt/elasticbeanstalk/tasks/bundlelogs.d/celery_logs.conf: content: |- /var/log/celer...
Getting custom elastic beanstalk logs into cloudwatch group
Having issues and been unable to create a custom cloudwatch log group from .ebextentions/logs.config Here are different files I have tried. 1 --- files: /opt/elasticbeanstalk/tasks/bundlelogs.d/celery_logs.conf: content: |- /var/log/celery_beat.stdout.log /var/log/celery_flower.stdout.log ...
[ "#It looks like you're trying to use AWS Elastic Beanstalk to create a custom CloudWatch log group. To do this, you'll need to use an Elastic Beanstalk configuration file called logs.config to specify the settings for your log group.\n\n#Here is an example logs.config file that you can use as a starting point:\n\nf...
[ 0 ]
[]
[]
[ "amazon_cloudwatch", "amazon_elastic_beanstalk", "celery", "logging" ]
stackoverflow_0073464085_amazon_cloudwatch_amazon_elastic_beanstalk_celery_logging.txt
Q: Cannot use variable in while clause that is declared inside the do/while loop Why am I not allowed to use a variable I declared inside do and use it inside the while part of a do/while loop? do { index += index; int composite = index + 1; // more code here } while (UnsetBitmask(bitmasks, composite)); // c...
Cannot use variable in while clause that is declared inside the do/while loop
Why am I not allowed to use a variable I declared inside do and use it inside the while part of a do/while loop? do { index += index; int composite = index + 1; // more code here } while (UnsetBitmask(bitmasks, composite)); // cannot resolve symbol composite First time I saw this I thought it was a compiler b...
[ "Your variable is used outside the do/while (in C# the curlies typically define the scope) and since it is declared inside the do-while, you cannot use it outside that scope. \nYou can fix this by simply declaring it outside the loop.\nint composite = 0; // you are not required to set it to zero, as long \n ...
[ 16, 7, 2, 2, 2, 2, 1, 0, 0 ]
[]
[]
[ "c#", "do_while" ]
stackoverflow_0032334338_c#_do_while.txt
Q: Exception has occurred: ValueError Data cardinality is ambiguous: Trying to build an RNN model for the first time. For some reason I am getting a cardinality error and I am not sure why. Each column is labeled, has a respective date, and has a value in the value field. Excluding the header I have 142 values in eac...
Exception has occurred: ValueError Data cardinality is ambiguous:
Trying to build an RNN model for the first time. For some reason I am getting a cardinality error and I am not sure why. Each column is labeled, has a respective date, and has a value in the value field. Excluding the header I have 142 values in each column. ERROR Exception has occurred: ValueError Data cardinality is ...
[ "The error message is telling you that the sizes of the x and y arrays are different. You are trying to create a dataset with 142 samples, but you are only providing 141 values for the y array.\nHere is the code that is causing the error:\nX_train= training_set[0:142]\ny_train= training_set[1:142]\n\nThe training_s...
[ 0 ]
[]
[]
[ "ml", "python", "recurrent_neural_network" ]
stackoverflow_0074681011_ml_python_recurrent_neural_network.txt
Q: How to let the program detect the previous form where a new form was accessed so that the input from the new form is transferred to that previous form I have multiple forms (e.g. Form1, Form2) that both contains a button that opens another form (Form3). In Form3 (pop-up form), the user is prompted to pick among th...
How to let the program detect the previous form where a new form was accessed so that the input from the new form is transferred to that previous form
I have multiple forms (e.g. Form1, Form2) that both contains a button that opens another form (Form3). In Form3 (pop-up form), the user is prompted to pick among the options, and once these were submitted through a button in Form3, the selected options will be transferred to the previous form where it was opened (eithe...
[ "You're thinking about it backwards. Instead of \"pushing\" from Form3 back to Form1 or Form2, you should \"pull\" from Form3 directly from within the code in either Form1 or Form2. You can do this by showing Form3 with ShowDialog(), which will cause execution in the current form (Form1 or Form2j) to STOP until For...
[ 0, 0 ]
[]
[]
[ "active_form", "button", "c#", "forms", "visible" ]
stackoverflow_0074679008_active_form_button_c#_forms_visible.txt
Q: How can I see the execution time in JanusGraph by Gremlin in Ubuntu 20.04? In JanusGraph, when any query is executed by Gremlin, how do you know the time it takes to execute the query? A: Gremlin has a profile step that will show you the time taken by each part or your query. For example you might do: g.V().has(...
How can I see the execution time in JanusGraph by Gremlin in Ubuntu 20.04?
In JanusGraph, when any query is executed by Gremlin, how do you know the time it takes to execute the query?
[ "Gremlin has a profile step that will show you the time taken by each part or your query. For example you might do:\ng.V().has('team-name','Arsenal').profile()\n\n" ]
[ 0 ]
[]
[]
[ "graphdb", "gremlin", "janusgraph", "tinkerpop" ]
stackoverflow_0074665310_graphdb_gremlin_janusgraph_tinkerpop.txt
Q: Docker app requests blocked by CORS to another container I've got two containers, one for a frontend app (build with Sveltekit) and the another for a backend app (Laravel, Nginx, MySQL). I'm trying to access my backend app from my frontend, but I'm getting the following error: Access to XMLHttpRequest at 'http://1...
Docker app requests blocked by CORS to another container
I've got two containers, one for a frontend app (build with Sveltekit) and the another for a backend app (Laravel, Nginx, MySQL). I'm trying to access my backend app from my frontend, but I'm getting the following error: Access to XMLHttpRequest at 'http://127.0.0.1:8000/api/auth/login' from origin 'http://localhost:8...
[ "It looks like the issue is with the Access-Control-Allow-Origin header in your backend app's response. This header specifies which domains are allowed to make requests to your API. The error message states that the header contains multiple values (*, *), but only one value is allowed.\nTo fix this issue, you will ...
[ 0 ]
[]
[]
[ "cors", "docker", "docker_compose", "laravel", "nginx" ]
stackoverflow_0074680388_cors_docker_docker_compose_laravel_nginx.txt
Q: whats wrong with my code, im using photon pun 2 in unity so im trying to make a vr game in unity and im following a tutorial for how to make a multiplayer game and imported the photon pun 2 and copied this code but when i try to build or start the ggame i get there errors using System.Collections; using System.Col...
whats wrong with my code, im using photon pun 2 in unity
so im trying to make a vr game in unity and im following a tutorial for how to make a multiplayer game and imported the photon pun 2 and copied this code but when i try to build or start the ggame i get there errors using System.Collections; using System.Collections.Generic; using UnityEngine; using Photon.Pun; using P...
[ "Very simple: replace MonoBehaviourPunCallBacks with MonoBehaviourPunCallbacks and those errors should go away.\n", "You uppercased b in backs in MonoBehaviourPunCallbacks. It must be lowercase\n" ]
[ 0, 0 ]
[]
[]
[ "photon", "unity3d", "visual_studio" ]
stackoverflow_0072884061_photon_unity3d_visual_studio.txt
Q: Getting unexpected behavior with multiple OR conditions Here is my code: df.where((F.col("A") != F.col("B")) | \ (F.col("A").isNotNull()) | \ (F.col("C") == F.col("D"))).show() When I do this, I do see instances that contradict some of the conditions above. Now, when I structure the code like th...
Getting unexpected behavior with multiple OR conditions
Here is my code: df.where((F.col("A") != F.col("B")) | \ (F.col("A").isNotNull()) | \ (F.col("C") == F.col("D"))).show() When I do this, I do see instances that contradict some of the conditions above. Now, when I structure the code like this, it runs successfully: df.where((F.col("A") != F.col("B"))...
[ "The first snipper uses the | to combine the three conditions.However, the | checks if any of the conditions evaluate to true rather than all of them.\nHowever, chaining using where clause is equivalent to combining the conditions using and.\nHence, the snippets in the code are not equivalent and produce different ...
[ 1 ]
[]
[]
[ "pyspark" ]
stackoverflow_0074679091_pyspark.txt
Q: Azure Function to communicate to external service via VPN I would like my azure function to be able to access a postgres db hosted on fly.io, however, to connect to the fly.io organisation I need to do it via a VPN/wireguard-tunnel as its hosted on a private network. Is this possible with an azure function, can I ...
Azure Function to communicate to external service via VPN
I would like my azure function to be able to access a postgres db hosted on fly.io, however, to connect to the fly.io organisation I need to do it via a VPN/wireguard-tunnel as its hosted on a private network. Is this possible with an azure function, can I have an azure function connect to an external service via a VPN...
[ "Azure Functions supports accessing resources in a VNET through Virtual Network Integration.\nWith this and setting up a VPN Gateway on the VNET to where your DB is connected, would allow the Azure Function to access it.\n" ]
[ 0 ]
[]
[]
[ "azure_functions", "fly", "postgresql", "wireguard" ]
stackoverflow_0074329679_azure_functions_fly_postgresql_wireguard.txt
Q: How to prevent error "WARNING: Unable to acquire token for tenant 'tenantid'" when running Powershell scripts in Azure I'm creating a Service principal to be used as an Azure Runas Account for Azure Automation, using a Powershell script. The script works, however I get the following warning when it's completed WA...
How to prevent error "WARNING: Unable to acquire token for tenant 'tenantid'" when running Powershell scripts in Azure
I'm creating a Service principal to be used as an Azure Runas Account for Azure Automation, using a Powershell script. The script works, however I get the following warning when it's completed WARNING: Unable to acquire token for tenant 'tenantID'. The tenantID from the warning message is another tenant that my acco...
[ "Login\nConnect-AzAccount\n\nCheck your current available subscriptions\nGet-AzContext -ListAvailable\n\nSelect the subscription you want to work on\nSelect-AzContext -Name ''\n\n", "I posted the answer already. The Get-AzSubscription command is the issue, it tries to access all the subscriptions you have access...
[ 5, 4, 4, 1, 0 ]
[ "One of the ways to get rid of this issue is to use Azure CLI.\n" ]
[ -5 ]
[ "azure_powershell" ]
stackoverflow_0058762844_azure_powershell.txt
Q: How to use U2F with NextJS I am trying to implement U2F in my NextJS project. Currently I am using NextJS 13 (beta). I already have the server side code working with the u2f library but how do I implement it on the client side? const U2F = require("u2f"); const Express = require("express"); const BodyParser = requ...
How to use U2F with NextJS
I am trying to implement U2F in my NextJS project. Currently I am using NextJS 13 (beta). I already have the server side code working with the u2f library but how do I implement it on the client side? const U2F = require("u2f"); const Express = require("express"); const BodyParser = require("body-parser"); const Cors =...
[ "// To implement U2F on the client side, you'll need to use a U2F-compatible browser and include a U2F JavaScript library on your page. The library will handle the communication with the U2F device and allow you to register and authenticate users using their hardware keys.\n\n// Here's an example of how you could i...
[ 0 ]
[]
[]
[ "authentication", "fido_u2f", "next.js", "node.js", "webauthn" ]
stackoverflow_0074646638_authentication_fido_u2f_next.js_node.js_webauthn.txt
Q: Unity 3D: Error CS0116: A namespace cannot directly contain members such as fields or methods I was coding AI for enemies in a game I’m making in Unity, but then Unity gave me this error. It says the error is on line 21, but I can't find it. Any help is appreciated! using System.Collections; using System.Collectio...
Unity 3D: Error CS0116: A namespace cannot directly contain members such as fields or methods
I was coding AI for enemies in a game I’m making in Unity, but then Unity gave me this error. It says the error is on line 21, but I can't find it. Any help is appreciated! using System.Collections; using System.Collections.Generic; using UnityEngine; public class EnemyController : MonoBehaviour { public float loo...
[ "You have a closing bracket after the empty Update() function that doesn't belong there, it should be below OnDrawGizmosSelected() so that it encloses the EnemyController class as follows:\npublic class EnemyController : MonoBehaviour\n{\n public float lookRadius = 10f;\n\n // Start is called before the first...
[ 0 ]
[]
[]
[ "c#", "unity3d" ]
stackoverflow_0074680991_c#_unity3d.txt
Q: Process a large file using Apache Airflow Task Groups I need to process a zip file(that contains a text file) using task groups in airflow. No. of lines can vary from 1 to 50 Million. I want to read the text file in the zip file process each line and write the processed line to another text file, zip it, update Po...
Process a large file using Apache Airflow Task Groups
I need to process a zip file(that contains a text file) using task groups in airflow. No. of lines can vary from 1 to 50 Million. I want to read the text file in the zip file process each line and write the processed line to another text file, zip it, update Postgres tables and call another DAG to transmit this new zip...
[ "Apache Spark, Apache Hadoop, and Apache Flink are distributed computing frameworks that can be used to process large datasets in parallel. They can be used to read the text file in the zip file, process each line in parallel, and write the processed line to another text file. After that, you can zip the file, upda...
[ 0, 0, 0 ]
[ "Here is a possible solution to your problem:\nFirst, you can define a function that calculates the start and end offsets for a given task and the total number of lines in the input file. For example:\ndef calculate_offsets(task_id, num_tasks, num_lines):\n chunk_size = num_lines // num_tasks\n start_offset =...
[ -1 ]
[ "airflow", "airflow_2.x", "python", "python_3.x" ]
stackoverflow_0074559428_airflow_airflow_2.x_python_python_3.x.txt
Q: How can I add an element to my dimensional array I have a dimensional array, and I would like to add an element in my lessons array this is my array $array = [ 'id' => 1, 'lessons' => [ [ 'name' => 'PHP', ], [ 'name' => 'Python', ] ] ]; I would like to add ...
How can I add an element to my dimensional array
I have a dimensional array, and I would like to add an element in my lessons array this is my array $array = [ 'id' => 1, 'lessons' => [ [ 'name' => 'PHP', ], [ 'name' => 'Python', ] ] ]; I would like to add flag element to my lessons, Desired output: $array = [...
[ "Try this:\n$array['lessons'] = array_map(function($lesson) {\n $lesson['flag'] = true;\n return $lesson;\n}, $array['lessons']);\n\nprint_r($array);\n\n", "foreach( $array['lessons'] as $lesson )\n{\n $lesson['flag'] = true;\n}\n\n" ]
[ 1, 0 ]
[]
[]
[ "php" ]
stackoverflow_0074680808_php.txt
Q: Change the JSON serialization settings of a single ASP.NET Core controller I'm having two controller controllers: ControllerA and ControllerB. The base class of each controller is Controller. The ControllerA needs to return JSON in the default format (camelCase). The ControllerB needs to return data in a different...
Change the JSON serialization settings of a single ASP.NET Core controller
I'm having two controller controllers: ControllerA and ControllerB. The base class of each controller is Controller. The ControllerA needs to return JSON in the default format (camelCase). The ControllerB needs to return data in a different JSON format: snake_case. How can I implement this in ASP.NET Core 3.x and 2.1?...
[ "ASP.NET Core 3.0+\nYou can achieve this with a combination of an Action Filter and an Output Formatter.\nThings look a little different for 3.0+, where the default JSON-formatters for 3.0+ are based on System.Text.Json. At the time of writing, these don't have built-in support for a snake-case naming strategy.\nHo...
[ 44, 3, 3, 0 ]
[]
[]
[ ".net_core", "asp.net_core", "asp.net_core_mvc", "c#", "json.net" ]
stackoverflow_0052605946_.net_core_asp.net_core_asp.net_core_mvc_c#_json.net.txt
Q: Alphabetize and word frequency from a file using strtok in C My goal is to analyze a text file, tokenize each word, then alphabetize each word with its word frequency. Example: Input: The house is on the ground on earth. Output: earth - 1 ground - 1 house - 1 is - 1 on - 2 the - 2 I have been able to open the ...
Alphabetize and word frequency from a file using strtok in C
My goal is to analyze a text file, tokenize each word, then alphabetize each word with its word frequency. Example: Input: The house is on the ground on earth. Output: earth - 1 ground - 1 house - 1 is - 1 on - 2 the - 2 I have been able to open the file, read the file line by line, tokenize each word, converted th...
[ "At the request of the OP, here is a bit of code to bulk load an entire text file for processing:\nFILE *mustOpen( char *fname, char *mode ) {\n FILE *fp = fopen( fname, mode );\n if( fp == NULL ) {\n fprintf( stderr, \"Cannot open '%s'\\n\", fname );\n exit( EXIT_FAILURE );\n }\n return f...
[ 0 ]
[]
[]
[ "c", "file", "frequency", "project", "strtok" ]
stackoverflow_0074672550_c_file_frequency_project_strtok.txt
Q: How to properly render form fields with django? I am currently working on a login page for a django webapp. I am trying to include the login form within the index.html file. However, the form fields are not being rendered. My urls are correct I believe but I'm not sure where I am going wrong. Here is my views.py, ...
How to properly render form fields with django?
I am currently working on a login page for a django webapp. I am trying to include the login form within the index.html file. However, the form fields are not being rendered. My urls are correct I believe but I'm not sure where I am going wrong. Here is my views.py, forms.py and a snippet of the index.html. (I do not w...
[ "In your index() view, you are creating a LoginForm object, but you are not passing it to the template when you render it. This means that the form fields will not be rendered in the template.\nTo fix this, you can pass the form object to the template when you render it, like this:\ndef index(request):\n form = ...
[ 0 ]
[]
[]
[ "django", "html", "python" ]
stackoverflow_0074681034_django_html_python.txt
Q: Reflection to avoid class load I was reading through the PerfMark code and saw a comment about avoid an accidental class load through using reflection in a commit: if (Boolean.getBoolean("io.perfmark.PerfMark.debug")) { - Logger.getLogger(PerfMark.class.getName()).log(Level.FINE, "Error during PerfMark.<c...
Reflection to avoid class load
I was reading through the PerfMark code and saw a comment about avoid an accidental class load through using reflection in a commit: if (Boolean.getBoolean("io.perfmark.PerfMark.debug")) { - Logger.getLogger(PerfMark.class.getName()).log(Level.FINE, "Error during PerfMark.<clinit>", err); + // We need...
[ "I think the important point of that commit is to load the classes from java.util.logging only when it is really required (when the system property \"io.perfmark.PerfMark.debug\" is \"true\" and err is not null, i.e. when the class io.perfmark.impl.SecretPerfMarkImpl$PerfMarkImpl is not available or that class has ...
[ 1 ]
[]
[]
[ "classloader", "dynamic_class_creation", "java", "reflection" ]
stackoverflow_0074680847_classloader_dynamic_class_creation_java_reflection.txt
Q: How do I iterate through an array of structs? I have this hashmap I want to implement. typedef void * Data; typedef struct { Data data; //Data pointer to the data char * key; //char pointer to the string key } HashMapItem; typedef struct hashmap { HashMapItem * items;...
How do I iterate through an array of structs?
I have this hashmap I want to implement. typedef void * Data; typedef struct { Data data; //Data pointer to the data char * key; //char pointer to the string key } HashMapItem; typedef struct hashmap { HashMapItem * items; //items of the hashmaps size_t size; ...
[ "typedef void * Data;\n\nNever hide pointers behind typedefs. It is a very, very bad practice.\nHow to iterate.\ntypedef struct {\n void *data; //Data pointer to the data\n char * key; //char pointer to the string key\n} HashMapItem;\n\ntypedef struct hashmap {\n HashMapIte...
[ 1 ]
[]
[]
[ "c", "pointers" ]
stackoverflow_0074681000_c_pointers.txt
Q: Incremental query in DBT based on current month with Jinja I am trying to implement a incremental query in DBT using Jinja. Considering there are tables getting created every month in warehouse with year and month suffix and I need to write a logic to union the new table which gets created every month to execute t...
Incremental query in DBT based on current month with Jinja
I am trying to implement a incremental query in DBT using Jinja. Considering there are tables getting created every month in warehouse with year and month suffix and I need to write a logic to union the new table which gets created every month to execute the DBT model. Below is the code which I have started with #initi...
[ "If you want to stop the loop when you reach the current month, you can simply add a conditional check to the loop to check if the month is equal to the current month, and if so, break out of the loop. Here is an example of how you might do this:\n#initialize the months in a list\n{% set months= ['03','04','05','06...
[ 0, 0 ]
[]
[]
[ "dbt", "jinja2" ]
stackoverflow_0074677489_dbt_jinja2.txt
Q: Memory issue while running ARIMA model I am trying to run my ARIMA model and am getting the below error:- MemoryError: Unable to allocate 52.4 GiB for an array with shape (83873, 83873) and data type float64 My python/anaconda is installed in the C drive and has somewhere around 110GB free space but still am get...
Memory issue while running ARIMA model
I am trying to run my ARIMA model and am getting the below error:- MemoryError: Unable to allocate 52.4 GiB for an array with shape (83873, 83873) and data type float64 My python/anaconda is installed in the C drive and has somewhere around 110GB free space but still am getting this error. How do I resolve this? Also...
[ "I did a pivot transformation and it solved my issue.\n" ]
[ 0 ]
[ "I have the same problem than you had and I cannot see the solution... Could you help me please? I'd be so greatful thanks :)\n" ]
[ -3 ]
[ "arima", "memory", "python", "time_series" ]
stackoverflow_0070726861_arima_memory_python_time_series.txt
Q: Why does `Tags.findOne();` return a TypeError? The /tag [tag name] command is supposed to send the tag description or a message if the tag doesn't exist. Currently I have no items in the model. When I run the command with any arguments I get TypeError: Cannot read properties of undefined (reading 'findOne'). Here ...
Why does `Tags.findOne();` return a TypeError?
The /tag [tag name] command is supposed to send the tag description or a message if the tag doesn't exist. Currently I have no items in the model. When I run the command with any arguments I get TypeError: Cannot read properties of undefined (reading 'findOne'). Here is my code: commands/tag.js: const { Tags } = requi...
[ "I can see that you are using Sequelize to interact with your SQLite database. In order to use the findOne method, you need to use the db object you created in db-init.js to access your Tags model and then call the findOne method on that object.\nHere's how you can fix your tag.js file:\nconst { db } = require('../...
[ 0 ]
[]
[]
[ "discord.js", "javascript", "node.js", "sequelize.js", "typeerror" ]
stackoverflow_0074681008_discord.js_javascript_node.js_sequelize.js_typeerror.txt
Q: Example query from my textbook is coming up with an Error message. "Ambiguous column name 'V_CODE'" For my homework, I have to enter example queries from the book to sql. There are also example database I downloaded for the homework and properly put them into SQL. The following is what I have to put in but an erro...
Example query from my textbook is coming up with an Error message. "Ambiguous column name 'V_CODE'"
For my homework, I have to enter example queries from the book to sql. There are also example database I downloaded for the homework and properly put them into SQL. The following is what I have to put in but an error message comes up. SELECT V_CODE, V_NAME, V_STATE, P_CODE, P_DESCRIPT, P_PRICE * P_QOH AS TOTAL FROM PRO...
[ "You need to choose which table you are choosing V_CODE from. In this example it's taken from the PRODUCT table.\nSELECT P.V_CODE, V_NAME, V_STATE, P_CODE, P_DESCRIPT, P_PRICE * P_QOH AS TOTAL\nFROM PRODUCT P JOIN VENDOR V ON P.V_CODE = V.V_CODE\nWHERE V_STATE IN ('TN','KY')\nORDER BY V_STATE, TOTAL DESC;\n--Total ...
[ 0 ]
[]
[]
[ "ambiguous", "sql", "sql_server" ]
stackoverflow_0074681024_ambiguous_sql_sql_server.txt
Q: Kinesis Firehose with S3 in the same account and Redshift in another account I'm finding out the different ways of ingest a Redshift from a Kinesis delivery firehose. I saw that it requires Firehose + intermediary S3 + Redshift, and I saw that it is possible to use a S3 of another account with a Redshift in the sa...
Kinesis Firehose with S3 in the same account and Redshift in another account
I'm finding out the different ways of ingest a Redshift from a Kinesis delivery firehose. I saw that it requires Firehose + intermediary S3 + Redshift, and I saw that it is possible to use a S3 of another account with a Redshift in the same account of S3. My question is: Is it possible to have the S3 bucket and firehos...
[ "Yes, this should be possible as long as you can create an IAM role / policy that provides read access to the accounts in Firehose and S3 that are separate. Redshift must have the \"AmazonS3ReadOnlyAccess\" and \"AmazonKinesisFirehoseFullAccess\" permissions enabled.\n" ]
[ 0 ]
[]
[]
[ "amazon_kinesis", "amazon_redshift", "amazon_s3", "firehose" ]
stackoverflow_0074497105_amazon_kinesis_amazon_redshift_amazon_s3_firehose.txt
Q: INVALID_NONCE authenticating on Crypto.com C# REST API I am working on private endpoints of Crypto.com, and I am receiving the following problem { "id":60, "method":"private/get-currency-networks", "code":10007, "message":"INVALID_NONCE" } when sending the message "{\"id\":60, \"method\":\"private/get...
INVALID_NONCE authenticating on Crypto.com C# REST API
I am working on private endpoints of Crypto.com, and I am receiving the following problem { "id":60, "method":"private/get-currency-networks", "code":10007, "message":"INVALID_NONCE" } when sending the message "{\"id\":60, \"method\":\"private/get-currency-networks\", \"nonce\":1667591280642, \"params\":{}...
[ "for me it helped substracting 10 sec from the current-time when setting the nonce, like:\n.setNonce(LocalDateTime.now().minusSeconds(10).atZone(ZoneId.systemDefault()).toInstant().toEpochMilli())\n\nsee:\nhttps://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#invalid_nonce-on-all-requests\n" ]
[ 0 ]
[]
[]
[ "authentication", "bad_request", "rest" ]
stackoverflow_0074322364_authentication_bad_request_rest.txt
Q: How to create a matrix with four 1's in each row staggered How can I easily create this matrix using clever commands: 1 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 1 A: unname(model.matrix(~gl(3,4) + 0)) [,1] [,2] [,3] [1,] 1 0 0 [2,] 1 0 0 [3,] 1 0 ...
How to create a matrix with four 1's in each row staggered
How can I easily create this matrix using clever commands: 1 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 1
[ "unname(model.matrix(~gl(3,4) + 0))\n\n [,1] [,2] [,3]\n [1,] 1 0 0\n [2,] 1 0 0\n [3,] 1 0 0\n [4,] 1 0 0\n [5,] 0 1 0\n [6,] 0 1 0\n [7,] 0 1 0\n [8,] 0 1 0\n [9,] 0 0 1\n[10,] 0 0 1\n[11,] 0 0 1\n[12,] 0 ...
[ 4, 3, 2, 1 ]
[]
[]
[ "matrix", "r" ]
stackoverflow_0074680911_matrix_r.txt
Q: How do show my tests passing/failing in Github? I have a project on github that has extensive unit tests (using mocha for node.js). I'd like to show off by showing those tests passing/failing on each page. I notice other projects on Github are doing this. I've been unable to find any documentation on how to make...
How do show my tests passing/failing in Github?
I have a project on github that has extensive unit tests (using mocha for node.js). I'd like to show off by showing those tests passing/failing on each page. I notice other projects on Github are doing this. I've been unable to find any documentation on how to make the test status display. How can I make Github sho...
[ "Take a look at Travis CI. You can use it with GitHub.\nThey have docs on using NodeJS\nThose badges you see are called \"status images\" and Travis provides MarkDown that you can insert into your project's README.md file.\n", "Note that since April 26th 2013, you can see the build status on your GitHub repo bran...
[ 55, 13, 7, 2, 0 ]
[]
[]
[ "continuous_integration", "github", "unit_testing" ]
stackoverflow_0013546097_continuous_integration_github_unit_testing.txt
Q: problem with backface culling on OpenGL python My goal is to render a .pmx 3D model using PyOpenGL on pygame. I've found pymeshio module that extracts vertices and normal vectors and etc. found an example code on it's github repo that renders on tkinter. I changed the code to render on pygame instead, didn't chang...
problem with backface culling on OpenGL python
My goal is to render a .pmx 3D model using PyOpenGL on pygame. I've found pymeshio module that extracts vertices and normal vectors and etc. found an example code on it's github repo that renders on tkinter. I changed the code to render on pygame instead, didn't change parts related to OpenGL rendering. The output is t...
[ "The colorful images on the top seem to be rendered without depth test. You have to enable the Depth Test and clear the depth buffer:\nglEnable(GL_DEPTH_TEST)\n\nglClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)\n\n" ]
[ 1 ]
[]
[]
[ "3d", "opengl", "pyopengl", "python" ]
stackoverflow_0074680930_3d_opengl_pyopengl_python.txt
Q: Netbeans profiler OpenJDK 64-Bit Server VM (Zulu 8.58.0.13-CA-macos-aarch64) I am trying to use Netbeans 12.5 profiler on OpenJDK 64-Bit Server VM (Zulu 8.58.0.13-CA-macos-aarch64) The first calibration process always fail. Deleting ~/.nbprofiler doesn't fix the problem. I am getting the error: Profiler calibratio...
Netbeans profiler OpenJDK 64-Bit Server VM (Zulu 8.58.0.13-CA-macos-aarch64)
I am trying to use Netbeans 12.5 profiler on OpenJDK 64-Bit Server VM (Zulu 8.58.0.13-CA-macos-aarch64) The first calibration process always fail. Deleting ~/.nbprofiler doesn't fix the problem. I am getting the error: Profiler calibration data file does not exists: /Users/myhome/.nbprofiler/machinedata.jdk18 and Netbe...
[ "The error message indicates that the profiler cannot connect to the target JVM (Java Virtual Machine) during the calibration process. This could be due to several reasons, including a conflict with the version of the Java runtime you are using or a problem with the profiler's configuration.\nOne possible solution ...
[ 0 ]
[]
[]
[ "java", "macos", "netbeans" ]
stackoverflow_0070821648_java_macos_netbeans.txt
Q: How to disable QWebEngineView logging with webEngineContextLog? I'm using a QWebEngineView in my application. After upgrading to PyQt6 it has started to output the logging information shown below. How can I disable these messages? I have found the code that is emitting them here: logContext It looks like I have to...
How to disable QWebEngineView logging with webEngineContextLog?
I'm using a QWebEngineView in my application. After upgrading to PyQt6 it has started to output the logging information shown below. How can I disable these messages? I have found the code that is emitting them here: logContext It looks like I have to change the output of webEngineContextLog.isInfoEnabled() to False, b...
[ "I stumbled over the same problem today when I tried to integrate a silent unit test into my current project.\nAfter a quick investigation and having a look at how it is logged here in the function logContext, I came up with the following solution which works fine for me:\nfrom PySide6.QtCore import QUrl, QLoggingC...
[ 0 ]
[]
[]
[ "pyqt6", "python", "qwebengineview" ]
stackoverflow_0074499940_pyqt6_python_qwebengineview.txt
Q: Error: ! Can't combine `..1$exists` and `..350$exists` I wrote a code in which loop through a folder with different files which are 2500. The names of the variable found in the list called flight_info_1 are path and data. When I want to unnest it, I god following error. Can give me someone a hint? With kind rega...
Error: ! Can't combine `..1$exists` and `..350$exists`
I wrote a code in which loop through a folder with different files which are 2500. The names of the variable found in the list called flight_info_1 are path and data. When I want to unnest it, I god following error. Can give me someone a hint? With kind regards library(prettydoc) library(tidyverse) library(fs) librar...
[ "The solution was\n data_i_mod <- bind_cols(\n moved_vars, select(data_i, -any_of(colnames(moved_vars)))\n )\n \n data_i_mod <- data_i_mod %>% mutate(across(where(is.double), as.character))\n \n return(data_i_mod)\n\n" ]
[ 0 ]
[]
[]
[ "data_wrangling", "r" ]
stackoverflow_0074680675_data_wrangling_r.txt
Q: Unity Take Render Each List Element Separately I want to get renders of multiple items and set them to a list in order to their itemId. For that, first program instantiate the object, get render and destroy it. In each render I am using the clone of the previous render because of the optimization issues. But there...
Unity Take Render Each List Element Separately
I want to get renders of multiple items and set them to a list in order to their itemId. For that, first program instantiate the object, get render and destroy it. In each render I am using the clone of the previous render because of the optimization issues. But there is some problem about ordering and set the correct ...
[ "You could sort the render pool list by item ID before assigning the render texture to the item. This can be done using the List<T>.Sort method, which takes a comparison function that specifies how the elements in the list should be compared and sorted.\nFor example, you could add the following code before the line...
[ 0 ]
[]
[]
[ "c#", "render", "textures", "unity3d" ]
stackoverflow_0074678297_c#_render_textures_unity3d.txt
Q: Unable to access UDF from external view Redshift I have created datashare, and shared VIEW with Consumer cluster. That view contains one UDF, I have added that view in External Schema. Now when I try to run that view in consumer cluster, I am getting below error. [Amazon](500310) Invalid operation: External view c...
Unable to access UDF from external view Redshift
I have created datashare, and shared VIEW with Consumer cluster. That view contains one UDF, I have added that view in External Schema. Now when I try to run that view in consumer cluster, I am getting below error. [Amazon](500310) Invalid operation: External view contains unsupported objects; Can someone help me with...
[ "A few possible reasons could be:\n\nThe UDF is not defined in the correct schema. Redshift external views can only access UDFs that are defined in the same schema as the external view. If the UDF is defined in a different schema, you will need to specify the schema name when calling the UDF from the external view....
[ 0 ]
[]
[]
[ "amazon_redshift", "data_sharing", "user_defined_functions" ]
stackoverflow_0074444090_amazon_redshift_data_sharing_user_defined_functions.txt
Q: How do I make my code capitalize the first letter of the word that has a capital letter in it? (Pig Latin) My code so far is: def to_pig(string): words = string.split() for i, word in enumerate(words): ''' if first letter is a vowel ''' if word[0] in 'aeiou': ...
How do I make my code capitalize the first letter of the word that has a capital letter in it? (Pig Latin)
My code so far is: def to_pig(string): words = string.split() for i, word in enumerate(words): ''' if first letter is a vowel ''' if word[0] in 'aeiou': words[i] = words[i]+ "yay" elif word[0] in 'AEIOU': words[i] = words[i]+ "yay" ...
[ "Use any(... isupper()) to check for the presence of a capital letter and str.title() to capitalize the first letter.\n>>> words = \"eThay ainray inyay ainSpay aysstay ainlymay inyay ethay ainsplay\".split()\n>>> words = [word.title() if any(c.isupper() for c in word) else word for word in words]\n>>> ' '.join(word...
[ 0, 0 ]
[]
[]
[ "python" ]
stackoverflow_0074681051_python.txt
Q: Emailed invoices say sent from messaging-service@post.xero.com - Reply email address is correct though I am using the xero api with Python. I am correctly emailing invoices and all appears well except that the "sent from User" is appearing in the received email as messaging-service@post.xero.com rather than my bu...
Emailed invoices say sent from messaging-service@post.xero.com - Reply email address is correct though
I am using the xero api with Python. I am correctly emailing invoices and all appears well except that the "sent from User" is appearing in the received email as messaging-service@post.xero.com rather than my business name. Replying to the email correctly goes to my address ( not the messaging-service.... one). Any he...
[ "I have temporarily \"fixed\" this by unselecting \"Logged in user\" under email settings in xero and selecting the user account I wish emails to be sent from.\nI don't think this is the best solution but it works for now.\nCheers\nSteve\n" ]
[ 0 ]
[]
[]
[ "email" ]
stackoverflow_0074673101_email.txt
Q: Why my example is passing test without model validation? I've got the following model and test file. To my understanding, the last example should fail until I validate the body attribute in the model but it's passing the test. I'm not sure what it is that I'm missing. Any assistance is highly appreciated in advanc...
Why my example is passing test without model validation?
I've got the following model and test file. To my understanding, the last example should fail until I validate the body attribute in the model but it's passing the test. I'm not sure what it is that I'm missing. Any assistance is highly appreciated in advance, thanks. article.rb class Article < ApplicationRecord vali...
[ "You are missing the validation for the body attribute.\nclass Article < ApplicationRecord\n validates :title, presence: true, length: { in: 6..25 }\n validates :body, presence: true\nend\n\n" ]
[ 0 ]
[]
[]
[ "rspec", "ruby", "ruby_on_rails", "testing" ]
stackoverflow_0074679222_rspec_ruby_ruby_on_rails_testing.txt
Q: Is it inefficient to open and close a WebSocket connection multiple times? I'm building a game that involves realtime voice chat in which I want to use WebSockets for. My understanding is that WebSockets are not scaleable meaning they would require a lot of server Infrastructure to handle. Although I plan to host ...
Is it inefficient to open and close a WebSocket connection multiple times?
I'm building a game that involves realtime voice chat in which I want to use WebSockets for. My understanding is that WebSockets are not scaleable meaning they would require a lot of server Infrastructure to handle. Although I plan to host the server through a server-less method (AWS), I still want to maximize efficien...
[ "Opening and closing WebSocket connections multiple times is not necessarily inefficient, as the overhead associated with establishing a new connection is usually minimal. However, if the WebSocket connection needs to be re-established frequently, there may be additional overhead associated with the authentication ...
[ 0 ]
[]
[]
[ "http", "polling", "server", "websocket" ]
stackoverflow_0074681105_http_polling_server_websocket.txt
Q: How to specify local shell for Fabric2/Paramiko/Invoke? When trying to create a fabric2.Connection, Paramiko tries to invoke a local /bin/bash command: $ fab2 db-shell Traceback (most recent call last): File "/nix/store/m2iyj18cifr4a1rvpfgphg7kfgsf2pj2-python3.9-fabric2-2.7.1/bin/.fab2-wrapped", line 9, in <modu...
How to specify local shell for Fabric2/Paramiko/Invoke?
When trying to create a fabric2.Connection, Paramiko tries to invoke a local /bin/bash command: $ fab2 db-shell Traceback (most recent call last): File "/nix/store/m2iyj18cifr4a1rvpfgphg7kfgsf2pj2-python3.9-fabric2-2.7.1/bin/.fab2-wrapped", line 9, in <module> sys.exit(program.run()) File "/nix/store/20k85mfdkb...
[ "Invoke currently defaults to /bin/bash, which is a known issue, since operating systems like Alpine and NixOS don't have that path. Fortunately we can specify a command in $PATH rather than manually looking it up, so adding the following to the Connection call does the trick: config=invoke.Config(overrides={\"shel...
[ 0 ]
[]
[]
[ "paramiko", "pyinvoke", "python_3.x", "python_fabric_2", "shell" ]
stackoverflow_0074681115_paramiko_pyinvoke_python_3.x_python_fabric_2_shell.txt
Q: Blank window vscode as root it's been a long time that i run vscode as root via this command (ubuntu 20.04.4 LTS) : > sudo code --user-data-dir="~/.vscode-root" Today, i used the same command to execute vscode as root, but i don't have the same result. in this time, i have a blank window. i tried to remove it + r...
Blank window vscode as root
it's been a long time that i run vscode as root via this command (ubuntu 20.04.4 LTS) : > sudo code --user-data-dir="~/.vscode-root" Today, i used the same command to execute vscode as root, but i don't have the same result. in this time, i have a blank window. i tried to remove it + remove /$Home/Code and .vscode fol...
[ "That works for me on VSCodium:\nsudo su -c \"codium --user-data-dir=\"/root\" --no-sandbox && sleep infinity\"\n\nFor some reason, vscode does not start with sudo, but it works calmly with su -c\nPS: I do not know if it can be done easier. I needed this to work with git in vscode\n" ]
[ 0 ]
[]
[]
[ "ubuntu_20.04", "visual_studio_code", "vscode_tasks" ]
stackoverflow_0072015007_ubuntu_20.04_visual_studio_code_vscode_tasks.txt
Q: REST API Design - Async REST Client Vs Async REST API I already have REST API (for System-to-System communication) which takes lot of time to process. I want to have asynchronous processing. I see two options here: To make the API itself as asynchronous, where it returns a LOCATION header giving another URI to fe...
REST API Design - Async REST Client Vs Async REST API
I already have REST API (for System-to-System communication) which takes lot of time to process. I want to have asynchronous processing. I see two options here: To make the API itself as asynchronous, where it returns a LOCATION header giving another URI to fetch result. To make the client asynchronous - using asynch...
[ "Both of the options you have mentioned can be effective ways to handle asynchronous processing in a REST API. The choice of which one to use will depend on the specific requirements of your API and the preferences of the team implementing it.\nIn general, making the API itself asynchronous by returning a location ...
[ 0 ]
[]
[]
[ "asynchronous", "asyncresttemplate", "http", "httpclient", "rest" ]
stackoverflow_0074627880_asynchronous_asyncresttemplate_http_httpclient_rest.txt
Q: Why can't I deploy my next.js app to port 80? I never deployed any project before and I'm currently running with an issue while deploying a next.js app to godaddy. I uploaded my next.js app to the public_html folder of my cpanel and then i connected through ssh and executed the npm run dev command with server.js p...
Why can't I deploy my next.js app to port 80?
I never deployed any project before and I'm currently running with an issue while deploying a next.js app to godaddy. I uploaded my next.js app to the public_html folder of my cpanel and then i connected through ssh and executed the npm run dev command with server.js pointing to my domain name as hostname and 3000 as p...
[ "Did you get this sorted?\nYou need to set up .htaccess rules for the port.\n DirectoryIndex disabled\n RewriteEngine On\n RewriteRule ^$ http://127.0.0.1:30000/ [P,L]\n RewriteCond %{REQUEST_FILENAME} !-f\n RewriteCond %{REQUEST_FILENAME} !-d\n RewriteRule ^(.*)$ http://127.0.0.1:30000/$1 [P,L]`\...
[ 0 ]
[]
[]
[ "cpanel", "deployment", "javascript", "next.js", "node.js" ]
stackoverflow_0072222283_cpanel_deployment_javascript_next.js_node.js.txt
Q: How disable and enable usb port via command prompt? How disable and enable usb port via command prompt? or using batch script ? or using vb script in windows 7? A: You can use batch which gives you a couple of options. You can edit the registry key to disable usb devices from being used reg add HKLM\SYSTEM\Curre...
How disable and enable usb port via command prompt?
How disable and enable usb port via command prompt? or using batch script ? or using vb script in windows 7?
[ "You can use batch which gives you a couple of options. You can edit the registry key to disable usb devices from being used\nreg add HKLM\\SYSTEM\\CurrentControlSet\\Services\\UsbStor /v \"Start\" /t REG_DWORD /d \"4\" /f\n\nTo enable change value to 3.\nOr you can deny access to the files Usbstor.pnf and Usbstor....
[ 11, 2, 1, 0 ]
[]
[]
[ "batch_file", "vbscript", "windows" ]
stackoverflow_0013267236_batch_file_vbscript_windows.txt
Q: csv.writer not writing entire output to CSV file I am attempting to scrape the artists' Spotify streaming rankings from Kworb.net into a CSV file and I've nearly succeeded except I'm running into a weird issue. The code below successfully scrapes all 10,000 of the listed artists into the console: import requests f...
csv.writer not writing entire output to CSV file
I am attempting to scrape the artists' Spotify streaming rankings from Kworb.net into a CSV file and I've nearly succeeded except I'm running into a weird issue. The code below successfully scrapes all 10,000 of the listed artists into the console: import requests from bs4 import BeautifulSoup import csv URL = "https:...
[ "As an alternative approach, you might want to make your life easier next time and use pandas.\nHere's how:\nimport requests\nimport pandas as pd\n\nsource = requests.get(\"https://kworb.net/spotify/artists.html\")\ndf = pd.concat(pd.read_html(source.text, flavor=\"bs4\"))\ndf.to_csv(\"artists.csv\", index=False)\n...
[ 1, 0 ]
[]
[]
[ "python", "python_3.x", "web_scraping" ]
stackoverflow_0074680982_python_python_3.x_web_scraping.txt
Q: how can i add fontawesome to javascript element? Good evening guys. I am preparing a todo app. I added delete button but I want to add icon from fontawesome to delete button. Where exactly do i need to add <i class="fa fa-trash" aria-hidden="true"></i> ? I would be glad if you help me <body> <div class="cont...
how can i add fontawesome to javascript element?
Good evening guys. I am preparing a todo app. I added delete button but I want to add icon from fontawesome to delete button. Where exactly do i need to add <i class="fa fa-trash" aria-hidden="true"></i> ? I would be glad if you help me <body> <div class="container"> <div id="newtask"> <input type="...
[ "There are two things to highlight here is,\nFirst, the code piece to delete a list item is not deleting the actual item, but just hiding it from rendered HTML and that's wrong. You should remove that element completely from the document. The below code is not deleting in actuality.\n\nclose[i].onclick = function()...
[ 0 ]
[]
[]
[ "font_awesome", "javascript" ]
stackoverflow_0074680967_font_awesome_javascript.txt
Q: Run multiple Data fusion replication jobs on one dataproc cluster I am currently analyzing GCP data fusion replication features to ingest initial snapshot followed by the CDC. The plan is to create one replication job per table because adding a new table is not supported once the replication job is created. I trie...
Run multiple Data fusion replication jobs on one dataproc cluster
I am currently analyzing GCP data fusion replication features to ingest initial snapshot followed by the CDC. The plan is to create one replication job per table because adding a new table is not supported once the replication job is created. I tried to a table by deleting and creating the replication job with same nam...
[ "Yes, it is possible to run all replication jobs on one dataproc autoscaling cluster. You can configure the dataproc cluster to autoscale based on the needs of the replication jobs. This way, you can avoid running multiple clusters and minimize costs.\nAdditionally, you can configure the cluster to shut down when t...
[ 0 ]
[]
[]
[ "change_data_capture", "google_cloud_data_fusion", "google_cloud_platform" ]
stackoverflow_0074681102_change_data_capture_google_cloud_data_fusion_google_cloud_platform.txt
Q: Understanding snake game extension logic There is a function "extend" which is behaving as expected but I don't understand how. The writer of the code is using -1 as the position of the item in the list "segments". Should this not add an extra element to the already created snake at the position of its last segmen...
Understanding snake game extension logic
There is a function "extend" which is behaving as expected but I don't understand how. The writer of the code is using -1 as the position of the item in the list "segments". Should this not add an extra element to the already created snake at the position of its last segment? If so, how would that lengthen the snake as...
[ "\nShould this not add an extra element to the already created snake at the position of its last segment? If so, how would that lengthen the snake as the segment created at the end will overlap with the segment that is already there?\n\nA good question: intuitively, it seems like it should. But examine the movement...
[ 0 ]
[]
[]
[ "python", "python_turtle", "turtle_graphics" ]
stackoverflow_0074677711_python_python_turtle_turtle_graphics.txt
Q: Is there a FIXED function in QuickSight like Tableau? I’m trying to manipulate a Tableau function to QS. My output is not getting the same number, so I am doing something wrong here. Can anyone help with this? Tableau - { FIXED [marketplace_id],[monthending],[page_type],[device_type]:MAX([traffic_o])} QS - maxOver...
Is there a FIXED function in QuickSight like Tableau?
I’m trying to manipulate a Tableau function to QS. My output is not getting the same number, so I am doing something wrong here. Can anyone help with this? Tableau - { FIXED [marketplace_id],[monthending],[page_type],[device_type]:MAX([traffic_o])} QS - maxOver(traffic_o,[{marketplace_id},monthending,{page_type},{devic...
[ "Are you applying any visualization filters?\nIn Tableau, the FIXED() function gets evaluated before the visualization filters. In QuickSight, your LOD expressions can be executed before or after the filters. If you want to replicate the FIXED() function in QuickSight, you should use the PRE_FILTER parameter in you...
[ 0 ]
[]
[]
[ "amazon_quicksight", "tableau_api" ]
stackoverflow_0072522601_amazon_quicksight_tableau_api.txt
Q: Azure Node Function w/ Eventhub output binding to dynamically routed ADX table Having difficulties outputting from my function to an eventhub and finally into ADX when I want to target a table to route to. I have had no issues hitting target tables with the Node SDK via EventHubProducerClient in which case, you si...
Azure Node Function w/ Eventhub output binding to dynamically routed ADX table
Having difficulties outputting from my function to an eventhub and finally into ADX when I want to target a table to route to. I have had no issues hitting target tables with the Node SDK via EventHubProducerClient in which case, you simply specify those properties next to the body of the event your sending: { body:...
[ "The returned object is set as the data payload of the Event Hub Message that the Azure Functions runtime returns. Unfortunately, there is no way to change this from the JS Function itself.\nIn a C# Function you can return an EventData object but this isn't supported in non-C# languages.\nYou're only option, if you...
[ 0 ]
[]
[]
[ "azure", "azure_data_explorer", "azure_eventhub", "azure_functions" ]
stackoverflow_0074354652_azure_azure_data_explorer_azure_eventhub_azure_functions.txt
Q: Solving equation of motion due to (Lorentz acceleration) using Forward Euler and Runge-Kutta 4th order using Python 3 I am tring to solve the equation of motion of charged particle in planetary magnetic field to see the path of the particle using Forward Euler's and RK5 method in python (as an excercise in learnin...
Solving equation of motion due to (Lorentz acceleration) using Forward Euler and Runge-Kutta 4th order using Python 3
I am tring to solve the equation of motion of charged particle in planetary magnetic field to see the path of the particle using Forward Euler's and RK5 method in python (as an excercise in learning Numerical methods) I encounter two problems: The 'for loop' in the RK4 method does not update the new values. It give th...
[ "You are not iterating more than once inside the for loop in rk4 because it returns after the first iteration.\nfor i in range(len(t)-1):\n k1 = dt * fun(t[i], p[i]) \n k2 = dt * fun(t[i] + 0.5*dt, p[i] + 0.5 * k1)\n k3 = dt * fun(t[i] + 0.5*dt, p[i] + 0.5 * k2)\n k4 = dt * fun(t[i] + dt, p[i] + k3)\...
[ 0 ]
[]
[]
[ "nonlinear_equation", "numerical_methods", "python_3.x", "runge_kutta" ]
stackoverflow_0074681075_nonlinear_equation_numerical_methods_python_3.x_runge_kutta.txt
Q: Angular Universal deployment in shared hosting cpanel node.js I am trying to deploy dist folder in public_html and then starting a node.js application in cpanel with startup file as main.js. But always getting bad luck. Can anyone please help with the steps to deploy succesfully?? A: If you are using the "setup ...
Angular Universal deployment in shared hosting cpanel node.js
I am trying to deploy dist folder in public_html and then starting a node.js application in cpanel with startup file as main.js. But always getting bad luck. Can anyone please help with the steps to deploy succesfully??
[ "If you are using the \"setup node.js app\" module, then you need to specify and different folder for the app.\nPlease see this video for steps on how to deploy https://youtu.be/sIcy3q3Ib_s\n" ]
[ 0 ]
[]
[]
[ "angular_universal", "node.js", "server_side_rendering", "shared_hosting", "web_deployment" ]
stackoverflow_0073144896_angular_universal_node.js_server_side_rendering_shared_hosting_web_deployment.txt
Q: How to put this bar in front of elements? I seem to run into this problem that i cant bring this bar upfront, ive used z-index, still nothing. And it wont work on any of my pages. Im adding media part, if theres a problem or something i can add please comment. Thank you!! Can somebody help me out? This is the bar ...
How to put this bar in front of elements?
I seem to run into this problem that i cant bring this bar upfront, ive used z-index, still nothing. And it wont work on any of my pages. Im adding media part, if theres a problem or something i can add please comment. Thank you!! Can somebody help me out? This is the bar @media (max-width: 700px) { .text-box h1 { ...
[ "To bring an element in front of other elements on a page, you can use the z-index property in CSS. This property specifies the stack order of an element and determines whether it is in front of or behind other elements. Elements with a higher z-index are positioned in front of elements with a lower z-index.\nIn yo...
[ 0 ]
[]
[]
[ "css", "html", "sass" ]
stackoverflow_0074680478_css_html_sass.txt
Q: Print Dictionnary using generator Is it possible to print a dictionnary using a generator using a pattern ? Exemple : giving this dictionnary people = [ { 'name' : 'AAA', 'date_birth': '12/08/1990', 'class': '1st'}, { 'name' : 'BB', 'date_birth': '12/08/1992', 'class': '2nd'}, { 'name' : 'CC', 'date_...
Print Dictionnary using generator
Is it possible to print a dictionnary using a generator using a pattern ? Exemple : giving this dictionnary people = [ { 'name' : 'AAA', 'date_birth': '12/08/1990', 'class': '1st'}, { 'name' : 'BB', 'date_birth': '12/08/1992', 'class': '2nd'}, { 'name' : 'CC', 'date_birth': '12/08/1988', 'class': '3rd'}, ...
[ "Yes, it is possible to print the elements of a dictionary using a generator and a pattern. Here is an example of how you can do this:\npeople = [\n {'name': 'AAA', 'date_birth': '12/08/1990', 'class': '1st'},\n {'name': 'BB', 'date_birth': '12/08/1992', 'class': '2nd'},\n {'name': 'CC', 'date_birth': '12/...
[ 0, 0, 0 ]
[ "You can use a list generator as follows:\npeople = [(i['name'], i['date_birth'], i['class']) for i in people]\n\n", "Yes, it is possible to use a generator to print the elements of a dictionary using a pattern. You can do this by using a generator expression to iterate over the dictionary items and yield a forma...
[ -1, -1 ]
[ "python" ]
stackoverflow_0074681100_python.txt
Q: foreach() argument must be of type array|object, string given Laravel I'm trying to retrieve data from database and display all the data using foreachloop. Im getting first row data easily without foreach loop but whenever I try using loop the error displays "foreach() argument must be of type array|object, string...
foreach() argument must be of type array|object, string given Laravel
I'm trying to retrieve data from database and display all the data using foreachloop. Im getting first row data easily without foreach loop but whenever I try using loop the error displays "foreach() argument must be of type array|object, string given" This is my Controller Code class dbcontroller extends Controller { ...
[ "You should bring $posts for your foreach.\ncontroller:\nreturn view('db', compact('posts'));\n\nin blade:\n@foreach ($posts as $post)\n <p>{{ $post->name }}</p>\n@endforeach\n\n" ]
[ 0 ]
[]
[]
[ "database", "laravel" ]
stackoverflow_0074680626_database_laravel.txt
Q: What happens if i send the null pointer to fclose()? For example: FILE* file_name; file_name = fopen("some.txt", "r"); // some.txt isn't exist if (file_name !=NULL) printf("nice"); fclose(file_name); What happens in fclose? A: Passing a NULL pointer to fclose triggers undefined behavior. The fclose function ...
What happens if i send the null pointer to fclose()?
For example: FILE* file_name; file_name = fopen("some.txt", "r"); // some.txt isn't exist if (file_name !=NULL) printf("nice"); fclose(file_name); What happens in fclose?
[ "Passing a NULL pointer to fclose triggers undefined behavior.\nThe fclose function is documented as a library function in section 7.21.5.1 of the C standard, and section 7.1.4p1 states the following regarding library functions:\n\nEach of the following statements applies unless explicitly stated\notherwise in the ...
[ 6, 4 ]
[]
[]
[ "c" ]
stackoverflow_0074681080_c.txt
Q: Non-const member reference is mutable on const object? Given the following: struct S { int x; int& y; }; int main() { int i = 6; const S s{5, i}; // (1) // s.x = 10; // (2) s.y = 99; // (3) } Why is (3) allowed when s is const? (2) produces a compiler error, which is expected. ...
Non-const member reference is mutable on const object?
Given the following: struct S { int x; int& y; }; int main() { int i = 6; const S s{5, i}; // (1) // s.x = 10; // (2) s.y = 99; // (3) } Why is (3) allowed when s is const? (2) produces a compiler error, which is expected. I'd expect (3) to result in a compiler error as well.
[ "\nWhy is s.y = 99 allowed when s is const?\n\nThe type of s.y for const S s is not int const& but int&. It is not a reference to a const int, but a const reference to an int. Of course, all references are constant, you cannot rebind a reference.\nWhat if you wanted a type S' for which const object cannot be used t...
[ 4 ]
[]
[]
[ "c++", "class", "member", "reference", "struct" ]
stackoverflow_0074681127_c++_class_member_reference_struct.txt