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
72,370,136
Edit text when I open a window<p>I'm working with PYQt5 and Python. Whenever I open a new window and that window has a lineEdit, I have to clic in the lineEdit in order to write any text. Is there a way in which I can start writing the text in the lineEdit just the moment I open the window without, first, having to cli...
<p>Thanks to musicamante the question was solved. I added the setFocus() like this.</p> <pre><code> def __init__(self): super(VentanaInicio,self).__init__() loadUi('D:\Matt\Combi\Archivo.ui',self) self.lineEdit.setFocus(True) self.pushButton.clicked.connect(self.conectar) </code></pr...
Edit text when I open a window
python|user-interface|pyqt5|qlineedit
0
41
1
72,370,391
72,370,391
1
true
2022-05-24T22:32:20.423Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Edit text when I open a window<p>I'm working with PYQt5 and Python. Whenever I open a new window and that window has a lineEdit, I have to clic in the lineEd...
72,370,593
How could i create a view and group - and average - values from original table?<p>Let’s say I have a table with 3 columns (weekday, price1 and price2), like this:</p> <p><a href="https://i.stack.imgur.com/wNp3T.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wNp3T.png" alt="original table" /></a></p>...
<p>you could do it with a case statement</p> <p>here is the fiddle <a href="https://dbfiddle.uk/?rdbms=oracle_11.2&amp;fiddle=e9f1bec3e9da3319a31a92eb9aa11b11" rel="nofollow noreferrer">https://dbfiddle.uk/?rdbms=oracle_11.2&amp;fiddle=e9f1bec3e9da3319a31a92eb9aa11b11</a></p> <pre><code>with t as (select weekday, avg(p...
How could i create a view and group - and average - values from original table?
sql|oracle|pivot|sql-view
0
41
1
72,371,098
72,371,098
1
true
2022-05-24T23:47:58.413Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How could i create a view and group - and average - values from original table?<p>Let’s say I have a table with 3 columns (weekday, price1 and price2), like ...
72,373,037
Titles for each wrapped plots created from a list of dataframes<p>I have a list of dataframes <code>(datalist)</code> and I have created wrapped plots with <code>geom_line</code> in ggplot however I am struggling to assign to each plot its title (BA0, OG0, ON0, etc.).</p> <pre><code>List of 27 $ BA0 :'data.frame': ...
<p>You can <code>enframe</code> the list of data frames into a table and create a new column <code>title</code> using the function <code>dplyr::mutate</code>. Then you can use <code>purrr::pmap</code> to map elements of columns to a function formula creating the plot. Lastly, the plot column can be feed into <code>patc...
Titles for each wrapped plots created from a list of dataframes
r|list|ggplot2|lapply
0
41
2
72,373,180
72,373,180
1
true
2022-05-25T06:48:17.150Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Titles for each wrapped plots created from a list of dataframes<p>I have a list of dataframes <code>(datalist)</code> and I have created wrapped plots with <...
72,374,388
Pandas - Filter based on multiple conditions<p>I am facing a problem when I need to exclude some rows from by dataframe.</p> <p>here the code:</p> <pre><code>import numpy as np import pandas as pd dff = { 'ID': [1, 2, 3, 4, 5, 6, 7], 'Default': [1,1,0,1,0,1,0], 'Default_Amount': [1200,2000,0,350,0,760,0], ...
<p>You need match not equal <code>dff.Default != 1</code> with bitwise <code>OR</code> by <code>|</code>:</p> <pre><code>df = dff[(dff.Time != 'November') | (dff.Default != 1) ] </code></pre> <p>Or invert mask, but change <code>|</code> to <code>&amp;</code> for bitwise <code>AND</code> and change <code>!=</code> to <c...
Pandas - Filter based on multiple conditions
python|pandas
1
41
3
72,374,405
72,374,405
1
true
2022-05-25T08:35:36.080Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pandas - Filter based on multiple conditions<p>I am facing a problem when I need to exclude some rows from by dataframe.</p> <p>here the code:</p> <pre><code...
72,372,030
AttributeError: type object 'fft' has no attribute 'fft_vcc'<p>I tried the flow graph shown below, but I get the following error and cannot run it. What could be the cause? Thanks.</p> <pre><code> Executing: /usr/bin/python3 -u /home/nomo/fft.py Traceback (most recent call last): File &quot;/home/nomo/fft.py&quot;, ...
<p>You've got a name conflict: You try to use the <code>fft</code> module (as imported in your python by <code>from gnuradio import fft</code>, but you also have declared the ID of this flowgraph class to be <code>fft</code>. So, Python picks the wrong one.</p> <p>Pick any other <code>Id</code> in your <code>Options</c...
AttributeError: type object 'fft' has no attribute 'fft_vcc'
gnuradio|gnuradio-companion
0
41
1
72,374,408
72,374,408
1
true
2022-05-25T04:41:43.900Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: AttributeError: type object 'fft' has no attribute 'fft_vcc'<p>I tried the flow graph shown below, but I get the following error and cannot run it. What coul...
72,376,040
I want to access ansible inventory value one by one in ansible playbook?<p>I have very simple use case. I want to access my inventory variable into playbook one by one.</p> <p>Folder structure:-</p> <p><a href="https://i.stack.imgur.com/d8WGO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/d8WGO.png"...
<p>If you are accessing your hostvars using the <code>hostvars</code> variable, you don't need to target the remote hosts in the play: you can write instead a play that targets <code>localhost</code>.</p> <p>We can use a <code>loop</code> to loop over a specific inventory group (or <code>all</code> for all hosts):</p> ...
I want to access ansible inventory value one by one in ansible playbook?
ansible|ansible-inventory
0
41
1
72,376,445
72,376,445
1
true
2022-05-25T10:35:30.877Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I want to access ansible inventory value one by one in ansible playbook?<p>I have very simple use case. I want to access my inventory variable into playbook ...
72,376,557
Elastic matchQuery for name<p>I have a elastic field which contains a user name, eg. my name would contain <code>vojtech knyttl</code>.</p> <p>I am trying to create a match query to be able to find my name by phrases like:</p> <ul> <li><code>vojtech k</code></li> <li><code>vojtech kny</code></li> <li><code>knyttl</code...
<p>You should use the <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query-phrase-prefix.html" rel="nofollow noreferrer">match phrase prefix query</a>, tested it on below samples and seems to be working fine according to your use-case.</p> <p><strong>Sample documents</strong></...
Elastic matchQuery for name
elasticsearch
1
41
2
72,376,640
72,376,640
1
true
2022-05-25T11:11:47.567Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Elastic matchQuery for name<p>I have a elastic field which contains a user name, eg. my name would contain <code>vojtech knyttl</code>.</p> <p>I am trying to...
72,377,804
React Hook Form - onSubmit does not works<p>I have following component. I am making this based on react-hook-form documentation. Additionally I add styled components. But I find out problem with button. Submit button does not works. Nothing happen when I click on it</p> <p><div class="snippet" data-lang="js" data-hide=...
<p>Your issue is that you don't have a <code>&lt;form/&gt;</code> element.</p> <p>Your <code>&lt;OrderForm/&gt;</code> component is rendering an <code>&lt;article/&gt;</code> element - this doesn't have an <code>onSubmit</code> prop, which is why the submission isn't working.</p> <p>Change styled.article to styled.form...
React Hook Form - onSubmit does not works
reactjs|forms
1
41
2
72,377,973
72,377,973
1
true
2022-05-25T12:38:56.993Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React Hook Form - onSubmit does not works<p>I have following component. I am making this based on react-hook-form documentation. Additionally I add styled co...
72,364,850
How to add values from first dict to values in second dict<p>I stuck, and need little help.</p> <p>How can I add values if i have a dict with other dictionaries?</p> <blockquote> <p>For example:</p> </blockquote> <pre><code>player_equipment = {'Boots:': [('Defence', 4), ('Mana', 13), ('Stamina', 30)], 'Gloves:': [('Att...
<pre><code>player_equipment = {'Boots:': [('Defence', 4), ('Mana', 13), ('Stamina', 30)], 'Gloves:': [('Attack', 5), ('Defence', 1), ('Health', 19), ('Mana', 3), ('Stamina', 29)]} player_equipment_statictic = {} # iterating through player_equipment extracting item list for _, item_list in player_eq...
How to add values from first dict to values in second dict
python|class|dictionary
-1
41
1
72,378,268
72,378,268
1
true
2022-05-24T14:38:05.090Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to add values from first dict to values in second dict<p>I stuck, and need little help.</p> <p>How can I add values if i have a dict with other dictionar...
72,361,932
Inherit view - add attribute maxlength to char (input text in web) field<p>Inherit view - add attribute maxlength to char (input text in web) field Avatar Victor Torralba 24 mayo 2022 viewsinheritanceattributes</p> <p>Hello, I'm trying to add the attribute maxlength=&quot;100&quot; to the description field in the produ...
<p>You can't do it from <code>xml</code>, What you can do is:</p> <ol> <li>Use constraints to show error message if size more than specific number and this error will raise once you click on save button :</li> </ol> <pre><code>@api.constrains('name') def _check_name(self): for product in self: if len(produc...
Inherit view - add attribute maxlength to char (input text in web) field
inheritance|attributes|odoo|odoo-14
0
41
1
72,379,300
72,379,300
1
true
2022-05-24T11:17:36.380Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Inherit view - add attribute maxlength to char (input text in web) field<p>Inherit view - add attribute maxlength to char (input text in web) field Avatar Vi...
72,380,562
Pytorch expand class label tensor<p>I am working on a semantic segmentation project in pytorch and I have class maps in the following shapes: [H,W] where each element is an integer between 0-n where n is the number of classes, H the height of the image and W the width of the image.</p> <p>Here is an example:</p> <pre><...
<p>You could apply <a href="https://pytorch.org/docs/stable/generated/torch.nn.functional.one_hot.html" rel="nofollow noreferrer"><code>nn.functional.one_hot</code></a> to convert the dense format into one-hot encoding and then multiple with the label value to get the desired result:</p> <pre><code>&gt;&gt;&gt; C = int...
Pytorch expand class label tensor
python|pytorch
1
41
1
72,381,038
72,381,038
1
true
2022-05-25T15:37:12.717Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pytorch expand class label tensor<p>I am working on a semantic segmentation project in pytorch and I have class maps in the following shapes: [H,W] where eac...
72,380,279
How to scrape with table class name with R?<p>I am tryng to scrape several web pages, particulaty some tables in the pages.<br /> But the problem is the places of tables change with respect to each page.<br /> Here is my code.</p> <pre><code>url &lt;- paste0(&quot;https://en.wikipedia.org/wiki/2011%E2%80%9312_Welsh_Pre...
<p>Since you know the table class name, just change the corresponding xpath.</p> <pre><code>library(rvest) url &lt;- paste0(&quot;https://en.wikipedia.org/wiki/2011%E2%80%9312_Welsh_Premier_League&quot;) webpage &lt;- read_html(url) j &lt;- webpage %&gt;% html_nodes(xpath=&quot;//table[@class='wikitable plainrowhe...
How to scrape with table class name with R?
html|r|class|web-scraping|rvest
1
41
1
72,382,840
72,382,840
1
true
2022-05-25T15:17:39.907Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to scrape with table class name with R?<p>I am tryng to scrape several web pages, particulaty some tables in the pages.<br /> But the problem is the plac...
72,383,333
How to insert only unique record in SQL Server using PowerShell<p>I'm inserting my CSV data into my sql server database using PowerShell but I'm just wondering how can I modify my sql query so that it will check if the GID and Source value is already matched in the Daily_Proc table and ONLY Insert if it's not existed.<...
<p>So i believe you should be able to do it something like the below:</p> <pre><code>INSERT INTO Daily_Proc (Hold, GMID, Source, Type, CreatedDate, Status) SELECT '$CSVHold1', '$CSVGMID1', '$($CSVSource1 -replace &quot;'&quot;,&quot;''&quot;)','$CSVTYPE1', '$CSVCreatedDate1','Error-Retry' WHERE NOT EXISTS (SELECT 1 ...
How to insert only unique record in SQL Server using PowerShell
sql|sql-server|powershell|powershell-4.0
0
41
1
72,383,668
72,383,668
1
true
2022-05-25T19:42:18.347Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to insert only unique record in SQL Server using PowerShell<p>I'm inserting my CSV data into my sql server database using PowerShell but I'm just wonderi...
72,386,453
Matrix logical matlab<p>I am trying to get M. To do this, it is necessary for Matlab to relate column 1 of A to column 1 of ^and build a matrix M with 1 and 0 depending on whether in position [,] and ^[,] are equal to 1</p> <pre><code>A = [1 0 1; 0 1 1; 0 0 1 ]; B = [0 0 1 ; 0 1 0; 1 1 1]; for i = 1:3 for j =1:3 ...
<p>When you use &quot;<code>if A(i,j) == BT(i,j) &amp;&amp; A(i,j)==;</code>&quot; you are comparing individual elements. Instead you want to be comparing columns: <code>A(:, i)</code> and <code>BT(:, j)</code>.</p> <p>Precisely, you want</p> <pre><code>for i = 1:3 for j = 1:3 M(i,j) = any( A(:,i) &amp; BT(...
Matrix logical matlab
matlab|matrix|discrete-mathematics
0
41
1
72,389,045
72,389,045
1
true
2022-05-26T03:44:19.500Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Matrix logical matlab<p>I am trying to get M. To do this, it is necessary for Matlab to relate column 1 of A to column 1 of ^and build a matrix M with 1 and ...
72,386,686
How to delete route to a particular node in the agent?<p>I want to delete routing entries from routing table to a node 1 from the agent but i am not able to figure out how to write code for deleting routing entries to a particular node through my own agent.</p>
<p>What you're looking for is the <a href="https://unetstack.net/javadoc/3.3/org/arl/unet/net/EditRouteReq.html" rel="nofollow noreferrer"><code>EditRouteReq</code></a> in the <a href="https://unetstack.net/handbook/unet-handbook_routing_and_route_maintenance.html" rel="nofollow noreferrer"><code>ROUTING</code></a> ser...
How to delete route to a particular node in the agent?
unetstack
0
41
1
72,389,547
72,389,547
1
true
2022-05-26T04:27:14.857Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to delete route to a particular node in the agent?<p>I want to delete routing entries from routing table to a node 1 from the agent but i am not able to ...
72,389,566
Jquery animation switch div slowly with animation<pre><code>&lt;html&gt; &lt;head&gt; &lt;script src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js&quot;&gt;&lt;/script&gt; &lt;style type=&quot;text/css&quot;&gt; .header { position: absolute; top: 0px; ...
<p>your CSS does not visible effect on this animation</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>var animating = false; $(".header").on("click", function() { var clic...
Jquery animation switch div slowly with animation
javascript|html|jquery|css
0
41
1
72,390,129
72,390,129
1
true
2022-05-26T09:22:20.133Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Jquery animation switch div slowly with animation<pre><code>&lt;html&gt; &lt;head&gt; &lt;script src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/...
72,792,900
filtering through array of strings doesn't include the first character<p>I have a search bar that filters through an array containing one object:</p> <pre><code> const [termList, setTermList] = useState([{term_name: 'Name', definition: 'This is a glossary term'}]); const filtered = termList.filter((term) =&gt; Obj...
<p>You are making you <code>searched</code> lowercase but not <code>term.term_name</code>, 'n' is not in 'Name', 'N' is. You need to do</p> <pre><code>term.term_name.toLowerCase().includes(searched.toLowerCase()) </code></pre>
filtering through array of strings doesn't include the first character
javascript|reactjs|arrays|filter
0
41
2
72,792,932
72,792,932
1
true
2022-06-28T20:38:41.297Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: filtering through array of strings doesn't include the first character<p>I have a search bar that filters through an array containing one object:</p> <pre><c...
72,795,792
Will defining a loss in metrics affect the model training?<p>I want to add multiple loss values to my model, but when I add them to the loss parameter, they don't show up (it just shows as loss, not each loss value):</p> <pre><code>dice_loss = sm.losses.DiceLoss() focal_loss = sm.losses.BinaryFocalLoss() total_loss = ...
<p>Yes this is fine, it will not change the training process, metrics are only used for monitoring and not for computing gradients that will train the model.</p>
Will defining a loss in metrics affect the model training?
python|tensorflow|machine-learning|keras|deep-learning
0
41
1
72,796,524
72,796,524
1
true
2022-06-29T04:26:28.100Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Will defining a loss in metrics affect the model training?<p>I want to add multiple loss values to my model, but when I add them to the loss parameter, they ...
72,796,551
Show title for each group that is grouped by value from array of object<p>I am receiving data as an array of objects in JS. Each object has a value <code>month</code> and I want to show data with groups according to month. Example:</p> <pre><code>data: [ {id: 0001,month:2,desc:'objectone'}, {id: 0001,month:4,desc:'obje...
<p>After you've grouped the data you can loop through it using <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries" rel="nofollow noreferrer"><code>Object.entries</code></a> and then inside the loop create the heading and the para for every month.</p> <p><div class="...
Show title for each group that is grouped by value from array of object
javascript|arrays|object|reduce
0
41
1
72,796,700
72,796,700
1
true
2022-06-29T06:12:33.650Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Show title for each group that is grouped by value from array of object<p>I am receiving data as an array of objects in JS. Each object has a value <code>mon...
72,796,623
How to solve error in BDD Parameterizing?<p>This is the TestRunner.java:</p> <pre><code>package StepDefinitions; import io.cucumber.junit.Cucumber; import io.cucumber.junit.CucumberOptions; import org.junit.runner.RunWith; @RunWith(Cucumber.class) @CucumberOptions(features=&quot;src/test/resources/Features&quot;, glu...
<p>can you please replace and try this when annotation</p> <p><code>@When(&quot;^User enters (.+) and (.+)$&quot;) public void user_enters_and(String username, String password) throws Throwable { //your code here }</code></p>
How to solve error in BDD Parameterizing?
java|selenium|selenium-webdriver|cucumber
0
41
1
72,801,066
72,801,066
1
true
2022-06-29T06:20:04.313Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to solve error in BDD Parameterizing?<p>This is the TestRunner.java:</p> <pre><code>package StepDefinitions; import io.cucumber.junit.Cucumber; import io...
72,800,340
Can anyone give me code example of how multiple outputs of a single fragment shader is recorded and how to read them seperately(VULKAN)<p>Take the fragment shader as example:</p> <pre><code>#version 450 //#extension GL_ARB_seperate_shader_objects : enable layout(location = 0) in vec3 color1; layout(location = 0) out ...
<p>Output at location 0 goes to color attachment 0.</p> <p>Output at location 1 goes to color attachment 1.</p> <p>Teh spec (<a href="https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#interfaces-fragmentoutput" rel="nofollow noreferrer">Fragment Output Interface</a>):</p> <blockquote> <p>A fragment sha...
Can anyone give me code example of how multiple outputs of a single fragment shader is recorded and how to read them seperately(VULKAN)
python|c++|vulkan
0
41
1
72,802,989
72,802,989
1
true
2022-06-29T11:06:14.953Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can anyone give me code example of how multiple outputs of a single fragment shader is recorded and how to read them seperately(VULKAN)<p>Take the fragment s...
72,788,450
Memory release in pthread TLS destructor is not detected by valgrind/massif<p>Symptoms: I allocate TLS key with a destructor, create a bundle of threads and pass the TLS key to each thread. Each thread allocates memory and sets its pointer in TLS, the TLS destructor deallocates memory. I wait for threads to finish befo...
<p>A second answer, this time concentrating on the 'leak' aspect.</p> <p>Massif isn't really a leak detector. It's for profiling heap use.</p> <p>If I compile the example (with 320 threads) then at the end I get about 89 million bytes still allocated. That is made up of</p> <p>75% the arena used by malloc called from ...
Memory release in pthread TLS destructor is not detected by valgrind/massif
linux|pthreads|valgrind|thread-local-storage|massif
0
41
2
72,803,941
72,803,941
1
true
2022-06-28T14:36:10.453Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Memory release in pthread TLS destructor is not detected by valgrind/massif<p>Symptoms: I allocate TLS key with a destructor, create a bundle of threads and ...
72,806,693
How to insert a <p> tag's text into its parent element as a data attribute?<p>I have this HTML:</p> <pre><code>&lt;div class=&quot;content_section_item&quot; data-item=&quot;&quot;&gt; &lt;img src=&quot;&quot;&gt; &lt;p&gt;table&lt;/p&gt; &lt;/div&gt; &lt;div class=&quot;content_section_item&quot; data-item=&quot;&...
<p>Loop over the divs. In each div, use <code>querySelector()</code> to find the nested <code>p</code>, get its contents with <code>.textContent</code>, and assign that to the div's <code>data-item</code> property.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div...
How to insert a <p> tag's text into its parent element as a data attribute?
javascript|php|html|json
0
41
1
72,806,908
72,806,908
1
true
2022-06-29T19:12:55.003Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to insert a <p> tag's text into its parent element as a data attribute?<p>I have this HTML:</p> <pre><code>&lt;div class=&quot;content_section_item&quot;...
72,808,552
Access variable after it was borrowed<p>I am assigning data to properties of a struct, but the following error appears:</p> <pre><code>error[E0382]: borrow of partially moved value: `super_hero` --&gt; src/main.rs:16:22 | 13 | for mut chunk in super_hero.description_chunks.unwrap() { | ...
<p>rustc is correct, it just needs a little adjustment: instead of <a href="https://doc.rust-lang.org/stable/std/option/enum.Option.html#method.as_ref" rel="nofollow noreferrer"><code>as_ref()</code></a> use <a href="https://doc.rust-lang.org/stable/std/option/enum.Option.html#method.as_mut" rel="nofollow noreferrer"><...
Access variable after it was borrowed
rust
0
41
1
72,808,588
72,808,588
1
true
2022-06-29T22:34:20.970Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Access variable after it was borrowed<p>I am assigning data to properties of a struct, but the following error appears:</p> <pre><code>error[E0382]: borrow o...
72,809,165
how do I write this style command as a key to fix this error?<p>Can anyone tell me how to fix this?</p> <pre><code>table = document.add_table(rows=1, cols=3) table.style = 'LightShading-Accent6' for i in range(3): table.rows[0].cells[i].text = table_header[i] </code></pre> <p>I am getting the error</p> <pre><code>C...
<p>The message you have is a warning, not an error. You should still fix it of course.</p> <p>The name corresponding to the style ID <code>LightShading-Accent6</code> is <code>Light Shading Accent 6</code>, so use that instead. Names are generally just the ID written out in title case with proper human-readable spacing...
how do I write this style command as a key to fix this error?
python|docx
1
41
1
72,809,302
72,809,302
1
true
2022-06-30T00:28:11.157Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how do I write this style command as a key to fix this error?<p>Can anyone tell me how to fix this?</p> <pre><code>table = document.add_table(rows=1, cols=3)...
72,808,040
How to read csv row by row and prevent skipping lines<p>Have this as data from a csv as rawdata coming in by REST api.</p> <pre><code>serial-number;device-identification;created;value-data-count;volume,m3,inst-value,0,0,0;duration-since-last-readout,second(s),inst-value,0,0,0;op-time,second(s),inst-value,0,0,0;enhanced...
<p>Read line by line (one line of headings and one line of content), using the longest headings as the complete headings:</p> <pre><code>a = &quot;&quot;&quot; serial-number;device-identification;created;value-data-count;volume,m3,inst-value,0,0,0;duration-since-last-readout,second(s),inst-value,0,0,0;op-time,second(s)...
How to read csv row by row and prevent skipping lines
python|json|pandas
0
41
1
72,809,776
72,809,776
1
true
2022-06-29T21:25:36.987Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to read csv row by row and prevent skipping lines<p>Have this as data from a csv as rawdata coming in by REST api.</p> <pre><code>serial-number;device-id...
72,813,051
Clone from public repository and push to private repository<p>I have cloned a public repository from github, made some modifications and now I want to push them to a private repo. The steps I took are shown below:</p> <pre><code>$ git clone -b dev https://github.com/public_repo $ cd public_repo ## modify files $ git ad...
<p>according to error : you have different code on the private repo <code>dev</code> branch and you're trying to push some other changes without taking pull . please try to take pull before push</p>
Clone from public repository and push to private repository
github
0
41
1
72,813,240
72,813,240
1
true
2022-06-30T09:01:24.500Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Clone from public repository and push to private repository<p>I have cloned a public repository from github, made some modifications and now I want to push t...
72,813,991
How can I group an array of samples by the threshold price with samples name as sub array key?<p>I have an array of product samples that I am trying to group by the threshold price, with the rest of the samples to be accessed by the samples array.</p> <p>This is what I am trying to achieve:</p> <pre><code>[ { &qu...
<p>is that you looking for ?</p> <p><a href="https://onlinephp.io/c/0d8de" rel="nofollow noreferrer">Example code</a></p> <pre><code>$arrs = array( '1' =&gt; array( &quot;sampleid&quot;=&gt; &quot;1234&quot;, &quot;productid&quot;=&gt; &quot;11111&quot;, &quot;threshold&quot;=&gt; &quot;20.00&quot;, ...
How can I group an array of samples by the threshold price with samples name as sub array key?
php|arrays|loops|foreach|iteration
0
41
1
72,815,321
72,815,321
1
true
2022-06-30T10:10:51.460Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I group an array of samples by the threshold price with samples name as sub array key?<p>I have an array of product samples that I am trying to group...
72,816,197
How to execute an observable conditionally? (Depending on a variable state in class level)<p>Can someone tell me if there is a clean way to return an observable conditionally, depending on a pre-defined condition?</p> <p>Let us consider the following scenario,</p> <pre><code>isEditing = false; // &lt;---- This is a va...
<p>My brief suggestion:</p> <pre><code>obervable1.pipe( switchMap(obs1-result =&gt; forkJoin(of(obs1-result), observable2)), map([obs1-result, obs2-result] =&gt; isEditing ? obs1-result : obs2-result ).subscribe(); </code></pre> <p>Please have a look at the example here: <a href="https://stackblitz.com/edit/rxjs-b3...
How to execute an observable conditionally? (Depending on a variable state in class level)
angular|rxjs|rxjs6|rxjs-observables|rxjs-marbles
0
41
1
72,816,583
72,816,583
1
true
2022-06-30T12:53:16.137Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to execute an observable conditionally? (Depending on a variable state in class level)<p>Can someone tell me if there is a clean way to return an observa...
72,816,335
Efficiently handle multiple arguments<p>I use Jenkins to trigger a deployment of multiple services (using a deployment script) There are 6 services in total and have used Jenkins <code>Boolean Parameter</code> to select which services to be deployed.</p> <p>So, if 1st, 4th and 5th services are to be deployed, the input...
<p>An array would help here.</p> <pre><code>#!/bin/bash #hardcoded for demo purposes, but you can build dynamically from arguments services_to_deploy=( 1 4 5 ) sshpass -p &lt;&gt; ssh username@host &quot;copy the deployment script to the deployment VM/server and give execute persmission....&quot; sshpass -p &lt;&gt; ...
Efficiently handle multiple arguments
bash|shell|jenkins
0
41
2
72,816,952
72,816,952
1
true
2022-06-30T13:04:16.903Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Efficiently handle multiple arguments<p>I use Jenkins to trigger a deployment of multiple services (using a deployment script) There are 6 services in total ...
72,815,576
How to determine if a column of a dataframe has an element of several different lists?<p>Suppose I have 3 lists and I want to search in one of the columns of my dataframe among them.</p> <p>Dataframe:</p> <pre class="lang-none prettyprint-override"><code>id desxription 1 'this is bad' 2 'city tehra...
<p>You could use <a href="https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.regexp_extract.html#pyspark.sql.functions.regexp_extract" rel="nofollow noreferrer"><code>regexp_extract</code></a>. While forming the pattern, use <code>\b</code> which will match word boundaries.<...
How to determine if a column of a dataframe has an element of several different lists?
list|dataframe|apache-spark|pyspark|contains
1
41
2
72,819,594
72,819,594
1
true
2022-06-30T12:09:23.250Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to determine if a column of a dataframe has an element of several different lists?<p>Suppose I have 3 lists and I want to search in one of the columns of...
72,790,795
Prolog - Find the depth of an element in a binary tree<p>I would like to know how I can find the depth of a given element <code>E</code> in a binary tree. For simplicity, the tree has no repeated elements.<br> I tried:</p> <pre><code>ElemDepth(E,t(E,T1,T2), D). ElemDepth(E,t(M,T1,T2), D):- D1 is D+1, ElemDepth(E,T1, D1...
<p>Given a binary tree where</p> <ul> <li>The empty tree is denoted by the atom <code>nil</code>, and</li> <li>A non-empty tree is represented as a <code>t/3</code> structure: <pre><code>t( Data, Left_Subtree, Right_Subtree) </code></pre> </li> </ul> <p>We can walk it easily:</p> <pre><code>visit( t(_,L,_) , P ) :- vis...
Prolog - Find the depth of an element in a binary tree
prolog|binary-search-tree|depth
0
41
1
72,821,059
72,821,059
1
true
2022-06-28T17:24:38.087Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Prolog - Find the depth of an element in a binary tree<p>I would like to know how I can find the depth of a given element <code>E</code> in a binary tree. Fo...
72,823,406
When can you rely on the value of this.state in react?<p>I'm new to React, going through the tutorial on the React website. In the step by step tutorial, there is a section which explains that you should not rely on the value of state for calculating the next state, because state updates are asynchronous. Instead, they...
<p>The tutorial's explanation is wrong. There are many cases in which you can rely on referencing <code>this.state</code> directly, including the case in the code snippet.</p> <p>Referencing <code>this.state</code> directly is a problem <em>only if</em></p> <ul> <li>You have previously called <code>this.setState</code>...
When can you rely on the value of this.state in react?
reactjs
1
41
2
72,823,446
72,823,446
1
true
2022-07-01T00:58:52.643Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: When can you rely on the value of this.state in react?<p>I'm new to React, going through the tutorial on the React website. In the step by step tutorial, the...
72,822,118
Adding UITextField() to UI programmatically, cannot tap on field to get keyboard<p>I've been doing iOS development for a long time and I've never run into this before. The UITextField appears in the UI, it is correctly sized and placed by the constraints I've given it, but when I tap/click on it and doesn't respond. Th...
<p>As we have discussed in the comments under the OP, it's always a good idea to check the view hierarchy in the View Hierarchy Inspector to see if the frame is laid out properly and also if perhaps some other view isn't covering the other view which should become the first responder.</p> <p>The view hierarchy inspecto...
Adding UITextField() to UI programmatically, cannot tap on field to get keyboard
ios|swift
0
41
1
72,827,938
72,827,938
1
true
2022-06-30T21:15:47.247Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Adding UITextField() to UI programmatically, cannot tap on field to get keyboard<p>I've been doing iOS development for a long time and I've never run into th...
72,829,547
Request URI too large for Grafana - kubernetes dashboard<p>We are running nearly 100 instances in Production for kubernetes cluster and using prometheus server to create Grafana dashboard. To monitor the disk usage , below query is used</p> <pre><code>(sum(node_filesystem_size_bytes{instance=~&quot;$Instance&quot;}) - ...
<p>You only need to specify the instances once and use the <a href="https://prometheus.io/docs/prometheus/latest/querying/operators/#one-to-one-vector-matches" rel="nofollow noreferrer"><code>on</code> matching operator</a> to get their matching series:</p> <pre><code>(sum(node_filesystem_size_bytes{instance=~&quot;$In...
Request URI too large for Grafana - kubernetes dashboard
kubernetes|prometheus|grafana
0
41
1
72,830,847
72,830,847
1
true
2022-07-01T12:51:36.853Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Request URI too large for Grafana - kubernetes dashboard<p>We are running nearly 100 instances in Production for kubernetes cluster and using prometheus serv...
72,831,705
i get an empty list when scraping a website<pre><code>from bs4 import BeautifulSoup import requests link = requests.get(&quot;https://www.upwork.com/nx/jobs/search/?q=web%20scraping&amp;sort=recency&quot;) source = link.content soup = BeautifulSoup(source, &quot;lxml&quot;) title = soup.find_all(&quot;h4&quot;, {&quo...
<p>You got an empty list because this data loads from a different request. You can see it if opens the console in your browser, network tab</p> <p><a href="https://i.stack.imgur.com/OHe5N.png" rel="nofollow noreferrer">Needed request</a></p>
i get an empty list when scraping a website
python|web-scraping
-3
41
1
72,831,781
72,831,781
1
true
2022-07-01T15:45:09.390Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: i get an empty list when scraping a website<pre><code>from bs4 import BeautifulSoup import requests link = requests.get(&quot;https://www.upwork.com/nx/jobs...
72,833,028
Does setup.py includes the packages installed with "pip install" in the same virtual env?<p>These are the steps I did, how I build my package from virtual env.</p> <pre><code>cd /data python -m venv python_environment source /data/python_environment/bin/activate cd /data/python_environment/workspace pip install sample1...
<p>The package you've specified in <code>setup.py</code> should not include the dependencies. Why would it? Imagine you have hundreds of them, and you &quot;pack(age)&quot; everything together, your own python package plus the dependencies - the size of your package would be significant. What if those dependencies have...
Does setup.py includes the packages installed with "pip install" in the same virtual env?
python
0
41
2
72,833,481
72,833,481
1
true
2022-07-01T17:54:58.333Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Does setup.py includes the packages installed with "pip install" in the same virtual env?<p>These are the steps I did, how I build my package from virtual en...
72,833,619
Permission to remove an Amazon EC2 resource. Whats to choose?<p>I need to ensure that no more than one person in its admin group has permanent permission to remove an amazon EC2 resource. There should be no modifications to the current Admin group policy. What should I use? Managed policy? STS? Maybe Inline policy?</p>
<p>you can create a new policy policy where you want include the ec2 action to terminate an instance and allow only one user to be able to do that by adding a condition.</p> <p>Example :</p> <pre><code>{ &quot;Version&quot;: &quot;2012-10-17&quot;, &quot;Statement&quot;: [ { &quot;Sid&quot;: &quot;Stmt165...
Permission to remove an Amazon EC2 resource. Whats to choose?
amazon-web-services|amazon-ec2
0
41
1
72,835,586
72,835,586
1
true
2022-07-01T19:00:14.177Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Permission to remove an Amazon EC2 resource. Whats to choose?<p>I need to ensure that no more than one person in its admin group has permanent permission to ...
72,834,583
How to specify an output type for a Future/async block?<pre><code>use tokio::runtime::Runtime; // Create the runtime let rt = Runtime::new().unwrap(); // Execute the future, blocking the current thread until completion let s = rt.block_on(async { println!(&quot;hello&quot;); }); </code></pre> <p>is it possible t...
<p>I am not quite familiar with <code>async rust</code>, but as far as I know, the return type of an <code>async fn</code> or <code>async block</code> is <code>impl Future&lt;Output=TheRealReturnTypeOfFnBody&gt;</code>. Once blocked on, as you did <code>rt.block_on(async block)</code>, the return type will become <code...
How to specify an output type for a Future/async block?
rust
0
41
1
72,835,732
72,835,732
1
true
2022-07-01T21:01:45.053Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to specify an output type for a Future/async block?<pre><code>use tokio::runtime::Runtime; // Create the runtime let rt = Runtime::new().unwrap(); // ...
72,836,018
Selecting elements with regular javascript within a set of coordinate in vanilla javascript?<p><a href="https://stackoverflow.com/questions/1259585/get-element-at-specified-position-javascript">Get element at specified position - JavaScript</a></p> <p>This question only answers for a particular x and y point, but I wou...
<p>I think i made an answer. Though I haven't tested it much.</p> <p>First a description of the program. The program recursively goes through the dom starting from the body element and tests to see if it is entirely inside the query rectangle. My code assumes that elements wont be found outside of there parents, but if...
Selecting elements with regular javascript within a set of coordinate in vanilla javascript?
javascript
0
41
1
72,837,465
72,837,465
1
true
2022-07-02T02:12:59.027Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Selecting elements with regular javascript within a set of coordinate in vanilla javascript?<p><a href="https://stackoverflow.com/questions/1259585/get-eleme...
72,837,056
How to dynamically add new property while looping through an array using map in reactJs<p>I have an emoji component in which I loop through an array of emojis (SVG's) that's stored like this:</p> <p>Constant Emojis Array:</p> <pre><code>import { ReactComponent as Coin } from &quot;../assets/emojiIcons/coin.svg&quot; im...
<p>You can archive your goal by this.</p> <pre><code>import { DEFAULT_EMOJI_OPTIONS } from &quot;../../utils/emojis&quot; const EmojiSection = ({reactions}) =&gt; { return ( &lt;div className=&quot;text-white border-2 border-gray-800 rounded p-3 my-8 max-w-xs mx-auto&quot;&gt; {DEFAULT_EMOJI_OPTIONS.m...
How to dynamically add new property while looping through an array using map in reactJs
reactjs|firebase|google-cloud-firestore
1
41
2
72,837,617
72,837,617
1
true
2022-07-02T06:51:12.873Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to dynamically add new property while looping through an array using map in reactJs<p>I have an emoji component in which I loop through an array of emoji...
72,838,113
Annotation label clipped in ggplot2<p>I'm trying to avoid the bottom annotation being clipped. It's the descender on the &quot;p&quot; that gets chopped off. I've used the &quot;inward&quot; option on vjust.</p> <pre><code>df &lt;- data.frame(x=c(as.Date(&quot;2020-01-01&quot;),as.Date(&quot;2022-01-01&quot;)) ...
<p>A possible approach would be to use the <code>min</code> and <code>max</code> y values:</p> <pre class="lang-r prettyprint-override"><code>library(tidyverse) df &lt;- data.frame( x = c(as.Date(&quot;2020-01-01&quot;), as.Date(&quot;2022-01-01&quot;)), y = c(0, 1) ) ggplot(df) + geom_point(aes(x, y)) + anno...
Annotation label clipped in ggplot2
r|ggplot2|geom-text|annotate
0
41
3
72,838,218
72,838,218
1
true
2022-07-02T09:52:05.763Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Annotation label clipped in ggplot2<p>I'm trying to avoid the bottom annotation being clipped. It's the descender on the &quot;p&quot; that gets chopped off....
72,838,926
How to explode a string that has very specific set of characters in php?<p>If I have a text output like this:</p> <pre><code>a. Hello my name is xxx. b. Hello is my name yyy? c. Hello my name is rrr! d. Hello my name is aaa </code></pre> <p>All the sentences may finish with different kinds of characters, so the critica...
<p>I've made one with <a href="https://www.php.net/manual/en/function.array-shift.php" rel="nofollow noreferrer">preg_split()</a>.</p> <pre><code>$str = &quot;a. Hello my name is xxx. b. Hello is my name yyy? c. Hello my name is rrr! d. Hello my name is aaa&quot;; $res = preg_split(&quot;/\n[a-z].\s/&quot;, &quot;\n&qu...
How to explode a string that has very specific set of characters in php?
php
0
41
1
72,839,126
72,839,126
1
true
2022-07-02T12:09:09.070Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to explode a string that has very specific set of characters in php?<p>If I have a text output like this:</p> <pre><code>a. Hello my name is xxx. b. Hell...
72,841,312
Pytest - 2 pytest tests, one should pass one should fail<p>I have an assignment which asks to do a pytest test and :</p> <p>· Test should PASS if the string “ Right-click in the box below to see one called 'the-internet' “ found on page.</p> <p>· Another Test should FAIL if string “Alibaba” is not found...
<p>There is no need for an if statement in an assert:</p> <pre><code>import pytest def test_text1(): text1 = &quot;Right-click in the box below to see one called 'the-internet'&quot; assert text1 in driver.page_source def test_text2(): text2 = &quot;Alibaba&quot; assert text2 in driver.page_source </c...
Pytest - 2 pytest tests, one should pass one should fail
selenium|pycharm|pytest
0
41
1
72,842,137
72,842,137
1
true
2022-07-02T17:55:37.100Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pytest - 2 pytest tests, one should pass one should fail<p>I have an assignment which asks to do a pytest test and :</p> <p>· Test should PASS if the...
72,843,230
How to fix y scale to include the error bar in a bar plot?<p>I have a problem with the second column of the plot. The error bar showed incomplete. There is a way to fix this? I need that the plot be exactly as below. Here is the example code and the result. Thanks.</p> <pre class="lang-r prettyprint-override"><code>ggp...
<p>We can explicitly set the plot's limits with <a href="https://ggplot2.tidyverse.org/reference/lims.html" rel="nofollow noreferrer"><code>lims()</code></a>, but in this case it is more elegant to use <a href="https://ggplot2.tidyverse.org/reference/expand_limits.html" rel="nofollow noreferrer"><code>expand_limits()</...
How to fix y scale to include the error bar in a bar plot?
r|ggplot2|plot|scale
-1
41
1
72,843,400
72,843,400
1
true
2022-07-03T00:19:57.157Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to fix y scale to include the error bar in a bar plot?<p>I have a problem with the second column of the plot. The error bar showed incomplete. There is a...
72,844,302
Basic setup.py - include the shared library<p>I am packaging a Python package with around 20 Python modules and one shared library[1]. I have create the following <code>setup.py</code> file:</p> <pre><code>from setuptools import setup, find_packages setup( name = &quot;mypack&quot;, version = &quot;1.0&quot;, ...
<p>Add <code>include_package_data=True</code> to your setup.py.</p> <p>You may need to include a <code>MANIFEST.in</code> file to your project root that points to the additional file:</p> <pre><code>include mypack/sub_pack2/shared_library.so </code></pre> <blockquote> <p>more about this <a href="https://python-packagin...
Basic setup.py - include the shared library
python|setuptools|setup.py
0
41
1
72,844,399
72,844,399
1
true
2022-07-03T06:16:00.780Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Basic setup.py - include the shared library<p>I am packaging a Python package with around 20 Python modules and one shared library[1]. I have create the foll...
72,845,448
how to pass arguments to a class when initializing a thread?<p>I'm trying to call the number of classes equal to the number of rows in the table and pass the argument there. but i get an error</p> <pre><code>NameError: name 'iterr' is not defined. Did you mean: 'iter'? class App(iterr): def __init__(self): if __n...
<p>You pass your arguments on the init function.</p> <pre><code>class App(): def __init__(self, iterr): </code></pre>
how to pass arguments to a class when initializing a thread?
python
0
41
1
72,845,659
72,845,659
1
true
2022-07-03T09:40:22.180Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to pass arguments to a class when initializing a thread?<p>I'm trying to call the number of classes equal to the number of rows in the table and pass the...
72,848,273
How can I change the whole look of a JTextField<p>I want to change the look of the whole JTextField but still want it to be editable. The first picture shows a normal JTextField, the second picture shows, what I want it too look like. So basically it is just a blue horizontal line instead of a whole Box.</p> <p><a href...
<p>Try setting a custom border on the JTextField or overriding <a href="https://docs.oracle.com/en/java/javase/18/docs/api/java.desktop/javax/swing/JComponent.html#paintBorder(java.awt.Graphics)" rel="nofollow noreferrer">paintBorder</a> instead</p>
How can I change the whole look of a JTextField
java|swing|jtextfield
0
41
2
72,848,356
72,848,356
1
true
2022-07-03T16:43:32.210Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I change the whole look of a JTextField<p>I want to change the look of the whole JTextField but still want it to be editable. The first picture shows...
72,849,109
Why the database view show data correct but when I called it in controller show different result?<p>I changed the project design and created database view :</p> <pre><code>ALTER VIEW [dbo].[samplesList] AS SELECT DISTINCT results.machine_id, sample_id, program_id, Machines.Machi...
<p>EF has its share of troubles with views - because views typically don't have a defined primary key, which is crucial for EF to detect which data has already been loaded (and which hasn't).</p> <p>What happens here is: since there's no primary key for your view, EF will just use <em>all non-nullable columns</em> from...
Why the database view show data correct but when I called it in controller show different result?
c#|asp.net-mvc
1
41
2
72,849,385
72,849,385
1
true
2022-07-03T18:51:11.183Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why the database view show data correct but when I called it in controller show different result?<p>I changed the project design and created database view :<...
72,851,062
how to get secret_key_base in aws?<p>I am continuing with the development in ruby on rails of a project from another programmer, the project was hosted in aws, the project references a key called secret_key_base. The problem is that that key is not in the project and I am working on another aws account so that key was ...
<p>If it is referenced as ENV variable then it must in the aws config. The other option is it may in <code>config/credentials.yml.enc</code> file or similar to this. For more information you can check this <a href="https://edgeguides.rubyonrails.org/security.html#custom-credentials" rel="nofollow noreferrer">guide</a>....
how to get secret_key_base in aws?
ruby-on-rails|ruby|amazon-web-services|amazon-ec2|secret-key
0
41
1
72,852,651
72,852,651
1
true
2022-07-04T01:51:33.193Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to get secret_key_base in aws?<p>I am continuing with the development in ruby on rails of a project from another programmer, the project was hosted in aw...
72,852,799
Why can't i set the values of request.attributes?<pre><code>public class Request { String attribute1; String attribute2; String attribute3; String s1 = &quot;attr1 is:&quot;+ attribute1+&quot;, attr2 is: &quot;+attribute2+&quot;, &quot;+&quot;attr3 is: &quot;+attribute3; @Override ...
<p>Your toString method is having issue, you are creating s1 variable which gets initialised when object is created with default values, change your toString method like below, it will work-</p> <pre><code> @Override public String toString() { return &quot;[&quot; + &quot;attr1 is:&quot;+ attribute1+&quot;, attr2...
Why can't i set the values of request.attributes?
java
-1
41
1
72,852,867
72,852,867
1
true
2022-07-04T06:56:15.520Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why can't i set the values of request.attributes?<pre><code>public class Request { String attribute1; String attribute2; String attribute3...
72,852,878
Counting number of persons present each 15 min in SQL<p>Ive got this Table called 'Present' Im using microsoft management SQL:</p> <pre><code>IdNum BeginDate Exitdate ------------------------------------------------------------------------- 123 2022-06-13 09:03 ...
<p>Use a <a href="https://www.sqlservercentral.com/blogs/tally-tables-in-t-sql" rel="nofollow noreferrer">tally</a> table if you have one to generate a series of datetime with 15 minutes interval.</p> <p>Solution below uses a recursive cte to generate the time series. For the count, use <code>CROSS APPLY</code> to perf...
Counting number of persons present each 15 min in SQL
sql|sql-server
0
41
1
72,853,631
72,853,631
1
true
2022-07-04T07:04:14.353Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Counting number of persons present each 15 min in SQL<p>Ive got this Table called 'Present' Im using microsoft management SQL:</p> <pre><code>IdNum ...
72,848,888
How or Where can I see users who signed in with Google signIn in the google console?<p>I have an app that I am implementing sign-in with google to it. How do I see the users who signed in with google from the google console? Is this possible?</p> <p>Also how can I, from my google account, see which apps I have signed i...
<blockquote> <p>How do I see the users who signed in with google from the google console? Is this possible?</p> </blockquote> <p>By Google console i assume you mean <a href="https://console.cloud.google.com/" rel="nofollow noreferrer">Google developer console</a> where you created the project for your app. If so the a...
How or Where can I see users who signed in with Google signIn in the google console?
google-signin|google-developers-console|google-account
1
41
1
72,854,100
72,854,100
1
true
2022-07-03T18:15:50.653Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How or Where can I see users who signed in with Google signIn in the google console?<p>I have an app that I am implementing sign-in with google to it. How do...
72,852,958
Toggles class only on the first loop element<p>Why this code toggles the class only on the first rendered forEach element? I want to toggle classes on the card on which i press the button but the toggle happens only on the first element.</p> <pre><code>const generateCards = (data) =&gt; { data.results.forEach((data) ...
<p>First, each element's ID attribute should be unique over the complete DOM, so instead, consider adding <code>myDiv</code> as a class.</p> <p>Now to get your function working you need to select just that element, and there are a couple of ways you can do it with different levels of jankiness.</p> <h2>Jank</h2> <p>If ...
Toggles class only on the first loop element
javascript|loops|foreach
0
41
2
72,854,693
72,854,693
1
true
2022-07-04T07:13:21.430Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Toggles class only on the first loop element<p>Why this code toggles the class only on the first rendered forEach element? I want to toggle classes on the ca...
72,853,194
Bokeh Hover Showing ??? instead of Date and Time<p>I have read lots of questions and answers here and can not seem to fix my issue. I can not get the Hover tool in Bokeh to display the Date and Time correctly, I get ???, I understand this to mean that the Hover cannot read the column in my Dataframe.</p> <p>I have impl...
<p>You are very close to a working solution. Your are defining a ColumnDataSource (CDS) but you are not using it and a HoverTool trys to get the needed infromation from the CDS.</p> <p>Please see the minmal example below with an working Holvertool.</p> <pre><code>import pandas as pd from bokeh.plotting import figure, s...
Bokeh Hover Showing ??? instead of Date and Time
python-3.x|pandas|dataframe|datetime|bokeh
0
41
1
72,855,649
72,855,649
1
true
2022-07-04T07:33:50.180Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Bokeh Hover Showing ??? instead of Date and Time<p>I have read lots of questions and answers here and can not seem to fix my issue. I can not get the Hover t...
72,856,097
Test a map inside a pipe in Angular (Isolated Test)<p>I have a method that has a pipe with a map inside of it. When I run the test I can't find a way to get into that map.</p> <p><strong>This is my component code</strong></p> <pre><code>public getParents(): void { Eif (this.filter.siteId !== null) { this.pare...
<p>Multiple issues here. You actually have to subscribe to <code>this.parents$</code> to execute the map, which makes your test async. In your test, you're subscribing on the result of <code>parentsM()</code>, which I guess doesn't return exactly <code>this.parents$</code>, so you're not subscribing to the pipe you wro...
Test a map inside a pipe in Angular (Isolated Test)
angular|dictionary|testing|jasmine|pipe
0
41
1
72,856,252
72,856,252
1
true
2022-07-04T11:37:58.403Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Test a map inside a pipe in Angular (Isolated Test)<p>I have a method that has a pipe with a map inside of it. When I run the test I can't find a way to get ...
72,858,140
SwiftUI display different images/text on toggle/true or false<p>I'm trying to create a button that displays a different images/text depending on the current state of a task.</p> <p>I've found the following doesn't work:</p> <pre class="lang-swift prettyprint-override"><code>Button { taskViewModel.completeTask(id: t...
<p>In lieu of more details, generally the best way to adjust your view in the result of an object's property is to make the smallest adjustment necessary. In this case, you can limit the change to the <code>systemName</code> of the image:</p> <pre class="lang-swift prettyprint-override"><code>Button { taskViewModel...
SwiftUI display different images/text on toggle/true or false
ios|swift|button|swiftui
-2
41
3
72,858,311
72,858,311
1
true
2022-07-04T14:15:04.197Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SwiftUI display different images/text on toggle/true or false<p>I'm trying to create a button that displays a different images/text depending on the current ...
72,853,428
How exactly do I have to use the perspective transform on CALayer?<p>I'm attempting to add perspective to a view in <code>UIKit</code>.</p> <p>Currently my implementation looks like this:</p> <pre><code>let view: UIView ... vat perspective = CATransform3DIdentity view.layer.sublayerTransform = perspective view.laye...
<p>We can transform:</p> <ul> <li><code>.layer</code>, which transforms everything together</li> <li><code>.layer.sublayerTransform</code>, which transforms the <strong>sublayers</strong> together,</li> <li><code>someSubLayer</code>, which transforms an individual layer</li> </ul> <p>Here's a quick example...</p> <p>We...
How exactly do I have to use the perspective transform on CALayer?
ios|swift|uikit|core-animation
0
41
1
72,859,811
72,859,811
1
true
2022-07-04T07:57:07.440Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How exactly do I have to use the perspective transform on CALayer?<p>I'm attempting to add perspective to a view in <code>UIKit</code>.</p> <p>Currently my i...
72,855,703
Azure Traffic Manager / AWS Route 53 policy failover functionality in Google Cloud (GCP)?<p>I am unable to find the proper documentation to create a failover scenario similar to the one offered by Azure Traffic Manager and AWS Route 53 Traffic Policy in Google Cloud (DNS based). Is such kind of functionality even possi...
<p>Google Cloud does not offer DNS failover features similar to Route 53 or Azure Traffic Manager.</p> <p>In Google Cloud, a load balancer and health checks are deployed instead of DNS server failover features.</p> <p>Because of DNS global caching of resource records, DNS failover is often not a good solution. Load bal...
Azure Traffic Manager / AWS Route 53 policy failover functionality in Google Cloud (GCP)?
google-cloud-platform|amazon-route53|terraform-provider-gcp|azure-traffic-manager
1
41
1
72,860,678
72,860,678
1
true
2022-07-04T11:03:01.703Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Azure Traffic Manager / AWS Route 53 policy failover functionality in Google Cloud (GCP)?<p>I am unable to find the proper documentation to create a failover...
72,860,859
How can I create a react app using react js?<p>I am new to backend and I am having issues creating react app.</p> <p>I have started fresh multiple times and create a brand new terminal which I cd in a folder named &quot;client&quot;.</p> <p>As I type npx create-react-app./ I get this error:</p> <pre><code> ritamiran...
<p><strong>Creating a React Project</strong></p> <p>I believe you're actually missing naming your app.</p> <p>To create a project, navigate to the folder where you want to store the project and from the terminal run:</p> <p><code>npx create-react-app my-app</code></p> <p><em>Instead of <code>my-app</code> make sure to ...
How can I create a react app using react js?
javascript|node.js|reactjs|terminal
0
41
2
72,860,942
72,860,942
1
true
2022-07-04T18:39:15.007Z
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 react app using react js?<p>I am new to backend and I am having issues creating react app.</p> <p>I have started fresh multiple times and ...
72,861,649
Extract varray element by index number using custom type's member function<p><em>Oracle 18c:</em></p> <p>I've created a user-defined type and a member function that work ask expected.</p> <p>The member function returns an <code>mdsys.sdo_ordinate_array</code> such as <code>MDSYS.SDO_ORDINATE_ARRAY(10, 20, 30, 40, 50, 6...
<p>Access the ordinate value from the array in the PL/SQL scope (within the member function) rather than returning the entire array to the SQL scope and trying to access the ordinate from there (which does not work):</p> <pre class="lang-sql prettyprint-override"><code>CREATE TYPE my_sdo_geom_type AS OBJECT( shape S...
Extract varray element by index number using custom type's member function
sql|oracle|member-functions|oracle18c|oracle-spatial
0
41
1
72,861,880
72,861,880
1
true
2022-07-04T20:15:43.250Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Extract varray element by index number using custom type's member function<p><em>Oracle 18c:</em></p> <p>I've created a user-defined type and a member functi...
72,862,032
Convert to DataFrame Pandas to json multiple level python<p>Is there any way to convert a pandas dataframe into a json with different levels, I have this dataframe:</p> <pre><code>df = pd.DataFrame([ {&quot;type&quot;:&quot;Feature&quot;,&quot;Id&quot;:319,&quot;Departament&quot;:&quot;1 DE MAYO&quot;,&qu...
<p>You can use:</p> <pre><code>import json def to_json(row): return {'type': row.iloc[0], 'properties': row.iloc[1:-1].to_dict(), 'geometry': row.iloc[-1]} data = {'features': df.apply(to_json, axis=1).to_list()} print(json.dumps(data, indent=2)) </code></pre> <p>Output:</p> <pre><code>{ ...
Convert to DataFrame Pandas to json multiple level python
python|json|pandas
1
41
2
72,862,114
72,862,114
1
true
2022-07-04T21:06:53.857Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Convert to DataFrame Pandas to json multiple level python<p>Is there any way to convert a pandas dataframe into a json with different levels, I have this dat...
72,862,847
Extract DB name and table name from snowflake query using snowsql<pre><code>Insert into D.d Select * from A.a join B.b on A.a.a1=B.b.b1 Join C.c on C.c.c1=B.b.b1 </code></pre> <p>I have complex statements for which i need to extract source db name ( in above statement source DB are A,B,C and source tables are a,b,c &...
<p>You can use the SQLPARSE to parse the statement. I am providing a code below which is not optimally and efficiently written, but it has the logic to get the information</p> <pre><code>import sqlparse raw = 'Insert into D.d ' \ 'Select * from A.a join B.b on ' \ 'A.a.a1=B.b.b1 Join C.c on C.c.c1=B.b.b1;'...
Extract DB name and table name from snowflake query using snowsql
mysql|snowflake-cloud-data-platform
0
41
2
72,863,034
72,863,034
1
true
2022-07-04T23:54:23.910Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Extract DB name and table name from snowflake query using snowsql<pre><code>Insert into D.d Select * from A.a join B.b on A.a.a1=B.b.b1 Join C.c on C.c.c1=B...
72,863,395
When do we need to use WebSettings.setDatabaseEnabled?<p>I'm working with Android WebView and have a concern related to the Webview database</p> <p><a href="https://developer.android.com/reference/android/webkit/WebSettings#setDatabaseEnabled(boolean)" rel="nofollow noreferrer">https://developer.android.com/reference/a...
<p>Does the webpage you use it to display require the database API? If so, you need to enable it. If not, you don't. If you don't know what page will be displayed so you can't answer that, you probably should be launching a browser rather than using WebView- web view should be used to display specific pages in your...
When do we need to use WebSettings.setDatabaseEnabled?
android|webview
0
41
1
72,863,652
72,863,652
1
true
2022-07-05T02:19:10.073Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: When do we need to use WebSettings.setDatabaseEnabled?<p>I'm working with Android WebView and have a concern related to the Webview database</p> <p><a href="...
72,864,235
Concat columns name with BOOLEAN condition<p>folks. How can I concatenate BOOLEAN columns name to a new column on Pandas?</p> <p>Original dataset</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>Column01</th> <th>Column02</th> </tr> </thead> <tbody> <tr> <td>TRUE</td> <td>TRUE</td> </tr> <tr...
<pre><code>import pandas as pd def t(x): x[&quot;CONCATENATED&quot;] = &quot;, &quot;.join([x.index[i] for i in range(len(x)) if x.values[i] == True]) return x df = pd.DataFrame({&quot;Column01&quot;: [True, False], &quot;Column02&quot;: [True, True]}) print(df.apply(t, axis=1)) </code></pre> <p>OUTPUT:</...
Concat columns name with BOOLEAN condition
python|conditional-statements|boolean|dataset
0
41
2
72,864,402
72,864,402
1
true
2022-07-05T05:05:49.090Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Concat columns name with BOOLEAN condition<p>folks. How can I concatenate BOOLEAN columns name to a new column on Pandas?</p> <p>Original dataset</p> <div cl...
72,867,379
how to read last two line of values and assign values to previous line from log file using power shell<p>I have log text file (solution.log). How to read last two line of values and how to assign each value to previous line each word like critical =0 ,high=0,medium=0 and informational=0<br /> Please assist on this.</p>...
<p>To read the last line you could use this:</p> <pre><code>Get-Content solution.log -tail 1 </code></pre>
how to read last two line of values and assign values to previous line from log file using power shell
powershell|jenkins
-2
41
1
72,867,509
72,867,509
1
true
2022-07-05T09:52:53.207Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to read last two line of values and assign values to previous line from log file using power shell<p>I have log text file (solution.log). How to read las...
72,868,955
Read csv file into dictionary in a certain format<p>I am trying to read .csv file into dictionary in a certain format. Below is the reproducible format for the dataframe.</p> <pre><code># initialize list of lists data = [['fac1', 1,11], ['fac1', 2,12], ['fac1',3,13],['fac2',1,8],['fac2',2,9],['fac2',3,20]] # Create th...
<p>Have you tried something like this :</p> <pre><code># Create the pandas DataFrame df = pd.DataFrame(data, columns=[&quot;facility&quot;, &quot;customer&quot;, &quot;distance&quot;]) dict = { k.replace(&quot;fac&quot;, &quot;Fac_&quot;): {c.customer: c.distance for _, c in v.iterrows()} for k, v in df.groupb...
Read csv file into dictionary in a certain format
python|pandas|dictionary
0
41
2
72,869,293
72,869,293
1
true
2022-07-05T11:51:34.027Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Read csv file into dictionary in a certain format<p>I am trying to read .csv file into dictionary in a certain format. Below is the reproducible format for t...
72,873,002
Use a loop/automation for html web scraping<p>I am performing web-scraping in R (using rvest) for a specific set of data on various webpages. All of the webpages are formatted the same, so I can extract the targeted data from its placement on each page, using the correct node with no problem. However, there are 100 dif...
<pre class="lang-r prettyprint-override"><code>nth_element &lt;- function(vector, starting_position, n) {vector[seq(starting_position, length(vector), n)]} allresults &lt;- lapply(webpage_urls, function(oneurl) { read_html(oneurl) %&gt;% html_nodes(&quot;td&quot;) %&gt;% html_text() %&gt;% nth_element(10...
Use a loop/automation for html web scraping
r|loops|web-scraping|rvest
1
41
1
72,873,347
72,873,347
1
true
2022-07-05T16:50:22.657Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Use a loop/automation for html web scraping<p>I am performing web-scraping in R (using rvest) for a specific set of data on various webpages. All of the webp...
72,875,956
Add data in React object<p>I want you to help me with something that doesn't work well for me, what happens is that I want to add a data in an array through a function but instead of adding it, it overrides it, I don't know what is wrong in redux:</p> <pre><code>const [list,setList]=useState([]) const addList=(id)=&gt;...
<p>First you need to add an element not override the whole array with another one. Second in react useState variable you should use the previous value to update the new array. You can't use the list itself. Try this:</p> <pre><code>const [list,setList]=useState([]) const addList=(id)=&gt;{ setList(pre =&gt; [...pr...
Add data in React object
reactjs
0
41
3
72,876,110
72,876,110
1
true
2022-07-05T21:54:47.623Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Add data in React object<p>I want you to help me with something that doesn't work well for me, what happens is that I want to add a data in an array through ...
72,855,120
Is it possible to write Terraform pre-condition and post-condition in shell?<p>I'd like to execute a <code>postcondition</code> validation check within a resource via shell script. Is this technically possible? How?</p>
<p>Terraform's <code>postcondition</code> block allows you to check conditions based on data Terraform already has in memory as a result of its other work, but it cannot request new data <em>itself</em> in order to make a decision.</p> <p>Therefore in order to consult an external source like a shell script to decide a ...
Is it possible to write Terraform pre-condition and post-condition in shell?
shell|terraform
-1
41
1
72,876,698
72,876,698
1
true
2022-07-04T10:15:27.823Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to write Terraform pre-condition and post-condition in shell?<p>I'd like to execute a <code>postcondition</code> validation check within a res...
72,877,573
Numpy to return average of 3D matrix<p>I have a 3D Numpy matrix named <code>stocks</code> that has shape <code>(A, P, T)</code>, with <code>A</code> corresponding to the number of stock symbols, <code>P</code> corresponding to number of prices for the stock at a given point in time, and <code>T</code> corresponding to ...
<pre><code>import numpy as np # shape (A, P, T) stocks = np.array([ [ [1,2,3],[4,5,6],[7,8,9] ], [ [10,11,12],[13,14,15],[16,17,18] ], [ [19,20,21],[22,23,24],[25,26,27] ], [ [28,29,30],[31,32,33],[34,35,36] ] ]) # this will give you the mean calculated along the first dimension # the shape will be (P, T) out_0 = np....
Numpy to return average of 3D matrix
python|numpy
-1
41
1
72,878,296
72,878,296
1
true
2022-07-06T03:13:21.483Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Numpy to return average of 3D matrix<p>I have a 3D Numpy matrix named <code>stocks</code> that has shape <code>(A, P, T)</code>, with <code>A</code> correspo...
72,881,712
bash regex in if statement<p>I'm trying to add name-checking with regular expression, that passes only characters and digits but no special symbols given from the output. I wrote this code, but it's does not working. It shows &quot;not ok&quot; either when I'm typing only characters with digits or chars+special symbols...
<p>You can use</p> <pre class="lang-bash prettyprint-override"><code>if [[ $text =~ ^[[:alnum:]_]+$ ]] then echo &quot;ok&quot; else echo &quot;not ok&quot; fi </code></pre> <p><em>Details</em>:</p> <ul> <li><code>^</code> - start of string</li> <li><code>[[:alnum:]_]+</code> - one or more letters, digits or un...
bash regex in if statement
regex|bash|if-statement|sh|script
0
41
1
72,881,737
72,881,737
1
true
2022-07-06T10:14:24.553Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: bash regex in if statement<p>I'm trying to add name-checking with regular expression, that passes only characters and digits but no special symbols given fro...
72,880,902
Find parameter values that satsify logical formula in Prolog<p>I have a fact base of a single logical formula, e.g.</p> <pre><code>check(A,B) :- A,B. </code></pre> <p>I can query <code>check(true,true).</code> or <code>check(true,false).</code> and the compiler will give correct results. But I would like to also make q...
<pre><code>check_both(X, Y) :- check_single(X), check_single(Y). check_single(true) :- !. check_single(X) :- call(X). </code></pre> <p>Results in swi-prolog:</p> <pre><code>?- check_both(X, Y). X = Y, Y = true. ?- X=1, check_both(X=1, Y). X = 1, Y = true. ?- X=1, check_both(X=2, Y). false. ?- X=1, check_bot...
Find parameter values that satsify logical formula in Prolog
prolog|logical-operators
0
41
1
72,882,537
72,882,537
1
true
2022-07-06T09:20:04.647Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Find parameter values that satsify logical formula in Prolog<p>I have a fact base of a single logical formula, e.g.</p> <pre><code>check(A,B) :- A,B. </code>...
72,878,663
How to print icmp packet (including all headers) in hex from istream in boost-asio example<p>I am trying to modify the <a href="https://www.boost.org/doc/libs/1_52_0/doc/html/boost_asio/example/icmp/ping.cpp" rel="nofollow noreferrer">ICMP boost_asio</a> implementation to print ICMP response and request packets. In the...
<p><code>ostream</code> prints chars as characters, not integers, so <code>std::hex</code> format manipulator does nothing. Instead print as an (unsigned) integer, e.g.:</p> <p><strong><a href="http://coliru.stacked-crooked.com/a/61011f5b2329e386" rel="nofollow noreferrer">Live On Coliru</a></strong></p> <pre><code>#in...
How to print icmp packet (including all headers) in hex from istream in boost-asio example
c++|boost|boost-asio|istream|icmp
1
41
1
72,883,610
72,883,610
1
true
2022-07-06T06:11:30.927Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to print icmp packet (including all headers) in hex from istream in boost-asio example<p>I am trying to modify the <a href="https://www.boost.org/doc/lib...
72,884,287
Moq: Manipulate passed param does not work<p>I have something like this:</p> <pre><code>MyMock .Setup(m =&gt; m.MyMethodAsync(It.IsAny&lt;Stream&gt;())) .Returns((Stream outStream) =&gt; { outStream = new MemoryStream(Encoding.UTF8.GetBytes(&quot;this is the content&quot;)); return Task.CompletedTask; }); </code>...
<p>The code of the sample does not use the <code>Stream</code> that is provided by the caller of the method, but assigns a new <code>MemoryStream</code> to the parameter. As the parameter is not marked with <code>ref</code> or <code>out</code>, this reassignment is only valid in the method, but not outside.</p> <p>I su...
Moq: Manipulate passed param does not work
c#|moq
0
41
1
72,884,844
72,884,844
1
true
2022-07-06T13:19:19.350Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Moq: Manipulate passed param does not work<p>I have something like this:</p> <pre><code>MyMock .Setup(m =&gt; m.MyMethodAsync(It.IsAny&lt;Stream&gt;())) .Ret...
72,878,420
Configuring proxy_pass multiple params w/ dynamic route + API call<p>I need to configure a reverse proxy for a dynamic route that appends a variable <code>chainId</code> to an axios request to an outside moralis API. Getting a 502 Bad Gateway.</p> <p>Server Route Structure</p> <p><code>/moralis/ERC20/${token.address}?c...
<p>You don't need neither a regex location, nor a <code>$request_uri</code> part. Just use a simple prefix location and do not add anything after the upstream address, your request URI will be passed &quot;as-is&quot;:</p> <pre class="lang-none prettyprint-override"><code>location /moralis/ERC20/ { proxy_pass http:...
Configuring proxy_pass multiple params w/ dynamic route + API call
nginx|axios|next.js|reverse-proxy|moralis
0
41
1
72,888,245
72,888,245
1
true
2022-07-06T05:41:24.320Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Configuring proxy_pass multiple params w/ dynamic route + API call<p>I need to configure a reverse proxy for a dynamic route that appends a variable <code>ch...
72,887,417
Golang - Unable to get results from pipped Windows command<p>I am struggling to get the output for a Windows command that has a pipe in it. Here is the command:</p> <blockquote> <p>systeminfo | findstr /B /C:&quot;OS Name&quot;</p> </blockquote> <p>Here is the code:</p> <pre><code>c1 := exec.Command(&quot;systeminfo&qu...
<p>Remove the <code>io.Copy</code> to no redirect to STDOUT and print the content of the buffer.</p> <pre class="lang-golang prettyprint-override"><code> systemCmd := exec.Command(&quot;systeminfo&quot;) findCmd := exec.Command(&quot;findstr&quot;, &quot;/B&quot;, &quot;/C:OS Name&quot;) reader, writer := i...
Golang - Unable to get results from pipped Windows command
go|cmd|command|pipe
2
41
1
72,889,809
72,889,809
1
true
2022-07-06T17:04:19.797Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Golang - Unable to get results from pipped Windows command<p>I am struggling to get the output for a Windows command that has a pipe in it. Here is the comma...
72,889,843
Gathering entries in a matrix based on a matrix of column indices (tensorflow/numpy)<p><strong>A little example to demonstrate what I need</strong></p> <p>I have a question about gathering in tensorflow. Let's say I have a tensor of values (that I care about for some reason):</p> <pre><code>test1 = tf.round(5*tf.random...
<p>You can use <a href="https://www.tensorflow.org/api_docs/python/tf/gather_nd" rel="nofollow noreferrer"><code>gather_nd()</code></a> for this. It can look a bit tricky to get this working. Let me try to explain this with shapes.</p> <p>We got <code>test1 -&gt; [2, 3]</code> and <code>test_ind_col_ind -&gt; [2, 5]</c...
Gathering entries in a matrix based on a matrix of column indices (tensorflow/numpy)
python|numpy|tensorflow|pytorch
0
41
1
72,890,361
72,890,361
1
true
2022-07-06T21:05:05.703Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Gathering entries in a matrix based on a matrix of column indices (tensorflow/numpy)<p><strong>A little example to demonstrate what I need</strong></p> <p>I ...
72,889,714
Springboot error when inserting to Oracle DB using Oracle JDBC java API with DATE<p>I got the error <code>Caused by: Error : 932, Position : 70, Sql = insert into T_table1 (CREATED_TIME, LOG, ID) values (:1 , :2 , :3 ), OriginalSql = insert into T_table1 (CREATED_TIME, LOG, ID) values (?, ?, ?), Error Msg = ORA-00932: ...
<p>I think you have two problems</p> <p>First, the LogEntity constructor is setting the value to the argument itself.</p> <pre><code>public LogEntity(String logEvent, DATE createdAt){ this.ts = createdAt; this.logEvent = logEvent; } </code></pre> <p>Its must be:</p> <pre><code>public LogEntity(String logEvent, ...
Springboot error when inserting to Oracle DB using Oracle JDBC java API with DATE
java|spring|oracle|spring-boot|jpa
1
41
1
72,890,440
72,890,440
1
true
2022-07-06T20:52:20.490Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Springboot error when inserting to Oracle DB using Oracle JDBC java API with DATE<p>I got the error <code>Caused by: Error : 932, Position : 70, Sql = insert...
72,889,752
Hashing token using bcrypt and verify it by hashing the secret string again<p>As I understand, having the token in plain text in the Database is not secure, if an attacker gets the tokens that I use for changing the user passwords and verifying the email, then they could do all those.</p> <p>So now I am trying to hash ...
<p>bcrypt returns different hashes every time you make a call. This is how bcrypt was designed, This help makes the hash secured.</p> <p>please use the compare or use a different hashing algorithm.</p>
Hashing token using bcrypt and verify it by hashing the secret string again
node.js|mongoose|hash|token|bcrypt
0
41
1
72,890,442
72,890,442
1
true
2022-07-06T20:56:26.737Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Hashing token using bcrypt and verify it by hashing the secret string again<p>As I understand, having the token in plain text in the Database is not secure, ...
72,889,076
Data being passed from Activity to Fragment is returning null<p>I have reviewed multiple solutions to my question, but each attempt results in my android application crashing due to the data being sent returning null. I am attempting to send a ArrayList of Strings to a fragment, but when I launch my application I recei...
<p>AFAIK when you use <code>&lt;fragment&gt;</code> in xml it is automatically inflated, when the view is inflated, i.e. <code>setContentView(R.layout.activity_main);</code></p> <p>This means the fragment is created before you got the chance to pass in the bundled args.</p> <p>Back in the day it was standard practice t...
Data being passed from Activity to Fragment is returning null
java|android|android-fragments
0
41
1
72,890,810
72,890,810
1
true
2022-07-06T19:44:17.967Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Data being passed from Activity to Fragment is returning null<p>I have reviewed multiple solutions to my question, but each attempt results in my android app...
72,889,955
Is it bad practice to use mysql:latest as docker image?<p>Docker was built to make sure that code can run on any device without any issues of missing libraries, wrong versions, etc.</p> <p>However if you use the &quot;latest&quot; tag instead of a fixed version number, then you actually don't know on beforehand with wh...
<p>Usually, probably, for the reasons you state, you likely want to avoid <code>...:latest</code> tags here.</p> <p>For databases in particular, there can be differences in the binary interfaces, and there definitely are differences in the on-disk storage. If you were expecting MySQL 5.7 but actually got MySQL 8.0 you...
Is it bad practice to use mysql:latest as docker image?
docker|docker-image
-1
41
1
72,891,342
72,891,342
1
true
2022-07-06T21:18:38.940Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it bad practice to use mysql:latest as docker image?<p>Docker was built to make sure that code can run on any device without any issues of missing librari...
72,887,602
Laravel: Add to favourites button is duplicating because of foreach loop<p>For a project, I've created a method where people can add products they want to buy to a wishlist. All items in the catalog are stored and each article has a hearticon that is clickable. Once it's clicked, it's added to my database. However, whe...
<p>You can use <a href="https://laravel.com/docs/9.x/collections#method-contains" rel="nofollow noreferrer">contains() collection method</a></p> <pre><code>&lt;form action=&quot;{{route('wishlist.store', $article-&gt;id)}}&quot; id=&quot;wish_form&quot; method=&quot;post&quot;&gt; {{csrf_field()}} &lt;input nam...
Laravel: Add to favourites button is duplicating because of foreach loop
php|laravel|laravel-8
0
41
1
72,894,516
72,894,516
1
true
2022-07-06T17:20:59.477Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Laravel: Add to favourites button is duplicating because of foreach loop<p>For a project, I've created a method where people can add products they want to bu...
72,894,419
Django: how to use .filter( ) method in django?<p>I am trying to display quiz only for users that are registered in a particular course, i.e if a user is registered in a <em><strong>Frontend Crash Course</strong></em> i want them to see only the <code>quiz</code> related to that course they are registered in, and not a...
<p>The Problem in the Second Line</p> <pre class="lang-py prettyprint-override"><code>user_course = UserCourse.objects.filter(user=request.user) quizzes=Quiz.objects.filter(course__usercourse=user_course).annotate(questions_count=Count('questions')) </code></pre> <p>remember that when You are using <code>filter</code> ...
Django: how to use .filter( ) method in django?
python|django|django-rest-framework|django-views
0
41
1
72,894,633
72,894,633
1
true
2022-07-07T08:14:17.223Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Django: how to use .filter( ) method in django?<p>I am trying to display quiz only for users that are registered in a particular course, i.e if a user is reg...
72,896,283
Chrome Extension: Can I send multiple send messages from content script?<p><strong>TLDR</strong>: I want data that was prepared in <code>content.js</code> to be available in <code>popup.js</code> so that when I click on it I can render it.</p> <p>Upgrading @wOxxOm's solution he gave in my last question, after having da...
<p>Since the content script already receives the info from the background script you can save it as a Promise by omitting the callback from sendMessage so that the API auto-switches into the Promise mode:</p> <pre class="lang-js prettyprint-override"><code>const dataPromise = chrome.runtime.sendMessage(url).then(data =...
Chrome Extension: Can I send multiple send messages from content script?
javascript|google-chrome-extension
-1
41
1
72,896,680
72,896,680
1
true
2022-07-07T10:35:29.247Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Chrome Extension: Can I send multiple send messages from content script?<p><strong>TLDR</strong>: I want data that was prepared in <code>content.js</code> to...
72,896,269
Permission error when using bitbucket as codepipeline source<p>I want to use bitbucket as source,</p> <p>I have the permission error like this below.</p> <p>I guess I should give the permission to AWSCloudFormation role, however how can I do it?</p> <pre><code>User: arn:aws:sts::678100228133:assumed-role/cdk-hnb659fds-...
<p><code>ari:cloud:bitbucket::app/{67a68345-bf8e-49c5-8eca-833727e2d892}/aws-codestar</code> is not a valid CodeStar connection ARN. A codestar connection ARN looks like this: <code>arn:aws:codestar-connections:eu-west-1:123456789012:connection/991f-27e07658dd59-344e-44d2-adea40dd</code></p> <p>You need to create a Cod...
Permission error when using bitbucket as codepipeline source
amazon-web-services|bitbucket|aws-cdk
0
41
1
72,898,855
72,898,855
1
true
2022-07-07T10:33:43.110Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Permission error when using bitbucket as codepipeline source<p>I want to use bitbucket as source,</p> <p>I have the permission error like this below.</p> <p>...
72,899,767
advanced reshaping / pivoting in a r dataframe<p>I am struggling to reshape a dataframe in R. My starting point is a dataframe, which has the following structure:</p> <pre class="lang-r prettyprint-override"><code>df_given &lt;- data.frame( first_column = c(&quot;NA&quot;, &quot;NA&quot;, &quot;NA&quot;, &quot;Count...
<p>You can use data table, after dropping the extra info in the first couple of rows which aren't really data.</p> <pre><code>names(df_given) &lt;- c(&quot;country&quot;,&quot;Real C 2021&quot;, &quot;Real C 2022&quot;, &quot;Inf 2021&quot;, &quot;Inf 2022&quot;) df_given &lt;- df_given[-c(1:3),] library(data.table) se...
advanced reshaping / pivoting in a r dataframe
r|dataframe|format|pivot
0
41
3
72,899,934
72,899,934
1
true
2022-07-07T14:38:37.470Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: advanced reshaping / pivoting in a r dataframe<p>I am struggling to reshape a dataframe in R. My starting point is a dataframe, which has the following struc...
72,900,167
Get Firestore parent doc ID in subcollection<p>Is it possible to retrieve the parent document ID within a sub-collection?</p> <p>The user can create a bot, which will itself contain a history linked to this bot. To list this history against the bot ID., i need to be able to get the ID of the parent (that of the bot's d...
<p>If you look at the second snippet in the documentation on <a href="https://firebase.google.com/docs/firestore/manage-data/add-data#node.js_5" rel="nofollow noreferrer">adding a document</a>, you can see that it logs the ID of the new document:</p> <pre><code>// Add a new document with a generated id. const res = awa...
Get Firestore parent doc ID in subcollection
javascript|node.js|firebase|google-cloud-firestore|firebase-security
0
41
1
72,900,482
72,900,482
1
true
2022-07-07T15:03:44.077Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get Firestore parent doc ID in subcollection<p>Is it possible to retrieve the parent document ID within a sub-collection?</p> <p>The user can create a bot, w...
72,896,317
Lit-html select component event handlers<p>I am using a library called lit to create custom web components and i have tried using the <code>@change</code> and <code>@select</code> event handlers to display another component with no luck. I also can't seem to find the info on the docs.</p> <p>My code looks like this :</...
<p>Based on the name <code>&lt;bx-select&gt;</code> I'll assume you're using Carbon web components.</p> <p>Unfortunately it doesn't look like it's listed in the doc but the event name that's fired when you select appears to be <code>bx-select-selected</code> so you'd want to add an event listener with <code>@bx-select-...
Lit-html select component event handlers
html|select|lit
0
41
1
72,902,095
72,902,095
1
true
2022-07-07T10:37:54.310Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Lit-html select component event handlers<p>I am using a library called lit to create custom web components and i have tried using the <code>@change</code> an...
72,904,517
How to make equal objects on ruby?<p>The challenge is to make a class that build equals objects for the same value for example:</p> <pre><code>class Person att_reader :name def initialize(name) @name = name end end </code></pre> <p>I want to make</p> <pre><code>p1 = Person.new('joe') p2 = Person.new('joe') p3 = Perso...
<p>Let's use <code>Comparable</code> mixin</p> <pre><code>class Person include Comparable attr_reader :name def initialize(name) @name = name end def &lt;=&gt;(other) name &lt;=&gt; other.name end end </code></pre>
How to make equal objects on ruby?
ruby|class
0
41
1
72,904,573
72,904,573
1
true
2022-07-07T21:40:07.353Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to make equal objects on ruby?<p>The challenge is to make a class that build equals objects for the same value for example:</p> <pre><code>class Person ...
72,905,060
C# User input validation, if user enters Q at any console.ReadLine it will quit the program and i can't see why its not working<pre class="lang-cs prettyprint-override"><code>using System; namespace SummerWorkTask1 { class Program { static void Main(string[] args) { string firstName...
<p>You need to check for <code>Q</code> as you go. Here's the way I would look at it if I were you.</p> <pre><code>static void Main(string[] args) { string Ask(string message) { Console.WriteLine(message); string input = Console.ReadLine().ToUpper(); Console.WriteLine(); return i...
C# User input validation, if user enters Q at any console.ReadLine it will quit the program and i can't see why its not working
c#
-1
41
2
72,905,250
72,905,250
1
true
2022-07-07T23:01:10.790Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C# User input validation, if user enters Q at any console.ReadLine it will quit the program and i can't see why its not working<pre class="lang-cs prettyprin...
72,905,394
CSV to JSON in Python takes only first and last rows<p>I made a function that converts data from given csv file to a json object, and the weird thing is that it only gets the first and last element of the CSV. My csv structure is 2 columns: name,days</p> <p>Example:</p> <pre><code>name,days John,17 Fred,2 Michelle,22 <...
<p>I do not understand why would you need to use <code>i</code> as a counter but here a two suggestions:</p> <pre class="lang-py prettyprint-override"><code>data = [] with open(file, &quot;rt&quot;) as csvf: csvReader = csv.DictReader(csvf) for rows in csvReader: data.append(rows) jsondata = json.dump...
CSV to JSON in Python takes only first and last rows
python
0
41
1
72,905,517
72,905,517
1
true
2022-07-08T00:03:40.197Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: CSV to JSON in Python takes only first and last rows<p>I made a function that converts data from given csv file to a json object, and the weird thing is that...
72,898,105
Montecarlo continuation of multicolumn pandas timeseries<p>I have a bunch of data points in a timeseries in a pandas dataframe. Each column is supposedly independent of each other. I want to create a montecarlo process to calculate expected values for each of the columns. For that, my expectation is that the underlying...
<p>You could use <code>apply()</code> to create a data frame of random normal values using the attributes of the associated columns.</p> <p><strong>Generate Test Data</strong></p> <pre><code>nv = 50 d = {'A':np.random.normal(1,1,nv),'B':np.random.normal(2,2,nv),'C':np.random.normal(3,3,nv)} df = pd.DataFrame(d) print(d...
Montecarlo continuation of multicolumn pandas timeseries
python|pandas|numpy
0
41
1
72,906,371
72,906,371
1
true
2022-07-07T12:49:50.097Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Montecarlo continuation of multicolumn pandas timeseries<p>I have a bunch of data points in a timeseries in a pandas dataframe. Each column is supposedly ind...
72,907,685
Idiomatic way to check if a value is inside an Enum<p>I want to check if some <em>string value</em> exists in the <em>values set</em> of some Enum. Here is what I do:</p> <pre><code>from enum import Enum class Color(str, Enum): RED = &quot;red&quot; GREEN = &quot;green&quot; YELLOW = &quot;yellow&quot; s...
<p>You can test values against <code>_value2member_map_</code>, a dict attribute of the <code>Enum</code> sub-class that maps values to member classes, if you prefer not to clutter up your code with a <code>try-except</code> block:</p> <pre><code>if s in Color._value2member_map_: print(Color(s)) </code></pre>
Idiomatic way to check if a value is inside an Enum
python|string|enums
2
41
3
72,908,037
72,908,037
1
true
2022-07-08T06:52:01.207Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Idiomatic way to check if a value is inside an Enum<p>I want to check if some <em>string value</em> exists in the <em>values set</em> of some Enum. Here is w...
72,908,666
WPF How to bind object from window to custom user control<p>I need to create a custom user control and pass it from the main window an object. I need to display the object's attribute inside the user control, how can i do it? Thanks in advance.</p> <p>EDIT: This is my code, what i'm doing wrong?</p> <p>My custom contro...
<p><code>Model</code> must be defined as a public <em>property</em> for you to be able to bind to it:</p> <pre><code>public partial class MainWindow : Window { public ModelClass Model { get; } public MainWindow() { InitializeComponent(); Model = new ModelClass(&quot;hi&quot;, &quot;hi&quot...
WPF How to bind object from window to custom user control
wpf|data-binding
-3
41
1
72,910,616
72,910,616
1
true
2022-07-08T08:26:27.583Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: WPF How to bind object from window to custom user control<p>I need to create a custom user control and pass it from the main window an object. I need to disp...
72,911,539
How can the inputs of a function be saved into a data frame?<p>I need a little help modifying a script to make it simpler and less &quot;hard-coded&quot;. The below code creates a data frame of 10 columns with headers &quot;Find&quot; followed by two rows. The first row is the column name to be replaced, and the second...
<p>Iteratively adding <em>columns</em> is fine, not anywhere near as bad as iteratively adding rows (see &quot;Growing Objects&quot; in <a href="https://www.burns-stat.com/pages/Tutor/R_inferno.pdf" rel="nofollow noreferrer">The R Inferno</a>).</p> <p>I suggest making your function accept the input data (not trying to ...
How can the inputs of a function be saved into a data frame?
r
0
41
1
72,912,464
72,912,464
1
true
2022-07-08T12:36:38.860Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can the inputs of a function be saved into a data frame?<p>I need a little help modifying a script to make it simpler and less &quot;hard-coded&quot;. Th...
72,912,992
Usage of messaging center in xamarin form<p>I'm currently trying to use Messaging Center to update the count of a shopping cart amount the message is sent with the correct data but is never received, and I'm not sure if my implementation is right (Never used it before) I'm trying to send data from a method to a view mo...
<p>first, you need to call <code>Subscribe</code> in your VM constructor, so that it will start listening for any incoming messages</p> <pre><code>MessagingCenter.Subscribe&lt;Panier, int&gt;(this, &quot;update counter&quot;, (x) =&gt; { Counter = x; }); </code></pre> <p>then your send needs to use the sam...
Usage of messaging center in xamarin form
c#|xamarin|mvvm|badge
0
41
1
72,913,245
72,913,245
1
true
2022-07-08T14:34:18.180Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Usage of messaging center in xamarin form<p>I'm currently trying to use Messaging Center to update the count of a shopping cart amount the message is sent wi...
72,914,353
Decompressing gzipped ReadOnlyMemory<byte> before I do JsonDocument.Parse<p>The websocket client is returning a <code>ReadOnlyMemory&lt;byte&gt;</code>.</p> <p>The issue is that <code>JsonDocument.Parse</code> fails due to the fact that the buffer has been compressed. I've got to decompress it somehow before I parse it...
<p>So, if you had a byte array, you'd do this:</p> <pre><code>private static JsonDocument DecompressData(byte[] byteData) { using var compressedStream = new MemoryStream(byteData); using var deflateStream = new GZipStream(compressedStream, CompressionMode.Decompress); return JsonDocument.Parse(deflateStream...
Decompressing gzipped ReadOnlyMemory<byte> before I do JsonDocument.Parse
c#|.net|memory|compression
0
41
1
72,914,588
72,914,588
1
true
2022-07-08T16:27:10.373Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Decompressing gzipped ReadOnlyMemory<byte> before I do JsonDocument.Parse<p>The websocket client is returning a <code>ReadOnlyMemory&lt;byte&gt;</code>.</p> ...
72,875,149
How to reuse API Credentials from AWS secret manager<p>My question is related to runtime, for example:</p> <ol> <li>I Make all the configurations and store an API Key at AWS Manager</li> <li>An application retrieves the key and accesses the 3rd API with it</li> <li>The application keeps running processing other stuff</...
<p>You might want to look into client side caching libraries provided by AWS Secrets Manager <a href="https://aws.amazon.com/about-aws/whats-new/2019/05/Secrets-Manager-Client-Side-Caching-Libraries-in-Python-NET-Go/" rel="nofollow noreferrer">https://aws.amazon.com/about-aws/whats-new/2019/05/Secrets-Manager-Client-Si...
How to reuse API Credentials from AWS secret manager
amazon-web-services|security|api-key|aws-secrets-manager|secret-key
0
41
1
72,916,733
72,916,733
1
true
2022-07-05T20:23:59.383Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to reuse API Credentials from AWS secret manager<p>My question is related to runtime, for example:</p> <ol> <li>I Make all the configurations and store a...
72,917,498
Finding the local minima of a convex function but expression of the function is unknown<p>I'm developing an application that can automatically calibrate lidar. The lidar has four parameters <code>a</code>, <code>b</code>, <code>c</code>, <code>d</code>, each with a range from -5.0 to 5.0 inclusive and step size 0.1. Th...
<p>You could start with the <a href="https://en.wikipedia.org/wiki/Nelder%E2%80%93Mead_method" rel="nofollow noreferrer">Nelder-Mead</a> method. It builds a simplex from previous function evaluation points and reflects them to dismiss the worst point and select a new trial point.</p> <p>To reduce the number of function...
Finding the local minima of a convex function but expression of the function is unknown
mathematical-optimization
0
41
1
72,917,944
72,917,944
1
true
2022-07-08T22:13:17.130Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Finding the local minima of a convex function but expression of the function is unknown<p>I'm developing an application that can automatically calibrate lida...