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,910
No method named `match_command` found for struct `HashMap` in the current scope<p>I'm writing a command parser. Here is my code.</p> <pre class="lang-rust prettyprint-override"><code>use std::collections::HashMap; use std::hash::{Hash, Hasher}; struct Command { begin: String, command: String, args: Vec&lt;...
<p>The implementation isn't found because the types don't match. Compare:</p> <pre><code>impl CommandRegister for HashMap&lt;Command, fn(args: Vec&lt;String&gt;)&gt; { </code></pre> <pre><code>let mut map: HashMap&lt;&amp;Command, fn(args: Vec&lt;String&gt;)&gt; = HashMap::new(); </code></pre> <p>One uses <code>Comman...
No method named `match_command` found for struct `HashMap` in the current scope
rust
0
72
1
72,370,927
72,370,927
1
true
2022-05-25T00:51:13.983Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: No method named `match_command` found for struct `HashMap` in the current scope<p>I'm writing a command parser. Here is my code.</p> <pre class="lang-rust pr...
72,346,826
Powershell how to concatenate with args<p>I just want to concatenate with args string but I get -System.Object[] in $test instead of &quot;testapp&quot; if args is app:</p> <pre><code> function test { Write-Host $args; $test = -join(&quot;test&quot;,$args.ToString()); Write-Host $test; } </code></pre>
<p>The easiest way is to use <a href="https://docs.microsoft.com/en-us/powershell/scripting/learn/deep-dives/everything-about-string-substitutions?view=powershell-7.2" rel="nofollow noreferrer">string interpolation</a>:</p> <pre class="lang-sh prettyprint-override"><code>function test { Write-Host $args $test =...
Powershell how to concatenate with args
powershell
0
72
1
72,348,248
72,348,248
1
true
2022-05-23T10:13:43.157Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Powershell how to concatenate with args<p>I just want to concatenate with args string but I get -System.Object[] in $test instead of &quot;testapp&quot; if a...
72,309,935
Zero sized array in struct managed by shared pointer<p>Consider the following structure:</p> <pre><code>struct S { int a; int b; double arr[0]; } __attribute__((packed)); </code></pre> <p>As you can see, this structure is packed and has Zero sized array at the end. I'd like to send this as binary data over ...
<blockquote> <p>I'd like this memory to be handled by std::shared_ptr.</p> <p>Is there a straight forward way of doing so without special hacks?</p> </blockquote> <p>Sure, there is:</p> <pre><code>shared_ptr&lt;S&gt; make_buffer(size_t s) { auto buffer = malloc(s); // allocate as usual auto r...
Zero sized array in struct managed by shared pointer
c++|memory|shared-ptr
0
72
3
72,314,832
72,314,832
1
true
2022-05-19T19:09:47.677Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Zero sized array in struct managed by shared pointer<p>Consider the following structure:</p> <pre><code>struct S { int a; int b; double arr[0]; }...
72,353,101
array of objects group them by a specific key<p>I have the following array</p> <pre><code>const arr = [{ agrupacion: &quot;Total país&quot;, valor: &quot;81.8&quot;, year: 2015 }, { agrupacion: &quot;Total país&quot;, valor: &quot;86.4&quot;, year: 2016 }, { agrupacion: &quot;Total país&quot;, valor: &q...
<p>Reduce the array into an object where the keys correspond to the <code>agrupacion</code> and the values correspond to an array of objects. And the length of this array is decided based on how many times an year appears for a particular <code>agrupacion</code>.</p> <p>So, the following array:</p> <pre><code>[ { agr...
array of objects group them by a specific key
javascript|arrays
1
72
3
72,353,309
72,353,309
1
true
2022-05-23T18:13:04.613Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: array of objects group them by a specific key<p>I have the following array</p> <pre><code>const arr = [{ agrupacion: &quot;Total país&quot;, valor: &quot...
72,321,024
echo command turns whitespace into new line<p>How to list files—whose filename has whitespace in it—and put them all into a text file. Unfortunately, the command below turns all whitespaces into new lines, e.g. <code>filename aba.txt</code> will be turned into:</p> <pre><code>filename aba.txt </code></pre> <p>I'd like ...
<p>You can pipe to <code>xargs</code> with an explicit delimiter (to '\n'):</p> <pre class="lang-sh prettyprint-override"><code>ls -1 *.txt | xargs -n 1 --delimiter '\n' echo &gt; output.txt </code></pre> <p>Note #1: <code>ls -1</code> will list a single entry per line</p> <p>Note #2: If you don't want to transform the...
echo command turns whitespace into new line
echo
0
72
2
72,328,161
72,328,161
1
true
2022-05-20T14:57:42.623Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: echo command turns whitespace into new line<p>How to list files—whose filename has whitespace in it—and put them all into a text file. Unfortunately, the com...
72,401,208
If an object value exists in an array of objects then return entire object<p>I have one array and one object:</p> <pre><code>const currentData = [{first: 'Breanna', last: 'Bazadoo', uid: '-Lz8YxHiwp8QZW3TqAFn'}, {first: 'Foo', last: 'Bazado', uid: '-Lz8YxHqQXWoaGOFRLrO'}, {first: 'Foo2', last: 'Bazado', uid: '-Lz8YxHsM...
<p>Does it work?</p> <pre><code>var valueList = Object.values(ministryMembers); var filteredData = currentData.filter(e =&gt; valueList.includes(e.uid)); </code></pre> <p>JsFiddle: <a href="https://jsfiddle.net/03bpak9m/2/" rel="nofollow noreferrer">https://jsfiddle.net/03bpak9m/2/</a></p>
If an object value exists in an array of objects then return entire object
javascript
0
72
4
72,401,988
72,401,988
1
true
2022-05-27T06:17:10.807Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: If an object value exists in an array of objects then return entire object<p>I have one array and one object:</p> <pre><code>const currentData = [{first: 'Br...
72,289,968
Parse HTML Table and hide columns<p>I have this basic HTML table that I export from JIRA. I need a quick way to hide all columns and show only 2 columns (<code>Key</code> + <code>Summary</code>).</p> <p>Please see the image below.</p> <p><a href="https://i.stack.imgur.com/MHOko.png" rel="nofollow noreferrer"><img src="...
<p>There is a few mistakes, td are not minded and th/td default display is table-cell ;)</p> <p>Here is how i would do: <em>(create a style element,innerHTML style to it and then append it to head)</em></p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snip...
Parse HTML Table and hide columns
javascript|html|jquery|css|html-table
0
72
1
72,290,179
72,290,179
1
true
2022-05-18T13:18:41.193Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Parse HTML Table and hide columns<p>I have this basic HTML table that I export from JIRA. I need a quick way to hide all columns and show only 2 columns (<co...
72,317,296
how to deal with a function pointer problem?<p>i'm implementing a normal function pointer.</p> <p>so this is the function that i want to call:</p> <blockquote> </blockquote> <pre><code> WndDyn* Punkt2d::pEditPunkt(WndInfo&amp; wi, Int32 AnzSichtChar, Bool WithUnit, const DecimalsConf&amp; DecConf) { WynDyn_c...
<p>Because <code>pEditFeldX</code> is a member function you can't just call <code>pEditFeldX(Dyncallback)</code>. You must call the function on some Punkt2d object, using e.g. <code>meinPunkt2d.pEditFeldX(Dyncallback)</code>.</p> <p>If you write <code>pEditFeldX(Dyncallback)</code> <em>inside the Punkt2d class</em> the...
how to deal with a function pointer problem?
c++|function|pointers|c++17
0
72
2
72,317,347
72,317,347
1
true
2022-05-20T10:21:53.713Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to deal with a function pointer problem?<p>i'm implementing a normal function pointer.</p> <p>so this is the function that i want to call:</p> <blockquot...
72,269,624
Intersect 2 columns in data.table R<p>i have a data table as this example below:</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>col1</th> <th>col2</th> </tr> </thead> <tbody> <tr> <td>a,b,c,d</td> <td>a,c,d</td> </tr> <tr> <td>r,h,g</td> <td>r</td> </tr> </tbody> </table> </div> <p>so eac...
<p>I used this command, and it seems working :</p> <pre><code>mapply(function(x, y) paste0(intersect(x, y), collapse = &quot; &quot;), strsplit(data$col1, '\\s'), strsplit(data$col2, '\\s')) </code></pre>
Intersect 2 columns in data.table R
r
1
72
2
72,270,109
72,270,109
1
true
2022-05-17T07:13:51.187Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Intersect 2 columns in data.table R<p>i have a data table as this example below:</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <t...
72,387,375
Error array bound is not an integer constant before ']' token<p>What am I doing wrong in this? Error array bound is not an integer constant before ']' token</p> <pre><code> using namespace std; bool cars_present[20]; int count = 0; void sortArrayIntegers(int IDs[count]); struct date { int day, month, year; }; s...
<pre><code>void sortArrayIntegers(int IDs[count]); </code></pre> <p>Please try changing this line to</p> <p>void sortArrayIntegers(int IDs[]);</p> <p>You dont need to provide a value here</p>
Error array bound is not an integer constant before ']' token
c++|arrays
1
72
1
72,387,391
72,387,391
1
true
2022-05-26T06:04:02.893Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error array bound is not an integer constant before ']' token<p>What am I doing wrong in this? Error array bound is not an integer constant before ']' token<...
72,399,694
jquery and bootstrap button event does not work<p>i have problems with the button click eventlistener</p> <p>this is the hanghoa.js</p> <pre><code>$(function(){ $(&quot;#addButton&quot;).on('click',function(){ console.log('addButton clicked'); }) //above show console work on click $(function(){ $(&...
<p>You forget to give id on your button:</p> <pre><code>&lt;button type=&quot;submit&quot; id=&quot;saveModalButton&quot; name=&quot;saveModalButton&quot; data-bs-dismiss=&quot;modal&quot;&gt;L&amp;#x1B0;u v&amp;#xE0; th&amp;#xEA;m&lt;/button&gt; </code></pre> <p>because u call $('#saveModalButton').on('click',function...
jquery and bootstrap button event does not work
javascript|jquery|bootstrap-modal
1
72
1
72,404,046
72,404,046
1
true
2022-05-27T01:58:56.173Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: jquery and bootstrap button event does not work<p>i have problems with the button click eventlistener</p> <p>this is the hanghoa.js</p> <pre><code>$(function...
72,319,645
Angular missing id attribute in DOM despite displaying "ng-reflect-id"<p>What could cause Angular to not add the <code>id</code> attribute to my component in the DOM.</p> <p>TS:</p> <pre><code>export class InputComponent extends BaseComponent { @Input() public id: string = ''; ... } </code></pre> <p>HTML :</p> ...
<p>The string interpolation is at fault. Without <code>{{...}}</code> the <code>id</code> appears as expected in the DOM.</p> <p>I'm very disappointed that Angular doesn't handle it.</p> <p>Edit: Actually <code>HostBinding</code> is a nice workaround.</p> <pre><code>export class MyInput { @Input() @HostBinding('att...
Angular missing id attribute in DOM despite displaying "ng-reflect-id"
html|angular|dom
0
72
1
72,319,818
72,319,818
1
true
2022-05-20T13:21:10.243Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Angular missing id attribute in DOM despite displaying "ng-reflect-id"<p>What could cause Angular to not add the <code>id</code> attribute to my component in...
72,294,062
useLocation doesn't recognize JSON object in state<p>I've been trying to pass a JSON object from one component to another using useNavigate() and useLocation() in react-router-dom. I've tried various ways of doing this, following <a href="https://stackoverflow.com/questions/61828145/uselocation-doesnt-recognize-state">...
<h1>Issue</h1> <p>The issue here is that <code>results</code> is your React state and enqueued React state updates are not immediately processed.</p> <pre><code>.then(data =&gt; { console.log(data); setResults(data); // &lt;-- enqueued state update toResults(); // &lt;-- uses current `results` state }); ......
useLocation doesn't recognize JSON object in state
javascript|reactjs|json|react-router|react-router-dom
1
72
1
72,294,349
72,294,349
1
true
2022-05-18T18:11:28.643Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: useLocation doesn't recognize JSON object in state<p>I've been trying to pass a JSON object from one component to another using useNavigate() and useLocation...
72,278,416
How to setup JPA bi-directional one to one while avoiding n+1 queries<p>I'm trying to debug two entities that have a bi-directional one to one relationship. The problem is that the relationship is causing N+1 Queries to occur. When I run <code>findAll()</code> a single query is executed for every item in my table.</p> ...
<p>You can optimize this with <code>EntityGraph</code> and lazy loading. I presume <code>VehicleEntity</code> is the owning entity here. In that case make <code>fetch = FetchType.LAZY</code> and <code>cascade = CascadeType.ALL</code> should be on the owning entity. And EntityGraph can be defined 2 ways</p> <ol> <li>Na...
How to setup JPA bi-directional one to one while avoiding n+1 queries
java|spring|spring-boot|hibernate|jpa
1
72
1
72,280,725
72,280,725
1
true
2022-05-17T17:36:21.277Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to setup JPA bi-directional one to one while avoiding n+1 queries<p>I'm trying to debug two entities that have a bi-directional one to one relationship. ...
72,284,763
Disable emojis in dotnet watch run<p>I upgraded to .NET SDK 6.0.300. When running <code>dotnet watch run</code>, the logs show emojis.</p> <p>How do I disable this behaviour?</p>
<p>The <a href="https://docs.microsoft.com/en-us/aspnet/core/tutorials/dotnet-watch?view=aspnetcore-6.0#non-ascii-characters" rel="nofollow noreferrer">answer</a> is this environment variable:</p> <pre class="lang-sh prettyprint-override"><code>DOTNET_WATCH_SUPPRESS_EMOJIS=1 </code></pre> <p>Example: from the shell:</p...
Disable emojis in dotnet watch run
asp.net-core|.net-core|dotnet-cli
1
72
1
72,284,781
72,284,781
1
true
2022-05-18T07:22:10.353Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Disable emojis in dotnet watch run<p>I upgraded to .NET SDK 6.0.300. When running <code>dotnet watch run</code>, the logs show emojis.</p> <p>How do I disabl...
72,275,187
Don't know how to create ISeq from: Java.lang.Long<p>Doing some practice on recursion and map implementation to knock some rust off Clojure. I'm using lists only here so how am I trying to mix seq and non-seqable stuff?</p> <pre><code>(defn mapset ([operator operand] (mapset operator operand '())) ([operator operan...
<p>Some errors:</p> <ul> <li>replace <code>'(finished-set)</code> with <code>finished-set</code></li> <li><a href="https://clojuredocs.org/clojure.core/into" rel="nofollow noreferrer"><code>into</code></a> adds elements from one collection to another, I think you're looking for <a href="https://clojuredocs.org/clojure....
Don't know how to create ISeq from: Java.lang.Long
java|casting|clojure|sequence|read-eval-print-loop
0
72
2
72,275,537
72,275,537
1
true
2022-05-17T13:46:28.137Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Don't know how to create ISeq from: Java.lang.Long<p>Doing some practice on recursion and map implementation to knock some rust off Clojure. I'm using lists ...
72,243,297
Error: Objects are not valid as a React child. When i use a child property<p>I am getting this error in my react app:</p> <blockquote> <p>Error: Objects are not valid as a React child. If you meant to render a collection of children, use an array instead.</p> </blockquote> <p>In my react Component i called an API and g...
<p>I believe you have initialised <code>data</code> with a default value which is probably failing in the render part. The component renders the division with that default <code>data</code> before calling the API. Once the API response is received, the component will get re-rendered with the fetched response.</p>
Error: Objects are not valid as a React child. When i use a child property
reactjs|json
0
72
1
72,246,306
72,246,306
2
true
2022-05-14T19:27:02.610Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error: Objects are not valid as a React child. When i use a child property<p>I am getting this error in my react app:</p> <blockquote> <p>Error: Objects are ...
72,255,616
create multiplication table that looks like a simple table with inputs<p>I am trying to make a program in which can print a multiplication table (a typical one, like the ones found in notebooks in table order). This table uses inputs in which it defines the perimeter of each axis (number defines length of x axis, multi...
<p>There are several things wrong in your code.</p> <ol> <li><p><code>document.write</code> is a pretty bad way to manipulate your DOM unless you want to do very specific things. You want to use stuff like <code>createElement</code> and <code>appendChild</code> to be more explicit in what you are doing for both readabi...
create multiplication table that looks like a simple table with inputs
javascript|html
-1
72
3
72,255,879
72,255,879
2
true
2022-05-16T07:35:08.097Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: create multiplication table that looks like a simple table with inputs<p>I am trying to make a program in which can print a multiplication table (a typical o...
72,259,677
Evaluating a String argument as if it were in an Excel cell<p>I have looked through the similar questions and cannot find one that quite matches my issue: I have a UDF that I pass arguments to to retrieve data. The arguments can be simple strings (e.g. &quot;vapour_mass_flow&quot;), simple cell references (e.g. &quot;C...
<p>Turns out I had 'cleaned' my complex argument strings previously - I have left the original message unedited so you can see the text I had that was failing, but the correctly parsed argument should have read (note the &quot; mark before _mass_flow that was missing in my original!):</p> <p>&quot;CHOOSE($B$8, &quot;ov...
Evaluating a String argument as if it were in an Excel cell
excel|vba
2
72
1
72,260,061
72,260,061
2
true
2022-05-16T13:02:17.250Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Evaluating a String argument as if it were in an Excel cell<p>I have looked through the similar questions and cannot find one that quite matches my issue: I ...
72,323,037
Nested generic impl<p>I don't understand why rust don't allow to use a generic inside an other generic constraint.</p> <p>It's difficult to explain with normal words but for example this simple code don't work</p> <pre><code>trait GenericTraitA&lt;T1&gt; {} trait GenericTraitB&lt;T2&gt; {} impl&lt;T1, T2: GenericTrai...
<p>What that compiler error is saying is, with that impl block definition, it would not be able to determine the appropriate type to substitute in for <code>T1</code>. Let's look at a concrete example to demonstrate this:</p> <pre class="lang-rs prettyprint-override"><code>pub trait Trait&lt;T&gt; { fn foo(&amp;sel...
Nested generic impl
generics|rust
1
72
1
72,323,423
72,323,423
2
true
2022-05-20T17:55:27.270Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Nested generic impl<p>I don't understand why rust don't allow to use a generic inside an other generic constraint.</p> <p>It's difficult to explain with norm...
72,339,184
Django Form "'ForwardManyToOneDescriptor' object has no attribute 'all'"<p>I'm having quite some problems. In effect trying to add a form to a home-page with options for a user to select based on a DB object. Then once submitted the page will refresh, and the form can be used again.</p> <p>Forms.py:</p> <pre class="lan...
<p>Looking at your code, the error is raised because you're specifying <code>queryset=command_node.host_id</code> in your form:</p> <pre class="lang-py prettyprint-override"><code> host_id = forms.ModelChoiceField( required=True, queryset=command_node.host_id, widget=forms.Select( ...
Django Form "'ForwardManyToOneDescriptor' object has no attribute 'all'"
python|django|django-models|django-forms
2
72
1
72,340,057
72,340,057
2
true
2022-05-22T16:00:06.803Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Django Form "'ForwardManyToOneDescriptor' object has no attribute 'all'"<p>I'm having quite some problems. In effect trying to add a form to a home-page with...
72,339,450
Creating a monitor in Unity<p>I have a prefab of a submarine I made in blender. In this submarine there is a &quot;altitude&quot; screen which is basically a cube I scaled and painted black. I can easly get the altitude of my submarine by doing sub.transform.position.y. Now I want to put a &quot;Text&quot; over the scr...
<p>There are multiple solutions for this.</p> <p>There is an old 3D Text component in unity. This can do what you want. The Problem with this is, that you have only limited styling options.</p> <p>A Better way is to use a WorldSpaceCanvas. If you use this option, you have all TextMeshPro styling options.</p> <p>Here is...
Creating a monitor in Unity
c#|visual-studio|unit-testing|unity3d
2
72
2
72,340,980
72,340,980
2
true
2022-05-22T16:36:54.640Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Creating a monitor in Unity<p>I have a prefab of a submarine I made in blender. In this submarine there is a &quot;altitude&quot; screen which is basically a...
72,357,326
cypress - get return of chain method with page objects<p>I implemented page objects with some chain methods.</p> <p>Page looks like this</p> <pre><code>class Table { getTable() { return cy.get('table#tblItem'); } getListRow() { return this.getTable() .within(($tbl) =&gt; { ...
<p>The <code>.within()</code> command will not permit returning of the inner value.</p> <p>Use a <code>.then()</code> and <code>.find()</code> instead.</p> <pre class="lang-js prettyprint-override"><code>getListRow() { return this.getTable() .then($tbl =&gt; { return cy.wrap($tbl).find('tbody') .scr...
cypress - get return of chain method with page objects
node.js|asynchronous|cypress|pageobjects|method-chaining
0
72
1
72,357,855
72,357,855
2
true
2022-05-24T04:48:30.417Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: cypress - get return of chain method with page objects<p>I implemented page objects with some chain methods.</p> <p>Page looks like this</p> <pre><code>clas...
72,385,057
Gatsby build error #95313, Audio is not defined<p>I think that an audio object is throwing a ReferenceError when building on Gatsby and I don't really know why. I've read it may be because of Node.JS, so I guess the way I'm creating the audio object is not the right one. The develop version works completely fine tho. T...
<p>Gatsby is trying to access the <code>Audio</code> object, which is only available client side. You'll need to add some conditional logic that checks for the availability of the global <code>window</code> object.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div...
Gatsby build error #95313, Audio is not defined
javascript|reactjs|webpack|gatsby|referenceerror
0
72
1
72,385,327
72,385,327
2
true
2022-05-25T23:15:03.587Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Gatsby build error #95313, Audio is not defined<p>I think that an audio object is throwing a ReferenceError when building on Gatsby and I don't really know w...
72,391,244
Sort JavaScript Array based on Key Value<p>I have an array of Objects with status 'Pass' &amp; 'Fail'. I want to move all Fail one's at the top and Pass one's at Bottom. Is there any array method to do the same?</p> <pre class="lang-js prettyprint-override"><code>let a = [ { name: 'x' , status: 'Pass' }, { name: '...
<p>An idiomatic solution for this task:</p> <pre class="lang-js prettyprint-override"><code>[...a.filter(el=&gt;el.status==='Fail'),...a.filter(el=&gt;el.status==='Pass')] </code></pre> <p>However, I thinq @farooq's solution is the best here</p>
Sort JavaScript Array based on Key Value
javascript|arrays|angular
-2
72
9
72,391,348
72,391,348
2
true
2022-05-26T11:41:39.497Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sort JavaScript Array based on Key Value<p>I have an array of Objects with status 'Pass' &amp; 'Fail'. I want to move all Fail one's at the top and Pass one'...
72,358,426
How can we trigger gitlab-ci before pushing to repository?<p>I want to implement pre-receive hooks on the GitLab server side but we don't have access to the file system. Is there any way I can handle it with GitLab-ci? I want to get control over what can and can't be pushed to the repository.</p>
<p>It's possible to implement pre-recieve hooks in gitLab but that comes when we have access to file system. For now, I have added gitlab-ci that will check on every merge request on protected branches and let all developers push to temp branches.</p>
How can we trigger gitlab-ci before pushing to repository?
devops|gitlab-ci|hook|push
1
72
2
72,394,593
72,394,593
2
true
2022-05-24T06:57:34.037Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can we trigger gitlab-ci before pushing to repository?<p>I want to implement pre-receive hooks on the GitLab server side but we don't have access to the ...
72,238,918
How to understand inaccurate results while using numpy.log?<p>I wish to calculate the natural logarithm of a value that is very close to 1, but not exactly one.</p> <p>For example, <code>np.log(1 + 1e-22)</code> is 0 and not some non-zero value. However, <code>np.log(1 + 1e-13)</code> is not zero, and calculated to be ...
<p>To complete the good solution of @yut23 using Numpy. If you need to deal with very small floats that does not fit in native types defined by Numpy or numbers close to 1 with a precision more than ~10 digits, then you can use the <strong>decimal package</strong>. It is <strong>slower than native float</strong> but it...
How to understand inaccurate results while using numpy.log?
python|numpy
0
72
2
72,244,662
72,244,662
2
true
2022-05-14T09:28:54.687Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to understand inaccurate results while using numpy.log?<p>I wish to calculate the natural logarithm of a value that is very close to 1, but not exactly o...
72,262,837
How to sum across rows with all NAs to be 0/NA<p>I have a dataframe:</p> <pre><code>dat &lt;- data.frame(X1 = c(0, NA, NA), X2 = c(1, NA, NA), X3 = c(1, NA, NA), Y1 = c(1, NA, NA), Y2 = c(NA, NA, NA), Y3 = c(0, NA, NA)) </code></p...
<p>By default, <code>sum</code> or <code>rowSums</code> return 0 when we use <code>na.rm = TRUE</code> and when all the elements are <code>NA</code>. To prevent this either use an <code>if/else</code> or <code>case_when</code> approach i.e. determine whether there are any non-NA elements with <code>if_any</code>, then...
How to sum across rows with all NAs to be 0/NA
r|dplyr|data-wrangling
3
72
1
72,262,885
72,262,885
2
true
2022-05-16T16:52:03.457Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to sum across rows with all NAs to be 0/NA<p>I have a dataframe:</p> <pre><code>dat &lt;- data.frame(X1 = c(0, NA, NA), X2 = c(1, NA, N...
72,314,247
How can Ruby `Complex` class have `Comparable` in its ancestors when it has none of its relational operator except `==`?<p>Indeed:</p> <pre class="lang-rb prettyprint-override"><code>Comparable.instance_methods # =&gt; [:clamp, :&lt;=, :&gt;=, :==, :&lt;, :&gt;, :between?] Complex.ancestors # =&gt; [Complex, Numeric, C...
<p>You can remove a method in two ways, <a href="https://ruby-doc.org/core-3.1.2/Module.html#undef_method-method" rel="nofollow noreferrer"><code>undef_method</code></a> and <a href="https://ruby-doc.org/core-3.1.2/Module.html#remove_method-method" rel="nofollow noreferrer"><code>remove_method</code></a></p> <p><code>u...
How can Ruby `Complex` class have `Comparable` in its ancestors when it has none of its relational operator except `==`?
ruby|inheritance|ruby-comparable
2
72
1
72,314,437
72,314,437
2
true
2022-05-20T06:06:31.857Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can Ruby `Complex` class have `Comparable` in its ancestors when it has none of its relational operator except `==`?<p>Indeed:</p> <pre class="lang-rb pr...
72,355,124
Researchpy : Warning in the example of summary_cont() page<p>The researchpy's <a href="https://researchpy.readthedocs.io/en/latest/summary_cont_documentation.html" rel="nofollow noreferrer">summary_cont() page</a> there is an example and it is given as;</p> <pre class="lang-py prettyprint-override"><code>import numpy, ...
<p>Values are assigned as shown below. Row indexes on the left, column names on the right. Explicit 'loc' indexing is used. You can see the difference between explicit and implicit 'iloc' indexing <a href="https://stackoverflow.com/questions/72235641/selecting-data-from-a-pandas-dataframe/72240640#72240640">here</a></p...
Researchpy : Warning in the example of summary_cont() page
python|pandas|dataframe
1
72
1
72,366,948
72,366,948
2
true
2022-05-23T21:47:04.893Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Researchpy : Warning in the example of summary_cont() page<p>The researchpy's <a href="https://researchpy.readthedocs.io/en/latest/summary_cont_documentation...
72,376,830
In R, what is the best way to save this type of list as a permanent file?<p>My question is straightforward: I have generated this type of object in R, that looks like a data frame, but is actually an array.</p> <pre><code>&gt; confidence , , 1 [,1] [,2] 2.5% 16.98751 -0.03834785 97.5% 17.58275 -0.014...
<p><strong>1) adply</strong> This will convert a 3d array to a data frame and then you can use write.csv and import it into Excel or transfer it using other R packages.</p> <pre><code># test input a &lt;- array(1:24, 2:4, dimnames = list(dim1 = c(&quot;a&quot;, &quot;b&quot;), dim2 = c(&quot;A&quot;, &quot;B&quot;, ...
In R, what is the best way to save this type of list as a permanent file?
r|list|dataframe
0
72
3
72,377,740
72,377,740
2
true
2022-05-25T11:31:12.340Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: In R, what is the best way to save this type of list as a permanent file?<p>My question is straightforward: I have generated this type of object in R, that l...
72,385,502
Change ggplot2 legend order without changing the manually specified aesthetics<p>I need to make a graph with multiple kinds of data on it, and I'm plotting one type of data with lines and one type with points. I've added a manually specified legend to show which type is points and which is lines (admittedly, my approac...
<p>You were attempting to override aesthetics for alpha in two places (ie <code>guides()</code> and <code>scale_alpha...()</code>), and ggplot was choosing to just interpret one of them. I suggest including your shape override with your legend order override, like this:</p> <pre><code>library(ggplot2) ggplot(DF1, aes...
Change ggplot2 legend order without changing the manually specified aesthetics
r|ggplot2|legend
0
72
1
72,385,581
72,385,581
2
true
2022-05-26T00:39:25.960Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Change ggplot2 legend order without changing the manually specified aesthetics<p>I need to make a graph with multiple kinds of data on it, and I'm plotting o...
72,250,758
R: Use real lon/lat values at x and y axis<p>I've generated the following chart with R:</p> <pre><code>library(rnaturalearth) library(rnaturalearthdata) library(ggplot2) library(rworldmap) library(scales) library(sf) library(mapdata) library(maptools) library(ggthemes) data(wrld_simpl) antarctica &lt;- wrld_simpl[wrl...
<p>You can solve this transforming the spatial polygon <code>(sp)</code> to simple feature class <code>(sf)</code> and using the <code>geom_sf</code> instead <code>geom_polygon</code>. I couldnt find the functions <code>annotation_scale</code> and <code>annotation_north_arrow</code> in any of those packages btw...</p> ...
R: Use real lon/lat values at x and y axis
r|ggplot2|data-visualization|geospatial|rlang
1
72
1
72,250,931
72,250,931
3
true
2022-05-15T17:45:22.180Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: R: Use real lon/lat values at x and y axis<p>I've generated the following chart with R:</p> <pre><code>library(rnaturalearth) library(rnaturalearthdata) libr...
72,284,652
Stop overlapping figures in Octave<p>Is there an easy way to have multiple <a href="https://octave.org/doc/v4.2.0/Figure-Properties.html" rel="nofollow noreferrer">figures</a> distributed evenly across a monitor without manual adjustment?</p> <p>I've attempted to use the <a href="https://au.mathworks.com/matlabcentral/...
<p>Below is a function I've called <code>tilefig</code> which tiles figures overlapping only on the toolbars, i.e. maximising plot visibility. Tested in MATLAB but I've done some quick documentation checks on the few less common functions like <a href="https://octave.sourceforge.io/octave/function/allchild.html" rel="n...
Stop overlapping figures in Octave
octave|figure
5
72
1
72,285,057
72,285,057
3
true
2022-05-18T07:13:09.947Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Stop overlapping figures in Octave<p>Is there an easy way to have multiple <a href="https://octave.org/doc/v4.2.0/Figure-Properties.html" rel="nofollow noref...
72,275,689
What kinds of expressions are allowed in a `#if` (the conditional inclusion preprocesssor directives)<p>Many sources online (for example, <a href="https://en.cppreference.com/w/cpp/preprocessor/conditional#Condition_evaluation" rel="nofollow noreferrer">https://en.cppreference.com/w/cpp/preprocessor/conditional#Conditi...
<p>I think that all of these examples are intended to be ill-formed, although as you demonstrate the current standard wording doesn't have that effect.</p> <p>This seems to be tracked as active <a href="https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1436" rel="nofollow noreferrer">CWG issue 1436</a>. The ...
What kinds of expressions are allowed in a `#if` (the conditional inclusion preprocesssor directives)
c++|language-lawyer|c-preprocessor
1
72
1
72,275,855
72,275,855
3
true
2022-05-17T14:17:41.237Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What kinds of expressions are allowed in a `#if` (the conditional inclusion preprocesssor directives)<p>Many sources online (for example, <a href="https://en...
72,280,917
breaking a nested loop<p>I have a nested loop which is checking if any <code>Currency</code> of <code>Wallet[]</code> matches any <code>Currency</code> in <code>Currency[] UtilityTokens</code>. Upon determining that indeed one of the wallets contains a utility token, I want to break my nested loop as soon as possible t...
<p>We can get this down to a one-liner, and it <strong>will</strong> do the early exit you want:</p> <pre><code>bool walletContainsUtilityToken = Wallets.Any(w =&gt; ExchangeFunctions.UtilityTokens.Any( ut =&gt; ut == w.Currency)); </code></pre> <p>This one might be easier to understand (no nesting, only one -shorter- ...
breaking a nested loop
c#|loops|break
0
72
3
72,280,992
72,280,992
3
true
2022-05-17T21:34:16.373Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: breaking a nested loop<p>I have a nested loop which is checking if any <code>Currency</code> of <code>Wallet[]</code> matches any <code>Currency</code> in <c...
72,397,562
Can someone help me understand this recursion in Haskell?<p>Here is the code:</p> <pre><code>func [] _ = 0 func (head:tail) num | head &gt; num = func tail num | head &lt;= num = head + (func tail num) main = print(func [4,1,2,5,7,6] 2 * 3) </code></pre> <p>Here is my solution:</p> <pre><code>4 + func[1,2,5,7,6] 6 ...
<p>The expression providing the argument to <code>print</code> should be understood as</p> <pre><code>(func [4, 1, 2, 5, 7, 6] 2) * 3 </code></pre> <p>not</p> <pre><code>func [4, 1, 2, 5, 7, 6] (2 * 3) </code></pre> <p>because function application takes precedence over any infix operator.</p>
Can someone help me understand this recursion in Haskell?
haskell|recursion
1
72
1
72,397,655
72,397,655
4
true
2022-05-26T20:14:10.267Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can someone help me understand this recursion in Haskell?<p>Here is the code:</p> <pre><code>func [] _ = 0 func (head:tail) num | head &gt; num = func tail n...
72,401,196
KeyValuePair deconstruction in ToDictionary<p>Can I deconstruct <code>KeyValuePair</code> as lambda argument in <code>ToDictionary</code> method like it could be done in <code>foreach</code>? So, is there any possibility to write something like this:</p> <pre class="lang-cs prettyprint-override"><code>dict.ToDictionary...
<p>No, you have to write it like this:</p> <pre><code>var d = dict.ToDictionary(p =&gt; p.Key, p =&gt; p.Value * 2); </code></pre>
KeyValuePair deconstruction in ToDictionary
c#|.net|linq
3
72
1
72,401,296
72,401,296
4
true
2022-05-27T06:16:13.033Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: KeyValuePair deconstruction in ToDictionary<p>Can I deconstruct <code>KeyValuePair</code> as lambda argument in <code>ToDictionary</code> method like it coul...
72,243,882
I am trying to load words from a text file into a binary search tree<p>I am trying to load words from a text file into a binary search tree.</p> <p>Each line of the file contains one word.</p> <pre><code>#include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; #include &lt;string.h&gt; typedef struct node node; struct node ...
<p>The memory size allocated for the word in <code>newnode()</code> is incorrect: <code>n-&gt;key = malloc(sizeof(key));</code> allocates the size of a pointer, not the length of the string plus an extra byte for the null terminator.</p> <p>You should use <code>strdup()</code> that allocates and copies the string in a ...
I am trying to load words from a text file into a binary search tree
c|binary-tree|binary-search-tree|pointer-to-pointer
0
72
1
72,243,925
72,243,925
4
true
2022-05-14T21:11:09.717Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I am trying to load words from a text file into a binary search tree<p>I am trying to load words from a text file into a binary search tree.</p> <p>Each line...
72,354,635
C# Pass various class objects to a single method dynamically<p>Lets say that I have two classes and I want to create one method that will process data from two classes, how can I setup a method that will accept both where I can create them into objects of their type?</p> <pre><code>Public classs Car:Wheel { public C...
<ol> <li><p>Your car and bike &quot;have&quot; wheels, but are not &quot;wheels&quot;, so you may want to read more about the has-a-is-a terminology when thinking about inheritance: <a href="https://stackoverflow.com/questions/2218937/has-a-is-a-terminology-in-object-oriented-language">has-a-is-a-terminology-in-object-...
C# Pass various class objects to a single method dynamically
c#|class|object
0
72
5
72,354,840
72,354,840
4
true
2022-05-23T20:46:14.230Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C# Pass various class objects to a single method dynamically<p>Lets say that I have two classes and I want to create one method that will process data from t...
72,265,398
Type punning in a const / static initializer (building a float constant from bits)<p>Some languages (like Rust, Zig, GLSL, HLSL) have built-in methods to build a floating type from bits supplied as an unsigned integer. However C and C++ do not have standard functions for that.</p> <p>With C99 we can use anonymous union...
<p>If you can use C++20 or above, then use <a href="https://en.cppreference.com/w/cpp/numeric/bit_cast" rel="noreferrer"><code>std::bit_cast</code></a> like</p> <pre><code>auto myvar = std::bit_cast&lt;type_to_cast_to&gt;(value_to_cast); </code></pre> <p>If you want to support older versions, you can do this same thing...
Type punning in a const / static initializer (building a float constant from bits)
c++|type-punning
1
72
2
72,265,489
72,265,489
5
true
2022-05-16T20:43:05.653Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Type punning in a const / static initializer (building a float constant from bits)<p>Some languages (like Rust, Zig, GLSL, HLSL) have built-in methods to bui...
72,247,817
how to write forward iterator using private std::vector base class<p>I need a vector class that exposes a small subset of the std::vector API. Everything works except range-based for. Here my attempt at implementing a forward iterator, which however does not compile.</p> <pre><code>#include &lt;vector&gt; #include &lt...
<pre><code>class Iterator : public std::vector&lt;T*&gt;::iterator {}; </code></pre> <p>Why? This looks like a certain other language's way of doing that. It's also not guaranteed to work because <code>vector&lt;T*&gt;::iterator</code> may actually be a pointer type, in which case you can't derive from it.</p> <pre><co...
how to write forward iterator using private std::vector base class
c++|iterator|range-based-loop
4
72
1
72,247,863
72,247,863
5
true
2022-05-15T11:25:50.510Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to write forward iterator using private std::vector base class<p>I need a vector class that exposes a small subset of the std::vector API. Everything wo...
72,365,155
Create a special Radial bar chart (race track plot)<p>I was able to replicate another good answers here to create a basic radial plot, but can anyone give me any clue of others functions/parameters/ideas on how to convert the basic one to something similar to this : <a href="https://i.stack.imgur.com/bsEXc.png" rel="no...
<p>You could get pretty close like this:</p> <pre class="lang-r prettyprint-override"><code>df &lt;- data.frame(x = c(10, 12.5, 15), y = c(1:3), col = c(&quot;#fcfbfc&quot;, &quot;#fbc3a0&quot;, &quot;#ec6f4a&quot;)) library(ggplot2) ggplot(df, aes(x = 0, xend = x, y = y, yend = y, color = col)) + ...
Create a special Radial bar chart (race track plot)
r|ggplot2|plot|bar-chart|radial
0
72
2
72,366,709
72,366,709
5
true
2022-05-24T14:57:52.980Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Create a special Radial bar chart (race track plot)<p>I was able to replicate another good answers here to create a basic radial plot, but can anyone give me...
72,932,703
Why "xargs -I {}" gets errors "wc or ls: {}: open: No such file or directory" but "xargs without -I {}" works?<h4>What works: <code>xargs</code> without <code>-I {}</code></h4> <p>I find all &quot;.txt&quot; files in my documents folder (about 5000 found) and use <code>wc -l</code> on them.</p> <pre><code>find . -type ...
<p>I believe macOS <code>xargs</code> is based on <a href="https://opensource.apple.com/source/shell_cmds/shell_cmds-149/xargs/xargs.c.auto.html" rel="nofollow noreferrer">a BSD version</a>.</p> <p>The FreeBSD xargs manpage states (emphasis mine):</p> <blockquote> <p>-I replstr</p> <p>Execute utility for each input lin...
Why "xargs -I {}" gets errors "wc or ls: {}: open: No such file or directory" but "xargs without -I {}" works?
macos|xargs
0
72
1
72,933,639
72,933,639
1
true
2022-07-11T00:15:25.230Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why "xargs -I {}" gets errors "wc or ls: {}: open: No such file or directory" but "xargs without -I {}" works?<h4>What works: <code>xargs</code> without <cod...
72,813,197
Unable to set Checkbox to Checked after refreshing and storing in Local Storage<p>I am currently facing an issue where I am unable to set a input box to stay checked after a refresh. I have stored the values in the local storage, even though the value is stored in the local storage; the checkbox does not remain checked...
<p>If you want to <strong>check</strong> the checkbox on pageload then <code>localStorage.getItem()</code> must be out of scope of any functions which are executed on certain events.</p> <pre><code> let checkBox = document.getElementById(&quot;checkboxFullDownload&quot;); _test: function() { if (checkBox.checked) { ...
Unable to set Checkbox to Checked after refreshing and storing in Local Storage
javascript|checkbox|dojo
0
72
2
72,813,440
72,813,440
1
true
2022-06-30T09:13:10.407Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unable to set Checkbox to Checked after refreshing and storing in Local Storage<p>I am currently facing an issue where I am unable to set a input box to stay...
72,987,086
Apexchart: how to rotate labels<p>I have the following code:</p> <pre><code>labels: [**&lt;dates dynamically populated here&gt;**], markers: { size: 3 }, </code></pre> <p>As I am running out of space, how do I rotate date labels at the bottom of the chart 45 or 90 degrees?</p> <p><a href="htt...
<p>Labels should rotate by default when there is no space, but if you want to have them always rotated (<code>rotateAlways</code> option) or change value you can do it in <code>xaxis</code> <a href="https://apexcharts.com/docs/options/xaxis/#rotate" rel="nofollow noreferrer">https://apexcharts.com/docs/options/xaxis/#r...
Apexchart: how to rotate labels
apexcharts
0
72
1
72,991,368
72,991,368
1
true
2022-07-14T22:03:24.367Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Apexchart: how to rotate labels<p>I have the following code:</p> <pre><code>labels: [**&lt;dates dynamically populated here&gt;**], ma...
72,897,318
extract rows across multiple files using conditions and variables<p>I have a text file of 5,000 rows. Each row corresponds to a unique <code>FILE</code> all labelled <code>gwas*</code>:</p> <pre><code>CHR BP FILE chr1 12345678 gwas1 chr2 87654321 gwas2 ... </code></pre> <p>I have 5,000 <code>gw...
<p>Sample inputs:</p> <pre><code>$ cat file.txt CHR BP FILE chr1 12345678 gwas1 chr2 87654321 gwas2 chr4 99999999 gwas4 # file gwas4 does not exist $ cat gwas1 CHR BP chr1 12345678 # match chr1 12345679 # mat...
extract rows across multiple files using conditions and variables
bash|awk|genetics
0
72
2
72,914,111
72,914,111
1
true
2022-07-07T11:50:37.990Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: extract rows across multiple files using conditions and variables<p>I have a text file of 5,000 rows. Each row corresponds to a unique <code>FILE</code> all ...
73,030,304
How can I pass the props to styled component(Button) in MUI?<p>I am creating custom button from Button component using styled.</p> <pre><code>export const CustomButton = styled(Button)({ borderRadius: &quot;17px&quot;, fontWeight: 300, fontSize: &quot;.8125rem&quot;, height: &quot;34px&quot;, lineHeight: &quo...
<p>Your <strong>Button</strong> component can be a <a href="https://mui.com/material-ui/react-button/" rel="nofollow noreferrer">MUI Button</a> or a custom button.</p> <pre class="lang-js prettyprint-override"><code>import Button from '@mui/material/Button'; </code></pre> <p>or</p> <pre class="lang-js prettyprint-overr...
How can I pass the props to styled component(Button) in MUI?
reactjs|typescript|material-ui
0
72
3
73,034,259
73,034,259
1
true
2022-07-19T01:55:35.340Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I pass the props to styled component(Button) in MUI?<p>I am creating custom button from Button component using styled.</p> <pre><code>export const Cu...
73,003,257
Passing multiple values as function in a single function<p>In Python, we normally pass arguements in the function when we have to call them multiple times as below:</p> <pre><code>def function_add(a,b): print(a+b) function_add(4,5) function_add(5,7) function_add(10,4) function_add(4,6) </code></pre> <p>Do we have a si...
<p>A function in VBA must return something. Otherwise, you should use a <code>Sub</code>:</p> <pre><code>Function function_add(a As Long, b As Long) As Long function_add = a + b End Function Sub TestFunction() MsgBox function_add(3, 5) End Sub </code></pre> <p>You can use a function without arguments, just retur...
Passing multiple values as function in a single function
excel|vba|excel-formula
0
72
1
73,003,641
73,003,641
1
true
2022-07-16T10:00:30.040Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Passing multiple values as function in a single function<p>In Python, we normally pass arguements in the function when we have to call them multiple times as...
72,959,617
How to compute the outer sum (similar to outer product<p>Given tensors <code>x</code> and <code>y</code>, each with shape <code>(num_batches, d)</code>, how can I use PyTorch to compute the sum of every combination of <code>x</code> and <code>y</code> within a batch?</p> <p>This is similar to outer product, except we d...
<p>This can easily be done, by introducing singleton dimensions into <code>x</code> and <code>y</code> and <a href="https://numpy.org/doc/stable/user/basics.broadcasting.html" rel="nofollow noreferrer">broadcasting</a> along these singleton dimensions:</p> <pre class="lang-py prettyprint-override"><code>osum = x[..., N...
How to compute the outer sum (similar to outer product
pytorch|numpy-einsum
0
72
2
72,961,535
72,961,535
1
true
2022-07-13T00:19:35.503Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to compute the outer sum (similar to outer product<p>Given tensors <code>x</code> and <code>y</code>, each with shape <code>(num_batches, d)</code>, how ...
72,835,014
Web scraping data that is not displayed on a webpage using rvest<p>This is a follow-up to a previous question: <a href="https://stackoverflow.com/questions/72480622/scraping-data-using-r-and-placing-results-in-a-data-frame">Scraping data using R and placing results in a data frame</a></p> <p>I'm trying to scrape review...
<p>It looks like this page has one less closing parenthesis, try: <code>str_extract(&quot;\&quot;urlParams\&quot;:.+\\}\\}\\}&quot;)</code>.<br /> This should work on the previous pages also.</p> <p>After much searching, the employee reviews are stored in the string starting with &quot;reviews&quot;: and ending with }]...
Web scraping data that is not displayed on a webpage using rvest
r|web-scraping|rvest
1
72
1
72,836,148
72,836,148
1
true
2022-07-01T22:05:36.270Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Web scraping data that is not displayed on a webpage using rvest<p>This is a follow-up to a previous question: <a href="https://stackoverflow.com/questions/7...
73,016,970
How to change entire column's values in excel?<p>I want to change the entire column's values. The values are like this</p> <pre><code>332450 457047024001990 </code></pre> <p>2 numbers with a white space in between. I only need the first number. This column has more than 5000 rows so it's very hard to do it manually. H...
<ul> <li>You can simply use <code>Find &amp; Replace</code> method.</li> </ul> <p>Use <code> *</code> <kbd>space and asterisk</kbd> to replace all things after space. Keep <em><strong>replace with</strong></em> field blank. Then hit <kbd>Replace All</kbd> button.</p> <p><a href="https://i.stack.imgur.com/iudiV.png" rel...
How to change entire column's values in excel?
excel|excel-formula
0
72
1
73,017,039
73,017,039
1
true
2022-07-18T03:17:03.023Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to change entire column's values in excel?<p>I want to change the entire column's values. The values are like this</p> <pre><code>332450 457047024001990 ...
72,768,180
How to get rid of this index out of range error? I know the reason but don't know the solution<p>I am using selenium with python to scrape web data. I want to scrape the data from a page and in the last I want to enter random generated email in input box and get the quote, this directs me to another page. When I come b...
<p>All problem is that you open other page (<code>Get an Offer</code>) and after going back all selections are removed - browser expects that user will start from the beginning but code expects that some sections will be still selected.</p> <p>It may need to remember all selections and later click them again.</p> <p>He...
How to get rid of this index out of range error? I know the reason but don't know the solution
python|selenium|selenium-webdriver
4
72
1
72,777,881
72,777,881
2
true
2022-06-27T07:10:27.253Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get rid of this index out of range error? I know the reason but don't know the solution<p>I am using selenium with python to scrape web data. I want t...
72,782,872
Move a dataframe column to last column<p>I want move the column in a dataframe to last column, I tried using <code>shift</code>. But this doesn't change the position.</p> <pre><code>import pandas a pd df = #input dataframe df['x'] = df['x'].shift(axis=1) </code></pre> <pre><code>Error: raise ValueError(f&quot;No ax...
<p>You can <a href="https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.pop.html" rel="nofollow noreferrer"><code>pop</code></a> and insert again:</p> <pre><code>df['X'] = df.pop('X') </code></pre> <p>example:</p> <pre><code>df = pd.DataFrame([list('axbc')], columns=['A', 'X', 'B', 'C']) print(df) A X B...
Move a dataframe column to last column
python-3.x|pandas|dataframe|shift
1
72
2
72,782,918
72,782,918
2
true
2022-06-28T08:09:47.100Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Move a dataframe column to last column<p>I want move the column in a dataframe to last column, I tried using <code>shift</code>. But this doesn't change the ...
72,794,831
Why std::vector<T>.resize() requires T has default ctor(with no parameter)?<p>I've got test code snippet:</p> <pre><code>#include&lt;vector&gt; using namespace std; struct My { My(int i) {} My(My&amp;&amp;) noexcept {} My(const My&amp;) {} }; int main() { vector&lt;My&gt; vm; vm.emplace_back(My(3));...
<p>The rule doesn't break your class semantics -- it actually enforces them. When you resize a vector, any new elements added are default-constructed. Since that is not allowed, then you may not resize a vector this way.</p> <p>Instead, you can use another overload of <code>resize</code> that accepts a value to initial...
Why std::vector<T>.resize() requires T has default ctor(with no parameter)?
c++|vector|constructor|resize|default
1
72
2
72,795,029
72,795,029
2
true
2022-06-29T01:33:47.673Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why std::vector<T>.resize() requires T has default ctor(with no parameter)?<p>I've got test code snippet:</p> <pre><code>#include&lt;vector&gt; using namespa...
72,851,107
How does Go unmarshall a string into a wrapped atomc int?<p>Uber's logging library Zap has a <code>Config</code> struct, in which the log level is defined as follows:</p> <pre class="lang-go prettyprint-override"><code>type Config struct { Level AtomicLevel `json:&quot;level&quot; yaml:&quot;level&quot;` } </code><...
<p>AtomicLevel has an <a href="https://pkg.go.dev/go.uber.org/zap#AtomicLevel.UnmarshalText" rel="nofollow noreferrer">UnmarshalText</a> method, which means it implements the <a href="https://pkg.go.dev/encoding#TextUnmarshaler" rel="nofollow noreferrer">encoding.TextUnmarshaler</a> interface. When the JSON decoder see...
How does Go unmarshall a string into a wrapped atomc int?
go|go-zap
1
72
1
72,851,552
72,851,552
2
true
2022-07-04T02:00:40.217Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How does Go unmarshall a string into a wrapped atomc int?<p>Uber's logging library Zap has a <code>Config</code> struct, in which the log level is defined as...
72,852,419
Inverting Map<Integer, Integer> into a Map<key, list<Integer>> using Streams<p>Is it possible to convert a Java <code>Map&lt;Integer, Integer&gt;</code> <code>m0</code> to a new <code>Map&lt;Integer, List&lt;Integer&gt;&gt;</code> <code>m1</code> where in the <code>m1</code> map to have <em>key</em> as <em>value</em> ...
<blockquote> <p>it is about the inverting key values pair grouped by values</p> </blockquote> <p>If you want to invert the Map as you've said in the comments, you need to create a stream over the entries of the source map, not over the values:</p> <pre><code>Map&lt;Integer, List&lt;Integer&gt;&gt; personByAge = m.entry...
Inverting Map<Integer, Integer> into a Map<key, list<Integer>> using Streams
java|hashmap|java-stream
0
72
3
72,852,689
72,852,689
2
true
2022-07-04T06:15:02.570Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Inverting Map<Integer, Integer> into a Map<key, list<Integer>> using Streams<p>Is it possible to convert a Java <code>Map&lt;Integer, Integer&gt;</code> <cod...
72,858,197
AWS Lambda function update command showing environment variables<p>I'm using gitlab pipelines to update configuration and code of my AWS Lambda functions. I noticed that when you perform AWS cli requests to update the Lambda like:</p> <p><code>aws lambda update-function-configuration --region $your_region --function-na...
<p>Could perhaps use <code>jq</code> to exclude the output? Otherwise use an SDK (e.g. boto3 or aws-sdk-go) and don't print the entire response.</p> <pre><code>$ cat ~/Desktop/Me.json { &quot;FunctionName&quot;: &quot;my-function&quot;, &quot;LastModified&quot;: &quot;2019-09-26T20:28:40.438+0000&quot;, &qu...
AWS Lambda function update command showing environment variables
gitlab|environment-variables
1
72
2
72,858,281
72,858,281
2
true
2022-07-04T14:19:24.237Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: AWS Lambda function update command showing environment variables<p>I'm using gitlab pipelines to update configuration and code of my AWS Lambda functions. I ...
72,892,212
Check if the mouse is within an element's boundary in react<p>I have a <code>div</code> with <code>onMouseEnter</code> and <code>onMouseLeave</code> events. Also, I am tracking the mouse position within a <code>useEffect</code> hook which updates the state.</p> <pre><code>useEffect(() =&gt; { const mouseMove = (e) ...
<p>In <code>isMouseInBound</code> function, dont use your <code>mousePosition</code> state, you can use event client position</p> <pre><code>const isMouseInBound = (e) =&gt; { const eleBounds = boxRef1.current.getBoundingClientRect(); let ret = false; if (e.clientX &gt;= eleBounds.left &amp;&amp; e.clientX ...
Check if the mouse is within an element's boundary in react
javascript|reactjs|framer-motion
0
72
1
72,892,364
72,892,364
2
true
2022-07-07T04:16:24.227Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Check if the mouse is within an element's boundary in react<p>I have a <code>div</code> with <code>onMouseEnter</code> and <code>onMouseLeave</code> events. ...
72,905,318
Why are string constant pointers different across crates in Rust?<p>While working with a <code>HashMap</code> that uses <code>&amp;'static str</code> as the key type, I created a <a href="https://rust-unofficial.github.io/patterns/patterns/behavioural/newtype.html" rel="nofollow noreferrer">newtype</a> to hash by the p...
<p>Instead of a <code>const</code> try a <code>static</code>?</p> <blockquote> <p>A constant item is an optionally named constant value which is not associated with a specific memory location in the program. Constants are essentially inlined wherever they are used, meaning that they are copied directly into the relevan...
Why are string constant pointers different across crates in Rust?
rust
2
72
1
72,910,281
72,910,281
2
true
2022-07-07T23:49:07.673Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why are string constant pointers different across crates in Rust?<p>While working with a <code>HashMap</code> that uses <code>&amp;'static str</code> as the ...
72,923,606
Why useEffect running two times?<p>I am trying to run <code>useEffect</code> only for the first time page load. But it's running two times when its loading for the first time. I cannot figure it out. Can anyone help me?</p> <p>Can Some one tell me why this code is running <code>useEffect</code> two times? React 18 I am...
<p>It's because you are in <code>strict mode</code>.</p> <p>Please remove <code>StrictMode</code> from the <code>index.js</code>.</p> <pre><code>//...... root.render( &lt;StrictMode&gt; &lt;App /&gt; &lt;/StrictMode&gt; ); </code></pre> <p>to</p> <pre><code>//...... root.render(&lt;App /&gt;); </code></pre> <...
Why useEffect running two times?
javascript|node.js|reactjs
0
72
1
72,923,653
72,923,653
2
true
2022-07-09T18:03:47.860Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why useEffect running two times?<p>I am trying to run <code>useEffect</code> only for the first time page load. But it's running two times when its loading f...
72,925,761
What is the best way of reading multiple kafka topics in spark streaming?<p>I'm developing an application using spark streaming reading from multiple kafka topics and I would like to know if this solution above is the best way of doing that.</p> <pre><code>bootstrap_server = '10.108.123.238:9092' topics = [ 'ingest_sr...
<p>Since the processing logic in your example is the same for all topics, you can replace</p> <pre class="lang-py prettyprint-override"><code>.option(&quot;subscribe&quot;, topic) </code></pre> <p>with</p> <pre class="lang-py prettyprint-override"><code>.option(&quot;subscribePattern&quot;, &quot;ingest_src_api.*&quot;...
What is the best way of reading multiple kafka topics in spark streaming?
apache-spark|pyspark|apache-kafka|spark-structured-streaming
0
72
1
72,927,335
72,927,335
2
true
2022-07-10T02:20:57.993Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the best way of reading multiple kafka topics in spark streaming?<p>I'm developing an application using spark streaming reading from multiple kafka t...
72,944,505
How do I disable Core Animation compositor in my Metal iOS (iPadOS) App<p>I have 3 questions relating to something from Apple WWDC 2015, more precisely Session 610, &quot;Metal performance optimisation techniques&quot;, slide 125 (or minute 33:56 in the video), to be found at <a href="https://developer.apple.com/videos...
<p>The compositor is there to basically compose different screen elements from OS and different applications together, while maintaining color management, HDR, all that jazz. The only time you don't need the compositor is when you are &quot;fullscreen&quot;, meaning that you have a layer that's fullscreen.</p> <p><code...
How do I disable Core Animation compositor in my Metal iOS (iPadOS) App
ios|swift|core-animation|metal|ipados
1
72
1
72,946,092
72,946,092
2
true
2022-07-11T20:48:29.073Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I disable Core Animation compositor in my Metal iOS (iPadOS) App<p>I have 3 questions relating to something from Apple WWDC 2015, more precisely Sessi...
72,946,142
Web Bluetooth send text from phone to browser<p>I've been doing a lot of reading and research on Web Bluetooth.</p> <p>I just want to send some text from a BLE Server (in this case a web app running on iOS WebBLE app)...and have the text appear on another web app running on Chrome on my Mac.</p> <p>I just want a textar...
<p>The Web Bluetooth API does not include APIs for acting in the peripheral role. A page using the API can only take on the role of the central.</p>
Web Bluetooth send text from phone to browser
ios|google-chrome|bluetooth|bluetooth-lowenergy|web-bluetooth
1
72
1
72,947,046
72,947,046
2
true
2022-07-12T01:29:06.697Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Web Bluetooth send text from phone to browser<p>I've been doing a lot of reading and research on Web Bluetooth.</p> <p>I just want to send some text from a B...
72,874,571
How to create a column with the lengths of strings from a different column in Polars Rust?<p>I'm trying to replicate one of the Polars Python examples in Rust but seem to have hit a wall. In the Python docs there is an example which creates a new column with the lengths of the strings from another column. So for exampl...
<p>You have to use apply function and cast the series to Utf8 Chunked Array. It then has a method <code>str_lengths()</code>: <a href="https://docs.rs/polars/0.22.8/polars/chunked_array/struct.ChunkedArray.html" rel="nofollow noreferrer">https://docs.rs/polars/0.22.8/polars/chunked_array/struct.ChunkedArray.html</a></p...
How to create a column with the lengths of strings from a different column in Polars Rust?
rust|rust-polars
1
72
1
72,952,184
72,952,184
2
true
2022-07-05T19:25:49.790Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to create a column with the lengths of strings from a different column in Polars Rust?<p>I'm trying to replicate one of the Polars Python examples in Rus...
72,957,114
Having issues getting the SUM() of a column with GROUP BY and DISTINCT<p>I have the following query:</p> <pre><code>select distinct ProdQty, JobCompletionDate, JobHead.JobNum from erp.JobHead inner join erp.LaborDtl on JobHead.JobNum = LaborDtl.JobNum and JobHead.Company = LaborDtl.Company where JobCompletionDate = '2...
<p>This:</p> <pre><code>select distinct ProdQty, JobCompletionDate, JobHead.JobNum... </code></pre> <p>is deciding what is distinct very differently than this:</p> <pre><code>select sum(distinct ProdQty)... </code></pre> <p>In the first example, it's removing duplicates where the combination of ProdQty, JobCompletionDa...
Having issues getting the SUM() of a column with GROUP BY and DISTINCT
sql|sql-server
0
72
1
72,960,655
72,960,655
2
true
2022-07-12T18:53:23.653Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Having issues getting the SUM() of a column with GROUP BY and DISTINCT<p>I have the following query:</p> <pre><code>select distinct ProdQty, JobCompletionDat...
72,962,620
Get ONLY the count of members of 'GROUP' type from an AAD group using Graph API<p>Is there a Graph API to get the count of members of a specific type from AAD group? For example, consider the following AAD group:</p> <p><a href="https://i.stack.imgur.com/llpfW.png" rel="nofollow noreferrer"><img src="https://i.stack.im...
<p>You can cast <code>microsoft.graph.group</code> type like this</p> <pre><code>GET https://graph.microsoft.com/v1.0/groups/{groupId}/transitiveMembers/microsoft.graph.group </code></pre> <p>To retrieve the count the query will be</p> <pre><code>GET https://graph.microsoft.com/v1.0/groups/{groupId}/transitiveMembers/m...
Get ONLY the count of members of 'GROUP' type from an AAD group using Graph API
c#|microsoft-graph-api|microsoft-graph-sdks
1
72
1
72,963,355
72,963,355
2
true
2022-07-13T07:44:14.470Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get ONLY the count of members of 'GROUP' type from an AAD group using Graph API<p>Is there a Graph API to get the count of members of a specific type from AA...
72,965,428
Why is a CNN model struggling to classify a colored MNIST?<p>I'm trying to classify colored MNIST digits with a basic CNN architecture on Keras. Here is the piece of code that colors the original dataset into purely either red, green or blue.</p> <pre class="lang-py prettyprint-override"><code>def load_norm_data(): #...
<p>The last part of the model includes a dense -&gt; relu -&gt; softmax. The relu activation should be removed. In addition, you might benefit from adding non-linearities (e.g., relu) in your convolutional blocks. Otherwise, the neural network will end up being a (big) linear function and will not work as well for non-...
Why is a CNN model struggling to classify a colored MNIST?
python|keras|conv-neural-network|rgb|mnist
3
72
1
72,967,249
72,967,249
2
true
2022-07-13T11:22:43.650Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is a CNN model struggling to classify a colored MNIST?<p>I'm trying to classify colored MNIST digits with a basic CNN architecture on Keras. Here is the ...
73,002,346
How to get internal ip of postgreSQL DB in GCP created by Terraform<p>I am learning terraform deployments coupled with GCP to streamline deployments.</p> <p>I have successfully deployed a postgreSQL db.</p> <p>Now I am trying to utilize terraform outputs to write a the private ip generated by the postgreSQL DB server t...
<p>As for the code style, usually there would be a separate file called <code>outputs.tf</code> where you would add all the values you want to have outputted after a successful apply. The second part of the question is two-fold:</p> <ol> <li>You have to understand how references to resource attributes/arguments work [1...
How to get internal ip of postgreSQL DB in GCP created by Terraform
postgresql|google-cloud-platform|terraform
1
72
2
73,002,446
73,002,446
2
true
2022-07-16T07:23:43.960Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get internal ip of postgreSQL DB in GCP created by Terraform<p>I am learning terraform deployments coupled with GCP to streamline deployments.</p> <p>...
73,003,528
Split column in several columns by delimiter '\' in pandas<p>I have a txt file which I read into pandas dataframe. The problem is that inside this file my text data recorded with delimiter ''. I need to split information in 1 column into several columns but it does not work because of this delimiter.</p> <p>I found thi...
<p>It looks like your file is <em>tab-delimited</em>, because of the &quot;\t&quot;. This may work</p> <pre><code>pd.read_csv('file.txt', sep='\t', skiprows=8) </code></pre>
Split column in several columns by delimiter '\' in pandas
python|pandas|dataframe|split|delimiter
0
72
1
73,003,564
73,003,564
2
true
2022-07-16T10:44:57.767Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Split column in several columns by delimiter '\' in pandas<p>I have a txt file which I read into pandas dataframe. The problem is that inside this file my te...
73,008,946
TypeError: Argument 'other' has incorrect type (expected spacy.tokens.token.Token, got str)<p>I'm looking to get all sentences in a text file that contain at least one of the conjunctions in the list &quot;conjunctions&quot;. However, when applying this function for the text in the variable &quot;text_to_look&quot; lik...
<p>While the problem lies in the fact that <code>conjunction</code> is a string and <code>sentence</code> is a <code>Span</code> object, and to check if the sentence <em>text</em> contains a conjunction you need to access the Span <code>text</code> property, you also re-initialize the <code>coord_sents</code> in the lo...
TypeError: Argument 'other' has incorrect type (expected spacy.tokens.token.Token, got str)
python|spacy
1
72
1
73,010,340
73,010,340
2
true
2022-07-17T02:47:22.497Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: TypeError: Argument 'other' has incorrect type (expected spacy.tokens.token.Token, got str)<p>I'm looking to get all sentences in a text file that contain at...
73,018,358
Apex: 22.1.1 - Based on the selection of the radio groups the form must be displayed dynamically<p>I am a newbie to APEX. I am currently working on radio buttons.. There are radio button groups in my page 1. For example :Radio 1 and Radio 2.Based on the selection of the radio button in these 2 groups , I need to dynami...
<p>The way you described it, you'd use <strong>dynamic actions</strong> (Show / Hide) because they let you &quot;dynamically&quot; (and immediately) manipulate other items on the page.</p> <p>You <em>could</em> use Server-side conditions as well, but they require page to be submitted first so - I guess that's not what ...
Apex: 22.1.1 - Based on the selection of the radio groups the form must be displayed dynamically
oracle-apex
0
72
1
73,018,464
73,018,464
2
true
2022-07-18T06:58:46.670Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Apex: 22.1.1 - Based on the selection of the radio groups the form must be displayed dynamically<p>I am a newbie to APEX. I am currently working on radio but...
73,017,468
Data validation list based on combination of two dynamic lists<p>I have a table where I want users to fill values off a list using data validation. The content of the validation list should be based on values entered in two other tables which are defined as dynamic named ranges (say list1 and list2). I need my validati...
<p>Use below formula to merger two or many list into one using <code>FILTERXML()</code> and <code>TEXTJOIN()</code> formula.</p> <pre><code>=FILTERXML(&quot;&lt;t&gt;&lt;s&gt;&quot;&amp;TEXTJOIN(&quot;&lt;/s&gt;&lt;s&gt;&quot;,TRUE,A2:A20,B2:B20)&amp;&quot;&lt;/s&gt;&lt;/t&gt;&quot;,&quot;//s&quot;) </code></pre> <p>Th...
Data validation list based on combination of two dynamic lists
excel
0
72
3
73,030,756
73,030,756
2
true
2022-07-18T04:53:44.980Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Data validation list based on combination of two dynamic lists<p>I have a table where I want users to fill values off a list using data validation. The conte...
72,920,132
int64(math.Pow(2, 63) - 1) results in -9223372036854775808 rather than 9223372036854775807<p>I am trying to store max and min signed ints of different bits. The code works just fine for ints other than int64</p> <pre class="lang-golang prettyprint-override"><code>package main import ( &quot;fmt&quot; &quot;mat...
<p>There are multiple problems here:</p> <p><code>math.Pow</code> returns a <code>float64</code>. This type cannot be used to represent a 64 bit signed integer with full precision as required for the attempted computation here. To cite from <a href="https://en.wikipedia.org/wiki/Double-precision_floating-point_format#...
int64(math.Pow(2, 63) - 1) results in -9223372036854775808 rather than 9223372036854775807
go|integer|pow|int64
1
72
1
72,920,751
72,920,751
2
true
2022-07-09T08:59:07.627Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: int64(math.Pow(2, 63) - 1) results in -9223372036854775808 rather than 9223372036854775807<p>I am trying to store max and min signed ints of different bits. ...
72,800,651
Powershell: terminating exception still continues to next command<p>I was expecting that with a terminating exception, the script execution will hault in powershell.</p> <p>Since try/catch will only capture terminating exception(other than ErroActionPreference etc) I had the below code</p> <pre><code>try { $hashtableJ...
<p>PowerShell has <strong><em>two</em> types of <em>terminating errors</em></strong>, which <strong>the documentation currently <em>conflates</em></strong>, unfortunately:</p> <ul> <li><p><strong><em>Statement</em>-terminating</strong> errors, as reported by compiled cmdlets (as opposed to written-in-PowerShell <a href...
Powershell: terminating exception still continues to next command
powershell|powershell-5.0
2
72
2
72,802,148
72,802,148
2
true
2022-06-29T11:29:16.007Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Powershell: terminating exception still continues to next command<p>I was expecting that with a terminating exception, the script execution will hault in pow...
72,778,194
Multiple Apollo queries in one component, getting cannot redeclare block-scoped variable<p>I have these two Apollo queries in one React component:</p> <pre><code> const { data, loading, error } = useQuery(PlaylistQuery, { variables: { _id: playlistId }, fetchPolicy: &quot;cache-and-network&quot;, }); const...
<p>To avoid this issue, you could simply name your queries' variables. As an example like below:</p> <pre><code>const { data: playListData, loading: playListLoading, error: playListError } = useQuery(PlaylistQuery, { variables: { _id: playlistId }, fetchPolicy: &quot;cache-and-network&quot;, }); const [lo...
Multiple Apollo queries in one component, getting cannot redeclare block-scoped variable
javascript|reactjs|graphql|apollo|apollo-client
2
72
1
72,778,329
72,778,329
2
true
2022-06-27T20:53:56.597Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Multiple Apollo queries in one component, getting cannot redeclare block-scoped variable<p>I have these two Apollo queries in one React component:</p> <pre><...
72,953,893
How to get the UTC time given any timezone and hour (considering daylight savings)<p>An example would be 9am CST (central standard time), or 6am CET (Central European Time).</p> <p>Using any new Date() calls will always give me a date in my local time zone (BST, or GMT+1).</p> <p>I think I need to first create the date...
<p>I would definitely suggest using a specialized date/time library for this purpose.</p> <p>Timezone conversion in vanilla JavaScript is tricky to say the least (especially converting from a timezone to UTC)</p> <p>However this is quite straightforward in <a href="https://moment.github.io/luxon/#/" rel="nofollow noref...
How to get the UTC time given any timezone and hour (considering daylight savings)
javascript|datetime
1
72
1
72,955,562
72,955,562
2
true
2022-07-12T14:21:47.800Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get the UTC time given any timezone and hour (considering daylight savings)<p>An example would be 9am CST (central standard time), or 6am CET (Central...
72,847,847
how to avoid duplicate in the code using generics or Function classes<pre><code>private &lt;Y&gt; void meth( MyObj ds, MultiValueMap&lt;String, List&gt; mvm, Class&lt;Y&gt; data) { if(data.isAssignableFrom(Employee.class)) { for (Employee rd : (List&lt;Employee&gt;) mvm.ge...
<p>While generic methods can be applied, they won't solve the actual scenario you're trying to solve for (an earlier edit of this answer was an attempt before I thought through it more).</p> <p>Taking a step back, this looks like the problem statement (&quot;what&quot; you're solving for, not &quot;how&quot;):</p> <ul>...
how to avoid duplicate in the code using generics or Function classes
java|generics
2
72
2
72,848,235
72,848,235
2
true
2022-07-03T15:41:44.387Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to avoid duplicate in the code using generics or Function classes<pre><code>private &lt;Y&gt; void meth( MyObj ds, MultiValueMap&lt;String, L...
73,007,112
How To Map An Array [Swift]<p>I have an array named <code>bonusCardsTest</code> of type [BonusCard] that is conformed to Identifiable that has an id and an url property of type String.</p> <pre><code>var bonusCardsTest: [BonusCard] = [] struct BonusCard: Identifiable { var id = UUID().uuidString var url: Strin...
<p>As Larme says, you could map your array of URLs to <code>BonusCard</code>s:</p> <pre><code>let bonusCards = getBonusURLsArray.map { BonusCard(url: $0) } </code></pre>
How To Map An Array [Swift]
arrays|swift
0
72
1
73,007,185
73,007,185
2
true
2022-07-16T19:32:21.540Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How To Map An Array [Swift]<p>I have an array named <code>bonusCardsTest</code> of type [BonusCard] that is conformed to Identifiable that has an id and an u...
72,929,054
How do I skip a value using the while loop?<pre class="lang-html prettyprint-override"><code> &lt;!DOCTYPE html&gt; &lt;html lang=&quot;en&quot;&gt; &lt;head&gt; &lt;meta charset=&quot;UTF-8&quot;&gt; &lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot;&gt; &lt;...
<p>You need to increase <code>w</code> value before you do the skipping, one method is to do it inside the <code>while</code> condition:</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-overrid...
How do I skip a value using the while loop?
javascript|while-loop|infinite-loop
-1
72
2
72,929,100
72,929,100
2
true
2022-07-10T13:59:46.437Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I skip a value using the while loop?<pre class="lang-html prettyprint-override"><code> &lt;!DOCTYPE html&gt; &lt;html lang=&quot;en&quot;&gt; ...
73,014,910
Clear content for filtered data<p>I managed to create script to delete rows when it is filtered but not managed to create clear content function when its filtered. Code as below:</p> <pre><code>var sheet = SpreadsheetApp.getActive().getSheetByName('data'); var lastRow = sheet.getLastRow() var lastColumn = sheet.getLast...
<p>Try to change:</p> <pre><code>sheet.deleteRows(2, deletedrows) // to delete rows </code></pre> <p>to:</p> <pre><code>for (var i = 2; i &lt; deletedrows; i++) { if (!sheet.isRowHiddenByFilter(i)) { sheet.getRange(i,1,1,lastColumn).clearContent(); } } </code></pre> <p>It should work fine for several rows, for ...
Clear content for filtered data
javascript|google-apps-script|google-sheets|spreadsheet
2
72
1
73,015,075
73,015,075
2
true
2022-07-17T19:52:03.983Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Clear content for filtered data<p>I managed to create script to delete rows when it is filtered but not managed to create clear content function when its fil...
72,989,888
Block IPs that requested more than N times per minute from a log file<p>I want to block IPs that requested more than N times/min using <code>iptables </code>.<br> I've sorted the log file using this script:<br> <code>cat $log_path | awk '{print $1, $4}' | sort -n -k 1,4 | sed &quot;s/\[//g&quot;</code></p> <pre><code>1...
<p>You can try this solution:</p> <pre class="lang-bash prettyprint-override"><code>awk ' { gsub(/\[|:[0-9]+$/, &quot;&quot;, $4) ++fq[$4,$1] } END { for (i in fq) if (fq[i] &gt;= 4) { sub(&quot;.*&quot; SUBSEP, &quot;&quot;, i) print &quot;iptables -A INPUT -s&quot;, i, &quot;-j DROP&q...
Block IPs that requested more than N times per minute from a log file
bash|awk|iptables
0
72
2
72,990,319
72,990,319
2
true
2022-07-15T06:35:39.587Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Block IPs that requested more than N times per minute from a log file<p>I want to block IPs that requested more than N times/min using <code>iptables </code>...
72,881,003
Pass complex arguments to powershell script through encoded command<br /> I want to run nested powershell script block, with complex type arguments. I want to pass parameters to powershell scriptblock trough encoded command and encoded arguments. I`m trying this script. <pre><code>$text = &quot;This is a test message.&...
<p>A <code>-EncodedArguments</code> parameter (or something alike) doesn't exist, therefore I would simply embed your arguments as a default <code>param</code> value in your (encoded) scriptblock:</p> <pre><code>$Arguments = @{ Msg = &quot;This is a test message.&quot; Proc = $PID Cred = (Get-Credential 'A...
Pass complex arguments to powershell script through encoded command
powershell|base64|start-process
0
72
1
72,882,657
72,882,657
2
true
2022-07-06T09:27:22.257Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pass complex arguments to powershell script through encoded command<br /> I want to run nested powershell script block, with complex type arguments. I want t...
72,957,576
Fortran TYPE inheritance on runtime (declared by user)<p>I want to know if it's possible (and if so how) to have a Fortran TYPE inherit another TYPE on runtime. For example the user provides an input file that states which TYPE needs to be inherited. Below is an example,</p> <pre><code>MODULE A_MOD type A real(8)...
<p>No, this is not possible. The compiler needs to know the memory requirements of a type at compile time, so runtime type definitions are not possible.</p> <p>A possible workaround would be to define two <code>C</code> types, <code>CA</code> and <code>CB</code>, and then use a factory method to pick which type to use ...
Fortran TYPE inheritance on runtime (declared by user)
inheritance|fortran|polymorphism
2
72
1
72,958,237
72,958,237
2
true
2022-07-12T19:40:45.257Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Fortran TYPE inheritance on runtime (declared by user)<p>I want to know if it's possible (and if so how) to have a Fortran TYPE inherit another TYPE on runti...
72,866,841
How to calculate loss with KerasClassifier<p>I'm using KerasClassifier from sklearn to wrap my Keras model in order to perform K-fold cross validation.</p> <pre><code>model = KerasClassifier(build_fn=create_model, epochs=20, batch_size=8, verbose = 1) kfold = KFold(n_splits=10) scoring = ['accuracy', 'precision', '...
<p>Point is that your <a href="https://www.adriangb.com/scikeras/stable/generated/scikeras.wrappers.KerasClassifier.html#scikeras.wrappers.KerasClassifier" rel="nofollow noreferrer"><code>KerasClassifier</code></a> instance mimics standard <em>scikit-learn</em> classifiers. In other terms, it is kind of a <em>scikit-le...
How to calculate loss with KerasClassifier
python|keras|scikit-learn|deep-learning|neural-network
1
72
1
72,874,910
72,874,910
2
true
2022-07-05T09:14:14.543Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to calculate loss with KerasClassifier<p>I'm using KerasClassifier from sklearn to wrap my Keras model in order to perform K-fold cross validation.</p> <...
72,928,836
How can I wait for a click to be executed?<p>I am trying to figure out how I can update the playerValue for my Rock Scissor Paper game. I have a function that registers a button click and should then update the playerValue accordingly(1,2 or three depending on which button was clicked). The problem is, when I call the ...
<p>In your case, player_choose_value doesn't wait until the player has actually picked a value.</p> <p>You could probably do this using async await/promises:</p> <pre class="lang-js prettyprint-override"><code>function player_choose_value(){ return new Promise(resolve =&gt; { bntRock.onclick = () =&gt; resolve(1)...
How can I wait for a click to be executed?
javascript|html
1
72
3
72,928,931
72,928,931
2
true
2022-07-10T13:27:07.610Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I wait for a click to be executed?<p>I am trying to figure out how I can update the playerValue for my Rock Scissor Paper game. I have a function tha...
72,919,270
Java generic interface implementation cannot omit type parameter?<p>I found that in Java I could use anonymous class to implement interface like Runnable (non-generic). I could also declare a variable without specifying type parameter on the right of &quot;=&quot;. But I found for generic type, I cannot omit this:</p> ...
<p>In Java 8 the compiler gives this error:</p> <pre><code>GenericInterface.java:23: error: cannot infer type arguments for Generic&lt;T&gt; Generic&lt;Integer&gt; i = new Generic&lt;&gt;() { // Why need type paramter here? ^ reason: cannot use '&lt;&gt;' with anonymous...
Java generic interface implementation cannot omit type parameter?
java|generics|java-8|interface|compilation
2
72
1
72,920,503
72,920,503
2
true
2022-07-09T05:49:47.877Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Java generic interface implementation cannot omit type parameter?<p>I found that in Java I could use anonymous class to implement interface like Runnable (no...
72,893,772
Selenium web scraping is giving me wrong row, I don't where I did wrong?<p>Hello I am web scrapping a site</p> <p>here is my code</p> <pre><code>from selenium import webdriver from selenium.webdriver.chrome.service import Service from selenium.webdriver.common.by import By from webdriver_manager.chrome import ChromeDri...
<p>It is because your are not selecting the perfect class name which is a common thing in all laptops and have all the details about that particular laptop.</p> <p>Here is the full working code</p> <pre><code>from selenium import webdriver from selenium.webdriver.chrome.service import Service from selenium.webdriver.co...
Selenium web scraping is giving me wrong row, I don't where I did wrong?
python|selenium|selenium-webdriver|web-scraping
0
72
3
72,896,214
72,896,214
2
true
2022-07-07T07:22:15.063Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Selenium web scraping is giving me wrong row, I don't where I did wrong?<p>Hello I am web scrapping a site</p> <p>here is my code</p> <pre><code>from seleniu...
73,026,325
SQL: Capturing first row in WHILE loop<p>I'm thinking my issue is based on how I've written the loop, but how it is written is how I've come to understand loops. So I'm really wondering if there is a way to consolidate this? As it sits, I have 2 sections: the first which captures the very first row, and it exists solel...
<p>One option is moving the <code>SET @I = @I + 1</code> line to <strong>after</strong> the rest of the loop body (and then also run for one iteration longer). In this way, the first adjustment for the dates is still 0. <strong>But don't do this.</strong></p> <blockquote> <p>I'm thinking my issue is based on how I've w...
SQL: Capturing first row in WHILE loop
sql|sql-server|while-loop
0
72
1
73,026,723
73,026,723
2
true
2022-07-18T17:31:09.283Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL: Capturing first row in WHILE loop<p>I'm thinking my issue is based on how I've written the loop, but how it is written is how I've come to understand lo...
73,006,326
Python webscraping: How to parse html table, selenium<p>I would like to parse the table &quot;Table 1: Consumer Price Index, historical indices from 1924 (2015=100)&quot; from here: <a href="https://www.ssb.no/en/priser-og-prisindekser/konsumpriser/statistikk/konsumprisindeksen" rel="nofollow noreferrer">https://www.ss...
<pre><code>from selenium import webdriver from selenium.webdriver.chrome.service import Service from selenium.webdriver.chrome.options import Options from bs4 import BeautifulSoup chrome_options = Options() chrome_options.add_argument(&quot;--no-sandbox&quot;) chrome_options.add_argument(&quot;--headless&quot;) webd...
Python webscraping: How to parse html table, selenium
python|html|selenium|parsing|web-scraping
0
72
1
73,006,505
73,006,505
2
true
2022-07-16T17:26:55.463Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python webscraping: How to parse html table, selenium<p>I would like to parse the table &quot;Table 1: Consumer Price Index, historical indices from 1924 (20...
72,829,555
json to json conversion by ExecuteScript processor<p>I have following json data and i want to convert data in expected result by ExecuteScript nifi processor</p> <pre class="lang-json prettyprint-override"><code>{ &quot;time&quot;: &quot;2017-01-01T01:14:55+00:00&quot;, &quot;any&quot;: { &quot;nested&quot;: &quot;data...
<p>use <code>ExecuteGroovyScript</code> processor (it's optimized for groovy lang) with this kind of code:</p> <pre><code>import groovy.json.JsonSlurper import groovy.json.JsonBuilder def flowFile = session.get() if (!flowFile) return flowFile.write{rawIn, rawOut-&gt; def json = rawIn.withReader(&quot;UTF-8&quot;...
json to json conversion by ExecuteScript processor
groovy|apache-nifi
0
72
1
72,845,535
72,845,535
2
true
2022-07-01T12:52:32.617Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: json to json conversion by ExecuteScript processor<p>I have following json data and i want to convert data in expected result by ExecuteScript nifi processor...
72,771,854
What does it mean that "Object Oriented Programming imposes discipline on indirect transfer of control"?<p>I have recently finished reading Clean Architecture book by Unckle Bob. There he wrote</p> <blockquote> <p>Three paradigms. Three constraints. Structured Programming imposes discipline on direct transfer of contro...
<blockquote> <ol> <li>What does indirect transfer of control mean?</li> </ol> </blockquote> <p>Pointers to functions.</p> <blockquote> <ol start="2"> <li>How it is restricted in OOP?</li> </ol> </blockquote> <p>Polymorphism.</p> <p>A more complete explanation can be found on the bottom of page 42.</p> <blockquote> <p>T...
What does it mean that "Object Oriented Programming imposes discipline on indirect transfer of control"?
oop|clean-architecture
3
72
1
72,777,405
72,777,405
3
true
2022-06-27T12:08:41.270Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What does it mean that "Object Oriented Programming imposes discipline on indirect transfer of control"?<p>I have recently finished reading Clean Architectur...
72,814,231
PowerShell equivalent of “dirname $0” from bash<p>I've used <code>dirname &quot;$0&quot;</code> which is an idiom to determine the path of the running script in bash, e.g.:</p> <pre class="lang-bash prettyprint-override"><code>pushd &quot;$(dirname &quot;$0&quot;)&quot; </code></pre> <pre class="lang-bash prettyprint-o...
<p>Since PowerShell version 3.0, the execution context provides 2 script-scoped automatic variables:</p> <ul> <li><code>$PSCommandPath</code> - the file system path to the executing script, eg. <code>C:\path\to\script.ps1</code></li> <li><code>$PSScriptRoot</code> - the immediate parent folder of the script, eg. <code>...
PowerShell equivalent of “dirname $0” from bash
powershell|filepath|idioms|dirname
2
72
1
72,814,287
72,814,287
3
true
2022-06-30T10:27:23.533Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PowerShell equivalent of “dirname $0” from bash<p>I've used <code>dirname &quot;$0&quot;</code> which is an idiom to determine the path of the running script...
72,842,826
How to append to a large varchar(max) column efficiently<p>Consider having a table like this:</p> <pre class="lang-sql prettyprint-override"><code>CREATE TABLE Product ( Id int PRIMARY KEY CLUSTERED, InvoicesStr varchar(max) ) </code></pre> <p>which <code>InvoicesStr</code> is concatenated Ids of the invoices c...
<p>You can use the little-known <a href="https://docs.microsoft.com/en-us/sql/t-sql/queries/update-transact-sql?view=sql-server-ver16#updating-lobs" rel="nofollow noreferrer"><code>.WRITE</code> syntax</a> to append or modify text/data in a <code>max</code> column.</p> <p>This does an efficient append or replace (minim...
How to append to a large varchar(max) column efficiently
sql|sql-server|azure-sql-database
1
72
1
72,843,430
72,843,430
3
true
2022-07-02T22:30:24.710Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to append to a large varchar(max) column efficiently<p>Consider having a table like this:</p> <pre class="lang-sql prettyprint-override"><code>CREATE TAB...
72,860,741
How to allow Typescript Generic parameter to have default<p>I am trying to set a default for a generic function in TS. Here is a simplistic example:</p> <pre class="lang-js prettyprint-override"><code>type Size = &quot;small&quot; | &quot;medium&quot; | &quot;large&quot;; type Detail&lt;S extends Size&gt; = S extends &...
<p>This is better done with function overloads</p> <pre><code>function getDetail(): Detail&lt;&quot;small&quot;&gt;; function getDetail&lt;T extends Size&gt;(size: T): Detail&lt;T&gt;; function getDetail(size: Size = &quot;small&quot;): Detail&lt;Size&gt;{ if(size === &quot;small&quot;) return &quot;noDetai...
How to allow Typescript Generic parameter to have default
typescript|typescript-generics
3
72
3
72,861,062
72,861,062
3
true
2022-07-04T18:24:26.103Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to allow Typescript Generic parameter to have default<p>I am trying to set a default for a generic function in TS. Here is a simplistic example:</p> <pre...
72,920,875
Substract values from two columns where same time (pandas, python)<p>I have a pandas dataFrame with 3 columns of weather data - temperature, time and the name of the weather station.</p> <p>It looks like this:</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th style="text-align: left;">Time</t...
<p>You can use a <a href="https://pandas.pydata.org/docs/reference/api/pandas.merge_asof.html?highlight=pa" rel="nofollow noreferrer"><code>merge_asof</code></a> on the two sub-dataframes:</p> <pre><code>df['Time'] = pd.to_datetime(df['Time']) out = (pd .merge_asof(df[df['Station_name'].eq('station_a')], ...
Substract values from two columns where same time (pandas, python)
python|pandas|datetime|difference
3
72
3
72,921,068
72,921,068
3
true
2022-07-09T11:11:56.207Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Substract values from two columns where same time (pandas, python)<p>I have a pandas dataFrame with 3 columns of weather data - temperature, time and the nam...
73,026,678
Conditional checking without if<p>I've been checking out how to do the below question without an if else condition, spent almost a day. Is it possible to do this without an if else?</p> <p>Check if area is greater than or equal to 15, then print &quot;big place!&quot; or if area is greater than 10 but less than 15, the...
<p>or construction with logical expression, either print it or assign to new variable:</p> <pre><code>area = 15 print(&quot;big place!&quot; * (area &gt;= 15) or &quot;medium size, nice!&quot; * (area &gt; 10) or &quot;pretty small&quot;) </code></pre>
Conditional checking without if
python|if-statement
-2
72
3
73,026,792
73,026,792
3
true
2022-07-18T18:01:29.937Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Conditional checking without if<p>I've been checking out how to do the below question without an if else condition, spent almost a day. Is it possible to do ...
72,980,504
how to get value from def function before<p>i got a problem to run the python, for example code in below, because the code not sure to see because i am beginner for this,and its too long too, i give the same problem on my code</p> <pre><code>from tkinter import * from tkinter import ttk root = Tk() root.title('app') ...
<p>I see a few problems on your code:</p> <ol> <li><p>First of all, you need to define a constructor for your class <code>__init__</code> to assign the default value to your attributes.</p> </li> <li><p>You have to use <code>self.</code> for class attributes, otherwhise, the value will not be saved.</p> </li> <li><p>Yo...
how to get value from def function before
python|tkinter
2
72
1
72,980,696
72,980,696
3
true
2022-07-14T12:27:14.993Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to get value from def function before<p>i got a problem to run the python, for example code in below, because the code not sure to see because i am begin...
72,955,038
Varying number of generic parameters based on a feature<p>I am using Rust 1.62.0 and would like to add a variant to an <code>enum</code> based on whether a feature is enabled.</p> <p>The following compiles without issues.</p> <pre class="lang-rust prettyprint-override"><code>enum MyEnum&lt;#[cfg(feature=&quot;my-featur...
<p>You can use a <code>macro_rules!</code> declarative macro to prevent needing to duplicate code:</p> <pre class="lang-rust prettyprint-override"><code>enum MyEnum&lt;#[cfg(feature=&quot;my-feature&quot;)] T&gt; { Always, #[cfg(feature = &quot;my-feature&quot;)] OnlyWithFeature(T), } // Produces impl bloc...
Varying number of generic parameters based on a feature
generics|rust|enums
1
72
1
72,956,178
72,956,178
3
true
2022-07-12T15:46:12.107Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Varying number of generic parameters based on a feature<p>I am using Rust 1.62.0 and would like to add a variant to an <code>enum</code> based on whether a f...
72,917,674
Replacing values in a R dataframe given certain conditions<p>I'm trying to loop through columns 10 - 12 of the following data set df2, replacing 1 with a.2. with b. 3 with c and 4 with d</p> <p>I've figured out how to perform the substitution on a single column using the code below.</p> <pre><code>df2[df2$DX == 1,]$DX ...
<p>Here is a tidy solution for mutating across several columns. This solution converts the four numbers to letters and converts any remaining rows to characters prior to factorizing.</p> <pre><code>library(dplyr) mutate(df2, across(c(col10, col11, col12), ~factor(case_when( . == 1 ~ &quot;a&quot;, ....
Replacing values in a R dataframe given certain conditions
r|data-science
1
72
3
72,917,724
72,917,724
3
true
2022-07-08T22:45:24.577Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Replacing values in a R dataframe given certain conditions<p>I'm trying to loop through columns 10 - 12 of the following data set df2, replacing 1 with a.2. ...