question_id int64 37.6M 73.2M | input_text stringlengths 88 52.4k | output_text stringlengths 37 35.6k | title stringlengths 15 150 | tags stringlengths 1 107 | q_score int64 -19 397 | view_count int64 3 879k | answer_count int64 1 21 | accepted_answer_id int64 37.6M 73.8M | answer_id int64 37.6M 73.8M | a_score int64 -5 1.29k | is_accepted bool 1
class | creation_date stringlengths 20 24 | input_text_instruct stringlengths 251 52.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
73,017,924 | My Huawei Ads are displaying only in some regions<p>My Apk is uploaded to AppGallery and my Huawei Ads are displaying successfully using Cloud Debugging , but only when I change the region to a country that is located in Asia or Africa .
Ads are not displaying if the region selected is in Europe !!</p>
<p>Can you pleas... | <p>According to <a href="https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/site-and-country-and-area-code-0000001172734088?ha_source=hms1" rel="nofollow noreferrer">this document</a>, Ads have the following sites:</p>
<ul>
<li>China</li>
<li>Asia, Africa, and Latin America</li>
<li>Europe</li>
<li... | My Huawei Ads are displaying only in some regions | huawei-mobile-services|huawei-developers|huawei-ads | 1 | 81 | 1 | 73,018,929 | 73,018,929 | 1 | true | 2022-07-18T06:06:36.330Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
My Huawei Ads are displaying only in some regions<p>My Apk is uploaded to AppGallery and my Huawei Ads are displaying successfully using Cloud Debugging , bu... |
72,827,309 | How to securely provide secrets to azure batch service running R scripts<p>I'm trying to find a way to provide sensitive data to my batch service job. The data is the sql connection credentials that is being used in the R scripts to connect to the SQL and fetch the tables. So the code looks like this if we have a confi... | <p>You need to initialize your vault with application authentication:</p>
<pre><code>cert <- PKI.load.cert(file=system.file("certs", "app_cert.pfx", package="PKI"))
token <- AzureAuth::get_azure_token("https://vault.azure.net", "myaadtenant",
... | How to securely provide secrets to azure batch service running R scripts | r|azure|azure-active-directory|azure-keyvault|azure-batch | 0 | 81 | 1 | 73,032,117 | 73,032,117 | 1 | true | 2022-07-01T09:38:56.103Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to securely provide secrets to azure batch service running R scripts<p>I'm trying to find a way to provide sensitive data to my batch service job. The da... |
72,776,480 | Using jq to select value from multiple datatypes (array/object)<p>I have a curl cmd and return either one of json structure as below</p>
<p>#1</p>
<pre><code>{
"keys": [
{
"key": "1234567890"
}
]
}
</code></pre>
<p>#2</p>
<pre><code>{
"keys": [
... | <p>One way would be to do an explicit check of the type of the content within <code>keys</code> as</p>
<pre class="lang-none prettyprint-override"><code>.keys[] | if type == "string" then . elif type == "object" then .key else empty end
</code></pre>
<p><a href="https://jqplay.org/s/4YR9Kq1eggz" rel... | Using jq to select value from multiple datatypes (array/object) | sh|jq | 1 | 81 | 3 | 72,776,580 | 72,776,580 | 1 | true | 2022-06-27T17:57:10.193Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using jq to select value from multiple datatypes (array/object)<p>I have a curl cmd and return either one of json structure as below</p>
<p>#1</p>
<pre><code... |
72,977,531 | undefined reference to `mlx5dv_create_flow_action_packet_reformat' in DPDK mlx5<p><a href="https://i.stack.imgur.com/u5gcg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/u5gcg.png" alt="enter image description here" /></a></p>
<p><a href="https://i.stack.imgur.com/x5EI3.png" rel="nofollow noreferrer... | <p>The issue with application <code>r2p2-echo</code> Makefile flags, as it only include DPDK headers via <code>-I$(RTE_SDK)/x86_64-native-linuxapp-gcc/include</code>. Based on the logs <code>DPDK is been built Mellanox PMD drivers which have an inherent dependency on libverbs to provide the definition for mlx5_glue_*</... | undefined reference to `mlx5dv_create_flow_action_packet_reformat' in DPDK mlx5 | hyperlink|undefined-reference|dpdk|mellanox | 0 | 81 | 1 | 72,988,870 | 72,988,870 | 1 | true | 2022-07-14T08:30:32.153Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
undefined reference to `mlx5dv_create_flow_action_packet_reformat' in DPDK mlx5<p><a href="https://i.stack.imgur.com/u5gcg.png" rel="nofollow noreferrer"><im... |
72,846,176 | C# access variable from another class without static<p>I'm trying to access some variables from different classes in one of my classes, I would like to be able to get the value and set the value of those variable from other classes.</p>
<p>Right now, I'm using static but I'm using it too much and I think that's not goo... | <p>You can access the variables of a class only in two ways:</p>
<ol>
<li>Make the variable static.</li>
</ol>
<pre><code>public class GeneralManager
{
public static float Eggs;
}
</code></pre>
<p>and use the variable in the <em>GameManager</em> like <code>GeneralManager.Eggs</code></p>
<ol start="2">
<li>Create an... | C# access variable from another class without static | c#|static|non-static | 0 | 81 | 1 | 72,846,967 | 72,846,967 | 1 | true | 2022-07-03T11:39:40.137Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C# access variable from another class without static<p>I'm trying to access some variables from different classes in one of my classes, I would like to be ab... |
72,909,243 | Encrypt password coming from application.properties<p>How can I encrypt a password coming from <code>application.properties</code>?</p>
<pre><code>spring:
security:
user:
name: bob
password: alice
</code></pre>
<p>Spring security authentication:</p>
<pre><code>@Configuration
@EnableWebSecurity
public ... | <p>Keep the PasswordEncoder bean, and put in properties the password encoded by your encoder (not the raw password).</p>
<p>So in your case sth. like this:</p>
<pre><code>spring:
security:
user:
name: bob
password: $2a$10$2T4wM24pGyHuLj12SI/rC.C1gkg4mLGTuzTse3choIVIOtlgsWmPC
</code></pre> | Encrypt password coming from application.properties | java|spring-boot|rest|spring-security | -1 | 81 | 2 | 72,909,559 | 72,909,559 | 1 | true | 2022-07-08T09:17:45.693Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Encrypt password coming from application.properties<p>How can I encrypt a password coming from <code>application.properties</code>?</p>
<pre><code>spring:
... |
73,001,228 | Grade calculator range and ValueError - Python<p>I'm new to python and have been trying to create a simple grade calculator which tells the user what grade they've achieved based on their final score they've inputted.</p>
<pre><code>def grades():
try:
score = int(input("Please enter your score between 0 and 10... | <p>Just for fun, let's make it a Match Case statement:</p>
<p>Since you only accept integers, we can take and assign score to input with <code>:=</code>, then check if it's valid with <code>str.isnumeric</code>. If that's true then we'll make <code>score</code> an integer <code>:=</code> and check if it's between 0 and... | Grade calculator range and ValueError - Python | python | 1 | 81 | 5 | 73,001,428 | 73,001,428 | 1 | true | 2022-07-16T02:59:54.060Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Grade calculator range and ValueError - Python<p>I'm new to python and have been trying to create a simple grade calculator which tells the user what grade t... |
72,976,976 | How to build TypeScript/JavaScript code by Webpack which will be executed in the Pug pre-processor?<p>I want to build some TypeScript code by Webpack and make it available inside <a href="https://pugjs.org/language/code.html" rel="nofollow noreferrer">Pug inline code</a> like:</p>
<pre><code>-
const { formatNumberWi... | <p><strong>TL;DR</strong>: According to the <a href="https://webpack.js.org/configuration/output/#outputglobalobject" rel="nofollow noreferrer">doc</a>, you need to set <code>output.globalObject</code>. This config should work:</p>
<pre><code>output.target = "web" // default
output.library.type = "umd&qu... | How to build TypeScript/JavaScript code by Webpack which will be executed in the Pug pre-processor? | javascript|typescript|webpack|pug | 0 | 81 | 1 | 73,051,419 | 73,051,419 | 1 | true | 2022-07-14T07:47:16.103Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to build TypeScript/JavaScript code by Webpack which will be executed in the Pug pre-processor?<p>I want to build some TypeScript code by Webpack and mak... |
72,938,364 | How to highlight the input button by clicking to a button?<p>I can't code jquery javascript therefore i have no idea how to highlight (border or background change) the submit button for a few seconds. I tried some of the scripts that have been shared on this platform but i wasn't lucky. What code do you suggest?</p>
<p... | <p>Simply add a class to the element you want to highlight. Then remove the class with the <code>setTimeout</code> function.</p>
<ol>
<li>Add a class in CSS with a high specificity that contains all visible changes you want to apply. It does not matter what it is. It can be background, border, box-shadow...</li>
<li>In... | How to highlight the input button by clicking to a button? | javascript|html|jquery|css | 1 | 81 | 4 | 72,938,551 | 72,938,551 | 1 | true | 2022-07-11T12:09:46.787Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to highlight the input button by clicking to a button?<p>I can't code jquery javascript therefore i have no idea how to highlight (border or background c... |
72,833,955 | Search combined keywords in a pdf with R<p>I have a list of keywords to find text in a group of PDF files, some of the keyword must appear combined to extract the text even if they are not together.</p>
<p>I used the pdfsearch library and it finds text with the separated keywords. I read the documentation but I am not ... | <p><em>I am assuming you want all keywords in a 'group' of keywords to be present in a single <strong>line</strong>, in order for you to extract that single line. If you want the keywords to be present in a single <strong>file</strong> to extract all text from that file, let me know so I can adjust the answer.</em></p>... | Search combined keywords in a pdf with R | r|pdf|text|keyword | 0 | 81 | 1 | 72,843,301 | 72,843,301 | 1 | true | 2022-07-01T19:39:27.500Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Search combined keywords in a pdf with R<p>I have a list of keywords to find text in a group of PDF files, some of the keyword must appear combined to extrac... |
72,981,735 | Why does MSVC STL not implement sync_with_stdio()?<p>I looked for the implementation of this function in MSVC STL source on github, but found no code other than setting the synchronization flag.</p>
<p>Next, I wrote a simple program with a call to this function, and ran it under a debugger, hoping to find a reading of ... | <p>"setting the synchronization flag" and returning the old one is all it is supposed to do as far as the standard goes: <a href="https://eel.is/c++draft/ios.base#ios.members.static-1" rel="nofollow noreferrer">https://eel.is/c++draft/ios.base#ios.members.static-1</a></p>
<blockquote>
<p>Otherwise, called wit... | Why does MSVC STL not implement sync_with_stdio()? | visual-c++|c++-standard-library | 2 | 81 | 1 | 72,986,122 | 72,986,122 | 1 | true | 2022-07-14T13:57:14.727Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why does MSVC STL not implement sync_with_stdio()?<p>I looked for the implementation of this function in MSVC STL source on github, but found no code other t... |
72,801,610 | Name a variable or object based on the value of another variable in R<p>I read data files from a directory where I don't know the number or the name of the files. Each files a data frame (as parquet file). I can read that files. But how to name the results?</p>
<p>I would like to have something like a named list where ... | <p>In the tidyverse you would use <code>purrr</code>. This is basically the same as the <code>lapply()</code> or <code>sapply()</code> approach, but in a different ecosystem.</p>
<pre class="lang-r prettyprint-override"><code>library(arrow)
library(purrr)
file_names = c('a.parquet', 'B.parquet')
daten <- file_name... | Name a variable or object based on the value of another variable in R | r | -1 | 81 | 2 | 72,802,091 | 72,802,091 | 1 | true | 2022-06-29T12:41:24.287Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Name a variable or object based on the value of another variable in R<p>I read data files from a directory where I don't know the number or the name of the f... |
72,974,615 | Javascript Fetch POST not receiving any response from api<p>I have many similar functions and those are working well. But this fetch is not recieving any response from the API.</p>
<pre><code>const fetchPdtDetails = async (code) => {
const url = `${api}data/pdtDetails`;
const params = { data: code };
const f... | <p>Your <code>fetchData</code> should be <code>undefined</code>.</p>
<p>You need change your codes to:</p>
<pre class="lang-js prettyprint-override"><code>try {
const fetchData = await fetch({ ... });
const data = fetchData.json();
console.log(data);
return data;
} catch (err) {
console.log(err);
}
... | Javascript Fetch POST not receiving any response from api | javascript|node.js|api|fetch|fetch-api | 0 | 81 | 1 | 72,974,951 | 72,974,951 | 1 | true | 2022-07-14T02:42:30.987Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Javascript Fetch POST not receiving any response from api<p>I have many similar functions and those are working well. But this fetch is not recieving any re... |
72,857,797 | How to copy a red black tree to another rb tree and remove the old one?<p>I want to copy nodes in an RB tree that satisfy a condition into another RB tree and remove the old one.</p>
<p>I've made these functions:</p>
<pre class="lang-c prettyprint-override"><code>void copy_tree(node* old_root, node** copied_root) {
... | <p>Without seeing the source to your <code>rb_insert</code> function, I suspect that it is adding the node pointed to by the second parameter to the new tree without copying the node. That would lead to problems while the old tree is still being traversed.</p>
<p>You need to remove the node from the old tree before mov... | How to copy a red black tree to another rb tree and remove the old one? | c | 0 | 81 | 1 | 72,859,560 | 72,859,560 | 1 | true | 2022-07-04T13:48:37.237Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to copy a red black tree to another rb tree and remove the old one?<p>I want to copy nodes in an RB tree that satisfy a condition into another RB tree an... |
72,901,023 | Sync Google sheets with Google Calendar, and blank cells in ss prevented subsequent events from being created<p>I'm very new to coding and running into problems.
I'm trying to sync my Google sheet to create All Day events on two separate GCal (so we can toggle between them) and experiencing a few issues.
1: If data is ... | <p>Custom menus must contain at least one item.</p>
<pre><code>function onOpen() {
SpreadsheetApp.getUi().createMenu('β© Calendar β©')
.addItem(' Add to Cal', 'createCalendarEvent')
.addToUi();
}
</code></pre>
<p><a href="https://i.stack.imgur.com/hZdpB.png" rel="nofollow noreferrer"><img src="https://i.stack.i... | Sync Google sheets with Google Calendar, and blank cells in ss prevented subsequent events from being created | google-apps-script|synchronization | 0 | 81 | 1 | 72,918,565 | 72,918,565 | 1 | true | 2022-07-07T16:05:36.027Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Sync Google sheets with Google Calendar, and blank cells in ss prevented subsequent events from being created<p>I'm very new to coding and running into probl... |
72,785,156 | Bring 'offline node' online script<p>So I was wondering if it's possible to create a script that checks in a node is <code>offline</code> and if it is it should bring it back <code>online</code>. The login used should be by <code>username</code> and <code>token</code>.</p>
<p>I'm talking about a script that triggers th... | <p>TL;DR: the scripted action for that button is <a href="https://javadoc.jenkins.io/hudson/slaves/SlaveComputer.html" rel="nofollow noreferrer"><code>.doToggleOffline</code></a>:<br>
<code>Jenkins.instance.getNode('Node-Name').getComputer().doToggleOffline(offlineMessage)</code></p>
<p><em>I knew I had dealt with this... | Bring 'offline node' online script | python|jenkins | 1 | 81 | 2 | 72,814,126 | 72,814,126 | 1 | true | 2022-06-28T10:53:22.843Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Bring 'offline node' online script<p>So I was wondering if it's possible to create a script that checks in a node is <code>offline</code> and if it is it sho... |
72,897,867 | Painting stroke generation algorithm for robot arm<p>I am writing a code that generate start and end points of strokes of a picture (Raster images) to let robot arm paint.</p>
<p>I have wrote an algorithm but with too many overlapping strokes:
<a href="https://github.com/Evrid/Painting-stroke-generation-for-robot-arm-o... | <p>I would start with:</p>
<ol>
<li><p><strong>Quantize your image to your palette</strong></p>
<p>so reduce colors to your palette first see:</p>
<ul>
<li><a href="https://stackoverflow.com/a/30265253/2521214">Effective gif/image color quantization?</a></li>
<li><a href="https://stackoverflow.com/a/36820654/2521214">C... | Painting stroke generation algorithm for robot arm | algorithm|image|stroke | 2 | 81 | 2 | 72,907,757 | 72,907,757 | 1 | true | 2022-07-07T12:31:29.020Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Painting stroke generation algorithm for robot arm<p>I am writing a code that generate start and end points of strokes of a picture (Raster images) to let ro... |
72,940,272 | search markers with leaflet search<p>IΒ΄m trying to use leaftlet search but it doesnt find the markers.
The markers are populated on the map as it should be, but the search wont work.
I have a <strong>freg.js</strong> file where I have the information to create markers, and I want to search using propertie "<strong... | <p>I assumed you're using <a href="https://github.com/stefanocudini/leaflet-search" rel="nofollow noreferrer">leaflet-search</a>.</p>
<p>The problem is in the referenced layer option. It should point to the geojson variable. In short, <code>layer: overlays,</code> should be <code>layer: fregData,</code>.</p>
<p>For a w... | search markers with leaflet search | search|leaflet|markers | 0 | 81 | 1 | 72,948,624 | 72,948,624 | 1 | true | 2022-07-11T14:36:00.227Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
search markers with leaflet search<p>IΒ΄m trying to use leaftlet search but it doesnt find the markers.
The markers are populated on the map as it should be, ... |
72,838,342 | How to use numba?<p>I meet a problem about using numba jit decorator (<code>@nb.jit</code>)! Here is the warning from jupyter notebook,</p>
<blockquote>
<p>NumbaWarning:
Compilation is falling back to object mode WITH looplifting enabled because Function "get_nb_freq" failed type inference due to: No implemen... | <p>Based on your mentioned shapes we can create the arrays as:</p>
<pre><code>onehot_ct = np.random.rand(921600, 4)
nb_count = np.random.rand(921600, 4)
</code></pre>
<p>Your prepared code will be work correctly and get an answer like:</p>
<pre><code>[[0.25013102754197963 0.25021461207825463 0.2496806287276126 0.24997... | How to use numba? | python|numpy|matrix-multiplication|numba | 0 | 81 | 1 | 72,838,867 | 72,838,867 | 1 | true | 2022-07-02T10:28:30.777Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use numba?<p>I meet a problem about using numba jit decorator (<code>@nb.jit</code>)! Here is the warning from jupyter notebook,</p>
<blockquote>
<p>N... |
72,811,862 | How to reload the first test case if it fails in cypress<p>Every feature test case starts with landing page testing in cypress.</p>
<p>We are witnessing failures here because of network connectivity issues.</p>
<pre><code>it('should load home page', () => {
cy.waitUntil(() =>
cy.contains('Home', { timeo... | <p>You can use <a href="https://docs.cypress.io/guides/guides/test-retries" rel="nofollow noreferrer">Test Retries</a>. You can add it to Test Suite Level, Test Case level or globally as well. The test will be re-triggered in case of failures.</p>
<p><code>runMode</code> works for headless. <code>openMode</code> for te... | How to reload the first test case if it fails in cypress | javascript|testing|cypress|integration-testing|e2e-testing | 1 | 81 | 1 | 72,811,881 | 72,811,881 | 1 | true | 2022-06-30T07:29:01.243Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to reload the first test case if it fails in cypress<p>Every feature test case starts with landing page testing in cypress.</p>
<p>We are witnessing fail... |
72,897,168 | Add legend to mplot3d<p>For the 3D plot given here (thanks to <a href="https://stackoverflow.com/users/16404872/redox">Redox</a> for his <a href="https://stackoverflow.com/questions/72886844/use-color-map-from-seaborn-sns-pairplot-tab10-r-on-mpl-toolkits-3d-scatter-plot">elegant solution posted here</a>):</p>
<p><a hre... | <p>You can add these lines at the end of your code to add and adjust the legend. Do take a look if the 0 and 1 match to the purple and green as I have added them manually.
You can adjust the position of the box by using <code>bbox_to_anchor</code>, the font and text of the title and legend items, size of the dots, etc.... | Add legend to mplot3d | python-3.x|legend|scatter3d | 1 | 81 | 1 | 72,898,334 | 72,898,334 | 1 | true | 2022-07-07T11:40:28.600Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Add legend to mplot3d<p>For the 3D plot given here (thanks to <a href="https://stackoverflow.com/users/16404872/redox">Redox</a> for his <a href="https://sta... |
72,976,384 | Is it possible to export classes under a new namespace in C#?<p>I'm pretty new to C#, so I may just not know the terms to search for.</p>
<p>I'm trying to export a subset of classes available in a namespace to manage visibility.</p>
<p>High level - there's an assembly which provides the UnityEngine namespace. UnityEngi... | <p>It is a bit unclear to me what exactly you are trying to do here.</p>
<p>It sounds a bit like in your first script you want to do</p>
<pre><code>namespace UnityTypes
{
using Vector2 = UnityEngine.Vector2;
}
</code></pre>
<p>and now you expect that wherever you do</p>
<pre><code>using UnityTypes;
</code></pre>
<p>... | Is it possible to export classes under a new namespace in C#? | c#|unity3d | 1 | 81 | 2 | 72,978,370 | 72,978,370 | 1 | true | 2022-07-14T06:54:09.217Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is it possible to export classes under a new namespace in C#?<p>I'm pretty new to C#, so I may just not know the terms to search for.</p>
<p>I'm trying to ex... |
72,937,347 | Python - How to convert datetime object to timezone given as string in a column?<p>I have a column of UTC times which I need to convert to 'local' times based on the UTC timezone provided in a second column as a string. How do I assign a timezone using <code>pytz</code> to the time in the column based on string UTC tim... | <p>Parse the date/time columns <a href="https://pandas.pydata.org/docs/reference/api/pandas.to_datetime.html" rel="nofollow noreferrer">to datetime</a>; for the UTC (offset) column do the same but just keep the offset. Then convert to this offset as time zone. EX:</p>
<pre class="lang-py prettyprint-override"><code>imp... | Python - How to convert datetime object to timezone given as string in a column? | python|pandas|datetime|timezone-offset|pytz | 0 | 81 | 2 | 72,938,172 | 72,938,172 | 1 | true | 2022-07-11T10:47:59.633Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python - How to convert datetime object to timezone given as string in a column?<p>I have a column of UTC times which I need to convert to 'local' times base... |
72,908,387 | Iterate an array of objects<p>I have an array of objects.</p>
<p><code>myArray = [{a:1,b:1,c:1,d:1},{a:2,b:2,c:2,d:2},{a:3,b:3,c:3,d:3},{a:4,b:4,c:4,d:4}]</code></p>
<p>I want to create a new dictionary from it:
<code>newDict = {a:[1,2,3,4],c:[1,2,3,4]}</code></p>
<p>I'm totally new to Javascript and Node.js
Any kind o... | <p>Alternatively you can also do it in a for loop, in case you are unfamiliar with the reduce method.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>const myArray = [{a:1,b:1,... | Iterate an array of objects | javascript|node.js|arrays | -2 | 81 | 6 | 72,908,484 | 72,908,484 | 1 | true | 2022-07-08T08:00:28.030Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Iterate an array of objects<p>I have an array of objects.</p>
<p><code>myArray = [{a:1,b:1,c:1,d:1},{a:2,b:2,c:2,d:2},{a:3,b:3,c:3,d:3},{a:4,b:4,c:4,d:4}]</c... |
72,990,882 | Are Photon raise event and rpc interchangeable?<p>I've read a few forum posts that some people prefer to use raise event over rpc,
but I can't find the reason why they prefer it. Is raise event interchangeable with rpc?
I mean I get it raise event is easier to use than RPC , because RPC requires the gameobject holding ... | <p>RPCs and Events are very similar, but have some key similarities/differences:</p>
<h3>Both:</h3>
<ul>
<li>Have options for buffering: (<code>RpcTarget.*Buffered</code> and <code>RaiseEventOptions.CachingOptions</code>)</li>
<li>Have options for encryption: (<code>RpcSecure</code> and <code>SendOptions.Encrypt</code>... | Are Photon raise event and rpc interchangeable? | unity3d|photon | -1 | 81 | 1 | 73,170,377 | 73,170,377 | 1 | true | 2022-07-15T08:04:29.623Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Are Photon raise event and rpc interchangeable?<p>I've read a few forum posts that some people prefer to use raise event over rpc,
but I can't find the reaso... |
72,336,324 | Xamarin MysqlConnector weird NullReferenceException error<p>I'm wanting to make a small and simple mobile app for a school project, I know connecting to a db from a phone is not good for security reasons but basically only I will touch it.</p>
<p>So to connect my Xamarin app to Mysql I downloaded the extension MysqlCon... | <p>It's hard to say for certain, but it's likely the issue is because you are not closing the reader and command, and you can't have multiple commands on the same connection.</p>
<p>Also, you need to advance the reader using <code>reader.Read</code>.</p>
<p>In any case there is no need to run the command twice in the f... | Xamarin MysqlConnector weird NullReferenceException error | c#|xamarin|xamarin.forms|xamarin.android | 0 | 81 | 1 | 72,336,492 | 72,336,492 | 1 | true | 2022-05-22T09:32:11.853Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Xamarin MysqlConnector weird NullReferenceException error<p>I'm wanting to make a small and simple mobile app for a school project, I know connecting to a db... |
72,319,755 | How to send data with libcurl in persistent connections?<p>I am using libcurl to connect to a LightStreamer server. Consider the following minimal example:</p>
<pre><code>#include <curl/curl.h>
static size_t writeCallback(char *ptr, size_t size, size_t nmemb, void* userdata)
{
printf("%.*s\n", ... | <pre><code>#include <curl/curl.h>
static size_t writeCallback(char *ptr, size_t size, size_t nmemb, void* userdata) {
printf("%.*s\n", size * nmemb, ptr);
return size * nmemb;
}
static size_t headerCallback(char *buffer, size_t size, size_t nitems, void *userdata) {
int *keep_running = (int *)us... | How to send data with libcurl in persistent connections? | c|libcurl | 2 | 81 | 1 | 72,356,864 | 72,356,864 | 1 | true | 2022-05-20T13:28:56.690Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to send data with libcurl in persistent connections?<p>I am using libcurl to connect to a LightStreamer server. Consider the following minimal example:</... |
72,303,634 | Gets stuck loading a component that isn't logged in<p>I have a problem when redirecting when a user is not logged in. In my project I have two Guards for the Admin and User, then I use the functions of the @angular/fire/auth-guard library to redirect if logged in and if not. The problem is if I add my guards that I cre... | <p>My solution for this situation is, remove authGurad and use UserService in each guard to check user is logged in:</p>
<p>RoleAdminGuard:</p>
<pre class="lang-js prettyprint-override"><code> canActivate(
next: ActivatedRouteSnapshot,
state: RouterStateSnapshot): Observable<boolean> | Promise<boolean... | Gets stuck loading a component that isn't logged in | angular|typescript|angular-ui-router | 3 | 81 | 1 | 72,307,515 | 72,307,515 | 1 | true | 2022-05-19T11:21:08.207Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Gets stuck loading a component that isn't logged in<p>I have a problem when redirecting when a user is not logged in. In my project I have two Guards for the... |
72,311,119 | Passing multiple STDIN inputs from powershell script into perl script<p>I have an existing perl script (which i cannot modify) which has two STDIN calls. I would like to run this perl script from a powershell script and feed it the two "user inputs" but using variables.</p>
<p>For a single input I tried</p>
... | <p>You are asking how to provide two lines to the STDIN of a program in PowerShell.</p>
<p>You can use either of the following:</p>
<pre><code>"line1", "line2" | perl ...
</code></pre>
<pre><code>"line1`nline2`n" | perl ...
</code></pre>
<hr />
<p>Demo:</p>
<pre class="lang-perl prettyprin... | Passing multiple STDIN inputs from powershell script into perl script | powershell|perl|chomp | 0 | 81 | 1 | 72,313,408 | 72,313,408 | 1 | true | 2022-05-19T21:10:28.113Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Passing multiple STDIN inputs from powershell script into perl script<p>I have an existing perl script (which i cannot modify) which has two STDIN calls. I ... |
72,327,221 | Laravel Cart session returns Object instead of Array, how can I convert the object to an array?<p>I am having trouble the last couple of days figuring this out, i tried googling and every answer I come across doesn't fix my problem</p>
<p>I am storing array of items in the cart but when retrieving the array, it's an ob... | <p>This may solve your problem;</p>
<pre><code>$request->session()->get('cart')
</code></pre> | Laravel Cart session returns Object instead of Array, how can I convert the object to an array? | php|laravel|cart | 0 | 81 | 1 | 72,327,390 | 72,327,390 | 1 | true | 2022-05-21T06:30:17.383Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Laravel Cart session returns Object instead of Array, how can I convert the object to an array?<p>I am having trouble the last couple of days figuring this o... |
72,386,864 | Apply gghighlight to multiple facets of time series plot<p>For the dataset <code>df</code> (the data is posted in the end of this question), I try to use <code>gg_season()</code> and <code>gghighlight(year >= 2020)</code> to highlight the lines after the years of 2020.</p>
<p>But the output is obviously not as expec... | <p>Here is one potential solution:</p>
<pre class="lang-r prettyprint-override"><code>library(tidyverse)
library(lubridate)
#>
#> Attaching package: 'lubridate'
#> The following objects are masked from 'package:base':
#>
#> date, intersect, setdiff, union
#install.packages("feasts")
libra... | Apply gghighlight to multiple facets of time series plot | r|ggplot2|plot|gghighlight | 2 | 81 | 1 | 72,387,449 | 72,387,449 | 1 | true | 2022-05-26T04:55:31.727Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Apply gghighlight to multiple facets of time series plot<p>For the dataset <code>df</code> (the data is posted in the end of this question), I try to use <co... |
72,368,590 | How to extract data from HDF5 file to fill PyTables table?<p>I am trying to write a Discord bot in Python. Goal of that bot is to fill a table with entries from users, where are retrieved username, gamename and gamepswd. Then, for specific users to extract these data and remove the solved entry. I took first tool found... | <p>Here is a simple method to iterate over the table rows and print them one at time.
HDF5 doesn't support Unicode strings, so your character data is stored as byte strings. That's why you see the <code>'b'</code>. To get rid of the <code>'b'</code>, you have to convert back to Unicode using <code>.decode('utf-8')</cod... | How to extract data from HDF5 file to fill PyTables table? | python|hdf5|pytables | 0 | 81 | 1 | 72,371,172 | 72,371,172 | 1 | true | 2022-05-24T19:37:26.130Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to extract data from HDF5 file to fill PyTables table?<p>I am trying to write a Discord bot in Python. Goal of that bot is to fill a table with entries f... |
72,388,673 | How to import multiple image into Excel by Java POI<p>Is there any way to import multi picture and text into a cell of excel?
I'm using Java POI.
This is
<a href="https://i.stack.imgur.com/wDRej.png" rel="nofollow noreferrer">my expected result</a></p> | <p>Pictures are not <strong>in</strong> cells in Excel. They hover in a drawing layer over the cells and only are anchored on the cells. So you need calculating the anchor position. That requires following knowledge:</p>
<p>A <a href="https://poi.apache.org/apidocs/dev/org/apache/poi/ss/usermodel/ClientAnchor.html" rel... | How to import multiple image into Excel by Java POI | java|image|apache-poi | 0 | 81 | 1 | 72,389,256 | 72,389,256 | 1 | true | 2022-05-26T08:04:05.400Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to import multiple image into Excel by Java POI<p>Is there any way to import multi picture and text into a cell of excel?
I'm using Java POI.
This is
<a ... |
72,300,831 | Is there a (portable) way to detect layout change in C++ classes?<p>For example say I have a class Foo with a typical serialization pattern.</p>
<pre><code>struct Foo {
int a;
bool b;
template <typename Archive>
void serialize(Archive & ar) {
ar & a;
ar & b;
}
};
</... | <p>There is cool library in boost: <a href="https://www.boost.org/doc/libs/1_75_0/doc/html/boost_pfr.html" rel="nofollow noreferrer">boost pfr</a>. I never used it in real project (just some toys), but seems to work quite well:</p>
<pre class="lang-cpp prettyprint-override"><code>struct Foo {
int a;
bool b;
... | Is there a (portable) way to detect layout change in C++ classes? | c++|reflection|c++17 | 0 | 81 | 1 | 72,381,813 | 72,381,813 | 1 | true | 2022-05-19T08:05:04.347Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there a (portable) way to detect layout change in C++ classes?<p>For example say I have a class Foo with a typical serialization pattern.</p>
<pre><code>s... |
72,283,151 | How is this "number square" problem done with a modulus operator?<p>I have come across a very familiar problem doing some exercises and for the life of me cannot figure it out using the intended method -- the modulus <code>%</code> operator -- that accepts <code>(int min, int max)</code> parameters as beginning and end... | <p>Assuming your <em>integer</em> is <code>abcd</code> where each letter is a digit. You can do left cyclic shift by first separating <code>bcd</code> and <code>a</code></p>
<pre><code>bcd = abcd % 1000
a = abcd / 1000 (integer division)
</code></pre>
<p>Then, to construct the left cyclic shift from <code>bcd</code> an... | How is this "number square" problem done with a modulus operator? | java|loops|modulo | 0 | 81 | 2 | 72,283,431 | 72,283,431 | 1 | true | 2022-05-18T04:18:35.977Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How is this "number square" problem done with a modulus operator?<p>I have come across a very familiar problem doing some exercises and for the life of me ca... |
72,262,563 | "This field is required." Django rest framework<p>I've looked every answer in stack I cant find an answer. I 've created an API with django rest framework with some measurements . Im trying to post a TreeSensor measurement through postman or django API .Weather measurements works just fine but on my TreeSensor i get t... | <p>I think the error occurred because you had changed the field names.</p>
<pre><code>########### TreeSensorMeasurement Api ###########
def post(self,request, *args, **kwargs):
data = {
'sensor' : request.data.get('sensor'),
'datetime' : request.data.get('datetime'),
# Here I changed the fi... | "This field is required." Django rest framework | django|post|django-rest-framework|django-serializer | 0 | 81 | 1 | 72,262,747 | 72,262,747 | 1 | true | 2022-05-16T16:30:16.957Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
"This field is required." Django rest framework<p>I've looked every answer in stack I cant find an answer. I 've created an API with django rest framework wi... |
72,288,870 | How to plot and save with an <AxesSubplot:> output<p>I am using this <a href="https://github.com/e2nIEE/pandapower/blob/develop/pandapower/plotting/simple_plot.py" rel="nofollow noreferrer">function</a></p>
<p>It return one AxesSubplot:</p>
<p>I would like to save the plot that is ploted when <code>show_plot=True</code... | <p>To get the whole figure, you could try:</p>
<pre><code>ax.get_figure().savefig('fig_name.png')
</code></pre>
<p>If you have a figure with multiple subplots and you want to only extract one (<code>ax</code>):</p>
<pre><code># Get the bounding box of the subplot and expand it to include the axis labels and ticks.
# Yo... | How to plot and save with an <AxesSubplot:> output | python|matplotlib|plot|pandapower | 1 | 81 | 1 | 72,288,943 | 72,288,943 | 1 | true | 2022-05-18T12:04:58.810Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to plot and save with an <AxesSubplot:> output<p>I am using this <a href="https://github.com/e2nIEE/pandapower/blob/develop/pandapower/plotting/simple_pl... |
72,273,657 | My email code doesn't work when I upload it to the host (godaddy- windows host) (Asp.net core (.net 5.0))<p>During the time I used iis express, I did not have any problems sending mail.
After uploading to the host, loading goes on while testing, and then returns an http 500 error. Creates a user when looking at the dat... | <p>After learning that the code I wrote did not work on this host, I found a new short code and there was no problem using it.
I'm adding a code here that might be useful to someone</p>
<pre><code>using (MailMessage mm = new MailMessage(" from @mail.com ", " to @mail.com "))
{
... | My email code doesn't work when I upload it to the host (godaddy- windows host) (Asp.net core (.net 5.0)) | c#|asp.net|smtp|web-hosting | 0 | 81 | 2 | 72,327,903 | 72,327,903 | 1 | true | 2022-05-17T11:58:31.500Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
My email code doesn't work when I upload it to the host (godaddy- windows host) (Asp.net core (.net 5.0))<p>During the time I used iis express, I did not hav... |
72,361,410 | How to make floating SliverAppBar to show only collapsed bar?<p>I am using a SliverAppBar for Flutter web with a background image, and I would like the bar to disappear when the user is scrolling down the web and appear again as soon as they scroll up, but only the app bar, without showing the background unless they re... | <p>Yes, it is. But, I guess not directly.</p>
<p>You can use a <code>ScrollController</code> to achieve this.
Attach a <code>ScrollController</code> to the <code>CustomScrollView</code>, then observe the <code>offset</code> of the controller where the position is. And based on it, you can achieve the desired output.</p... | How to make floating SliverAppBar to show only collapsed bar? | flutter|dart|flutter-web|sliverappbar | 1 | 81 | 1 | 72,366,404 | 72,366,404 | 1 | true | 2022-05-24T10:37:02.183Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make floating SliverAppBar to show only collapsed bar?<p>I am using a SliverAppBar for Flutter web with a background image, and I would like the bar t... |
72,241,836 | How can I verify that my textfield is empty?<pre><code> def check_full_name(self):
toast("You have to enter your full name to use the app correctly ! ")
</code></pre>
<pre><code> MDTextFieldRound:
id:user_app
hint_text: "Full Name"
size_hint_x: None
siz... | <p>According to your question, this should fix your problem:</p>
<p><strong>.py file</strong></p>
<pre><code>from kivymd.app import MDApp
from kivymd.toast import toast
class PyApp(MDApp):
def on_start(self):
if self.root.ids.user_app.text == '':
self.check_full_name()
else:
... | How can I verify that my textfield is empty? | python|kivy|kivymd | 1 | 81 | 2 | 72,242,179 | 72,242,179 | 2 | true | 2022-05-14T15:51:20.197Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I verify that my textfield is empty?<pre><code> def check_full_name(self):
toast("You have to enter your full name to use the app cor... |
72,250,227 | INSERT IF NOT EXISTS ELSE RETURN THE VALUE<p>I need an SQLite query which inserts a value into some table if not exist, and return the value if exist. So far I've found "insert if not exists" part here as:</p>
<pre><code>INSERT INTO tableName (str1, str2, date)
SELECT 'example','someText', DATETIME()
WHERE NO... | <p>For my understanding, SQLite doesn't support this. But in the future it will support this.</p>
<p>See: <a href="https://www.sqlite.org/draft/lang_returning.html#:%7E:text=The%20RETURNING%20clause%20is%20designed%20to%20provide%20the,report%20the%20chosen%20values%20back%20to%20the%20application" rel="nofollow noref... | INSERT IF NOT EXISTS ELSE RETURN THE VALUE | sqlite | 0 | 81 | 1 | 72,252,785 | 72,252,785 | 2 | true | 2022-05-15T16:36:41.190Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
INSERT IF NOT EXISTS ELSE RETURN THE VALUE<p>I need an SQLite query which inserts a value into some table if not exist, and return the value if exist. So far... |
72,260,239 | Breadth First Search Algorithm Does Not Work Results in Infinite Loop<p>I am trying to do a BFS search where I dynamically create the Nodes of the graph as I search the State Space. I followed the book but it does not work the frontier keeps on running and the explored set stays at the start value only. Please help, I ... | <p>You are never checking if nodes are already explored, so you will likely enter an infinite loop:</p>
<pre><code>explored.Add(next.Data.Data);
</code></pre>
<p>should be</p>
<pre><code>if(!explored.Add(next.Data.Data)) continue;
</code></pre>
<p>But there might be other problems with the code. I would highly recommen... | Breadth First Search Algorithm Does Not Work Results in Infinite Loop | c#|algorithm|graph|artificial-intelligence|breadth-first-search | 0 | 81 | 1 | 72,261,069 | 72,261,069 | 2 | true | 2022-05-16T13:44:52.597Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Breadth First Search Algorithm Does Not Work Results in Infinite Loop<p>I am trying to do a BFS search where I dynamically create the Nodes of the graph as I... |
72,266,426 | Increase time before connection timout on python cx_Oracle connection to slow database<p>I am using a standard cx_Oracle.connect() statement in python like this</p>
<p><code>cnxn = cx_Oracle.connect(user/pwd@connection:port/service)</code></p>
<p>And I am getting this error</p>
<p><code>DatabaseError: ORA-12170: TNS:Co... | <p>If you are using Oracle Client 19c or later, you can add a connect timeout to your Easy Connect string. See <a href="https://download.oracle.com/ocomdocs/global/Oracle-Net-21c-Easy-Connect-Plus.pdf" rel="nofollow noreferrer">Oracle Database 21c Easy Connect Plus</a>:</p>
<pre><code>cnxn = cx_Oracle.connect(user/pwd... | Increase time before connection timout on python cx_Oracle connection to slow database | python|cx-oracle | 1 | 81 | 2 | 72,266,850 | 72,266,850 | 2 | true | 2022-05-16T22:54:52.083Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Increase time before connection timout on python cx_Oracle connection to slow database<p>I am using a standard cx_Oracle.connect() statement in python like t... |
72,283,548 | Multiple arithmetic operation in awk<p>I have this awk function to do speed conversion.</p>
<pre><code>function hum(x) {
split( "B/s KB/s MB/s GB/s TB/s", v); s=1
while( x>1000 ){ x/=1000; s++ }
printf( "%0.2f %s" , x , v[s] )
}
hum($1)
</code></pre>
<p>It works great if used standalone.</p... | <p>Instead of a loop, let's use <code>log()</code>:</p>
<pre><code>$ cat program.awk
function hum2(x, v,p) {
split( "b/s kb/s Mb/s Gb/s Tb/s", v) # remember to B -> b
x*=8 # to bits conversion
p=int(log(x)/log(1000)) #... | Multiple arithmetic operation in awk | shell|awk | 0 | 81 | 4 | 72,284,367 | 72,284,367 | 2 | true | 2022-05-18T05:19:07.617Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Multiple arithmetic operation in awk<p>I have this awk function to do speed conversion.</p>
<pre><code>function hum(x) {
split( "B/s KB/s MB/s GB/s TB... |
72,288,379 | 2 Docker images, different TAG have the same IMAGE ID<p>Why do 2 docker images with a different TAG have the same IMAGE ID?</p>
<p>My idea of IMAGE ID was that this is unique for the image/tag.</p>
<pre class="lang-sh prettyprint-override"><code>$ docker images | grep -e "airflow" -e "IMAGE"
REPOSIT... | <p>The image id is based on a hash of the image config. That config uniquely identifies an image since it not only contains all settings of the image, but also hashes of the filesystem layers that make up the image.</p>
<p>Tags, both on docker and in registries (though they reference a slightly different thing) are poi... | 2 Docker images, different TAG have the same IMAGE ID | docker | 0 | 81 | 1 | 72,288,496 | 72,288,496 | 2 | true | 2022-05-18T11:30:19.703Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
2 Docker images, different TAG have the same IMAGE ID<p>Why do 2 docker images with a different TAG have the same IMAGE ID?</p>
<p>My idea of IMAGE ID was th... |
72,288,319 | Can PIVOT in BigQuery generate a "total" column, aggregated across all dimension rows?<p>Sample table:</p>
<pre><code>+---------+-------+---------+------+
| product | sales | quarter | year |
+---------+-------+---------+------|
| Kale | 51 | Q1 | 2020 |
| Kale | 23 | Q2 | 2020 |
| Kale | 45 ... | <p>Take a look at below query: You can calculate <code>total</code> over product and year using an analytic function first and then pivot a table to get the result you want.</p>
<pre class="lang-sql prettyprint-override"><code>WITH t AS (
SELECT 'Kale' as product, 51 as sales, 'Q1' as quarter, 2020 as year UNION ALL
... | Can PIVOT in BigQuery generate a "total" column, aggregated across all dimension rows? | sql|google-bigquery | 0 | 81 | 2 | 72,290,819 | 72,290,819 | 2 | true | 2022-05-18T11:26:29.163Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can PIVOT in BigQuery generate a "total" column, aggregated across all dimension rows?<p>Sample table:</p>
<pre><code>+---------+-------+---------+------+
| ... |
72,319,999 | Convert combinations of row+column as Column headers<p>I have a dataframe as follows:</p>
<pre><code>Machine Time Part PowerA PowerB
1 20:30 1 0.1 0.4
1 20:30 2 0.9 0.7
1 20:31 1 0.3 0.1
1 20:31 2 0.2 0... | <p>Let us do <code>pivot_table</code> then <code>swaplevel</code></p>
<pre><code>s = df.pivot_table(index= ['Machine','Time'],
columns = df.Part.astype(str).radd('Part'),
values=['PowerA','PowerB'],
fill_value=-1).swaplevel(1,0, axis=1).sort_index(level=0, axis=... | Convert combinations of row+column as Column headers | python|pandas|dataframe | 2 | 81 | 4 | 72,320,142 | 72,320,142 | 2 | true | 2022-05-20T13:47:25.267Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Convert combinations of row+column as Column headers<p>I have a dataframe as follows:</p>
<pre><code>Machine Time Part PowerA PowerB
1 ... |
72,367,945 | Perform operations on button values in JavaScript<p>I'm trying to make a calculator in JS and I'm searching for ways to add, subtract, multiply and divide button values. I've created a function to display the buttons but now I realize that that might not be necessary and I might need just one function which displays an... | <p>You're right that you can use one function to do all the work <em>but</em> it means that you have to mark up your HTML with classes and data-attributes.</p>
<p>In this example I've used <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/grid" rel="nofollow noreferrer">CSS grid</a> to display the various calcu... | Perform operations on button values in JavaScript | javascript|button|calculator|operation | 0 | 81 | 1 | 72,368,605 | 72,368,605 | 2 | true | 2022-05-24T18:40:34.897Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Perform operations on button values in JavaScript<p>I'm trying to make a calculator in JS and I'm searching for ways to add, subtract, multiply and divide bu... |
72,251,092 | Simulate, through a macro, a click on a custom ribbon item<p>I've seen similar questions asked, but did not manage to find an answer to my specific problem.</p>
<p>I have in place a custom ribbon tab, with custom buttons. Their purpose is to each insert a QuickPart in the document.</p>
<p>As I have a lot of different Q... | <p>Use keytips for ribbon controls instead of inventing something new. <code>KeyTips</code> are the keyboard shortcuts that appear on the Ribbon when you press the ALT key. You can assign your own <code>KeyTips</code> by using the <code>keytip</code> and <code>getKeytip</code> attributes. The <code>getKeyTip</code> cal... | Simulate, through a macro, a click on a custom ribbon item | vba|ms-word|keyboard-shortcuts|ribbonx | -1 | 81 | 2 | 72,252,340 | 72,252,340 | 2 | true | 2022-05-15T18:24:43.503Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Simulate, through a macro, a click on a custom ribbon item<p>I've seen similar questions asked, but did not manage to find an answer to my specific problem.<... |
72,248,135 | How can I declare an array of unknown elements where the first one must be a string?<p>I'm trying to write a function that accepts an array of arrays. The inner array can have any number of elements of any type, but the first one must be a string.</p>
<p>The following is a valid input array:</p>
<pre><code>[
['2022... | <p>The example's <code>[[string, ...any[]]]</code> parameter type is expecting a tuple that contains a single nested tuple with the first value being a string and allowing any other entry types after it.</p>
<p>This type should be changed to <code>[string, ...any[]][]</code> which expects an array of tuples that accept... | How can I declare an array of unknown elements where the first one must be a string? | typescript | 1 | 81 | 2 | 72,248,256 | 72,248,256 | 2 | true | 2022-05-15T12:11:36.723Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I declare an array of unknown elements where the first one must be a string?<p>I'm trying to write a function that accepts an array of arrays. The in... |
72,322,565 | How to activate my own Jakarta HttpAuthenticationMechanism implementation in Jakarta EE app<p>I am creating an simple <strong>Jakarta EE 9</strong> app. Because of my own reason, I have to implement my own HttpAuthenticationMechanism (I am not using built-in <a href="https://jakarta.ee/specifications/platform/9/apidocs... | <p><strong>I found out what was wrong. There was NO security domain 'jaspitest' in Wildfly 26. This security domain existed in Wildfly before by default, but no longer exists</strong>. That was the reason why my own HttpAuthenticationMechanism did not get invoked.</p>
<p><strong>Solution</strong>: Use Security Domain <... | How to activate my own Jakarta HttpAuthenticationMechanism implementation in Jakarta EE app | java|jakarta-ee|wildfly-26|jakarta-ee-security-api|jakarta-ee-9 | 2 | 81 | 1 | 72,350,172 | 72,350,172 | 2 | true | 2022-05-20T17:13:20.133Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to activate my own Jakarta HttpAuthenticationMechanism implementation in Jakarta EE app<p>I am creating an simple <strong>Jakarta EE 9</strong> app. Beca... |
72,238,075 | How to change color of checkbox values<p>I want to change color of checkbox values like if it's checked it shows text in green if its unchecked it shows color in red here is simple input type</p>
<p>but I am not sure how I color these true-value and false-value if someone knows please help, Thanks! P.S I have put the w... | <p>You can bind style:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>new Vue({
el: '#demo',
data() {
return {
student: {name: "", gender: "male", age: 0, count... | How to change color of checkbox values | javascript|vue.js|vuejs2 | -1 | 81 | 3 | 72,238,199 | 72,238,199 | 2 | true | 2022-05-14T07:08:01.950Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to change color of checkbox values<p>I want to change color of checkbox values like if it's checked it shows text in green if its unchecked it shows colo... |
72,350,046 | How to work with 2 HCSR04 Arduino Component?<p>Any ideas for the code of working with 2 different ultrasonic sensors? The idea is when either one of the sensors detects an obj in front of the sensor, it automatically turns on a buzzer. But for now, I only use the 2 ultrasonic sensors. This is my code, doesnt work as ex... | <p>A better way to approach this problem would be to make a function that returns the distance long. The code would look like this:</p>
<pre><code>long duration, distance, RightSensor,LeftSensor;
void setup()
{
Serial.begin (9600);
pinMode(trigPin1, OUTPUT);
pinMode(echoPin1, INPUT);
pinMode(trigPi... | How to work with 2 HCSR04 Arduino Component? | c++|arduino|arduino-uno | 0 | 81 | 1 | 72,366,408 | 72,366,408 | 2 | true | 2022-05-23T14:12:55.787Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to work with 2 HCSR04 Arduino Component?<p>Any ideas for the code of working with 2 different ultrasonic sensors? The idea is when either one of the sens... |
72,401,055 | 2 different ways of doing terraform dynamic statement, what's the difference<p>I have come across 2 terraform dynamic syntax, just wondering what's the difference?</p>
<pre><code>dynamic "storage_account" {
for_each = var.storage_account == null ? {} : var.storage_account
content {
name ... | <p>When you have <a href="https://www.terraform.io/language/expressions/conditionals" rel="nofollow noreferrer">Conditional Expression</a> in TF such as</p>
<p><code>condition ? true_val : false_val</code></p>
<p><code>true_val</code> and <code>false_val</code> must be of <strong>same type</strong>.</p>
<p>So in your f... | 2 different ways of doing terraform dynamic statement, what's the difference | azure|terraform|terraform-provider-azure | 0 | 81 | 1 | 72,402,541 | 72,402,541 | 2 | true | 2022-05-27T05:57:56.390Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
2 different ways of doing terraform dynamic statement, what's the difference<p>I have come across 2 terraform dynamic syntax, just wondering what's the diffe... |
72,301,279 | How to get attributes of annotations in Java using reflection?<p>I have several data classes in java of which I want to know - using reflection - which fields have a certain annotation with a certain attribute which is the following:</p>
<pre><code>@Column(columnDefinition = "text") // Text with unbound lengt... | <p>You should be able to get the instance of that annotation (including your values) using</p>
<pre><code>Column fieldAnnotation = attr.getAnnotation(Column.class);
</code></pre>
<p>If the field is not annotated with <code>@Column</code>, <code>getAnnotation</code> returns null. That means you don't need to iterate ove... | How to get attributes of annotations in Java using reflection? | java|reflection|annotations | 2 | 81 | 1 | 72,301,320 | 72,301,320 | 2 | true | 2022-05-19T08:39:35.590Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get attributes of annotations in Java using reflection?<p>I have several data classes in java of which I want to know - using reflection - which field... |
72,281,153 | Why does AdaBoost or GradientBoosting ensemble with a single estimator give different values than the single estimator?<p>I'm curious why a single-estimator Adaboost "ensemble", a single-estimator Gradient Boosted "ensemble" and a single decision tree give different values.</p>
<p>The code below com... | <p><code>AdaBoostRegressor</code> performs weighted bootstrap sampling for each of its trees (unlike <code>AdaBoostClassifier</code> which IIRC just fits the base classifier using sample weights): <a href="https://github.com/scikit-learn/scikit-learn/blob/32f9deaaf27c7ae56898222be9d820ba0fd1054f/sklearn/ensemble/_weig... | Why does AdaBoost or GradientBoosting ensemble with a single estimator give different values than the single estimator? | machine-learning|scikit-learn|decision-tree|ensemble-learning|adaboost | 1 | 81 | 1 | 72,293,089 | 72,293,089 | 3 | true | 2022-05-17T22:05:31.237Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why does AdaBoost or GradientBoosting ensemble with a single estimator give different values than the single estimator?<p>I'm curious why a single-estimator ... |
72,317,021 | Rails: multi-file upload produces one empty entry<p>I am trying to create some sort of a nested file upload. I have Images and Albums, which are related through the model AlbumImages. Images can be part of an album. The upload is carried out through Carrierwave.</p>
<p>I want to be able to upload Images in two ways:</p... | <p>I was able to get it running. I needed to set <code>include_hidden: false</code> in the file_field</p>
<pre><code><%= image.file_field :file_name, include_hidden: false, multiple: :true, name: "album[images_attributes][][file_name]", class: 'form-field' %>
</code></pre>
<p>Before updating Rails and C... | Rails: multi-file upload produces one empty entry | ruby-on-rails|carrierwave | 1 | 81 | 2 | 72,322,598 | 72,322,598 | 3 | true | 2022-05-20T10:00:41.593Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Rails: multi-file upload produces one empty entry<p>I am trying to create some sort of a nested file upload. I have Images and Albums, which are related thro... |
72,401,443 | How to do multi string replace in a multiline text file that has almost a million lines using PowerShell?<p>I have a few log files ( mosquitto broker logs) that have the following format <br/></p>
<pre><code>1652855102: New connection from xx.xx.xx.xx on port xxxx.
1652855102: Socket error on client <unknown>, di... | <p><strong>Your only problem is the use of inline regex option <code>s</code></strong>, i.e. the <code>SingleLine</code> option that makes metacharacter <code>.</code> match <em>any</em> character, <em>including newlines</em>; in effect, this causes your regex to match the <em>entire string, across all lines</em>; <em... | How to do multi string replace in a multiline text file that has almost a million lines using PowerShell? | regex|powershell | 0 | 81 | 2 | 72,405,499 | 72,405,499 | 3 | true | 2022-05-27T06:43:54.573Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to do multi string replace in a multiline text file that has almost a million lines using PowerShell?<p>I have a few log files ( mosquitto broker logs) t... |
72,387,045 | Python recursive function with helper function<p>I am writing a function to determine the size of a binary search tree. I tried it in a recursive way:</p>
<pre><code>def size(self) -> int: #self representing the whole bst
"""Return number of nodes contained in the tree."""
... | <p>There are the following issues:</p>
<ul>
<li><p><code>_size</code> is an instance attribute that is set in the <code>__init__</code> function. That means that <code>self._size</code> will refer to that attribute, and not to the class method with the same name. This is the cause of the error you get. You should use a... | Python recursive function with helper function | python|recursion|binary-search-tree | 2 | 81 | 2 | 72,394,128 | 72,394,128 | 3 | true | 2022-05-26T05:21:21.587Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python recursive function with helper function<p>I am writing a function to determine the size of a binary search tree. I tried it in a recursive way:</p>
<p... |
72,334,754 | Terraform command line arguments doesn't work with conditional expression<p>I am trying to deploy a resource block either into dev or prod depending on the variable using conditional expression , for this i am trying to use command line argument.
This work with terraform.tfvars but doesn't work with CMD arguments which... | <p>I would recommend to use the following syntax instead of checking for the literal <code>true</code> or <code>false</code> value</p>
<pre><code>resource "aws_instance" "dev" {
ami = "ami-0ca285d4c2cda3300"
instance_type = var.instanceType
count = var.istest ? 1 :... | Terraform command line arguments doesn't work with conditional expression | amazon-web-services|terraform|terraform-provider-aws | 0 | 81 | 1 | 72,335,363 | 72,335,363 | 3 | true | 2022-05-22T04:13:08.740Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Terraform command line arguments doesn't work with conditional expression<p>I am trying to deploy a resource block either into dev or prod depending on the v... |
72,261,262 | Data manipulation inside a function in "C"<p>Here's something I don't understand. Maybe someone can shed some light on it.</p>
<p>I know that the standard method for data manipulation is passing a reference to a function and changing the data in the function. Like this:</p>
<pre><code>#include <stdio.h>
#include ... | <p>This declaration of the parameter</p>
<pre><code>void function2( float &param) {
</code></pre>
<p>is incorrect. In C there is no reference. Such a function declaration will be valid in C++, where references exist.</p>
<p>In C++ when the function is called like</p>
<pre><code>function2(variable);
</code></pre>
<p... | Data manipulation inside a function in "C" | c|pointers|reference|pass-by-reference|function-declaration | 3 | 81 | 5 | 72,261,420 | 72,261,420 | 4 | true | 2022-05-16T14:56:48.443Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Data manipulation inside a function in "C"<p>Here's something I don't understand. Maybe someone can shed some light on it.</p>
<p>I know that the standard me... |
72,396,924 | Mismatched types with modules<p>I am making small program for validating and computing IPs.
I wanted to try out modules and I encountered an error I do not know how to solve and can't find anything on the internet.</p>
<p>Here is my project structure:</p>
<pre><code>src/
ip.rs
main.rs
mask.rs
show.rs ... | <blockquote>
<pre><code>#[path = "ip.rs"] mod ip;
#[path = "mask.rs"] mod mask;
</code></pre>
</blockquote>
<p>This declares new submodules, independent from the ones declared in <code>mod.rs</code>. That they have the same source code is immaterial, as far as typechecking and object identity are co... | Mismatched types with modules | rust|module | 1 | 81 | 2 | 72,397,385 | 72,397,385 | 4 | true | 2022-05-26T19:16:55.300Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Mismatched types with modules<p>I am making small program for validating and computing IPs.
I wanted to try out modules and I encountered an error I do not k... |
72,256,841 | Are constraints in overload resolution affected by difference it type qualifiers?<p>Having the following simple code:</p>
<pre><code>#include <concepts>
auto f(const auto&) { }
auto f(std::integral auto) {}
int main()
{
f(5);
}
</code></pre>
<p><a href="https://gcc.godbolt.org/z/5cxn88rbE" rel="nofol... | <p>Without considering constraints, the call is ambiguous because the first overload is deduced to a function parameter type <code>const int&</code> and the second to <code>int</code>. Neither will be considered better than the other when called with a prvalue of type <code>int</code> and neither <code>const auto&a... | Are constraints in overload resolution affected by difference it type qualifiers? | c++|c++20|c++-concepts | 4 | 81 | 1 | 72,257,071 | 72,257,071 | 5 | true | 2022-05-16T09:18:41.867Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Are constraints in overload resolution affected by difference it type qualifiers?<p>Having the following simple code:</p>
<pre><code>#include <concepts>... |
72,307,874 | Why disabling copy elision for std::atomic doesn't work using C++17?<p>For <code>std::atomic</code> the copy constructor is deleted, and this should only compile with C++17 and higher due to <a href="https://stackoverflow.com/a/68328324/1383356">copy elision</a>:</p>
<pre class="lang-cpp prettyprint-override"><code>std... | <p>C++17 doesn't simply say that the previously optional return value optimizations are now mandatory. The actual description of the language changed so that there is no creation of a temporary object anymore in the first place.</p>
<p>So, since C++17, there is no constructor call that <em>could</em> be elided anymore.... | Why disabling copy elision for std::atomic doesn't work using C++17? | c++|c++17|copy-elision | 2 | 81 | 2 | 72,308,048 | 72,308,048 | 6 | true | 2022-05-19T16:14:05.017Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why disabling copy elision for std::atomic doesn't work using C++17?<p>For <code>std::atomic</code> the copy constructor is deleted, and this should only com... |
72,882,050 | Why Heroku unable to start worker?<p>I have a Rails app deployed to heroku but it doesn't work. Here is what i got in <code>heroku logs --tail</code></p>
<pre><code>2022-07-06T09:59:13.574745+00:00 heroku[web.1]: State changed from down to starting
2022-07-06T09:59:23.970068+00:00 heroku[web.1]: Starting process with c... | <p>Try to add <code>workers Integer(ENV.fetch('WEB_CONCURRENCY') || 2)</code> in config/puma.rb</p>
<p>Uncomment <code>preload_app!</code></p>
<p>In Procfile add <code>-c 2</code> to <code>worker: bundle exec sidekiq</code></p>
<p>Add 'net/pop' gem to Gemfile.</p> | Why Heroku unable to start worker? | ruby-on-rails|heroku|deployment|kernel | 0 | 81 | 1 | 72,882,585 | 72,882,585 | 1 | true | 2022-07-06T10:37:56.453Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why Heroku unable to start worker?<p>I have a Rails app deployed to heroku but it doesn't work. Here is what i got in <code>heroku logs --tail</code></p>
<pr... |
72,954,828 | Not able to see the content of my data when I check or uncheck my checkbox in the console log<p>I don't understand why when I check (<code>availability:1</code>) or uncheck (<code>availability:0</code>) the checkbox, I don't have this info : <code>availability:1</code> (for example), I only get <code>availability: </co... | <p>Updating <code>checked</code> state in the child component won't automatically update the <code>forms</code> state in the parent, since they are not related to one another.</p>
<p>Because <code>const [checked, setChecked] = useState(v);</code> only reads the initialState passed in as <code>v</code> from parent compo... | Not able to see the content of my data when I check or uncheck my checkbox in the console log | javascript|html|reactjs | 0 | 81 | 1 | 72,955,297 | 72,955,297 | 1 | true | 2022-07-12T15:29:29.230Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Not able to see the content of my data when I check or uncheck my checkbox in the console log<p>I don't understand why when I check (<code>availability:1</co... |
72,999,689 | Why can I not delegate to a parameter in a Kotlin value class?<p>I can delegate to a contructor parameter in a class</p>
<pre><code>class SerialNumber(val value: String) : CharSequence by value {
init {
require(value.isNotBlank())
}
}
</code></pre>
<p>but if I make the class a value class</p>
<pre><cod... | <p>Implementation by delegation for inline classes was enabled in version 1.7.0</p>
<p><a href="https://kotlinlang.org/docs/whatsnew17.html#allow-implementation-by-delegation-to-an-inlined-value-of-an-inline-class" rel="nofollow noreferrer">https://kotlinlang.org/docs/whatsnew17.html#allow-implementation-by-delegation-... | Why can I not delegate to a parameter in a Kotlin value class? | kotlin | 1 | 81 | 1 | 72,999,762 | 72,999,762 | 1 | true | 2022-07-15T21:17:52.100Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why can I not delegate to a parameter in a Kotlin value class?<p>I can delegate to a contructor parameter in a class</p>
<pre><code>class SerialNumber(val va... |
72,826,788 | How to Parse Array of JSON Objects using Axios<p>Using <strong>Axios</strong> I'm trying to pass <code>JSON</code> data as <code>params</code> to the endpoint URL.</p>
<p>My <code>params</code>:</p>
<pre><code>const annotations = {
"key": "Book.pdf",
"pages": [
{
&quo... | <p>I'd use JSON.stringify on your params...</p>
<pre><code>const parseParams = (params) => {
const keys = Object.keys(params);
let options = [];
keys.forEach((key) => {
options.push(`${key}=${encodeURIComponent(JSON.stringify(params[key]))}`);
});
return options.join('&');
};
</code></pre> | How to Parse Array of JSON Objects using Axios | javascript|axios | 1 | 81 | 1 | 72,827,003 | 72,827,003 | 1 | true | 2022-07-01T08:57:27.237Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to Parse Array of JSON Objects using Axios<p>Using <strong>Axios</strong> I'm trying to pass <code>JSON</code> data as <code>params</code> to the endpoin... |
72,771,712 | How can I assign green for an uptrend in line chart in chart-js and red for a downtrend in chart-js?<p>I want to assign green for an uptrend in line chart in chart-js and red for a downtrend in chart-js. I am relatively new to chartjs and I am not sure how to access the data elements to spot an uptrend or a downtrend.<... | <p>You can use <a href="https://www.chartjs.org/docs/3.7.1/charts/line.html#segment" rel="nofollow noreferrer">segments</a> for this:</p>
<pre class="lang-js prettyprint-override"><code>var dataReqdFormat = {
labels: [],
datasets: [{
data: [],
label: "Nifty",
fill: true,
segment: {
b... | How can I assign green for an uptrend in line chart in chart-js and red for a downtrend in chart-js? | chart.js|react-chartjs|vue-chartjs|react-chartjs-2|chartjs-2.6.0 | 1 | 81 | 1 | 72,771,922 | 72,771,922 | 1 | true | 2022-06-27T11:58:59.447Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I assign green for an uptrend in line chart in chart-js and red for a downtrend in chart-js?<p>I want to assign green for an uptrend in line chart in... |
72,775,970 | Sweetalert 2 - Post Variable from form AND Sweetalert to PHP?<p>I have the following code. I need the variable "$computerID" from the form and the variable "hardwareComputerName". I tested some things, but nothing worked. The variable "$computerID" is no problem.</p>
<p>The form:</p>
<pre>... | <p>The PHP global variable <code>$_POST</code> contains all the data that are posted to the server. Currently, <code>hardwareComputerName</code> is only a variable on the client side. You need to add it to your form, so it can be posted to the server. Only then you'll be able to read it from <code>$_POST['hardwareComp... | Sweetalert 2 - Post Variable from form AND Sweetalert to PHP? | javascript|php|html|input|sweetalert2 | 0 | 81 | 1 | 72,856,581 | 72,856,581 | 1 | true | 2022-06-27T17:13:05.683Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Sweetalert 2 - Post Variable from form AND Sweetalert to PHP?<p>I have the following code. I need the variable "$computerID" from the form and the ... |
72,788,032 | getSuperClass() throws Exception but getSuperclassName() returns the name of the super class<pre><code>System.out.println(javaClass.getSuperclassName());
JavaClass javaClass1 = javaClass.getSuperClass();
</code></pre>
<p>the first line output the name of the class: RestController</p>
<p>The second line throws Excepti... | <p>So, you're using <a href="https://commons.apache.org/proper/commons-bcel/" rel="nofollow noreferrer">The Byte Code Engineering Library (Apache Commons BCELβ’)</a> to load classes from a Jar file (by filename) and want to print the entire call graph with <a href="https://github.com/gousiosg/java-callgraph/blob/master/... | getSuperClass() throws Exception but getSuperclassName() returns the name of the super class | java|superclass|bcel | 1 | 81 | 1 | 72,797,586 | 72,797,586 | 1 | true | 2022-06-28T14:11:48.470Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
getSuperClass() throws Exception but getSuperclassName() returns the name of the super class<pre><code>System.out.println(javaClass.getSuperclassName());
Ja... |
72,820,153 | Element not interactable with selenium python<p>I know that this question was asked many times on stackoverflow. I tried different solutions but did not get it work. Here is a simple MWE to automate the search on Youtube. Any body familiar with this can help explain the raison ?</p>
<pre><code>from bs4 import Beautiful... | <p>There are 2 problems with your code:</p>
<ol>
<li>You should use unique locator.<br />
The locator you are using here matching 5 elements on that page, so Selenium returns you the first element on the page matching the locator you passing here while you need the second match.<br />
This locator will work better <cod... | Element not interactable with selenium python | python|selenium|selenium-webdriver|xpath|webdriverwait | 0 | 81 | 1 | 72,820,435 | 72,820,435 | 1 | true | 2022-06-30T17:58:05.677Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Element not interactable with selenium python<p>I know that this question was asked many times on stackoverflow. I tried different solutions but did not get ... |
72,935,045 | Dynamically add item into react-bootsrap accordion<p>I'm getting my data from database. Then I would like them to be categorized by "item_category" and have them in react-bootstrap accordion.</p>
<p>So far I have this:</p>
<pre><code><Accordion>
{
items.map((item, index) =>... | <p>You can either get items from backend already grouped by category or you can ask for category while iterating over your items, save them grouped by category and only then render Accordion.Item for each category:</p>
<ul>
<li>Iterate over items</li>
<li>Create an object for categories</li>
<li>Look up if item.item_ca... | Dynamically add item into react-bootsrap accordion | javascript|reactjs|react-bootstrap | 1 | 81 | 2 | 72,935,146 | 72,935,146 | 1 | true | 2022-07-11T07:27:22.870Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Dynamically add item into react-bootsrap accordion<p>I'm getting my data from database. Then I would like them to be categorized by "item_category"... |
72,779,319 | How can you require that a concept parameter is a reference `&` type?<p>In the following <a href="https://godbolt.org/z/YWs74esxo" rel="nofollow noreferrer">concept implementation</a> <code>struct</code>, <code>String</code>, the <code>operator()</code> method does not take the value <code>Source</code> by reference bu... | <p>You cannot (reasonably) detect if takes a reference parameter. But you can detect if it can take an rvalue:</p>
<pre><code>template <class Type, class Source>
concept ConsumerOfRvalue = requires(Type type, Source &&source, std::ranges::iterator_t<Source> position) {
type(std::move(source), po... | How can you require that a concept parameter is a reference `&` type? | c++|reference|arguments|c++20|c++-concepts | 1 | 81 | 2 | 72,779,460 | 72,779,460 | 2 | true | 2022-06-27T23:40:24.947Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can you require that a concept parameter is a reference `&` type?<p>In the following <a href="https://godbolt.org/z/YWs74esxo" rel="nofollow noreferrer">... |
72,779,539 | Inno Setup RegKeyExists returns False although the key exists<p>Can someone tell me what is wrong with this code?</p>
<pre class="lang-pascal prettyprint-override"><code>[Code]
const
OldVersionRegKey = '\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#MyAppId}_is1';
var
HasOldVersion: Boolean;
function Ge... | <p>There should be no slash at the beginning of the key path. Check the example in <a href="https://jrsoftware.org/ishelp/index.php?topic=isxfunc_regkeyexists" rel="nofollow noreferrer"><code>RegKeyExists</code> documentation</a>.</p>
<pre class="lang-pascal prettyprint-override"><code>const
OldVersionRegKey = 'SOFTW... | Inno Setup RegKeyExists returns False although the key exists | registry|inno-setup|pascalscript | 3 | 81 | 1 | 72,780,798 | 72,780,798 | 2 | true | 2022-06-28T00:26:32.520Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Inno Setup RegKeyExists returns False although the key exists<p>Can someone tell me what is wrong with this code?</p>
<pre class="lang-pascal prettyprint-ove... |
72,792,839 | Creating array with non-constant length<p>I want to understand why in Rust, we can't create an array with a non-constant size?</p>
<p>Essentially - the piece of code here looks similar (to me). But with vector I can change the length of the vector but can't do that with array. So, why create this artificial limitation:... | <p>Generally speaking, everything in Rust must have a known size (in bytes). In situations where a thing does not have a known size, you may only do very specific things with it. An array of size <code>n</code> and element type <code>T</code> takes up <code>n * size_of::<T>()</code> space (Note: <a href="https://... | Creating array with non-constant length | rust | 1 | 81 | 1 | 72,793,885 | 72,793,885 | 2 | true | 2022-06-28T20:31:08.450Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Creating array with non-constant length<p>I want to understand why in Rust, we can't create an array with a non-constant size?</p>
<p>Essentially - the piece... |
72,792,578 | Google Cloud Project Service Accounts<p>I am using a Google Cloud Project to automate the creation of some users inside of our organization. I have been using some API's that are hosted using the Google Cloud and have had no problem authenticating and using the API's, however I am not sure if I should be using a servic... | <p>Using a <a href="https://cloud.google.com/iam/docs/best-practices-for-using-and-managing-service-accounts#choosing_when_to_use_service_accounts" rel="nofollow noreferrer">Service Account</a> is the best course of action for security reasons when you are the one giving authorization and authentication to your organiz... | Google Cloud Project Service Accounts | google-cloud-platform | 0 | 81 | 1 | 72,794,869 | 72,794,869 | 2 | true | 2022-06-28T20:09:09.953Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Google Cloud Project Service Accounts<p>I am using a Google Cloud Project to automate the creation of some users inside of our organization. I have been usin... |
72,805,325 | Scraping w/ Selenium returns "none:<p>I'm trying to scrape company profile pages from capterra using selenium. Capterra loads profile pages in batches of 25. My code is able to get the first 5, but then returns "none" for the other 20 on the page.</p>
<p>Code:</p>
<pre><code>from bs4 import BeautifulSoup as b... | <p>You don't need selenium. Here you have an <strong>API</strong> and you can scrape directly API with <strong>one request</strong> it returns you <strong>125 objects</strong> you need.</p>
<pre class="lang-py prettyprint-override"><code>import json
import requests
headers = {
'accept': '*/*',
'accept-language... | Scraping w/ Selenium returns "none: | python|selenium|web-scraping | 1 | 81 | 1 | 72,807,964 | 72,807,964 | 2 | true | 2022-06-29T17:07:44.157Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Scraping w/ Selenium returns "none:<p>I'm trying to scrape company profile pages from capterra using selenium. Capterra loads profile pages in batches of 25.... |
72,833,031 | Use $addFields to add field to each item in $lookup results<p>I have two collections in my MongoDB database, <code>category</code> and <code>product</code>, there is a One-to-many relation between these two. So I get what I want like this:</p>
<pre><code>db.category.aggregate([
{
"$lookup": {
&quo... | <p>You need to use full $lookup syntax and add the field within the subquery:</p>
<pre><code>db.category.aggregate([
{
"$lookup": {
"from": "product",
"let": {
"id": "$_id"
},
"pipeline": [
{
$m... | Use $addFields to add field to each item in $lookup results | mongodb | 2 | 81 | 1 | 72,833,210 | 72,833,210 | 2 | true | 2022-07-01T17:55:06.433Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Use $addFields to add field to each item in $lookup results<p>I have two collections in my MongoDB database, <code>category</code> and <code>product</code>, ... |
72,853,553 | Assign values from slice of unknown length to struct in Go?<p>I find the case below from some useful packages in github and it looks so ugly and stupid. I think the better design of code can avoid this, but if we meet this, can it be written more concisely?</p>
<p>Is there a better way to do that instead of continuous ... | <p>You could use a <code>for range</code> to range over the numbers, so you can omit the length check, and use a <code>switch</code> for field assignment, e.g.:</p>
<pre><code>for i, v := range numbers {
switch i {
case 0:
set.Number1 = v
case 1:
set.Number2 = v
case 2:
set.Numbe... | Assign values from slice of unknown length to struct in Go? | go|struct|slice | 2 | 81 | 1 | 72,853,698 | 72,853,698 | 2 | true | 2022-07-04T08:09:16.560Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Assign values from slice of unknown length to struct in Go?<p>I find the case below from some useful packages in github and it looks so ugly and stupid. I th... |
72,857,849 | cannot convert from IEnumerable<string> to char<pre class="lang-cs prettyprint-override"><code>private async Task<string> GenerateQueryAsync(string month, IEnumerable<string> includedUsers)
{
var queryTemplate = await _settingsService.GetAsync("Sat_Retest_Query_Template");
var sb = new Str... | <p>You need to convert the IEnumerable<string> to some form of string that makes sense in your situation.</p>
<p>As an example, this shows how you can convert it into a CSV, e.g. ["one", "two"] becomes "one, two"</p>
<pre><code>var includedUsersCsv = string.Join(", ", inclu... | cannot convert from IEnumerable<string> to char | c# | -1 | 81 | 1 | 72,857,944 | 72,857,944 | 2 | true | 2022-07-04T13:51:55.330Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
cannot convert from IEnumerable<string> to char<pre class="lang-cs prettyprint-override"><code>private async Task<string> GenerateQueryAsync(string mon... |
72,879,912 | How can I create a wasm_bindgen Closure which captures a Rc<RefCell<_>> without moving out of it?<p>I have state that needs to be mutated multiple times by JavaScript callbacks (it's a game, so input from the user needs to modify the game state). I can't seem to figure out how to do it though. This is the simplest exam... | <p><code>Rc</code> can make it live enough, but currently you're borrowing the <code>Rc</code> itself which is destroyed at the end of <code>run()</code>. You need to clone it, and move the clone into the closure:</p>
<pre class="lang-rust prettyprint-override"><code>#[wasm_bindgen(start)]
pub fn run() {
let data =... | How can I create a wasm_bindgen Closure which captures a Rc<RefCell<_>> without moving out of it? | rust|webassembly|wasm-bindgen|rust-wasm | 0 | 81 | 1 | 72,881,156 | 72,881,156 | 2 | true | 2022-07-06T08:07:12.513Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I create a wasm_bindgen Closure which captures a Rc<RefCell<_>> without moving out of it?<p>I have state that needs to be mutated multiple times by J... |
72,879,955 | Adding all table fields into the SE11 structure?<p>I'm learning SAP and ABAP language, I need to create a structure with all the fields of the SFLIGHT database table and a few more. Do I have to enter all the fields of the SFLIGHT table manually or is there any possibility to add all the fields of a given table at once... | <p>The code solution is given by Jonas, but if you are asking about SE11-way then</p>
<p><strong>Edit</strong> => scroll down to <strong>Include</strong> => click on <strong>Insert</strong></p>
<p><a href="https://i.stack.imgur.com/2Sxlo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2Sxlo.png... | Adding all table fields into the SE11 structure? | sap-data-dictionary | 1 | 81 | 2 | 72,884,881 | 72,884,881 | 2 | true | 2022-07-06T08:10:25.210Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Adding all table fields into the SE11 structure?<p>I'm learning SAP and ABAP language, I need to create a structure with all the fields of the SFLIGHT databa... |
72,905,999 | Function works in windows but doesn't in linux<p>I've been learning C for like 5 days, and so I tried doing some little projects.
I created a very simple library that automates getting a string from the user,then implemented it in a program which just outputs the string's value.</p>
<p>It runs perfectly on Windows (Com... | <ol>
<li><p><code>char *s[MAX];</code> creates an array of <code>MAX</code> pointers, not <code>char</code> values.</p>
<p>ALWAYS enable your compiler's warnings. It would have found this. With gcc, I use <code>-Wall -Wextra -pedantic</code>.</p>
</li>
<li><p><code>get_string</code> returns a pointer to a variable that... | Function works in windows but doesn't in linux | c|null|user-input|c-strings | 0 | 81 | 2 | 72,906,059 | 72,906,059 | 2 | true | 2022-07-08T02:12:20.537Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Function works in windows but doesn't in linux<p>I've been learning C for like 5 days, and so I tried doing some little projects.
I created a very simple lib... |
72,917,139 | How to use useRef with Material UI<p>There is something wrong with the code but I didn't found what is it exactly, I guess the question is how to use <code>useRef</code> with Material UI?
I'm trying to code a login page, the code worked fine with original but when I used Material UI's it stopped.</p>
<p><strong>The C... | <p>The better way to work with MUI TextField is to use a state like this instead of a ref:</p>
<pre><code>const [userEmail, setUserEmail] = useState("")
return <TextField ... value={userEmail} onChange={(e)=>{setUserEmail(e.target.value)}} />
</code></pre>
<p>However if you still want to use a useRe... | How to use useRef with Material UI | javascript|reactjs|material-ui | 1 | 81 | 1 | 72,917,168 | 72,917,168 | 2 | true | 2022-07-08T21:24:24.970Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use useRef with Material UI<p>There is something wrong with the code but I didn't found what is it exactly, I guess the question is how to use <code>u... |
72,943,510 | How to handle exceptions in event handler in Axon<p>I am building a monolith project using Axon framework.</p>
<p>I have a method here that dispatches an event</p>
<pre><code> @CommandHandler
public void createRoom(CreateRoomCommand createRoomCommand){
log.info("Receiving create room command: {}",... | <p>When moving to an Event-Driven Architecture, what's important to note is that an Event Handling failure <em>should never mean</em> Event Publishing should fail too.</p>
<p>The benefit of this style of programming <em>is</em> the decoupling of these components. If you prefer the Event Handling task to roll back the E... | How to handle exceptions in event handler in Axon | java|spring-boot|domain-driven-design|cqrs|axon | 0 | 81 | 1 | 72,951,090 | 72,951,090 | 2 | true | 2022-07-11T19:08:59.990Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to handle exceptions in event handler in Axon<p>I am building a monolith project using Axon framework.</p>
<p>I have a method here that dispatches an eve... |
72,960,159 | How to pass command line argument to python script from docker run command?<p>I have created a docker file. i can build an image and run it. next i want to pass command line arugument when i run a docker container. i am planning to read those arguments in my python , app.py file and make decisions based on that. How to... | <p>When you <code>docker run</code> the container, you can supply a command at the end of it. This replaces the Dockerfile's <code>CMD</code>, so you need to repeat the script name, but any arguments there will be passed through as-is.</p>
<p>If the script begins with <code>#!/usr/bin/env python</code> as its very ver... | How to pass command line argument to python script from docker run command? | python|docker | 0 | 81 | 1 | 72,965,012 | 72,965,012 | 2 | true | 2022-07-13T02:08:58.517Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to pass command line argument to python script from docker run command?<p>I have created a docker file. i can build an image and run it. next i want to p... |
72,968,544 | sum values base duplicate values in dict - python<p>I have a dict as below:</p>
<pre><code>dict_data = {
"NAME": ['A', 'B', 'A', 'B', 'C', 'C'],
"VALUE": [100, 200 , 100 , 200, 300, 300]
}
</code></pre>
<p>How to sum values from above dict if NAME duplicate
output:</p>
<pre><code>NAME: A
VALUE: ... | <p>Without extra imports.</p>
<p>Use class method <code>fromkeys</code> to set default values</p>
<pre><code>d = dict.fromkeys(dict_data['NAME'], 0)
for k, v in zip(dict_data['NAME'], dict_data['VALUE']):
d[k] += v
print(d)
</code></pre>
<p>or, more verbosely, with the instance method <code>setdefault</code></p>
<... | sum values base duplicate values in dict - python | python|list|dictionary | 0 | 81 | 3 | 72,969,677 | 72,969,677 | 2 | true | 2022-07-13T15:07:07.290Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
sum values base duplicate values in dict - python<p>I have a dict as below:</p>
<pre><code>dict_data = {
"NAME": ['A', 'B', 'A', 'B', 'C', 'C'],
... |
72,984,721 | Hour in input date Blazor<p>I'm tried to set a hour in input date in blazor, but i don't know if it is possible.</p>
<p>My code:</p>
<pre><code><div class="form-group">
<label for="Validade" class="p-3">Validade</label>
<InputDate @bind-Value:format="dd/MM... | <p>change</p>
<pre><code> <InputDate @bind-Value:format="dd/MM/yyyy hh:mm:ss" @bind-Value="@InfracaoDto.Validade" />
</code></pre>
<p>to</p>
<pre><code><InputDate Type="InputDateType.DateTimeLocal" @bind-Value:format="dd/MM/yyyy hh:mm:ss" @bind-Value="@InfracaoDto.... | Hour in input date Blazor | c#|html|asp.net-core|blazor | 0 | 81 | 1 | 72,986,220 | 72,986,220 | 2 | true | 2022-07-14T17:49:53.517Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Hour in input date Blazor<p>I'm tried to set a hour in input date in blazor, but i don't know if it is possible.</p>
<p>My code:</p>
<pre><code><div class... |
73,022,999 | Why aren't Drawn Values always used in List Comprehensions?<p>In Haskell, if I want to repeat a value I can write a list comprehension with the following form:</p>
<pre><code>repeat_value x n = [x | _ <- [1..n]]
</code></pre>
<p>Why is it acceptable for me to use a generator that puts its values into a variable, <co... | <p>Syntactically, <code>x <- gen</code> is a repeated pattern-matching operation. For each value provided by the generator, it is matched against the pattern <code>x</code>, with whatever binding that might imply. For each pattern-match that succeeds, an expression is evaluated to produce a value to add to the list ... | Why aren't Drawn Values always used in List Comprehensions? | haskell|list-comprehension|generator | -1 | 81 | 1 | 73,023,465 | 73,023,465 | 2 | true | 2022-07-18T13:20:54.820Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why aren't Drawn Values always used in List Comprehensions?<p>In Haskell, if I want to repeat a value I can write a list comprehension with the following for... |
73,024,628 | Limit accepted cross-platform authenticators WebAuthn API<p>I'm currently creating a POC for WebAuthentication and I'm looking at a scenario where we could use cross-platform authenticators as a 2FA method. So essentially: user logs in to their account on the site, and proceeds to register an authenticator for later us... | <p>There is a certain degree of control that you have over the modals that appear to an end user when registering a WebAuthn credential. This will depend on your exact meaning of "limit the kind of authenticators a user can use". We can explore this from two angles.</p>
<p><strong>Authenticator Attachment</st... | Limit accepted cross-platform authenticators WebAuthn API | frontend|webauthn|fido|fido-u2f | 1 | 81 | 1 | 73,025,637 | 73,025,637 | 2 | true | 2022-07-18T15:12:35.673Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Limit accepted cross-platform authenticators WebAuthn API<p>I'm currently creating a POC for WebAuthentication and I'm looking at a scenario where we could u... |
73,027,635 | It's good to practice using try with resources without finally in Java<p>I am working with microservices in Quarkus (Java Framework). I have doubts about the closing of connections using <code>try</code>-with-resources. According to the documentation if we have an <code>AutoCloseable</code> object it should close the c... | <p>Unless the <code>AutoCloseable</code> object you're working with has bugs with its <code>close()</code> method (which would prevent you from using <code>finally</code> <em>anyway</em>), using try-with-resources is preferred over <code>finally</code>.</p>
<p>The objective reason is <a href="https://docs.oracle.com/ja... | It's good to practice using try with resources without finally in Java | java|quarkus|try-with-resources | -2 | 81 | 2 | 73,027,777 | 73,027,777 | 2 | true | 2022-07-18T19:28:19.980Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
It's good to practice using try with resources without finally in Java<p>I am working with microservices in Quarkus (Java Framework). I have doubts about the... |
72,982,010 | Makefile with multiple separate *.cpp files to output separate *.exe files in different dir<p>I am stuck, writing my Makefile.
Directory structure:</p>
<pre><code>.\
Makefile
.\src\*.cpp(s)
.\bin
</code></pre>
<p><strong>Desire:</strong> <em>What I want to achieve with one <code>Makefile</code></em>.</p>
<p><stro... | <p>The introductory parts of the <a href="https://www.gnu.org/software/make/manual/html_node/Introduction.html" rel="nofollow noreferrer">GNU make manual</a> describe that <code>all: $(BIN)</code> creates a target <code>all</code> that depends on a target <code>bin</code>. That means make will try to create <code>bin<... | Makefile with multiple separate *.cpp files to output separate *.exe files in different dir | c++|makefile | 0 | 81 | 2 | 72,982,455 | 72,982,455 | 2 | true | 2022-07-14T14:16:00.613Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Makefile with multiple separate *.cpp files to output separate *.exe files in different dir<p>I am stuck, writing my Makefile.
Directory structure:</p>
<pre>... |
72,990,372 | Python comparing array to zero faster than np.any(array)<p>I want to test whether all elements of an array are zero. According to the StackOverflow posts <a href="https://stackoverflow.com/questions/18395725/test-if-numpy-array-contains-only-zeros">Test if numpy array contains only zeros</a> and <a href="https://stacko... | <p>The problem is due to the first two operations being vectorized using SIMD instructions while the three last are not. More specifically, the three last calls do an implicit conversion to bool (<code>_aligned_contig_cast_double_to_bool</code>) which is not yet vectorized. This is a known issue and I have already prop... | Python comparing array to zero faster than np.any(array) | python|arrays|numpy|boolean | 3 | 81 | 1 | 72,999,465 | 72,999,465 | 2 | true | 2022-07-15T07:21:13.687Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python comparing array to zero faster than np.any(array)<p>I want to test whether all elements of an array are zero. According to the StackOverflow posts <a ... |
73,013,628 | Powershell create New-Variable from foreach loop to be used outside of the loop<p>So I am pulling in an array and then cleaning it to just the unique values I need and then running that though a foreach loop to create</p>
<pre><code>$ZoneArray = Import-Csv -Path "Test.csv" | select Zone
$Zones = @()
foreach (... | <p>As <a href="https://stackoverflow.com/users/1701026/iron">iRon</a> points out, variable indirection (referring to variables <em>indirectly</em>, via dynamically created variable names) is best avoided - see <a href="https://stackoverflow.com/a/68830451/1701026">this post</a>.</p>
<p>It sounds like what you're really... | Powershell create New-Variable from foreach loop to be used outside of the loop | powershell|powershell-7.2 | 1 | 81 | 2 | 73,015,257 | 73,015,257 | 2 | true | 2022-07-17T16:44:04.330Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Powershell create New-Variable from foreach loop to be used outside of the loop<p>So I am pulling in an array and then cleaning it to just the unique values ... |
72,963,291 | Python Multiprocessing: Variable only changes inside the function even though there is a global statement<p>I am trying to change a variable inside a function and access the changed one inside another function but the first function won't change the variable globally.</p>
<p>what i want my code to do:
when i press the ... | <p>You can try to print ids of the 'switch's in your code, and you can find they are different. (In other words, they don't share memory) Global variable doesn't work as usual in multiprocess.</p>
<p>And these links provide much infomation you need.</p>
<p><a href="https://stackoverflow.com/questions/48306952/how-to-up... | Python Multiprocessing: Variable only changes inside the function even though there is a global statement | python|function|multiprocessing|global-variables|local-variables | -1 | 81 | 2 | 72,966,385 | 72,966,385 | 2 | true | 2022-07-13T08:42:21.767Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python Multiprocessing: Variable only changes inside the function even though there is a global statement<p>I am trying to change a variable inside a functio... |
72,938,527 | Combine / sum rows in R<p>I have a large dataset with each row representing a different category. However, some of categories have been miss spelled or miss named resulting in two rows for the same category. I would like to combine and sum specific rows.</p>
<p>DF</p>
<div class="s-table-container">
<table class="s-tab... | <p>This solution will possibly work just for this given scenario because I don't know what other types of misspelling and misnaming are there in the category column, but once you clean the category column to have all unique categories, you can simply do a <code>group_by</code> by category column and then <code>summaris... | Combine / sum rows in R | r|cumsum | 2 | 81 | 4 | 72,938,761 | 72,938,761 | 2 | true | 2022-07-11T12:22:36.737Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Combine / sum rows in R<p>I have a large dataset with each row representing a different category. However, some of categories have been miss spelled or miss ... |
72,820,476 | scala: Is collection object mutable?<p>this question has no functional value. Just trying to get a better understanding of scala.
All collections inherent <a href="https://www.scala-lang.org/api/current/scala/collection/Iterable.html" rel="nofollow noreferrer">Iterable</a>. There is no <code>isMutable</code> method in ... | <p>AminMal's idea if fine. Mutable collections do extend <code>mutable.Iterable</code>, so checking if your collection is an instance of it is self-explanatory.</p>
<p>As an alternative way: mutable collections inherit 2 specific traits that allow them to be mutated internally: <code>Growable</code> and <code>Shrinkabl... | scala: Is collection object mutable? | scala|collections | -1 | 81 | 2 | 72,821,101 | 72,821,101 | 2 | true | 2022-06-30T18:27:59.117Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
scala: Is collection object mutable?<p>this question has no functional value. Just trying to get a better understanding of scala.
All collections inherent <a... |
72,833,288 | My windows C program does not print japanese characters<pre><code>#include <locale.h>
#include <stdio.h>
#include <wchar.h>
int main() {
setlocale(LC_ALL, "");
wchar_t test = L'γ₯';
printf("%ls", L"\x3065");
printf("%lc", test);
return 0;
}
<... | <p><code>printf</code> is a narrow string function and unless you have requested UTF-8 in your manifest and are running on an appropriate version Windows 10 it is not going to print Unicode correctly in all cases.</p>
<p>Use <code>wprintf</code> to print wide strings. Depending on the C runtime library, you might need ... | My windows C program does not print japanese characters | c|windows | 0 | 81 | 1 | 72,835,768 | 72,835,768 | 2 | true | 2022-07-01T18:23:08.697Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
My windows C program does not print japanese characters<pre><code>#include <locale.h>
#include <stdio.h>
#include <wchar.h>
int main() ... |
72,933,305 | Android Kotlin AlertDialog.Builder() usage and context. "this" not working<p>This is my very first time using Kotlin/Android App Development, so I apologise if I am missing something simple. I have a background in Java and C#.</p>
<p>I'm trying to display an AlertBox containing X information. All the tutorials I am rea... | <p>In order to access <code>this</code> from an inner class in Kotlin you have to mark it as <a href="https://kotlinlang.org/docs/nested-classes.html#inner-classes" rel="nofollow noreferrer"><code>inner</code></a> (so it can access parent class members) and use <a href="https://kotlinlang.org/docs/this-expressions.html... | Android Kotlin AlertDialog.Builder() usage and context. "this" not working | android|kotlin|android-alertdialog | 1 | 81 | 2 | 72,933,431 | 72,933,431 | 2 | true | 2022-07-11T03:04:11.043Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Android Kotlin AlertDialog.Builder() usage and context. "this" not working<p>This is my very first time using Kotlin/Android App Development, so I apologise ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.