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:
PHP routing - How can I implement 404 page on wrong url routes?
everyone.
I have a basic router created in PHP.
I can redirect to any page I want, if there is a callback function the callback function gets executed and if there is a page (String instead of a function) the page loads the correct file. However I can... | PHP routing - How can I implement 404 page on wrong url routes? | everyone.
I have a basic router created in PHP.
I can redirect to any page I want, if there is a callback function the callback function gets executed and if there is a page (String instead of a function) the page loads the correct file. However I can't figure out how to implement 404 page on non-existing route.
I trie... | [
"To implement a 404 page for non-existing routes, you can add a check at the end of your resolve() method to see if no routes have been matched. If no routes were matched, then you can call the notFound() method to display the 404 page.\npublic static function resolve(){\n $path = $_SERVER['REQUEST_URI'];\n $... | [
0
] | [] | [] | [
"frameworks",
"model_view_controller",
"php",
"routes",
"url_routing"
] | stackoverflow_0074679361_frameworks_model_view_controller_php_routes_url_routing.txt |
Q:
What are these weird symbols in bash terminal in vs code. I am working with Django. How to fixed it?
$ python manage.py migrate
?[36;1mOperations to perform:?[0m
?[1m Apply all migrations: ?[0madmin, auth, contenttypes, my_app, sessions
?[36;1mRunning migrations:?[0m
Applying my_app.0001_initial...?[32;1m OK?[0... | What are these weird symbols in bash terminal in vs code. I am working with Django. How to fixed it? | $ python manage.py migrate
?[36;1mOperations to perform:?[0m
?[1m Apply all migrations: ?[0madmin, auth, contenttypes, my_app, sessions
?[36;1mRunning migrations:?[0m
Applying my_app.0001_initial...?[32;1m OK?[0m
In a course i am following the guy terminal doesn't show those kind of messed up characters.
| [
"The reason for this is, that Django tries to dye your text, for estatic reasons.\nSee here for more info about the coloring.\nThere a various Option to fix this:\n1. Use another terminal\nIt might help to use another terminal tool that interpretes the color orders by Django.\n2. Disable colors\nYou can also disabl... | [
0
] | [] | [] | [
"django",
"django_migrations",
"symbols",
"terminal"
] | stackoverflow_0074680517_django_django_migrations_symbols_terminal.txt |
Q:
Create 48 plots by iterating through columns of pandas dataframe - How to increase column index in a loop?
I have a Pandas Dataframe with 96 columns x 100 rows which looks like this:
x1, y1, x2, y2, x3, y3, ..., x48, y48
0.5, 521, 1.8, 625, 5.5, 856, ..., 2.5, 453
0.6, 556, 1.9, 695, 5.6... | Create 48 plots by iterating through columns of pandas dataframe - How to increase column index in a loop? | I have a Pandas Dataframe with 96 columns x 100 rows which looks like this:
x1, y1, x2, y2, x3, y3, ..., x48, y48
0.5, 521, 1.8, 625, 5.5, 856, ..., 2.5, 453
0.6, 556, 1.9, 695, 5.6, 1023, ..., 2.6, 569
I want to plot y1 against x1, then y2 against x2, y3 against x3, and so on.
I'm really ... | [
"Here is an approach (highly inspired by Trenton McKinney).\nWe start by selecting/zipping the x columns and y columns with pandas.DataFrame.filter and pandas.DataFrame.columns, then we use matplotlib.axes.Axes.scatter (feel free to put any other kind of plots).\nTry this :\nimport pandas as pd\nimport matplotlib.p... | [
0
] | [] | [] | [
"dataframe",
"indexing",
"loops",
"pandas",
"plot"
] | stackoverflow_0074681072_dataframe_indexing_loops_pandas_plot.txt |
Q:
Web Audio API - Stereo to Mono
I need to convert an input stereo (channelCount: 2) stream to mono.
I've tried several things but the destination.stream always has 2 channels.
const context = new AudioContext()
const splitter = context.createChannelSplitter(1)
const merger = con... | Web Audio API - Stereo to Mono | I need to convert an input stereo (channelCount: 2) stream to mono.
I've tried several things but the destination.stream always has 2 channels.
const context = new AudioContext()
const splitter = context.createChannelSplitter(1)
const merger = context.createChannelMerger(1)
... | [
"To convert the stereo audio stream to mono, you can use the createChannelSplitter and createChannelMerger methods of the AudioContext object, as you have done in your code. However, instead of connecting the splitter directly to the merger, you will need to use the splitter to split the stereo audio into two separ... | [
0
] | [] | [] | [
"audio",
"google_chrome_extension",
"javascript",
"webrtc"
] | stackoverflow_0074681121_audio_google_chrome_extension_javascript_webrtc.txt |
Q:
Trying update and save a value for product meta data on woocommerce cart
I've been trying to figure out how can I make the value on the product meta data shown on the cart to be editable and saved when clicking the update quote button. When I try to update the value on the BOP field for each product, it does not r... | Trying update and save a value for product meta data on woocommerce cart | I've been trying to figure out how can I make the value on the product meta data shown on the cart to be editable and saved when clicking the update quote button. When I try to update the value on the BOP field for each product, it does not reflect properly
I've made some work in progress but can never seem to make it... | [
"// To make the value on the product meta data editable and savable in the cart, you can add a form input field for the BOP value in the cart.php file. For example:\n\n<input type=\"text\" name=\"bop_value\" value=\"<?php echo $bop_value; ?>\" />\n\n// Then, you can update the value of the BOP field when the update... | [
1
] | [] | [] | [
"ajax",
"php",
"woocommerce",
"wordpress"
] | stackoverflow_0074652853_ajax_php_woocommerce_wordpress.txt |
Q:
How to loop from a dataframe to another one to count occurence of certain words?
enter image description here
I have two dataframes, df1 contains a column with all possible combinations and df2 contains a column with the actual combinations. I want to make a second column within df1 that loops through df2 and coun... | How to loop from a dataframe to another one to count occurence of certain words? | enter image description here
I have two dataframes, df1 contains a column with all possible combinations and df2 contains a column with the actual combinations. I want to make a second column within df1 that loops through df2 and counts the values. So if df1 has a row with 'A,C' and df2 rows with 'A,B,C' and with 'A,C,... | [
"To loop through the rows of two dataframes and count the values in one dataframe based on the values in the other dataframe, you can use a for loop and the pandas DataFrame.isin() method.\nHere is an example of how you can do this:\nimport pandas as pd\n\n# Define the dataframes\ndf1 = pd.DataFrame({'col1': ['A,B'... | [
0
] | [] | [] | [
"combinations",
"count",
"dataframe",
"find_occurrences",
"python"
] | stackoverflow_0074681083_combinations_count_dataframe_find_occurrences_python.txt |
Q:
How can I change the HTML of elements in a loop, using JavaScript?
I'm trying to add paragraph numbers to a text using JavaScript. Here's what I have so far.
// Get all the paragraphs. I only want the ones in <main>
const paras = document.querySelectorAll('main p')
// Iterate through all the paragraphs, keeping t... | How can I change the HTML of elements in a loop, using JavaScript? | I'm trying to add paragraph numbers to a text using JavaScript. Here's what I have so far.
// Get all the paragraphs. I only want the ones in <main>
const paras = document.querySelectorAll('main p')
// Iterate through all the paragraphs, keeping track of their indices
for (let i = 0; i < paras.length; i++) {
var th... | [
"There is a typo in your code. You are using innerHtml to set the inner HTML of the paragraph element, but the correct property name is innerHTML.\nHere is the corrected code:\n// Get all the paragraphs. I only want the ones in <main>\nconst paras = document.querySelectorAll('main p')\n\n// Iterate through all the ... | [
0
] | [] | [] | [
"javascript"
] | stackoverflow_0074681159_javascript.txt |
Q:
gitlab-runner executor failing on Microk8s Raspberry pi cluster - `ContainersNotInitialized: "containers with incomplete status: [init-permissions]"`
gitlab-runner executor failing on Microk8s Raspberry pi cluster - ContainersNotInitialized: "containers with incomplete status: [init-permissions]"
Any help or just ... | gitlab-runner executor failing on Microk8s Raspberry pi cluster - `ContainersNotInitialized: "containers with incomplete status: [init-permissions]"` | gitlab-runner executor failing on Microk8s Raspberry pi cluster - ContainersNotInitialized: "containers with incomplete status: [init-permissions]"
Any help or just suggestions as to how to troubleshoot this further would be appreciated!
I am trying to us the gitlab-runner executor on a mincrok8s raspberry pi cluster. ... | [
"I had the same issue today and it was beacause of the default helper image which is basically wrong in the chart. Something went really wrong with gitlab's helper image registry because all of the arm images look to be built for amd64! Look here for example: https://hub.docker.com/r/gitlab/gitlab-runner-helper/tag... | [
0
] | [] | [] | [
"gitlab_ci",
"gitlab_ci_runner",
"microk8s",
"raspberry_pi4"
] | stackoverflow_0070350914_gitlab_ci_gitlab_ci_runner_microk8s_raspberry_pi4.txt |
Q:
CPanel Node.js application stopped working after successfully pulling data from Firebase
I deployed a Node.js application on CPanel at this domain https://ad900.brighton.domains/api
It stopped working after updating my app.js file to pull data from a Firebase database. Yesterday it was actually up and running and ... | CPanel Node.js application stopped working after successfully pulling data from Firebase | I deployed a Node.js application on CPanel at this domain https://ad900.brighton.domains/api
It stopped working after updating my app.js file to pull data from a Firebase database. Yesterday it was actually up and running and it was able to retrieve data from the database but when I checked today, the page is not even ... | [
"If you are using shared hosting, it might be that the processes are terminated and you need to run a cron job to keep it running.\nPlease see this video for full set up via shared hosting with cPanel https://youtu.be/sIcy3q3Ib_s\n"
] | [
0
] | [] | [] | [
"cpanel",
"express",
"firebase",
"firebase_realtime_database",
"node.js"
] | stackoverflow_0074405957_cpanel_express_firebase_firebase_realtime_database_node.js.txt |
Q:
Is there a way to take a combo of mixed numbers and letters and just put the numbers into a new variable
For example, If I input 9a8,4 I want 984 output from it. I am not sure how I would do this or if I can. Thank you.
I have not been able to try anything because i do not know where to start.
A:
Sure you can, t... | Is there a way to take a combo of mixed numbers and letters and just put the numbers into a new variable | For example, If I input 9a8,4 I want 984 output from it. I am not sure how I would do this or if I can. Thank you.
I have not been able to try anything because i do not know where to start.
| [
"Sure you can, take a look at arrays and try manipulate them.\nYou can start creating an array with a string type and scan it using loops. When you find a number you take it and put into another array. Another solution could be to scan to find letters and remove those from the array.\nThere are different ways, you ... | [
1,
0
] | [] | [] | [
"c"
] | stackoverflow_0074681133_c.txt |
Q:
Angular emit one value when element is in view
I created a directive that should emit an event once its element is visible in the viewport.
@Directive({
selector: '[scrollListener]',
})
export class ScrollListenerDirective {
@Output() scrollListener: Observable<number>;
constructor(private el: ElementRef) {... | Angular emit one value when element is in view | I created a directive that should emit an event once its element is visible in the viewport.
@Directive({
selector: '[scrollListener]',
})
export class ScrollListenerDirective {
@Output() scrollListener: Observable<number>;
constructor(private el: ElementRef) {
this.scrollListener = fromEvent(document, 'scro... | [
"You could use the scan operator to cache the preceding value of top. By comparing the preceding value with the current value of top you can determine when the transition from > 100 to <= 100 happens. At the time of this transition, the observable emits a value.\n@Directive({\n selector: '[scrollListener]',\n }... | [
0
] | [] | [] | [
"angular",
"eventemitter",
"rxjs"
] | stackoverflow_0074679636_angular_eventemitter_rxjs.txt |
Q:
How properly store values in belonging rows/cells of dataframe while scraping with Beautiful Soup?
So, I am trying to scrape data from a journal.
While I can successfully scrape titles of papers, keywords, and so on, and save them in dataframe properly when it comes to collecting authors' names, each mentioned aut... | How properly store values in belonging rows/cells of dataframe while scraping with Beautiful Soup? | So, I am trying to scrape data from a journal.
While I can successfully scrape titles of papers, keywords, and so on, and save them in dataframe properly when it comes to collecting authors' names, each mentioned author of the paper after the first one is stored in a new row. The same problem applies to affiliations.
I... | [
"For cases like this, you should use nested loops - an outer loop for the containers ResultSet (soup.select('article.obj_article_details') here), and the inner loop/s for the details you want - title/author/affiliation/etc. And it's also better to build a dictionary of the details for each container and add it to a... | [
0
] | [] | [] | [
"beautifulsoup",
"dataframe",
"pandas",
"python_3.x",
"web_scraping"
] | stackoverflow_0074680330_beautifulsoup_dataframe_pandas_python_3.x_web_scraping.txt |
Q:
Multiple qq plots in one figure
I have a matrix mEps which is of shape (10, 1042), where 10 is the number of assets, and 1042 is the amount of datapoints. I want to show the Q-Q plot for each asset, so I can plot:
for i in range(iN):
sm.qqplot((mEps[i,:]), fit = True, line='q')
However, then I get 10 pictures... | Multiple qq plots in one figure | I have a matrix mEps which is of shape (10, 1042), where 10 is the number of assets, and 1042 is the amount of datapoints. I want to show the Q-Q plot for each asset, so I can plot:
for i in range(iN):
sm.qqplot((mEps[i,:]), fit = True, line='q')
However, then I get 10 pictures of Q-Q plots. I would like to have t... | [
"QQplot documentation https://www.statsmodels.org/dev/generated/statsmodels.graphics.gofplots.qqplot.html\nstates that function takes as argument \"ax\" the ax in subplots, where you want to place your qqplot\nfig, (ax1, ax2) = plt.subplots(ncols=2, figsize=(10,4))\n\nqqplot(data_a['metrics'], line='s', ax=ax1)\nqq... | [
0
] | [] | [] | [
"plot",
"python",
"qq",
"quantile"
] | stackoverflow_0052813683_plot_python_qq_quantile.txt |
Q:
Multiplayer with Photon, but I am controlling the other character instead
I am using Photon PUN 2 for multiplayer in Unity.
I can create a room or join a room.
The problem appears when I join with a second player. When I control one of the players, I control the other player instead.
I am using Standard Assets FPS... | Multiplayer with Photon, but I am controlling the other character instead | I am using Photon PUN 2 for multiplayer in Unity.
I can create a room or join a room.
The problem appears when I join with a second player. When I control one of the players, I control the other player instead.
I am using Standard Assets FPS controller.
Do anyone know what is causing the problem?
Any help would be appr... | [
"put isMine in your code and put the movement code inside of it\nExample:\nprivate void Update()\n {\n if(view.IsMine){ //Add this \n RotateView();\n \n if (!m_Jump)\n {\n m_Jump = CrossPlatformInputManager.GetButtonDown(\... | [
0
] | [] | [] | [
"c#",
"photon",
"unity3d"
] | stackoverflow_0068694333_c#_photon_unity3d.txt |
Q:
Gitlab CI/CD cache expires and therefor build fails
I got AWS CDK application in typescript and pretty simple gitlab CI/CD pipeline with 2 stages, which takes care of the deployment:
image: node:latest
stages:
- dependencies
- deploy
dependencies:
stage: dependencies
only:
refs:
- master
ch... | Gitlab CI/CD cache expires and therefor build fails | I got AWS CDK application in typescript and pretty simple gitlab CI/CD pipeline with 2 stages, which takes care of the deployment:
image: node:latest
stages:
- dependencies
- deploy
dependencies:
stage: dependencies
only:
refs:
- master
changes:
- package-lock.json
script:
- npm inst... | [
"A cache is only a performance optimization, but is not guaranteed to always work. Your expectation that the cache might be expired is most likely correct, and thus you'll need to have a fallback in your deploy script.\nOne thing you could do is that you change your dependencies job to:\n\nAlways run\nBoth push & p... | [
0
] | [] | [] | [
"aws_cdk",
"gitlab_ci",
"gitlab_ci.yml",
"node.js",
"typescript"
] | stackoverflow_0074678052_aws_cdk_gitlab_ci_gitlab_ci.yml_node.js_typescript.txt |
Q:
recreate folder structure Osx
I currently have a set of folders that I need to duplicate the structure into another folder.
I currently work with photos that are dumped into a Dump folder in groups.
Eg.
Photo Dump
Group1
Group2 etc
I would like to have a script to recreate these folders without t... | recreate folder structure Osx | I currently have a set of folders that I need to duplicate the structure into another folder.
I currently work with photos that are dumped into a Dump folder in groups.
Eg.
Photo Dump
Group1
Group2 etc
I would like to have a script to recreate these folders without the files to the good folder so tha... | [
"If I understand correctly, you want to copy the parent folder and all of its subfolders, but none of the files contained therein. There might be a simpler way, but I just threw together this Terminal command (which should also work on Linux or anywhere else with Bash):\nls -R | grep :$ | sed 's/\\.\\/\\(.*\\):$/\\... | [
2,
0
] | [] | [] | [
"directory",
"macos"
] | stackoverflow_0023588221_directory_macos.txt |
Q:
Ansible dynamically assigned variable
Unable to print the output of a variable when assigned in playbook. it returns the value of variable.
- name: get contents of local file
set_fact:
"{{ item.filename }}": "{{ lookup('file', 'files/conf/{{ item.name }}.zip') }}"
loop: "{{ genericconf }}"
... | Ansible dynamically assigned variable | Unable to print the output of a variable when assigned in playbook. it returns the value of variable.
- name: get contents of local file
set_fact:
"{{ item.filename }}": "{{ lookup('file', 'files/conf/{{ item.name }}.zip') }}"
loop: "{{ genericconf }}"
- name: encode to base64
set_fac... | [
"- name: get contents of local file\n set_fact:\n filename: \"{{ lookup('file', 'files/conf/{{ item.name }}.zip') }}\"\n loop: \"{{ genericconf }}\"\n\n- name: encode to base64\n set_fact:\n basename: \"{{ filename | b64encode }}\"\n loop: \"{{ genericconf }}\"\n\n- name: add lines\n blockinfile:\n bl... | [
0
] | [] | [] | [
"ansible",
"ansible_2.x"
] | stackoverflow_0074678348_ansible_ansible_2.x.txt |
Q:
when I debugging code I found "Exception has occurred." in object_patch.dart file
NoSuchMethodError (NoSuchMethodError: The method '[]' was called on null.
Receiver: null
Tried calling: )
I cant solve this , because I can't understand this mean
but its can't received null
A:
The error message "NoSuchMethodError ... | when I debugging code I found "Exception has occurred." in object_patch.dart file | NoSuchMethodError (NoSuchMethodError: The method '[]' was called on null.
Receiver: null
Tried calling: )
I cant solve this , because I can't understand this mean
but its can't received null
| [
"The error message \"NoSuchMethodError (NoSuchMethodError: The method '[]' was called on null. Receiver: null Tried calling: )\" indicates that you are trying to call the [] operator (also known as the index operator) on a null object. This means that the object you are trying to access is null, and therefore the [... | [
0
] | [] | [] | [
"api",
"dart",
"dart_async",
"flutter"
] | stackoverflow_0074680972_api_dart_dart_async_flutter.txt |
Q:
Screen Record Full Resolution Chrome Mobile Responsive Screen
I'm trying to record our software in Chrome's mobile device emulator. The resolution for the hypothetical device is 1080 x 1920 (vertical orientation). I would like to be able to just record the emulation screen at full resolution. I know I could record... | Screen Record Full Resolution Chrome Mobile Responsive Screen | I'm trying to record our software in Chrome's mobile device emulator. The resolution for the hypothetical device is 1080 x 1920 (vertical orientation). I would like to be able to just record the emulation screen at full resolution. I know I could record my entire screen and just crop for the window showing the software... | [
"One option is to use a screen recording software that allows you to select a specific area to record. This will allow you to select the emulator screen and record just that area at the desired resolution.\nAnother option is to use the built-in screen recording feature in Chrome. To do this, you will need to open t... | [
0
] | [] | [] | [
"google_chrome",
"responsive_design",
"screen_capture",
"screen_recording"
] | stackoverflow_0073280654_google_chrome_responsive_design_screen_capture_screen_recording.txt |
Q:
Typescript: Get runtime value of argument for return type evaluation
I am having a problem with typescript return types.
I have written the following function as a wrapper around process.env:
function env<
RequiredType = undefined | boolean,
FallbackType = undefined | string,
>(
name: string,
required?: Re... | Typescript: Get runtime value of argument for return type evaluation | I am having a problem with typescript return types.
I have written the following function as a wrapper around process.env:
function env<
RequiredType = undefined | boolean,
FallbackType = undefined | string,
>(
name: string,
required?: RequiredType,
fallback?: FallbackType,
): FallbackType extends string ? st... | [
"Recall that Typescript types don't exist at runtime. Thus, if you want to narrow the function signature for specific data passed, you have to teach Typescript about what subsets of data passed to your function will return in specific more narrowed return values. You can accomplish this with function overloading:\n... | [
0,
0
] | [] | [] | [
"types",
"typescript"
] | stackoverflow_0074680380_types_typescript.txt |
Q:
Python - Shutil - Skip File Already exists
I have many pdfs on my desktop. I want to run a python script to move all these pdfs to a folder
I am testing a script and I found that a file already exists in the destination folder. The script when run says the file already exists.
In this scenario, I would like to ove... | Python - Shutil - Skip File Already exists | I have many pdfs on my desktop. I want to run a python script to move all these pdfs to a folder
I am testing a script and I found that a file already exists in the destination folder. The script when run says the file already exists.
In this scenario, I would like to overwrite the file if it exists. How do I tell shut... | [
"To tell the shutil.move() function to overwrite the destination file if it already exists, you can use the shutil.move() function's copy_function argument and set it to the shutil.copy2() function. This will cause the shutil.move() function to use the shutil.copy2() function to copy the file to the destination, wh... | [
0
] | [] | [] | [
"python",
"shutil"
] | stackoverflow_0074681196_python_shutil.txt |
Q:
Cucumber 6 + JUnit 5 + Spring Parallel Scenarios Execution
I've been reading a lot of documentations, posts, articles and it's said that out-of-box solution to run scenarios in a single feature file in parallel is impossible.
We can use maven-surefire-plugin to run in parallel different feature files, but not scen... | Cucumber 6 + JUnit 5 + Spring Parallel Scenarios Execution | I've been reading a lot of documentations, posts, articles and it's said that out-of-box solution to run scenarios in a single feature file in parallel is impossible.
We can use maven-surefire-plugin to run in parallel different feature files, but not scenarios.
For example there is a feature file with scenarios:
Featu... | [
"I am using testNG with courgette-jvm to run parallel tests at scenario level\n. Here is runner file\nimport courgette.api.CourgetteOptions;\nimport courgette.api.CourgetteRunLevel;\nimport courgette.api.CucumberOptions;\nimport courgette.api.testng.TestNGCourgette;\nimport org.testng.annotations.Test;\n\n@Test\n@... | [
1
] | [
"For example two test fraemworks with parallel execution and 'Allure' screenshots(when step fail).\nAll detailed information in readme on github:\nhttps://github.com/simileyskiy/cucumber7-selenium3.selenide5-junit5-Allure-parallelExecution\nhttps://github.com/simileyskiy/cucumber7-selenium4.selenide6-junit5-Allure-... | [
-7
] | [
"cucumber",
"java",
"maven",
"parallel_processing",
"spring"
] | stackoverflow_0071020032_cucumber_java_maven_parallel_processing_spring.txt |
Q:
gcd of all pair numbers in 2d array
It is given a two-dimensional array with N rows and M columns(N and M are entered by the user). Calculate the GCDs(greatest common divisors) of each possible pairs of elements in the two-dimensional array. And those GCDs have to be strored in one-dimensional array, sorted from s... | gcd of all pair numbers in 2d array | It is given a two-dimensional array with N rows and M columns(N and M are entered by the user). Calculate the GCDs(greatest common divisors) of each possible pairs of elements in the two-dimensional array. And those GCDs have to be strored in one-dimensional array, sorted from smallest to largest(including duplicated n... | [
"Here is some sample code that calculates the GCDs of all possible pairs of elements in a two-dimensional array and stores them in a one-dimensional array sorted from smallest to largest.\n#include <stdio.h>\n#include <stdlib.h>\n\nint gcd(int a, int b) {\n if (b == 0) return a;\n return gcd(b, a % b);\n}\n\n... | [
-3
] | [] | [] | [
"c"
] | stackoverflow_0074681124_c.txt |
Q:
Tricky typing problems with a generic union type doing an intersection type
I have stumbled upon a peculiar problem, and I have no idea how to fix this. I have a class with a generic type. This class contains a method with only one union parameters asking for the generic type or an object. Since this class is inst... | Tricky typing problems with a generic union type doing an intersection type | I have stumbled upon a peculiar problem, and I have no idea how to fix this. I have a class with a generic type. This class contains a method with only one union parameters asking for the generic type or an object. Since this class is instantiated multiple times with different types, I wanted to create a generic method... | [
"The reason you get an intersection is because the compiler loses track of the correlation between the type of key and the type of myData, and so it only accepts something it knows is safe. If myData were both A and B (like {a: 1, b: 2}), then it would be safe to call myClassInstance.myMethod(myData) no matter whi... | [
2
] | [] | [] | [
"typescript",
"typescript_generics"
] | stackoverflow_0074680936_typescript_typescript_generics.txt |
Q:
How to convert a MYSQL database to an Oracle database
I am editing a MYSQL database using phpMyAdmin. I want to turn this into an Oracle database. How can this be done?
A:
Use mysqldump to export your data from MySQL.
shell> mysqldump [options] db_name [tbl_name ...]
In the [options] you'll probably have to tel... | How to convert a MYSQL database to an Oracle database | I am editing a MYSQL database using phpMyAdmin. I want to turn this into an Oracle database. How can this be done?
| [
"Use mysqldump to export your data from MySQL.\nshell> mysqldump [options] db_name [tbl_name ...]\n\nIn the [options] you'll probably have to tell MySQL to export your database in a format that is recognizable by Oracle. You can to this with the --compatible=name option, where name can be oracle.\nshell> mysqldump ... | [
4,
0
] | [] | [] | [
"database",
"mysql",
"oracle10g",
"sqlplus"
] | stackoverflow_0008395612_database_mysql_oracle10g_sqlplus.txt |
Q:
Images take -1 second to load in Flutter
I'm using precacheImage in my app to load faster my assets. Despite this, my first screen images take less than a second to show, causing a bad user experience. I think that this happens because I'm calling precacheImage in the same screen where I have to show some of the i... | Images take -1 second to load in Flutter | I'm using precacheImage in my app to load faster my assets. Despite this, my first screen images take less than a second to show, causing a bad user experience. I think that this happens because I'm calling precacheImage in the same screen where I have to show some of the images, but this i the very first screen of the... | [
"Yes, there is a way to cache the images for the next time the app is opened in Flutter. This can be done using the flutter_cache_manager package, which provides caching functionality for images and other files.\nTo use this package, first add it to your pubspec.yaml file:\ndependencies:\n flutter_cache_manager: ^... | [
0
] | [] | [] | [
"flutter"
] | stackoverflow_0074680890_flutter.txt |
Q:
I can't deploy my react nodejs application on the internet
I have developed an application on React and NodeJs, everything works locally (localhost), but I do not understand how to deploy my application on the internet. Either on Cpanel (namecheap) or on netlify for example.
I tried different ways, I think my prob... | I can't deploy my react nodejs application on the internet | I have developed an application on React and NodeJs, everything works locally (localhost), but I do not understand how to deploy my application on the internet. Either on Cpanel (namecheap) or on netlify for example.
I tried different ways, I think my problem is either the organization of my files or the scripts in my ... | [
"Does your server run on a port?\nIf so you need to add some extra configuration code in a file .htaccess\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 ^(.*)$ htt... | [
0
] | [] | [] | [
"cpanel",
"node.js",
"reactjs",
"web",
"web_deployment"
] | stackoverflow_0074665417_cpanel_node.js_reactjs_web_web_deployment.txt |
Q:
How to change iPython error highlighting color
I'm using iPython with iterm2 in macOS. I had never had issues before with the color scheme, but this time when an exception occurs, it highlights certain parts in a color combination that I find very hard to read. I've tried with different color setups in iterm and a... | How to change iPython error highlighting color | I'm using iPython with iterm2 in macOS. I had never had issues before with the color scheme, but this time when an exception occurs, it highlights certain parts in a color combination that I find very hard to read. I've tried with different color setups in iterm and also adjusting highlighting_style and colors in the i... | [
"There is an open issue regarding this: https://github.com/ipython/ipython/issues/13446\n\nHere is the commit which introduced this change:\nhttps://github.com/ipython/ipython/commit/3026c205487897f6874b2ff580fe0be33e36e033\nTo get the file path on your system, run the following:\nimport IPython, os\nos.path.join(o... | [
13,
0
] | [] | [] | [
"ipython"
] | stackoverflow_0070766518_ipython.txt |
Q:
Replace word in package names and variables in code
In my android project I got very intericting task
My company wants to hide all mintions about her in code (variables names, packages and etc)
But only for one flavour, so I cannot do it once for all project.
My first idea, was writing a simple gradle task, that w... | Replace word in package names and variables in code | In my android project I got very intericting task
My company wants to hide all mintions about her in code (variables names, packages and etc)
But only for one flavour, so I cannot do it once for all project.
My first idea, was writing a simple gradle task, that will replace all strings that fit in code, but in this cas... | [
"Replacing the package name/variable names blindly seems a bit risky, as it could replace other overlapping strings as well, which may lead to various issues. Assuming your package name is unique and you don't have any overlapping names and it doesn't result in any directory name changes, you can use different meth... | [
1,
0,
0
] | [] | [] | [
"android",
"gradle",
"jenkins",
"jenkins_groovy"
] | stackoverflow_0074571088_android_gradle_jenkins_jenkins_groovy.txt |
Q:
Firebase emulator token revoked
I have been using the Firebase Emulator for quite some time now and everthing have been working fine. Recenttly, I set up some seed data with a user in the seed as well.
My problem is that each time I start the emulator (with the seed) and I try to execute an action, the auth.verify... | Firebase emulator token revoked | I have been using the Firebase Emulator for quite some time now and everthing have been working fine. Recenttly, I set up some seed data with a user in the seed as well.
My problem is that each time I start the emulator (with the seed) and I try to execute an action, the auth.verifyIdToken(token, true) throws an error:... | [
"If the auth.verifyIdToken(token, true) method is throwing an error saying that the Firebase ID token has been revoked, it means that the ID token is no longer valid and can no longer be used to authenticate the user.\nThere are a few possible reasons why this could happen:\n\nThe user's account may have been delet... | [
0
] | [] | [] | [
"firebase",
"firebase_authentication",
"firebase_tools",
"javascript"
] | stackoverflow_0074649632_firebase_firebase_authentication_firebase_tools_javascript.txt |
Q:
Difference between (function designator) and {function pointer}?
In clang, a pointer to a function and the designation/designator have distinct object grouping symbols, parenthesis compared to curly braces.
Why does the initial have parenthesis enclosing the symbol whereas the second symbol uses curly braces?
For ... | Difference between (function designator) and {function pointer}? | In clang, a pointer to a function and the designation/designator have distinct object grouping symbols, parenthesis compared to curly braces.
Why does the initial have parenthesis enclosing the symbol whereas the second symbol uses curly braces?
For example, the following code fragment when compiled,
.
(*function)(1);
... | [
"function designator is an expression with function type.\nfor example in\na = foo(x);\n\nfoo is a function designator.\nFunction pointer is a reference to the function. Function designators decay to function pointers when used as values.\nint (*fptr)(int) = foo;\n\n"
] | [
0
] | [] | [] | [
"c",
"function_pointers",
"grouping",
"struct"
] | stackoverflow_0074681176_c_function_pointers_grouping_struct.txt |
Q:
Adding type class to the function defenition doesn't help in Haskell
In the line
eval :: (Enum Instruction) => [Instruction] -> [Value] -> [Value]
eval inst mem = evalSecond (evalStep ((fromList Halt inst), (fromList 0 mem), (0,0,0,0), (ZeroFlag, EvenFlag)))
where fromList is
fromList ::(Enum a) => a -> [a] -> Ta... | Adding type class to the function defenition doesn't help in Haskell | In the line
eval :: (Enum Instruction) => [Instruction] -> [Value] -> [Value]
eval inst mem = evalSecond (evalStep ((fromList Halt inst), (fromList 0 mem), (0,0,0,0), (ZeroFlag, EvenFlag)))
where fromList is
fromList ::(Enum a) => a -> [a] -> Tape a
fromList a xs = (Tape 0 inf (xs ++ inf))
where inf = [a, a..]
I'... | [
"In eval you are requiring that the Instruction type is an instance of the Enum type class, but no such instance definition can be found. Thus, eval cannot be called.\nIn order to make Instruction an instance of Enum, you have to provide definitions for toEnum :: Int -> Instruction and fromEnum :: Instruction -> In... | [
1
] | [] | [] | [
"enums",
"haskell",
"typeclass"
] | stackoverflow_0074680532_enums_haskell_typeclass.txt |
Q:
Push Notifications not working when Android inactive
I developed a PWA that subscribes to a push notification, and when a notification is received the Service Worker (SW) does a showNotification and a postMessage to each client, triggering them to update a display field in the browser. The client I'm testing on i... | Push Notifications not working when Android inactive | I developed a PWA that subscribes to a push notification, and when a notification is received the Service Worker (SW) does a showNotification and a postMessage to each client, triggering them to update a display field in the browser. The client I'm testing on is Android 11 on a Pixel 5a, Chrome 99.0.4844.58, and the P... | [
"It is possible that this behavior is expected, as Android devices are designed to conserve battery power when the screen is turned off. This can involve suspending certain background processes, including push notifications, until the device is unlocked again.\nYou can try a few things to see if they help resolve t... | [
0
] | [] | [] | [
"progressive_web_apps",
"push_notification"
] | stackoverflow_0071405598_progressive_web_apps_push_notification.txt |
Q:
Passing variable arguments to another function that accepts a variable argument list
So I have 2 functions that both have similar arguments
void example(int a, int b, ...);
void exampleB(int b, ...);
Now example calls exampleB, but how can I pass along the variables in the variable argument list without modifying... | Passing variable arguments to another function that accepts a variable argument list | So I have 2 functions that both have similar arguments
void example(int a, int b, ...);
void exampleB(int b, ...);
Now example calls exampleB, but how can I pass along the variables in the variable argument list without modifying exampleB (as this is already used elsewhere too).
| [
"You can't do it directly; you have to create a function that takes a va_list:\n#include <stdarg.h>\n\nstatic void exampleV(int b, va_list args);\n\nvoid exampleA(int a, int b, ...) // Renamed for consistency\n{\n va_list args;\n do_something(a); // Use argument a somehow\n va_start(args,... | [
153,
89,
16,
8,
5,
4,
3,
1,
0,
0,
0
] | [] | [] | [
"c++",
"variadic_functions"
] | stackoverflow_0003530771_c++_variadic_functions.txt |
Q:
Data record becomes double in database when updated
I have 2 features that I'm working on, say Clock in and Clock out. The thing is that when I clock out(updated the Time Clock out and Location Clock out), suddenly there's an extra record as seen on this pic, https://paste.pics/586336ef0bf2517da832678425125655 . A... | Data record becomes double in database when updated | I have 2 features that I'm working on, say Clock in and Clock out. The thing is that when I clock out(updated the Time Clock out and Location Clock out), suddenly there's an extra record as seen on this pic, https://paste.pics/586336ef0bf2517da832678425125655 . Although the data is updated but there's an extra row with... | [
"in function userClockOut:\nAttendanceRecord::updateOrCreate(\n ['staff_id' => $users->staff_id, 'date_checkIn' => $date],\n $users->toArray()\n);\n\nand\n// I suggest you comment these lines\n$attendanceRecord = new AttendanceRecord();\n$attendanceRecord->fill($currentData);\n$attendanceRecord->save();\n\nar... | [
0
] | [] | [] | [
"api",
"laravel",
"php"
] | stackoverflow_0074675407_api_laravel_php.txt |
Q:
Using HTTPS with Azure functions running on Azure iot Edge
Background
I have a system running on Azure iot edge. The system is composed of multiple modules that expose REST interfaces. To make everything look tidy from the client's perspective (a browser on another machine in the same network) we use an Azure Func... | Using HTTPS with Azure functions running on Azure iot Edge |
Background
I have a system running on Azure iot edge. The system is composed of multiple modules that expose REST interfaces. To make everything look tidy from the client's perspective (a browser on another machine in the same network) we use an Azure Function and its reverse proxy capabilities.
So, basically, the cl... | [
"For HTTPS, you primarily need a SSL certificate and reverse proxy like nginx that can do SSL Termination since I believe Azure Functions doesn't support it as part of the runtime itself (which is what the docker container has).\nNginx is a popular and fairly common choice to use for SSL Termination. You would have... | [
0
] | [] | [] | [
"azure",
"azure_functions",
"azure_functions_proxies",
"azure_iot_edge",
"https"
] | stackoverflow_0072227639_azure_azure_functions_azure_functions_proxies_azure_iot_edge_https.txt |
Q:
Restarting game upon player death is deleting game objects
I am in the process of creating a call of duty zombies style game. The issue I'm currently running into is when my player's health = 0 the game restarts but for some reason throws out the following errors:
MissingReferenceException: The object of type 'Tr... | Restarting game upon player death is deleting game objects | I am in the process of creating a call of duty zombies style game. The issue I'm currently running into is when my player's health = 0 the game restarts but for some reason throws out the following errors:
MissingReferenceException: The object of type 'Transform' has been destroyed but you are still trying to access i... | [
"When you're calling SceneManager.LoadScene(\"Zombie Game\") to reload your scene. This effectively destroys the objects in the scene which do not have a DontDestroyOnLoad attribute.\nIt is generally good practice to unsubscribe from events when an object is destroyed. This is because events are a type of delegate,... | [
0
] | [] | [] | [
"c#",
"unity3d"
] | stackoverflow_0074681063_c#_unity3d.txt |
Q:
fftshift c++ implemetation for openCV
I have already looked in this question
fftshift/ifftshift C/C++ source code
I'm trying to implement fftshift from matlab
this is the code from the matlab function for 1D array
numDims = ndims(x);
idx = cell(1, numDims);
for k = 1:numDims
m = size(x, k);
... | fftshift c++ implemetation for openCV | I have already looked in this question
fftshift/ifftshift C/C++ source code
I'm trying to implement fftshift from matlab
this is the code from the matlab function for 1D array
numDims = ndims(x);
idx = cell(1, numDims);
for k = 1:numDims
m = size(x, k);
p = ceil(m/2);
idx{k} = [p+1:m 1:... | [
"Ok, this thread is may be out of date in the meantime but maybe for other users.. Take a look at the samples: \n\nopencv/samples/cpp/dft.cpp (line 66 - 80)\n\nint cx = mag.cols/2;\nint cy = mag.rows/2;\n\n// rearrange the quadrants of Fourier image\n// so that the origin is at the image center\nMat tmp;\nMat q0(ma... | [
5,
2,
1,
1,
1,
0,
0
] | [
"In Matlab's implementation, the main code are the two lines:\nidx{k} = [p+1:m 1:p];\ny = x(idx{:});\n\nThe first one obtains the correct index order against the original one; then the second one assigns the output array according to the index order. Therefore, if you want to re-write Matlab's implementation withou... | [
-1
] | [
"c++",
"image_processing",
"matlab",
"opencv"
] | stackoverflow_0029226465_c++_image_processing_matlab_opencv.txt |
Q:
Angular Node.js CPanel Deployment
I am trying to deploy my Angular Universal using Node.js option in CPanel. My configuration is as follows:
Node.js Version: 12.9.0
Application Mode: Development
Application Root: public_html/ssr
Application URL: ssr
Application Startup File: main.js
It has managed to run npm inst... | Angular Node.js CPanel Deployment | I am trying to deploy my Angular Universal using Node.js option in CPanel. My configuration is as follows:
Node.js Version: 12.9.0
Application Mode: Development
Application Root: public_html/ssr
Application URL: ssr
Application Startup File: main.js
It has managed to run npm install and node_modules are now installed.... | [
"This post is old, but if anyone else is interested...\nPlease see this video for steps on how to deploy node.js via cPanel \"setup nodejs app\" module https://youtu.be/sIcy3q3Ib_s\n"
] | [
0
] | [] | [] | [
"angular",
"angular_universal",
"cpanel",
"node.js",
"npm"
] | stackoverflow_0062949543_angular_angular_universal_cpanel_node.js_npm.txt |
Q:
Error using SQS with multiple Laravel queue readers
I am using Laravel Jobs to read messages from an SQS queue (Laravel version 5.7)
Following Laravel indications I am using supervisor to run multiple queue:work processes at the same time.
All goes well until I get this SQS error related to the message availabilit... | Error using SQS with multiple Laravel queue readers | I am using Laravel Jobs to read messages from an SQS queue (Laravel version 5.7)
Following Laravel indications I am using supervisor to run multiple queue:work processes at the same time.
All goes well until I get this SQS error related to the message availability:
InvalidParameterValue (client): Value
... for paramet... | [
"I've seen this error intermittently in production too, where we run a good number of consumers for a single SQS queue. In our case, I'm pretty convinced that the error is due to SQS's at-least-once delivery semantics. Essentially, a message can be delivered twice or more on rare occasions.\nLaravel's queue worker ... | [
0,
0
] | [] | [] | [
"amazon_sqs",
"laravel",
"php"
] | stackoverflow_0054569337_amazon_sqs_laravel_php.txt |
Q:
PDF to txt python3
I'm trying to convert pdf file to txt.
`
import re
import PyPDF2
with open('123.pdf', 'rb') as pdfFileObj:
pdfreader = PyPDF2.PdfFileReader(pdfFileObj)
x = pdfreader.numPages
pageObj = pdfreader.getPage(x + 1)
text = pageObj.extractText()
file1 = open(f"C:\\Users\\honorr\\Des... | PDF to txt python3 | I'm trying to convert pdf file to txt.
`
import re
import PyPDF2
with open('123.pdf', 'rb') as pdfFileObj:
pdfreader = PyPDF2.PdfFileReader(pdfFileObj)
x = pdfreader.numPages
pageObj = pdfreader.getPage(x + 1)
text = pageObj.extractText()
file1 = open(f"C:\\Users\\honorr\\Desktop\\ssssssss\{re.sub('... | [
"You're setting x to the number of pages, but then trying to get page x + 1, which doesn't exist. Depending on how the library is implemented (I'm not familiar with PyPDF2), you may need to try pdfreader.getPage(x) or pdfreader.getPage(x - 1) to get it to work. This will only get the last page in the document thoug... | [
0
] | [] | [] | [
"pdf",
"pypdf2",
"txt"
] | stackoverflow_0074681138_pdf_pypdf2_txt.txt |
Q:
Understanding a code snippet in pine script
I'm new to pine-script. I'm trying to understand an indicator 'HalfTrend' by Alex Orekhov (everget) at TradingView.
I'm having hard time in understanding following snippet, may you please explain this:
if not na(trend[1]) and trend[1] != 1
Does the above line mean the ... | Understanding a code snippet in pine script | I'm new to pine-script. I'm trying to understand an indicator 'HalfTrend' by Alex Orekhov (everget) at TradingView.
I'm having hard time in understanding following snippet, may you please explain this:
if not na(trend[1]) and trend[1] != 1
Does the above line mean the following:
na(trend[1]) //check if trend[1] exist... | [
"Yes, your understanding is correct. na() will check if it is NaN. [1] refers to the previous value of the series.\nSince it refers to a historical value with [1], for the very first bar of the chart it will return na. Because there is no previous value yet. That's why that check is there for.\n//@version=5\nindica... | [
0,
0
] | [] | [] | [
"pine_script",
"pine_script_v4"
] | stackoverflow_0071231338_pine_script_pine_script_v4.txt |
Q:
How do I multiply tensors like this?
I am working on a project where I need to multiply 2 tensors which look like this. The first tensor has 5 matrices and the second one has 5 column vectors. I need to multiply these two to get the resultant tensor such that each element of that tensor is the column vector I get ... | How do I multiply tensors like this? | I am working on a project where I need to multiply 2 tensors which look like this. The first tensor has 5 matrices and the second one has 5 column vectors. I need to multiply these two to get the resultant tensor such that each element of that tensor is the column vector I get after multiplying the corresponding matrix... | [
"It seems like what you are trying to do is best done with torch.einsum which is a function allowing you to perform custom product-summation operations.\nSay first tensor is named t1 & second tensor is named t2, then to obtain a matrix-vector multiplication, resulting in a 5x5x2 shaped tensor, you should use the fo... | [
0,
0
] | [] | [] | [
"autograd",
"pytorch"
] | stackoverflow_0074680817_autograd_pytorch.txt |
Q:
Display a list with corresponding numbers for user to select
//PASSWORD Y/N LOOP
//Does not want to add password, will list stores websites and corresponding numbers
while (yesNo == 'n') {
//WEBSITE LIST MENU LOOP
//FIXME website num is exponentially increasing everytime no is entered.
... | Display a list with corresponding numbers for user to select | //PASSWORD Y/N LOOP
//Does not want to add password, will list stores websites and corresponding numbers
while (yesNo == 'n') {
//WEBSITE LIST MENU LOOP
//FIXME website num is exponentially increasing everytime no is entered.
for (i = 0; i < (websites.getwebList().size()); i++) {... | [
"\nwhen it loops they numbers will exponentially increase\n\nYou're incrementing websiteNum in the first for loop, but it never resets back to zero. Every time you enter that loop you're increasing it's value. It's not 'exponentially' increasing, but it always increasing without resetting back to zero.\n"
] | [
0
] | [] | [] | [
"java"
] | stackoverflow_0074679787_java.txt |
Q:
Creating a code verifier and challenge for PKCE auth on Spotify API in ReactJS
I'm trying to add Spotify auth to my single page react application following the doc from their api.
So far this is how I generate the codes based on solutions I found online:
const generateVerifier = () => {
return crypto.randomByt... | Creating a code verifier and challenge for PKCE auth on Spotify API in ReactJS | I'm trying to add Spotify auth to my single page react application following the doc from their api.
So far this is how I generate the codes based on solutions I found online:
const generateVerifier = () => {
return crypto.randomBytes(64).toString('hex');
}
const getChallenge = verifier => {
return crypto.crea... | [
"Try following this guide for generating code for generating code challenge and verifier\nHere are the important parts:\nGenerate Code Verifier\n// GENERATING CODE VERIFIER\nfunction dec2hex(dec) {\n return (\"0\" + dec.toString(16)).substr(-2);\n}\n\nfunction generateCodeVerifier() {\n var array = new Uint32Arra... | [
15,
1,
0
] | [] | [] | [
"javascript",
"oauth",
"pkce",
"reactjs",
"spotify"
] | stackoverflow_0063309409_javascript_oauth_pkce_reactjs_spotify.txt |
Q:
Search github file contents by filename
I am trying to identify use cases of a specific python package on github.
Is there a way you could search all requirements.txt files on repositories written in python for a string ?
A:
From the Web UI
In https://github.com/search, type :
django filename:requirements.txt l... | Search github file contents by filename | I am trying to identify use cases of a specific python package on github.
Is there a way you could search all requirements.txt files on repositories written in python for a string ?
| [
"From the Web UI\nIn https://github.com/search, type :\ndjango filename:requirements.txt language:python in:requirements.txt\n\nlike this :\n\nFrom Github API\nhttps://api.github.com/search/code?q=django+in:requirements.txt+filename:requirements.txt+language:python+org:openmicroscopy\n\nFor the Github API case, you... | [
4,
0
] | [] | [] | [
"github"
] | stackoverflow_0041858706_github.txt |
Q:
How/when to use expressions instead of returns in rust
I'm doing this advent of code in rust to learn it (started today with the rust book too since the language is becoming more interesting to me) and I'm having some doubts as of how to comply with rust style.
Just read in the book that in rust is more idiomatic ... | How/when to use expressions instead of returns in rust | I'm doing this advent of code in rust to learn it (started today with the rust book too since the language is becoming more interesting to me) and I'm having some doubts as of how to comply with rust style.
Just read in the book that in rust is more idiomatic to use an expression at the end of a function than a return ... | [
"With a lot of missing context and guessing, I assume that your question is as follows.\nYou had the code:\nfn get_top_three(current: i32, first: i32, second: i32, third: i32) -> (i32, i32, i32) {\n if current > first {\n return (current, first, second);\n } else if current > second {\n return (... | [
0
] | [] | [] | [
"expression",
"match",
"return",
"rust"
] | stackoverflow_0074680672_expression_match_return_rust.txt |
Q:
Firebase - emulators start but attempt to view hosting emulator throws error in log
On running firebase emulators:start, everything loads up correctly. I currently have an express web app deployed to firebase using cloud functions combined with firebase hosting, and my code is identical on my local machine. When I... | Firebase - emulators start but attempt to view hosting emulator throws error in log | On running firebase emulators:start, everything loads up correctly. I currently have an express web app deployed to firebase using cloud functions combined with firebase hosting, and my code is identical on my local machine. When I attempt to emulate it, I can access the hub but hosting throws the below error on an att... | [
"Fixed the problem! I updated my version of node using npm i node@latest and everything started working again just fine.\n"
] | [
0
] | [] | [] | [
"express",
"firebase",
"google_cloud_functions",
"google_cloud_platform",
"node.js"
] | stackoverflow_0074680610_express_firebase_google_cloud_functions_google_cloud_platform_node.js.txt |
Q:
Deployed on cPanel, how to avoid access to my app.js file by writing it after the link?
I deployed my app on cPanel. However, if you type 'mylink/'+app.js you have access to my app.js file and that goes for all other js files in my backend.
How can I revoke access to those files on cPanel without revoking access t... | Deployed on cPanel, how to avoid access to my app.js file by writing it after the link? | I deployed my app on cPanel. However, if you type 'mylink/'+app.js you have access to my app.js file and that goes for all other js files in my backend.
How can I revoke access to those files on cPanel without revoking access to all .js files?
Thanks
I tried going on Hotlink Protection and removing access to .js butt h... | [
"You need to set your app in a different folder than your domain name.\nPlease see this video for steps on how to deploy https://youtu.be/sIcy3q3Ib_s\n"
] | [
0
] | [] | [] | [
"cpanel",
"express",
"node.js"
] | stackoverflow_0074647262_cpanel_express_node.js.txt |
Q:
Show mouse hover info as annotation in a plotly R boxplot
I have several boxplots and I'd like to always show the information of their mouse hover events. I need that because I am generating pdfs of those charts.
This is a reproducible example:
library(plotly)
set.seed(1)
plot_ly(y = ~rnorm(500), type = "box", ho... | Show mouse hover info as annotation in a plotly R boxplot | I have several boxplots and I'd like to always show the information of their mouse hover events. I need that because I am generating pdfs of those charts.
This is a reproducible example:
library(plotly)
set.seed(1)
plot_ly(y = ~rnorm(500), type = "box", hoverinfo = 'y') %>%
layout(yaxis = list(hoverformat = '.2f'))
F... | [
"You can manually calculate the values that Plotly generates for you, then use annotations to add the text. Alternatively, you can use the values Plotly generated for you and use annotations to add the text. The only problem I foresee is that the text could overlap..for example if the lower fence and the minimum we... | [
0
] | [] | [] | [
"boxplot",
"plotly",
"r"
] | stackoverflow_0074668844_boxplot_plotly_r.txt |
Q:
Using a counter to find multiple occurences on same day from ID & date
I am trying find when a person has multiple occurences on the same day & when they do not.
My data looks something like this
data have;
input id date ;
datalines ;
1 nov10
1 nov15
2 nov11
2 nov11
2 nov14
3 nov12
4 nov17
4 nov19
4 nov19
etc...;
... | Using a counter to find multiple occurences on same day from ID & date | I am trying find when a person has multiple occurences on the same day & when they do not.
My data looks something like this
data have;
input id date ;
datalines ;
1 nov10
1 nov15
2 nov11
2 nov11
2 nov14
3 nov12
4 nov17
4 nov19
4 nov19
etc...;
I want to create a new variable to show when an occurence happens on the sa... | [
"Your IF/THEN logic is just a complicated way to do\nocc = 1 + not first.date;\n\nLooks like you want to instead test whether or not there are multiple observations per date.\nocc = 1 + not (first.date and last.date) ;\n\n"
] | [
0
] | [] | [] | [
"sas"
] | stackoverflow_0074680760_sas.txt |
Q:
Why is my program breaking when I add a void function to the main? It works without it
I have 2 functions + my main.
One of them is a void function that "prints out instructions"
The other is the one that actually does what I want it to do.
For some reason when the play function is by itself in the main it works j... | Why is my program breaking when I add a void function to the main? It works without it | I have 2 functions + my main.
One of them is a void function that "prints out instructions"
The other is the one that actually does what I want it to do.
For some reason when the play function is by itself in the main it works just fine, but as soon as I add the print instructions function, it breaks and I cannot figur... | [
"With the suggestions from UnholySheep & Martin James, I was able to get my code to work.\nHere is the working code:\n#include <stdio.h>\n#include <stdlib.h>\n#include <time.h>\n\nint playGame();\n\nvoid printInstructions()\n{\n printf(\"--------------\\n\");\n printf(\"- HOW TO WIN -\\n\");\n printf(\"---... | [
1
] | [] | [] | [
"c",
"for_loop",
"function",
"printf"
] | stackoverflow_0074681061_c_for_loop_function_printf.txt |
Q:
Get last 12 months based on the most recent dates in the file and not current date
How to get last 12 months based on the most recent dates in the file and not current date.
enter image description here
Most recent date is 2021-05-07
Thank you
This the query that I tried to run but there's no result because this q... | Get last 12 months based on the most recent dates in the file and not current date | How to get last 12 months based on the most recent dates in the file and not current date.
enter image description here
Most recent date is 2021-05-07
Thank you
This the query that I tried to run but there's no result because this query only take in consideration the current date.
`SELECT [Contact_Id]
,([Add_Date... | [
"You're looking to compare the date to the latest date in the table, less 12 months:\nwhere Add_Datetime > (\n select top(1) dateadd(month, -12, Add_Datetime)\n from [Group CH].dbo.CustomerData\n order by Add_Datetime desc\n);\n\n"
] | [
0
] | [] | [] | [
"date",
"sql",
"sql_server"
] | stackoverflow_0074681194_date_sql_sql_server.txt |
Q:
Keep only the three highest values in array of array in php
I have an array of 83 arrays (an array that I have a chunk in 83). I'm trying to keep only the three highest values of each array. All the numbers in each array are included between -1 and 1. There is necessarily a 1 in each array that I don't want to cou... | Keep only the three highest values in array of array in php | I have an array of 83 arrays (an array that I have a chunk in 83). I'm trying to keep only the three highest values of each array. All the numbers in each array are included between -1 and 1. There is necessarily a 1 in each array that I don't want to count in my three highest values.
Array
(
[0] =>... | [
"Your code seems to be almost correct. You are sorting the arrays in descending order, but you are not storing the result of array_slice in any variable. As a result, the changes made by array_slice are not being saved.\nHere is how you can fix the issue:\n// Sort the arrays in descending order\nfor ($i = 0; $i < s... | [
0,
0
] | [] | [] | [
"max",
"php",
"slice",
"sorting"
] | stackoverflow_0074679467_max_php_slice_sorting.txt |
Q:
jq - remove duplicate from array
i want to remove duplicates from array, here is input json
{
"abc": [
"five"
],
"pqr": [
"one",
"one",
"two",
"two",
"three",
"three",
"four",
"four"
],
"xyz": [
"one",
"one",
"two",
"two",
"four"
]
}
output I am ... | jq - remove duplicate from array | i want to remove duplicates from array, here is input json
{
"abc": [
"five"
],
"pqr": [
"one",
"one",
"two",
"two",
"three",
"three",
"four",
"four"
],
"xyz": [
"one",
"one",
"two",
"two",
"four"
]
}
output I am expecting is to remove duplicates from... | [
"unique can remove duplicates, but it automatically sorts the arrays, which may not be what you want.\njq '.[] |= unique'\n\n{\n \"abc\": [\n \"five\"\n ],\n \"pqr\": [\n \"four\",\n \"one\",\n \"three\",\n \"two\"\n ],\n \"xyz\": [\n \"four\",\n \"one\",\n \"two\"\n ]\n}\n\nDemo\nRetr... | [
1,
0
] | [] | [] | [
"jq"
] | stackoverflow_0074678678_jq.txt |
Q:
How can I update or edit my this feature without the URL being able to do server side request forgery
Hi I am currently having trouble with like the URL being able to change other person's data and am in need of help to prevent that for the security aspects in PHP. The idea behind is Only the Head Admin can Delete... | How can I update or edit my this feature without the URL being able to do server side request forgery | Hi I am currently having trouble with like the URL being able to change other person's data and am in need of help to prevent that for the security aspects in PHP. The idea behind is Only the Head Admin can Delete all these Employee Accounts.
I tried using sessions also which kind of works but like I couldn't get like ... | [] | [] | [
"To prevent unauthorized users from being able to modify other users' information, you can add a check in your code to verify that the user making the request is authorized to do so. In this case, it looks like only the Head Admin should be able to delete employee accounts, so you could add a check in the delete se... | [
-1
] | [
"html",
"php",
"session",
"sqlite"
] | stackoverflow_0074681222_html_php_session_sqlite.txt |
Q:
How to reorder a numpy array by giving each element a new index?
I want to reorder a numpy array, such that each element is given a new index.
# I want my_array's elements to use new_indicies's indexes.
my_array = np.array([23, 54, 67, 98, 31])
new_indicies = [2, 4, 1, 0, 1]
# Some magic using new_indicies at my_... | How to reorder a numpy array by giving each element a new index? | I want to reorder a numpy array, such that each element is given a new index.
# I want my_array's elements to use new_indicies's indexes.
my_array = np.array([23, 54, 67, 98, 31])
new_indicies = [2, 4, 1, 0, 1]
# Some magic using new_indicies at my_array
# Note that I earlier gave 67 and 31 the index 1 and since 31 i... | [
"To reorder the elements in a NumPy array according to a set of new indices, you can use the put() method.\n# Create an empty array of zeros with the same size as my_array\nreordered_array = np.zeros_like(my_array)\n\n# Move the elements in my_array to the indices specified in new_indices\nreordered_array.put(new_i... | [
1
] | [] | [] | [
"arrays",
"numpy",
"python"
] | stackoverflow_0074681288_arrays_numpy_python.txt |
Q:
Trying to find all last names starting with a letter
I'm working a project for school in T-SQL.
I have an Advisors table that is fully set up. I'm trying to update the Student table so that each StudentID is associated with an AdvisorID (referencing the Advisors table). The Student table is fully set up, minus the... | Trying to find all last names starting with a letter | I'm working a project for school in T-SQL.
I have an Advisors table that is fully set up. I'm trying to update the Student table so that each StudentID is associated with an AdvisorID (referencing the Advisors table). The Student table is fully set up, minus the AdvisorID column. Both tables have Name_Full, Name_First,... | [
"So I figured out what was wrong.\nThe code was working perfectly fine. BUT every Name_Last in Student started with a ' '.\nSo altering the code to:\nSELECT Name_Last\n FROM Student\n where Name_Last like ' R%'\n\nWorked perfectly. Thank you for your suggestions though!\n",
"It is better to trim (remove spa... | [
1,
0
] | [
"The missing part in your statement is the name which is the first word of a full name.\nFinds a string that starts with 'R'\nSELECT Name_Last\n FROM Student\n WHERE Name_Last IN ('R%')\n\nFinds a string that includes ' R'\nSELECT Name_Last\n FROM Student\n WHERE Name_Last LIKE '% R%'\n\nHope this helps... | [
-1
] | [
"ssms",
"string",
"tsql"
] | stackoverflow_0074669469_ssms_string_tsql.txt |
Q:
Chrome Ignoring Cache-Control no-store directive?
I have a web-app I'm allowing users to add scripts to. These scripts are written in JavaScript and run in the user's browser. When developing new scripts to run locally, I've added a button to the app that allows you to load it from a locally running web server, (i... | Chrome Ignoring Cache-Control no-store directive? | I have a web-app I'm allowing users to add scripts to. These scripts are written in JavaScript and run in the user's browser. When developing new scripts to run locally, I've added a button to the app that allows you to load it from a locally running web server, (i.e. so you'd click on it and enter http://path.to.my.pc... | [
"In order to prevent the browser from caching the scripts that are loaded from your local web server, you can try setting the Expires header to a date in the past. This will tell the browser that the resource has already expired and should not be cached.\nHere is an example of how you can do this using the setHeade... | [
0,
0,
0
] | [] | [] | [
"express",
"google_chrome",
"javascript"
] | stackoverflow_0074657168_express_google_chrome_javascript.txt |
Q:
nested routes are not working when using react router v6.4
i'm trying to implement route nesting and here is my App component
export default function App() {
return (
<BrowserRouter>
<Routes>
<Route path="signup" element={<Signup />}>
<Route path="avatar" element={<Avatar />... | nested routes are not working when using react router v6.4 | i'm trying to implement route nesting and here is my App component
export default function App() {
return (
<BrowserRouter>
<Routes>
<Route path="signup" element={<Signup />}>
<Route path="avatar" element={<Avatar />} />
</Route>
</Routes>
</BrowserRouter>... | [] | [] | [
"Do you have an <Outlet /> component inside the <Signup /> component?\nYour avatar component should be displayed there.\nhttps://www.robinwieruch.de/react-router-nested-routes/\n"
] | [
-1
] | [
"react_router",
"react_router_dom",
"reactjs"
] | stackoverflow_0074681204_react_router_react_router_dom_reactjs.txt |
Q:
Plotting Agglomerative Hierarchical Clustering with complete linkage
I need to do a visual rappresentation of Hierarchical clustering using Complete Linkage by plotting an dendogram.
My data.frame is obtained from eurostat database (CP00 - HICP) and after some cleaning looks like:
dput(head(CP00))
structure(list... | Plotting Agglomerative Hierarchical Clustering with complete linkage | I need to do a visual rappresentation of Hierarchical clustering using Complete Linkage by plotting an dendogram.
My data.frame is obtained from eurostat database (CP00 - HICP) and after some cleaning looks like:
dput(head(CP00))
structure(list(id = c("CP00", "CP00", "CP00", "CP00", "CP00",
"CP00"), country = c("Aus... | [
"Do you want to plot 7344 entities into the dendrogram or only several countries?\nIf several countries: for dist function, you have CP00 in a long format (1 value per line per object), however, the dist function needs a wide format (1 object per row, multiple properties as columns; see https://www.statology.org/lo... | [
0
] | [] | [] | [
"hierarchical_clustering",
"r"
] | stackoverflow_0074675701_hierarchical_clustering_r.txt |
Q:
require working but import not working
I have a actions.js file that is exporting actions like this
export var toggleTodo = (id) => {
return {
type: 'TOGGLE_TODO',
id
}
}
but when i import it using es6 import i get error
Uncaught TypeError: Cannot read property 'toggleTodo' of undefined
but when i re... | require working but import not working | I have a actions.js file that is exporting actions like this
export var toggleTodo = (id) => {
return {
type: 'TOGGLE_TODO',
id
}
}
but when i import it using es6 import i get error
Uncaught TypeError: Cannot read property 'toggleTodo' of undefined
but when i require it using common js require it works ju... | [
"There are several different forms of import, each doing slightly different thing. The one you are using\nimport actions from 'actions' //not working\n\nis for importing default export from actions module. You can see complete list in MDN javascript reference.\nIt's not working because your action.js module probab... | [
12,
0
] | [] | [] | [
"es6_class",
"es6_module_loader",
"es6_modules"
] | stackoverflow_0040762352_es6_class_es6_module_loader_es6_modules.txt |
Q:
add random integer as clusterProperty in maplibre/mapbox gl-js
i want to add a random number as clusterProperty in maplibre/mapbox.
So far I have only found methods that use existing cluster properties to create new cluster properties by subtracting, adding, multiplying... the old values.
I just want to add a rand... | add random integer as clusterProperty in maplibre/mapbox gl-js | i want to add a random number as clusterProperty in maplibre/mapbox.
So far I have only found methods that use existing cluster properties to create new cluster properties by subtracting, adding, multiplying... the old values.
I just want to add a random number, let's say between 1 and 25, as a property for every clust... | [
"It sounds like you're looking for a way to add a property to each cluster in a Mapbox map that is generated using a random number between 1 and 25. I'm not familiar with Mapbox, but it looks like the clusterProperties option of the GeoJSONSource object may be what you're looking for. You could try using this optio... | [
0
] | [] | [] | [
"mapbox",
"mapbox_gl_js",
"maplibre_gl"
] | stackoverflow_0074681255_mapbox_mapbox_gl_js_maplibre_gl.txt |
Q:
How to know the exact position of a camera viewbox in Qt?
I am working with OpenGL in python and trying to attach 2d images to a canvas (the images will change according to a certain frequence).
I managed to achieve that but to continue my task i need two things:
the major problem: I need to get the image positio... | How to know the exact position of a camera viewbox in Qt? | I am working with OpenGL in python and trying to attach 2d images to a canvas (the images will change according to a certain frequence).
I managed to achieve that but to continue my task i need two things:
the major problem: I need to get the image position (or bounds), sorry if i don't have the correct term, i am new... | [
"Do you want to know the coordinates of the picture in the viewport (the window), or do you want the coordinates of the picture on the canvas? Vispy actually puts the image at (0,0) by default inside the Vispy canvas. When you move around the canvas you actually aren't moving the canvas around, you are just moving ... | [
0
] | [] | [] | [
"camera",
"pyqt",
"python",
"qt",
"vispy"
] | stackoverflow_0074629482_camera_pyqt_python_qt_vispy.txt |
Q:
I require converting this for loop into a recursion function
rate, cashflows = 0.05,[-1100,300,450,800]
def npv_for_loop(rate,cashflows):
NPV=0
for i in range(len(cashflows)):
NPV+=cashflows[i]/(1+rate)**i
print(round(NPV,3))
i generally have no idea how a recursion works and would really appreciate ... | I require converting this for loop into a recursion function | rate, cashflows = 0.05,[-1100,300,450,800]
def npv_for_loop(rate,cashflows):
NPV=0
for i in range(len(cashflows)):
NPV+=cashflows[i]/(1+rate)**i
print(round(NPV,3))
i generally have no idea how a recursion works and would really appreciate if anybody can help me.
| [
"Here is an example of how you could convert the given for loop into a recursive function:\ndef npv(rate, cashflows, i=0, NPV=0):\n # Stop the recursion when we reach the end of the cash flows\n if i == len(cashflows):\n return NPV\n\n # Compute the present value of the ith cash flow\n present_va... | [
1,
0
] | [] | [] | [
"for_loop",
"python",
"recursion"
] | stackoverflow_0074681195_for_loop_python_recursion.txt |
Q:
wich algorythm php to create a secret santa program
I'm trying to make a draw for a secret santa.
I collect in a table the information of the person and the name of the person on whom it should not fall (to avoid couples).
However during my php loop I can't take into account my exclusions
`
foreach ($supplier as $... | wich algorythm php to create a secret santa program | I'm trying to make a draw for a secret santa.
I collect in a table the information of the person and the name of the person on whom it should not fall (to avoid couples).
However during my php loop I can't take into account my exclusions
`
foreach ($supplier as $sup){
$exclude = $sup['blacklist'];
$data = $reci... | [
" shuffle($supplier);\n shuffle($recipient);\n // dump($supplier, $recipient);\n\n $result = [];\n\n foreach ($supplier as $sup){\n $assign = false;\n dump($sup);\n foreach ($recipient as $key=>$recip){\n dump($recip['surname'... | [
0
] | [] | [] | [
"algorithm",
"php",
"symfony"
] | stackoverflow_0074681039_algorithm_php_symfony.txt |
Q:
Cannot find module "@sendgrid/mail"
I'm using the Sendgrid mail package (https://www.npmjs.com/package/@sendgrid/mail) to send a test email using the Twilio Serveless functions. I have configured the module, specifying the correct version and module in the configure dashboard here. https://www.twilio.com/console/f... | Cannot find module "@sendgrid/mail" | I'm using the Sendgrid mail package (https://www.npmjs.com/package/@sendgrid/mail) to send a test email using the Twilio Serveless functions. I have configured the module, specifying the correct version and module in the configure dashboard here. https://www.twilio.com/console/functions/configure but when I deploy my f... | [
"the Twilio GUI Console based Functions are separate and distinct from the API based functions. You can find more detail here.\nBeta limitations, known issues and limits\nYou can add the npm module(s) using npm install , as detailed here.\nTwilio Serverless Toolkit - Deploy a Project\n\"Any dependency that is liste... | [
3,
0,
0
] | [] | [] | [
"twilio",
"twilio_functions"
] | stackoverflow_0058786287_twilio_twilio_functions.txt |
Q:
TextInput react-native-paper remove label on focus
I am using the TextInput of React Native Paper (https://callstack.github.io/react-native-paper/text-input.html)
Is there a way to not show the label on the border line when we are focusing on a TextInput?
<TextInput
mode="outlined"
... | TextInput react-native-paper remove label on focus | I am using the TextInput of React Native Paper (https://callstack.github.io/react-native-paper/text-input.html)
Is there a way to not show the label on the border line when we are focusing on a TextInput?
<TextInput
mode="outlined"
label="Email"
value={email}
... | [
"The label \"Email\" in black in your picture appears to come from another component not included in your code snippet.\nIf you wish to keep the \"Email\" label in black, remove the \"Email\" label in red, but retain the outlined style of the TextInput, you can simply remove the label key of the component:\n<TextIn... | [
0
] | [] | [] | [
"react_native",
"react_native_paper",
"textinput"
] | stackoverflow_0074681199_react_native_react_native_paper_textinput.txt |
Q:
Uncaught ( in promise ) AxiosError: Request failed with status code 403
The goal: get 'suggested videos' data using Youtube v3 RapidAPI for my React + Vite.js project. But, an error occurs, and I don’t know what to do, the file. env in the root folder, with the syntax all correct ( see photos below ). Maybe the pr... | Uncaught ( in promise ) AxiosError: Request failed with status code 403 | The goal: get 'suggested videos' data using Youtube v3 RapidAPI for my React + Vite.js project. But, an error occurs, and I don’t know what to do, the file. env in the root folder, with the syntax all correct ( see photos below ). Maybe the problem is in process.env. but I don’t know what exactly is. All dependencies i... | [
"You can access env variable by\nconst envValue = process.env.REACT_APP_RAPID_API_KEY;\n\ninstead of process.env.NODE_ENV.REACT_APP_RAPID_API_KEY.\nprocess.env.NODE_ENV is a string type, so you get the type error when accessing REACT_APP_RAPID_API_KEY from string value.\nAdditionally, process.env.NODE_ENV indicates... | [
0
] | [] | [] | [
"axios",
"rapidapi",
"reactjs",
"vite"
] | stackoverflow_0074680875_axios_rapidapi_reactjs_vite.txt |
Q:
How to delay ajax using jquery
I need to access an API but I dont want to shoot with 100 requests at the same time so I want to make 1 request per second so I write:
$.each(added_collections, function(index, collection) {
$.each(collection, function(index1, page) {
$.each(page, function(index2, produ... | How to delay ajax using jquery | I need to access an API but I dont want to shoot with 100 requests at the same time so I want to make 1 request per second so I write:
$.each(added_collections, function(index, collection) {
$.each(collection, function(index1, page) {
$.each(page, function(index2, product) {
setT... | [
"I'm not sure what data you need to be in that ajax call, but here's a way to throttle in the manner you're after. Build the array of indexes (products) first. Then use a separate helper function to call the ajax and call itself again recursively when complete.\nlet allThings = [];\n\n$.each(added_collections, func... | [
0,
0
] | [] | [] | [
"ajax",
"javascript",
"jquery"
] | stackoverflow_0074680835_ajax_javascript_jquery.txt |
Q:
Override javascript property with getter/setter while still accessing underlying property
In service of building an API polyfill I'd like to override a property (in this case width and height) of an element with getters and setters to catch changes to the value and modify it before passing it on to the underlying ... | Override javascript property with getter/setter while still accessing underlying property | In service of building an API polyfill I'd like to override a property (in this case width and height) of an element with getters and setters to catch changes to the value and modify it before passing it on to the underlying element. Ideally this process would also be reversible. Something along the lines of this code ... | [
"Thanks to Bergi I figured out that Object.getOwnPropertyDescriptor is exactly what I want. I had tried it previously but missed that the property that I had to go to the object's __proto__ to find the property I was looking for. (Your milage may vary depending on the property you're replacing.) This is the code th... | [
3,
0
] | [] | [] | [
"javascript"
] | stackoverflow_0035493778_javascript.txt |
Q:
How can I enable node.js application logs on from cpanel?
I have a node.js application that sends email using nodemailer. It is working fine from localhost but when I try it from server I can't receive any mail.
Since, other activities of application are working fine means I assumed nodemailer is installed proper... | How can I enable node.js application logs on from cpanel? | I have a node.js application that sends email using nodemailer. It is working fine from localhost but when I try it from server I can't receive any mail.
Since, other activities of application are working fine means I assumed nodemailer is installed properly on server. I tried on both ways using host as my server and ... | [
"Unfortunately there is no easy way to access node's logs on a cpanel server as far as I know.\nWhat I usually do is I set up log4js to write logs to a file:\nconst log4js = require('log4js');\n\nlog4js.configure({\n appenders: { everything: { type: 'file', filename: 'logs.log' } },\n categories: { default: { app... | [
3,
2,
0,
0
] | [] | [] | [
"cpanel",
"error_logging",
"node.js"
] | stackoverflow_0056200795_cpanel_error_logging_node.js.txt |
Q:
how can I inject gradle ext properties
I am trying to pass project version and compilation time to my Quarkus project via build.gradle and GradleExtraProperties.
I have in my gradle.build file:
version '0.0.0-SNAPSHOT'
ext {
buildTime = new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(new Da... | how can I inject gradle ext properties | I am trying to pass project version and compilation time to my Quarkus project via build.gradle and GradleExtraProperties.
I have in my gradle.build file:
version '0.0.0-SNAPSHOT'
ext {
buildTime = new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(new Date())
}
and in my Java source:
@ConfigPr... | [
"The following worked for me:\n@ConfigProperty(name = \"buildTime\", defaultValue=\"defaultValue\")\nString buildTime;\n\n",
"The answer was simple and much more embarrassing: If one runs Quarkus in dev mode, Gradle does not build the project.\nAfter I run gradew build everything was just fine.\nSMH\n"
] | [
1,
0
] | [] | [] | [
"gradle",
"java",
"microprofile",
"quarkus"
] | stackoverflow_0074681081_gradle_java_microprofile_quarkus.txt |
Q:
Why might Wireshark and NodeJS disagree about a packet's contents?
I'm working with raw-socket (a node module for sending raw data out on the network) and playing with their Ping example.
I have Wireshark set up to monitor traffic. I can see my ICMP packet go out, and a response comes back.
Here's where things get... | Why might Wireshark and NodeJS disagree about a packet's contents? | I'm working with raw-socket (a node module for sending raw data out on the network) and playing with their Ping example.
I have Wireshark set up to monitor traffic. I can see my ICMP packet go out, and a response comes back.
Here's where things get strange.
Wireshark shows the following packet:
IP: 4500003c69ea000040... | [
"This is due to a FreeBSD bug (feature?) which subtracts the length of the IP header from the IP length header field and also flips it to host byte order.\nhttps://cseweb.ucsd.edu//~braghava/notes/freebsd-sockets.txt\n"
] | [
1
] | [] | [] | [
"networking",
"node.js"
] | stackoverflow_0074448657_networking_node.js.txt |
Q:
What is a Simple Example for using the Boost Graph Library
I am trying to use the BGL, I find the documentation precise but lacks more examples for simple cases. My goal is described below (after reading the documentation I still couldn't do this):
struct Vertex
{
double m_d;
std::size_t m_id;
};
//or
st... | What is a Simple Example for using the Boost Graph Library | I am trying to use the BGL, I find the documentation precise but lacks more examples for simple cases. My goal is described below (after reading the documentation I still couldn't do this):
struct Vertex
{
double m_d;
std::size_t m_id;
};
//or
struct Vertex
{
double m_d;
std::size_t id() const;
};
Go... | [
"\n\n\nA directed graph G\n\nStraight-away:\nstruct Vertex {\n double m_d = 0;\n size_t m_id = -1;\n // or std::size_t id() const;\n};\n\nstruct Edge {\n double cost = 0;\n};\n\nusing Graph =\n boost::adjacency_list<boost::vecS, boost::vecS, boost::bidirectionalS, Vertex, Edge>;\n\n\n(what is the di... | [
3
] | [] | [] | [
"boost",
"c++",
"graph"
] | stackoverflow_0074680998_boost_c++_graph.txt |
Q:
Graph drawing in YASM 8086
I don't know if anyone will be able to help me, but I will try to explain my problem as clearly, as possible. I am learning 8086 FPU with YASM. I want to draw y = cos(x^2+x+1) This is how this graph looks like. I am doing it in DosBox, and I am emulating 8086 processor.
My problem: How t... | Graph drawing in YASM 8086 | I don't know if anyone will be able to help me, but I will try to explain my problem as clearly, as possible. I am learning 8086 FPU with YASM. I want to draw y = cos(x^2+x+1) This is how this graph looks like. I am doing it in DosBox, and I am emulating 8086 processor.
My problem: How to normalize graph's(red) ratio, ... | [
"The axes are the easy part\nSince you are working on a graphics screen that has a resolution of 320 x 200, the X coordinates range from 0 to 319 and the Y coordinates range from 0 to 199. Your code erroneously outputs in X's of 320 and y's of 200 and you don't use the X's of 0 or the Y's of 0.\n xor di, di ... | [
1
] | [] | [] | [
"assembly",
"fpu",
"graph",
"x86",
"yasm"
] | stackoverflow_0074640974_assembly_fpu_graph_x86_yasm.txt |
Q:
Using cell input into function and ovewriting result into result in same cell in Google Sheet
In Google Sheet, I would like to take the input of a cell, make a calculation, and display the result in the same cell in a different format. This would likely always be a percentage value that I would use conditional for... | Using cell input into function and ovewriting result into result in same cell in Google Sheet | In Google Sheet, I would like to take the input of a cell, make a calculation, and display the result in the same cell in a different format. This would likely always be a percentage value that I would use conditional formatting to color the cell to provide a 'dashboard' view of statistics.
Example would be usage stati... | [
"Here's a general example that should give you an idea of how to manipulate the cells, formats and values in Sheets:\nfunction onEdit(e) {\n var ss = SpreadsheetApp.getActiveSpreadsheet();\n var cell = ss.getActiveSelection();\n var cell_input = cell.getValue();\n var divisor = cell.offset(-1, 0)\n\n if (e.ran... | [
0,
0
] | [] | [] | [
"google_apps_script",
"google_sheets",
"google_sheets_formula"
] | stackoverflow_0074657407_google_apps_script_google_sheets_google_sheets_formula.txt |
Q:
Problem using C. Program works then acts differently for unknown reason
So in my program I retrieve a command line argument (must be 26 characters with no duplicates) which is used kind of like a rubric for a cypher or something and all these letters are put into an array (i know im not doing it super efficiently)... | Problem using C. Program works then acts differently for unknown reason | So in my program I retrieve a command line argument (must be 26 characters with no duplicates) which is used kind of like a rubric for a cypher or something and all these letters are put into an array (i know im not doing it super efficiently).
Following this I prompt for a user to write something and that sentence wil... | [
"here you have created zero size arrays\nchar letters[] = {};\nchar word[] = {};\n\nyou need to make them larger. I guess you need\nchar letters[26] = {};\nchar word[50] = {};\n\nnot quite sure what max size you need tho\n"
] | [
0
] | [] | [] | [
"arrays",
"c",
"for_loop"
] | stackoverflow_0074681306_arrays_c_for_loop.txt |
Q:
How can you add a subtitle track dynamically to a video.js video player
That's pretty much it; I need to change the subtitles to the theater of a webpage and if possible, even not have them at all, but mostly I wanna change the subtitles of a videojs player. I could show you the website but don't think it's necess... | How can you add a subtitle track dynamically to a video.js video player | That's pretty much it; I need to change the subtitles to the theater of a webpage and if possible, even not have them at all, but mostly I wanna change the subtitles of a videojs player. I could show you the website but don't think it's necessary. I've tried:
videojs(theater_video, {tracks: `<track kind='subtitles' src... | [
"To do this, you will need to use the addTextTrack method provided by the Video.js player. This method takes a few arguments, including the kind of text track you want to add (in this case, subtitles), the label for the track, the language of the track, and the src of the track's text file.\nHere is an example of h... | [
1
] | [] | [] | [
"html",
"javascript",
"subtitle",
"video.js"
] | stackoverflow_0074681006_html_javascript_subtitle_video.js.txt |
Q:
import statement not working in JavaScript code
Hello I am a new programmer, recently I started coding in react but I have this problem with my JavaScript code. Import is not working.
import React from 'react';
import './App.css';
import { hello } from '/components/hello.js';
function App() {
return (
<div ... | import statement not working in JavaScript code | Hello I am a new programmer, recently I started coding in react but I have this problem with my JavaScript code. Import is not working.
import React from 'react';
import './App.css';
import { hello } from '/components/hello.js';
function App() {
return (
<div className="App">
<header>
<p>
<he... | [
"Change this:\n import React from 'react';\n\n export default function Hello(){\n return <h1>Hello user</h1>;\n}\n\nTo this:\n import React from 'react';\n\n export function Hello(){\n return <h1>Hello user</h1>;\n}\n\nIf you want to leave it as a default function then import it like this instead:... | [
2,
1,
0
] | [] | [] | [
"javascript",
"reactjs"
] | stackoverflow_0064430454_javascript_reactjs.txt |
Q:
Cannot deploy Firebase Cloud Function in flutter
When i try to deploy my function i get a lot of error. This is a brand new flutter install and firebase init with Typescript.
Error :
node_modules/@types/express-serve-static-core/index.d.ts:99:68 - error TS1110: Type expected.
99 type RemoveTail<S extends string,... | Cannot deploy Firebase Cloud Function in flutter | When i try to deploy my function i get a lot of error. This is a brand new flutter install and firebase init with Typescript.
Error :
node_modules/@types/express-serve-static-core/index.d.ts:99:68 - error TS1110: Type expected.
99 type RemoveTail<S extends string, Tail extends string> = S extends `${infer P}${Tail}` ... | [
"// It looks like there is an issue with the TypeScript definitions for the express-\n// serve-static-core package. This could be caused by an outdated or incorrect version of the package being installed.\n// To fix this, try running the following commands:\n\nRemove the existing node_modules folder:\nrm -rf node_m... | [
1
] | [] | [] | [
"firebase",
"flutter",
"google_cloud_functions",
"typescript"
] | stackoverflow_0074620232_firebase_flutter_google_cloud_functions_typescript.txt |
Q:
Flutter - Isar schema is not defined
I have decided to use Isar database in my next project and I find it much helpful when dealing with local data.
I followed the quickstart guide in its website. I added dependencies. Annotated the contact class. Ran code generator. But at fourth step, I have problem creating sch... | Flutter - Isar schema is not defined | I have decided to use Isar database in my next project and I find it much helpful when dealing with local data.
I followed the quickstart guide in its website. I added dependencies. Annotated the contact class. Ran code generator. But at fourth step, I have problem creating schema while creating Isar instance.
initIsar... | [
"For completeness of response:\nRun (error? look at it, it likely say to remove isar from the first command)\nflutter pub add isar isar_flutter_libs\nflutter pub add -d isar_generator build_runner\nflutter pub run build_runner build # Run every update of the collection\n\nExample collection:\n@Collection(accessor: ... | [
0,
0
] | [
"Hello Zahid If you want to add local db in your next flutter app there are various packgaes on https://pub.dev.\nI would highly recomend you to go start with https://pub.dev/packages/floor it is easy to learn light weight to use..\nTry this you would loved it.. and how to implement you can google it and here is a ... | [
-1
] | [
"flutter",
"flutter_packages",
"isar"
] | stackoverflow_0071062256_flutter_flutter_packages_isar.txt |
Q:
Selection in DataGridView does not work after CellPaintEvent
I have a Datagridview. I need to use a CellPainting Event to customize the appereance of my DataGridview. I used the code of the msd documentation:
MSD Documentation
Evrything works perfect, i was able to customize my Datagridview like i needed to.
But t... | Selection in DataGridView does not work after CellPaintEvent | I have a Datagridview. I need to use a CellPainting Event to customize the appereance of my DataGridview. I used the code of the msd documentation:
MSD Documentation
Evrything works perfect, i was able to customize my Datagridview like i needed to.
But the only thing that is not working anymore ist the selection of a R... | [
"from dr.null i built the following code:\n// checks if cell is selected. if so, paint the background with the selectionbackgroundcolor. \nif ((e.State & DataGridViewElementStates.Selected) == DataGridViewElementStates.Selected)\n{\n var selectedbrush = new SolidBrush(e.CellStyle.SelectionBackColor);\n e.Graphi... | [
2
] | [] | [] | [
"c#",
"datagridview",
"paintevent",
"winforms"
] | stackoverflow_0074680869_c#_datagridview_paintevent_winforms.txt |
Q:
same flutter project but different git repository
I have the same flutter project but I want two different apps from the same project because the client wants some minor changes but the other client didn’t. Also, both client wants their specific apps on the play store and app store as well and requested code as we... | same flutter project but different git repository | I have the same flutter project but I want two different apps from the same project because the client wants some minor changes but the other client didn’t. Also, both client wants their specific apps on the play store and app store as well and requested code as well. I want to copy my existing project so I can match t... | [
"You can link the same project to two different repositories and push to or pull from anyone you want at any time.\ngit remote add remoteOne <repository address 1>\n\ngit remote add remoteTwo <repository address 2>\n\nSo, as you proceed, you can do git push remoteOne or git push remotewo after you commit your prog... | [
0
] | [] | [] | [
"dart",
"flutter",
"git"
] | stackoverflow_0073219267_dart_flutter_git.txt |
Q:
flutter box won't save the data
I am trying to store logged user data in Hive storage but my user box return null
Code
main.dart
Future main() async {
WidgetsFlutterBinding.ensureInitialized();
await Hive.initFlutter();
Hive.registerAdapter(UsermodelAdapter());
await Hive.openBox<Usermodel>('user');
runA... | flutter box won't save the data | I am trying to store logged user data in Hive storage but my user box return null
Code
main.dart
Future main() async {
WidgetsFlutterBinding.ensureInitialized();
await Hive.initFlutter();
Hive.registerAdapter(UsermodelAdapter());
await Hive.openBox<Usermodel>('user');
runApp(MyApp());
}
login.dart
After use... | [
"Using the add() to store your data in a Hive box, will give it an incremental index as it's key, so you can imagine that your Hive box is like a list, so this:\nbox.add(data); will add data to the box with a 0 index since it's the first and only element in the box.\nbox.get('name'); // will return null because tha... | [
0
] | [] | [] | [
"flutter",
"flutter_hive"
] | stackoverflow_0067865747_flutter_flutter_hive.txt |
Q:
Adding a box on top of a divider
I've made a divider for my site and it works perfectly! I'm just having trouble with adding a little box on top of my divider as shown in the picture, any help would be appreciated!
.divider {
width: 2px;
background: linear-gradient(90deg, rgba(6,144,45,1) 0%, rgba(6,144,4... | Adding a box on top of a divider | I've made a divider for my site and it works perfectly! I'm just having trouble with adding a little box on top of my divider as shown in the picture, any help would be appreciated!
.divider {
width: 2px;
background: linear-gradient(90deg, rgba(6,144,45,1) 0%, rgba(6,144,45,0.0032387955182072714) 87%);
he... | [
"You can achieve this by using the pseudo-element ::before.\n\n\n.divider::before {\n content: '';\n display: block;\n position: relative;\n background-color: black;\n width: 8px;\n height: 8px;\n top: 0;\n left: -2px;\n}\n\n.divider {\n background-color: black;\n width: 4px;\n height: 60px;\n}\n<div cla... | [
1
] | [] | [] | [
"css",
"html"
] | stackoverflow_0074681206_css_html.txt |
Q:
Cumulative sum from the beginning of a stream in Spark
I have to compute a cumulative sum on a value column by group from the beginning of the time series with a daily output.
If I do with a batch, it should be something like this:
val columns = Seq("timestamp", "group", "value")
val data = List(
(Instant.parse(... | Cumulative sum from the beginning of a stream in Spark | I have to compute a cumulative sum on a value column by group from the beginning of the time series with a daily output.
If I do with a batch, it should be something like this:
val columns = Seq("timestamp", "group", "value")
val data = List(
(Instant.parse("2020-01-01T00:00:00Z"), "Group1", 0),
(Instant.parse("20... | [
"I didn't find any solution using the high-level functions. For example, it is not possible to add another groupBy over the main aggregation agg(functions.sum('value).as(\"agg\"), functions.last('timestamp).as(\"ts\") to get the daily report.\nAfter many experiments, I switched to the low level functions. The most ... | [
0
] | [] | [] | [
"apache_spark",
"apache_spark_sql",
"scala",
"spark_streaming"
] | stackoverflow_0074648128_apache_spark_apache_spark_sql_scala_spark_streaming.txt |
Q:
How to target latest minor Azure Function Runtime Version locally?
What do I have to do to get the latest Function Runtime Version running locally?
I'm developing isolated v4 app with .NET 6. Version 4.15.0 was released a week ago. Source. But when I run the project, it is using v4.13.0.19486.
I've tried to explic... | How to target latest minor Azure Function Runtime Version locally? | What do I have to do to get the latest Function Runtime Version running locally?
I'm developing isolated v4 app with .NET 6. Version 4.15.0 was released a week ago. Source. But when I run the project, it is using v4.13.0.19486.
I've tried to explicitly set the version in app settings with the FUNCTIONS_EXTENSION_VERSIO... | [
"The local version would be the one that is part of the local version of Azure Functions Tools. The best way to test a particular minor version would be to use the docker container for the same.\nHere are the tags available for you to choose from.\n"
] | [
0
] | [] | [] | [
"azure",
"azure_functions",
"azure_functions_core_tools"
] | stackoverflow_0074616912_azure_azure_functions_azure_functions_core_tools.txt |
Q:
How do you combine the data from two tables
create table table1 (
header bit,
[type] char(1),
Intype varchar(3),
agrid int,
affid int,
inno varchar(10),
amount int
);
create table table2 (
header bit,
[type] char(1),
Intype varchar(3),
agrid int,
affid int,
inno... | How do you combine the data from two tables | create table table1 (
header bit,
[type] char(1),
Intype varchar(3),
agrid int,
affid int,
inno varchar(10),
amount int
);
create table table2 (
header bit,
[type] char(1),
Intype varchar(3),
agrid int,
affid int,
inno varchar(10),
amount int
);
Scenario 1:
inse... | [
"You can try to sort then, by adding more columns\nthe main part is that both get a row_number that can join table1 and table1, the constant sorter is necessary as header is binary and can only handle two different tables, if you have more, it will be useful\nTo get the right order for amount, you need an aditiona... | [
0
] | [] | [] | [
"sql",
"sql_server",
"tsql"
] | stackoverflow_0074680993_sql_sql_server_tsql.txt |
Q:
connect to a database from a prestashop module
the module can't connect with the database.
I have a prestashop module that has to do a task with a database when this hook is launched: hookActionPaymentConfirmation. But I can't do anything, I don't know if it's a problem with the connection or with the query. This ... | connect to a database from a prestashop module | the module can't connect with the database.
I have a prestashop module that has to do a task with a database when this hook is launched: hookActionPaymentConfirmation. But I can't do anything, I don't know if it's a problem with the connection or with the query. This is the code of the function of the hookActionPayment... | [
"i've already solved.It was this line missing: $campoid = Configuration::get('CAMPOID', null);\n"
] | [
0
] | [] | [] | [
"mysql",
"prestashop",
"prestashop_1.7",
"prestashop_modules"
] | stackoverflow_0074635194_mysql_prestashop_prestashop_1.7_prestashop_modules.txt |
Q:
Php lengthy if statements and permutations
Is there any method to simplify a lengthy if statement such as below. Even Switch case is very lengthy:
$day1
$day2
if ($day1 ==‘Monday’ && $day2 ==‘Monday’) {
//code
}
elseif ($day1 ==‘Monday’ && $day2 ==‘Tuesday’) {
// code
}
elseif ($day1 == ‘Monday’ && $day2 == ‘Wedn... | Php lengthy if statements and permutations | Is there any method to simplify a lengthy if statement such as below. Even Switch case is very lengthy:
$day1
$day2
if ($day1 ==‘Monday’ && $day2 ==‘Monday’) {
//code
}
elseif ($day1 ==‘Monday’ && $day2 ==‘Tuesday’) {
// code
}
elseif ($day1 == ‘Monday’ && $day2 == ‘Wednesday’) {
//code
}
…covering all possible combi... | [
"To be honest, I think you're looking at it a bit too narrow-minded. You have laravel at your disposal and you might as well do this kind of stuff in your Model. I expect your input days ($day1, $day2) are not day of week inputs, but actual dates (like '2022-11-30').\nYou could add something like this to the Model:... | [
0
] | [] | [] | [
"php"
] | stackoverflow_0074674645_php.txt |
Q:
Terraform AWS -Using Data from remote backend issue
I am currently building a 3 tier wordpress structure for a project that includes VPC, ASG-ALB, EFS and RDS clusters. .TF files are in seperate directories so i am using makefile to apply them in order.
Backend is stored in s3 bucket/dynamodb.
I want to be able to... | Terraform AWS -Using Data from remote backend issue | I am currently building a 3 tier wordpress structure for a project that includes VPC, ASG-ALB, EFS and RDS clusters. .TF files are in seperate directories so i am using makefile to apply them in order.
Backend is stored in s3 bucket/dynamodb.
I want to be able to get certain info from RDS, EFS tf files that are located... | [
"There are three different methods to achieve solution to your problem.\nSolution nr 1 - Terraform modules\nThe components of the system you have created in separate directiories became separate Terraform projects. The intended way of stucturing such dependency is to use Terraform modules.\nIn this scenario, the en... | [
0
] | [] | [] | [
"amazon_efs",
"amazon_rds",
"amazon_web_services",
"terraform",
"terraform_provider_aws"
] | stackoverflow_0074680191_amazon_efs_amazon_rds_amazon_web_services_terraform_terraform_provider_aws.txt |
Q:
Python GC: What's the meaning: Not all items in some free lists may be freed due to the particular implementation, in particular float
When I read the doc of gc.collect(). There is a saying: Not all items in some free lists may be freed due to the particular implementation, in particular float.
I'm quite confused.... | Python GC: What's the meaning: Not all items in some free lists may be freed due to the particular implementation, in particular float | When I read the doc of gc.collect(). There is a saying: Not all items in some free lists may be freed due to the particular implementation, in particular float.
I'm quite confused. What's the meaning of this saying?
import gc
l = [1.0, 2.0, 3.0]
l = None
gc.collect()
Does it mean that even though the list [1.0, 2.0, 3... | [
"It's counterintuitive, but thats just simply how the gc works.\nIn particular, the gc.collect() method may not free memory associated with floating-point numbers (i.e. float objects). This is because the garbage collector uses a specific algorithm to determine which objects can be safely freed, and this algorithm ... | [
0,
0
] | [] | [] | [
"garbage_collection",
"memory_management",
"python"
] | stackoverflow_0074681214_garbage_collection_memory_management_python.txt |
Q:
Can we get data processed in Spring Batch after batch job is completed?
I am using spring batch for reading data from db and process the same and do spome process in writer.
if batch size is less than the records read by reader then spring batch runs in multiple batches.I want to do the processing in writer only o... | Can we get data processed in Spring Batch after batch job is completed? | I am using spring batch for reading data from db and process the same and do spome process in writer.
if batch size is less than the records read by reader then spring batch runs in multiple batches.I want to do the processing in writer only once at the end of all batch process completion or if this is not possible the... | [
"// It is possible to get data processed in Spring Batch after all batch job executions have completed. One way to do this would be to move the processing that you are currently doing in the writer step to a separate step that is executed only after all other steps in the job have completed.\n\n// To do this, you c... | [
0
] | [] | [] | [
"batch_processing",
"spring",
"spring_batch",
"spring_boot"
] | stackoverflow_0074655259_batch_processing_spring_spring_batch_spring_boot.txt |
Q:
How to force EditText to accept only numbers in compose kotlin?
How to force outLineTxtFieldValue to accept only numbers ?.
For example,
user can only enter numbers, not a negative value. We can enter numbers such as
120,
1,
9,
10012,
in short, we can say positive integers or natural numbers in kotlin compose ou... | How to force EditText to accept only numbers in compose kotlin? | How to force outLineTxtFieldValue to accept only numbers ?.
For example,
user can only enter numbers, not a negative value. We can enter numbers such as
120,
1,
9,
10012,
in short, we can say positive integers or natural numbers in kotlin compose outlinetextfield or textfield
| [
"To force a TextField or OutlinedTextField to accept only numbers in Compose, you can use the keyboardType property and set it to Number like so:\nTextField(\n keyboardType = KeyboardType.Number\n)\n\nOr for OutlinedTextField, you can use the modifier property and set it to keyboardType = KeyboardType.Number lik... | [
1
] | [] | [] | [
"android",
"kotlin",
"textfield"
] | stackoverflow_0074681337_android_kotlin_textfield.txt |
Q:
Issue in setting an image as the background a of a scene in Manim Community v0.17.0
Issue in setting an image as the background a of a scene in Manim Community v0.17.0
from manim import *
class ImageFromArray(Scene):
def construct(self):
self.background_image =r"C:\Users\Shobhan\Desktop\program\bb.jpg... | Issue in setting an image as the background a of a scene in Manim Community v0.17.0 | Issue in setting an image as the background a of a scene in Manim Community v0.17.0
from manim import *
class ImageFromArray(Scene):
def construct(self):
self.background_image =r"C:\Users\Shobhan\Desktop\program\bb.jpg"
is not working...what to do?
| [
"To set an image as the background of a scene in Manim Community v0.17.0, you can use the set_background_image method in your construct function. The method takes the path to the image as an argument, so you can use it like this:\nclass ImageFromArray(Scene):\n def construct(self):\n self.set_background_i... | [
0,
0
] | [] | [] | [
"manim",
"python"
] | stackoverflow_0074679231_manim_python.txt |
Q:
Expressjs on a cPanel environment
I am trying to build an API with expressjs. Although I was able to run a pretty simple test with basic http like the code below
const http = require('http')
const hostname = '127.0.0.1';
const port = 3003;
const server = http.createServer((req, res) => {
res.statusCode = 200;
... | Expressjs on a cPanel environment | I am trying to build an API with expressjs. Although I was able to run a pretty simple test with basic http like the code below
const http = require('http')
const hostname = '127.0.0.1';
const port = 3003;
const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/pl... | [
"The issue is that basic cPanel plan doesn't support node.js applications for some reason (haven't dug deep enough to upderstend why).\nWhat worked for me is getting a CloudLinux add-on and running my app from the software tab through the provided \"Setup Node.js App\".\nHope this helps people like me, that are try... | [
0,
0
] | [] | [] | [
"channel",
"express",
"node.js"
] | stackoverflow_0072565511_channel_express_node.js.txt |
Q:
How to open a Flutter .hive file from Hive in Android Studio
Can someone please explain how to open the .hive files generated by Flutter Hive when you create a Box and add to it?
Within my application, the files are stored as name.hive files.
I have tried opening them as JSON/XML/plain text but nothing seems to wo... | How to open a Flutter .hive file from Hive in Android Studio | Can someone please explain how to open the .hive files generated by Flutter Hive when you create a Box and add to it?
Within my application, the files are stored as name.hive files.
I have tried opening them as JSON/XML/plain text but nothing seems to work, the contents are showing incorrectly
I am using Android Studio... | [
"An issue was opened for this and the answer is:\nHive uses a custom binary format for storing data which isn't supported by any existing editors or tools.\n\nso you cannot actually open a box .hive file like you could do with JSON, XML...\n"
] | [
0
] | [] | [] | [
"dart",
"flutter",
"flutter_hive"
] | stackoverflow_0067709112_dart_flutter_flutter_hive.txt |
Q:
Adding prefix to column names generated by pivot_longer names_to .value
Is it possible to add a prefix to the column names that are generated from using the .value option in the argument names_to in pivot_longer ?
Example:
df <- tibble(x1 = 0.1, x2 = 0.2, y1 = 0.05, y2 = 0.15)
df %>%
pivot_longer(cols = everythi... | Adding prefix to column names generated by pivot_longer names_to .value | Is it possible to add a prefix to the column names that are generated from using the .value option in the argument names_to in pivot_longer ?
Example:
df <- tibble(x1 = 0.1, x2 = 0.2, y1 = 0.05, y2 = 0.15)
df %>%
pivot_longer(cols = everything(),
names_to = c('coord_type', '.value'),
nam... | [
"We could use names_repair, which can take a function\nlibrary(stringr)\nlibrary(tidyr)\npivot_longer(df, cols = everything(),\n names_to = c('coord_type', '.value'),\n names_pattern = '(\\\\D+)(\\\\d+)', \n names_repair = ~ str_replace(.x, \"^(\\\\d+)\", \"coord_\\\\1\"))\n\n-outp... | [
0
] | [] | [] | [
"dplyr",
"r",
"tidyr"
] | stackoverflow_0074680530_dplyr_r_tidyr.txt |
Q:
How to restrict the textfield to accept max 3 digits with a decimal value of two digits
I am using Xcode 14 Swift 5 and I am new to it.
I am trying to make the textField accpet maximum 3 digits but also can have a decimal number in it with 2 digits.
(E.g. the user can enter 123 or 123.45 but not 12345 nor 12134.54... | How to restrict the textfield to accept max 3 digits with a decimal value of two digits | I am using Xcode 14 Swift 5 and I am new to it.
I am trying to make the textField accpet maximum 3 digits but also can have a decimal number in it with 2 digits.
(E.g. the user can enter 123 or 123.45 but not 12345 nor 12134.54)
Thanks in advance.
here is my code to restrict the textField to accept max 3 digits but I c... | [
"To make your text field accept a maximum of three digits with a decimal number of two digits, you can use the NSCharacterSet class to define the characters that are allowed in the text field. You can then use the rangeOfCharacter method to check if the entered text contains any characters that are not in the allow... | [
0
] | [] | [] | [
"ios",
"swift",
"swift5",
"uitextfield",
"xcode"
] | stackoverflow_0074680405_ios_swift_swift5_uitextfield_xcode.txt |