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,970,921
SQL - trimming values before bracket<p>I have a column of values where some values contain brackets with text which I would like to remove. This is an example of what I have and what I want:</p> <pre><code>CREATE TABLE test (column_i_have varchar(50), column_i_want varchar(50)) INSERT INTO test (column_i_have, column...
<p>If all the values contain &quot;valid&quot; brackets, then you may use <a href="https://www.postgresql.org/docs/13/functions-string.html#FUNCTIONS-STRING-OTHER" rel="nofollow noreferrer">split_part</a> function without any regular expressions:</p> <blockquote> <pre><code>select test.*, trim(split_part(column_i_...
SQL - trimming values before bracket
sql|regex|postgresql|substring|trim
0
42
3
72,971,629
72,971,629
1
true
2022-07-13T18:20:32.540Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL - trimming values before bracket<p>I have a column of values where some values contain brackets with text which I would like to remove. This is an exampl...
72,972,903
Does anyone know why my heroku app doesn't access any of the data from my seeds.rb file?<p>I recently deployed an app to heroku but for some reason the heroku app doesn't access any of the seed data from the seed.rb file but when I run the app locally the data shows up just fine. Would love assistance</p>
<p>Try to run the rails task as follows:</p> <pre><code>heroku run rails db:seed -a name_of_your_heroku_app </code></pre> <p>You may need to do heroku login first.</p>
Does anyone know why my heroku app doesn't access any of the data from my seeds.rb file?
ruby-on-rails|ruby|heroku
1
42
1
72,973,183
72,973,183
1
true
2022-07-13T21:37:00.850Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Does anyone know why my heroku app doesn't access any of the data from my seeds.rb file?<p>I recently deployed an app to heroku but for some reason the herok...
72,970,453
How to download automated word doc to client machine<p>I have created a word document based on an aspx form, the document is created in a different vb.class and I can only save it in a server path in pdf format, I would like this to be downloaded directly to the client machine.</p> <p>this is the line where I save it t...
<p>Is this a asp.net web site? If yes, then the file system you have for use on the web side of things of course is only folders in the web site. You can certainly save a file into that web site and say one of its folders.</p> <p>However, when you provide a button for a download link? Well, you can provide a path name ...
How to download automated word doc to client machine
vb.net
-1
42
2
72,973,931
72,973,931
1
true
2022-07-13T17:38:24.987Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to download automated word doc to client machine<p>I have created a word document based on an aspx form, the document is created in a different vb.class ...
72,977,980
How to update and shift my graph along the x-axis?<p>I am trying to update and shift my graph along its x-axis, so that it includes a maximum of 5 values on the x-axis. <a href="https://apexcharts.com/javascript-chart-demos/line-charts/realtime/" rel="nofollow noreferrer">This</a> is what I am trying to achieve essenti...
<p>You can set max number of elements in <code>xaxis</code> like this</p> <pre><code>xaxis:{ range: 5, }, </code></pre> <p><a href="https://apexcharts.com/docs/options/xaxis/#range" rel="nofollow noreferrer">https://apexcharts.com/docs/options/xaxis/#range</a></p>
How to update and shift my graph along the x-axis?
javascript|apexcharts
1
42
1
72,978,478
72,978,478
1
true
2022-07-14T09:07:37.970Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to update and shift my graph along the x-axis?<p>I am trying to update and shift my graph along its x-axis, so that it includes a maximum of 5 values on ...
72,970,685
How to push an abline grid to the background in a plot?<p>I'm trying to plot a grid for a time series plot using <code>abline()</code>. It works fine, but I'm not able to draw the grid lines in the background: they are above the time series line.</p> <p>I'm using the following code:</p> <pre><code>options(repr.plot.wid...
<p>This should work:</p> <pre><code>plot(NA, xlab=&quot;Tiempo&quot;, #Título de los ejes ylab=&quot;Miles de millones de €&quot;, main=&quot;PIB pm Demanda España (datos no ajustados de estacionalidad y calendario)&quot;, xlim = c(1995, 2020), ylim = c(0, 350), xaxp = c(1995, 2019, 8)) abline(h ...
How to push an abline grid to the background in a plot?
r|plot|time-series|grid|abline
0
42
1
72,984,850
72,984,850
1
true
2022-07-13T17:58:58.697Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to push an abline grid to the background in a plot?<p>I'm trying to plot a grid for a time series plot using <code>abline()</code>. It works fine, but I'...
72,975,440
Program is not working on leetcode, 14. Longest common prefix<p>Is it true that leetcode site sometimes doesn't work? I have been struggling for 2 weeks, but failed to find where is the problem.</p> <pre><code>char *longestCommonPrefix(char **strs, int strsSize) { static char retStr[100] = { '\0' }; unsigned in...
<p>There are multiple problems in your code:</p> <ul> <li>the maximum string length is specified as 200, so the <code>static</code> array for the result should have a length of at least 201 bytes.</li> <li>you compute <code>matchTillPos</code> for each string and only remember the last value. You should instead keep tr...
Program is not working on leetcode, 14. Longest common prefix
c
-1
42
1
72,987,159
72,987,159
1
true
2022-07-14T05:03:17.543Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Program is not working on leetcode, 14. Longest common prefix<p>Is it true that leetcode site sometimes doesn't work? I have been struggling for 2 weeks, but...
72,984,228
Calculate the row number associated to a byte position inside text file vba<p>I have a text file that I open to search for a value, using the instr() to get the matched position. From the code below I get the stats below:</p> <ul> <li>InStrPos : 7.775 (the InStr() position)</li> <li>FileSize : 494.736 (FileSize = FileL...
<p>If you know the position in the file content, you could use:</p> <pre class="lang-vb prettyprint-override"><code>Debug.Print &quot;Line#: &quot; &amp; UBound(Split(Left(strFileContent, InStrPos ), vbCrLf)) + 1 </code></pre> <p>Or split the file on <code>vbCrLf</code> and loop over the resulting array.</p>
Calculate the row number associated to a byte position inside text file vba
vba|text-files
1
42
1
72,987,295
72,987,295
1
true
2022-07-14T17:03:51.483Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Calculate the row number associated to a byte position inside text file vba<p>I have a text file that I open to search for a value, using the instr() to get ...
72,984,487
What to do if an error occurs on a DataNode during the writing process?<p>HDFS write process. What to do if an error occurs on a DataNode during the writing process?</p> <p><a href="https://i.stack.imgur.com/YTcOf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YTcOf.png" alt="enter image description...
<p>It depends on the configuration of HDFS. By default, it has a replication factor of 3, which means there must be three copies of the data at all times. If the write to one of the DataNodes fails, then the data will be in an under-replicated state.</p> <p>There will be warnings in the log file about this until the pr...
What to do if an error occurs on a DataNode during the writing process?
java|hadoop|hdfs
1
42
1
72,987,857
72,987,857
1
true
2022-07-14T17:29:25.980Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What to do if an error occurs on a DataNode during the writing process?<p>HDFS write process. What to do if an error occurs on a DataNode during the writing ...
72,983,600
cannot use a bytes pattern on a string-like object with agent.request<p>I am learning - how to send a request to the browser with <code>twisted</code> then get the headers and print them. However, I find myself getting the following error when I run:</p> <pre><code> python agent_request.py http://www.google.com/ &gt; ...
<p>On Python 3 <code>sys.argv</code> is a list of <code>str</code>. However, <code>Agent.request</code> accepts a value of type <code>bytes</code> as its 2nd argument. Since <code>sys.argv[1]</code> is a value of type <code>str</code> something goes wrong somewhere in the implementation and you get this obscure excep...
cannot use a bytes pattern on a string-like object with agent.request
python|twisted
0
42
1
72,988,282
72,988,282
1
true
2022-07-14T16:11:21.373Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: cannot use a bytes pattern on a string-like object with agent.request<p>I am learning - how to send a request to the browser with <code>twisted</code> then g...
72,987,707
get distinct values from "text field" without remapping<p>I'm querying ~350 TB of documents.</p> <p>Re-indexing is not an option.</p> <p>Performance, within reason, is not a concern.</p> <p>my documents have a field <code>s3_filename</code> <code>{&quot;type&quot;: &quot;text&quot;}</code>. It doesn't have any subfield...
<p>The crux of the problem is that your field is analyzed by ES into individual tokens, and not a single value as you want. THat is whay the aggregations dont work.</p> <p>You said reindexing is a problem. That rules out rebuilding the index. But have you considered <strong>updating</strong> the mapping of this field t...
get distinct values from "text field" without remapping
elasticsearch|mapping|elasticsearch-aggregation
0
42
1
72,991,173
72,991,173
1
true
2022-07-14T23:45:42.767Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: get distinct values from "text field" without remapping<p>I'm querying ~350 TB of documents.</p> <p>Re-indexing is not an option.</p> <p>Performance, within ...
72,990,684
Converting Tree-like table headers into an indented structure<p>Sorry for the terrible title, I don't know how to properly describe this.</p> <p>I have a set of table headers that are hierarchical, and I need to transform them from a multi-column tree structure, to a single column indented structure.</p> <p>The Tree li...
<p>You could take a virtual target by using span and the intermediate indices to get a tree structure and render a flat array with indented label and value, denoted here with <code>data[0]</code>, which should be replaced by the real values.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="tru...
Converting Tree-like table headers into an indented structure
javascript|reactjs
1
42
1
72,993,793
72,993,793
1
true
2022-07-15T07:47:36.360Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Converting Tree-like table headers into an indented structure<p>Sorry for the terrible title, I don't know how to properly describe this.</p> <p>I have a set...
72,967,912
Highcharts - Linear series zoom on logarithmic axis<p>I'm having trouble when zooming in on a linear series that is on a logarithmic yAxis. What would be an easy solution?</p> <p>Zoom out:<br /> <a href="https://i.stack.imgur.com/CiLUq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CiLUq.png" alt="e...
<p>It is a bug which you can track in the following ticket: <a href="https://github.com/highcharts/highcharts/issues/16784" rel="nofollow noreferrer">https://github.com/highcharts/highcharts/issues/16784</a></p> <p>As a temporary workaround, you can set <code>xAxis.ordinal</code> to <code>false</code> in your config.</...
Highcharts - Linear series zoom on logarithmic axis
javascript|highcharts
0
42
1
72,996,224
72,996,224
1
true
2022-07-13T14:22:10.273Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Highcharts - Linear series zoom on logarithmic axis<p>I'm having trouble when zooming in on a linear series that is on a logarithmic yAxis. What would be an ...
72,998,599
BeautifulSoup not finding a table elment that exists<p>I'm trying to scrape a table from this website: <a href="https://www.cbc.ca/sports/basketball/cebl/broadcast" rel="nofollow noreferrer">https://www.cbc.ca/sports/basketball/cebl/broadcast</a>. I checked and confirmed the table exists, here is a snippet of what the ...
<p>The data you see on the page is loaded from external URL via Javascript. To load it into a pandas DataFrame you can use next example:</p> <pre class="lang-py prettyprint-override"><code>import requests import pandas as pd url = &quot;https://www.cbc.ca/sports-content/v11/includes/json/schedules/broadcast_schedule....
BeautifulSoup not finding a table elment that exists
python|beautifulsoup
2
42
1
72,998,649
72,998,649
1
true
2022-07-15T19:04:14.173Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: BeautifulSoup not finding a table elment that exists<p>I'm trying to scrape a table from this website: <a href="https://www.cbc.ca/sports/basketball/cebl/bro...
73,000,035
Trying to use mosquitto broker with TLS using paho python<p>python code</p> <pre><code>import time broker = &quot;test.mosquitto.org&quot; port=8884 conn_flag= False def on_connect(client, userdata, flags, rc): global conn_flag conn_flag=True print(&quot;connected&quot;,conn_flag) conn_flag=True def on_...
<p>As per <a href="http://test.mosquitto.org" rel="nofollow noreferrer">http://test.mosquitto.org</a> the ports are:</p> <blockquote> <p>8883 : MQTT, encrypted, unauthenticated<br /> 8884 : MQTT, encrypted, client certificate required</p> </blockquote> <p>In your code <code>client1.tls_set('C:\etc\mosquitto\certs\mosq...
Trying to use mosquitto broker with TLS using paho python
python|ssl|mqtt
0
42
1
73,000,545
73,000,545
1
true
2022-07-15T22:10:14.930Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Trying to use mosquitto broker with TLS using paho python<p>python code</p> <pre><code>import time broker = &quot;test.mosquitto.org&quot; port=8884 conn_fla...
72,999,278
How to extract an auth code in Location response header String using Rest Assured<p>Currently I have a method that does some authorization, which is used for my access token POST request in the body to establish the proper access token. In my authorization method, I am able to extract the Location header value in the ...
<p>You just need simple <code>split()</code> method of String to extract value from this text.</p> <pre><code>String url = &quot;https://something.url.com/myapp/auth/token?code=**12WVUcPyFbmTZUOcgaluGl98r08**&amp;iss=https%3A%2F%2Fsomething.url.com%3A8443%2Fam%2Foauth2%2Fvendors&amp;client_id=5c1d7ex3-g3rc-4a64-9855-07...
How to extract an auth code in Location response header String using Rest Assured
java|authorization|substring|access-token|rest-assured
0
42
1
73,000,716
73,000,716
1
true
2022-07-15T20:26:17.683Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to extract an auth code in Location response header String using Rest Assured<p>Currently I have a method that does some authorization, which is used for...
72,933,607
onclick modifier function referencing variable instead of using variable value (JavaScript)<p><em>(Edit: Someone asked for where <code>trueName</code> is defined in relation to the loop, so I included it in the code sample. <code>relPath</code> is defined in the function parameter)</em></p> <p>I have a forEach loop tha...
<p>Managed to fix the problem in the end by changing the line where <code>trueName</code> is defined:</p> <pre class="lang-js prettyprint-override"><code>trueName = nameSplit[0] </code></pre> <p>and adding <code>var</code> in front of <code>trueName</code> to declare it as a variable:</p> <pre class="lang-js prettyprin...
onclick modifier function referencing variable instead of using variable value (JavaScript)
javascript|variables|onclick
0
42
2
73,001,047
73,001,047
1
true
2022-07-11T04:09:13.807Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: onclick modifier function referencing variable instead of using variable value (JavaScript)<p><em>(Edit: Someone asked for where <code>trueName</code> is def...
73,000,392
Traversing through XML<p>I have the following XML file:</p> <pre><code>&lt;Tournament TeamPlayers=&quot;1&quot;&gt; &lt;Teams&gt; &lt;Team&gt; &lt;TeamID&gt;0&lt;/TeamID&gt; &lt;TeamName&gt;Sample&lt;/TeamName&gt; &lt;Status&gt;10&lt;/Status&gt; &lt;Memo&gt;Sa...
<p>It may be causing you grief that your <code>Select Case</code> is assigning variables to themselves:</p> <pre><code>Select Case tpPlayer.strSeatOrder Case &quot;A&quot; tpPlayerA = tpPlayer Case &quot;B&quot; tpPlayerB = tpPlayerB Case &quot;C&quot; tpPlayerC = tpPlayerC End Selec...
Traversing through XML
xml|vb.net|.net-core|xmldocument
1
42
1
73,001,112
73,001,112
1
true
2022-07-15T23:15:55.417Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Traversing through XML<p>I have the following XML file:</p> <pre><code>&lt;Tournament TeamPlayers=&quot;1&quot;&gt; &lt;Teams&gt; &lt;Team&gt; ...
72,975,371
SQL: Joining 3 tables to generate report dashboard<p>I am trying to join 3 different tables that holds my test execution results as &quot;PASS&quot;, &quot;FAIL&quot; and &quot;SKIP&quot;. There are 2 common properties in these 3 tables on the basis of which I need to club my result i.e. &quot;BUILD_NUMBER&quot; and &q...
<p>Not sure if this answers your question but you could try something like this</p> <pre><code>WITH cte AS ( SELECT * FROM test_execution union SELECT * FROM test_execution_fail UNION SELECT * FROM test_execution_skip ) SELECT t.*, (SKIP + FAIL + PASS) AS TOTAL FROM ( select COMPONENT, BUILD_NUMBER, ...
SQL: Joining 3 tables to generate report dashboard
mysql|sql|database
-1
42
1
73,001,214
73,001,214
1
true
2022-07-14T04:54:11.980Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL: Joining 3 tables to generate report dashboard<p>I am trying to join 3 different tables that holds my test execution results as &quot;PASS&quot;, &quot;F...
72,999,292
how to convert array in series to normal number in python<p>[<img src="https://i.stack.imgur.com/yrFdN.jpg" alt=" number of days - recency column" /> <a href="https://i.stack.imgur.com/ddh1K.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ddh1K.jpg" alt="enter image description here" /></a></p> <p>I ...
<p>First make sure that your data has no null values.</p> <p>For removing null values you can use</p> <p><code>a.dropna(inplace=True)</code></p> <p>Assuming a is your dataframe</p> <p>Now extract the first word from each row of recency column into elements variable</p> <pre><code>elements=a[&quot;recency&quot;] element...
how to convert array in series to normal number in python
python|arrays|datetime|split|series
0
42
1
73,001,370
73,001,370
1
true
2022-07-15T20:27:42.040Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to convert array in series to normal number in python<p>[<img src="https://i.stack.imgur.com/yrFdN.jpg" alt=" number of days - recency column" /> <a href...
73,001,396
how to make a responsive span<p>I'm trying to fix this issue that i'm facing is that I need a span to view the name of the picture but the problem is when I insert a long name like <code>bullet rounds</code> it makes the picture not clear so I want to fix this problem without changing the font size or anything else, an...
<p>You can do two things. One this is when overflowing the content you can limit it content and add ... ath the end of the content.<a href="https://www.w3schools.com/cssref/css3_pr_text-overflow.asp" rel="nofollow noreferrer">see the reference</a></p> <p>you can add below code to the itemname class.Remenber to add max ...
how to make a responsive span
html|css
0
42
2
73,001,531
73,001,531
1
true
2022-07-16T03:55:58.287Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to make a responsive span<p>I'm trying to fix this issue that i'm facing is that I need a span to view the name of the picture but the problem is when I ...
73,001,594
Is the service affected when all masters are stopped?<p>Is the service affected when all masters are stopped?</p> <p>OpenShift 4</p> <ul> <li>Infra Node 3</li> <li>Master Node 3</li> <li>Worker Node 3</li> </ul> <p>※ Router pods are in the Infra Node.</p> <p>The work request is as follows.</p> <ul> <li><p>frontend(DC) ...
<p>Yes, it is affected. Here's what's happening when you stop all the master nodes.</p> <ol> <li>The incoming traffic to the DC egress is being forwarded to the <code>Ingress</code> component of your Kubernetes/Openshift cluster. (Your <code>front-end</code>).</li> <li>This is succeeding because the name resolution of ...
Is the service affected when all masters are stopped?
kubernetes|openshift|open-closed-principle|okd
1
42
1
73,001,640
73,001,640
1
true
2022-07-16T04:44:42.600Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is the service affected when all masters are stopped?<p>Is the service affected when all masters are stopped?</p> <p>OpenShift 4</p> <ul> <li>Infra Node 3</l...
73,017,570
How to change lists inside of a list of Maps in Java<p>I have a list <code>Graph</code>, consisting of <code>Node</code>-Maps:</p> <pre><code>public static Map&lt;Integer, List&lt;Integer&gt;&gt; node = new HashMap&lt;&gt;(); public static List&lt;HashMap&gt; graph = new ArrayList&lt;&gt;(); </code></pre> <p>In each <c...
<p>The collections you are trying to use for storing graph looks redundant. You can create single collection to hold the graph in the form of adjacency lists with each node as key and each node's adjacency list as value.</p> <pre><code>public static Map&lt;Integer, List&lt;Integer&gt;&gt; graph = new HashMap&lt;&gt;();...
How to change lists inside of a list of Maps in Java
java|list|dictionary|graph|add
0
42
1
73,018,046
73,018,046
1
true
2022-07-18T05:11:55.553Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to change lists inside of a list of Maps in Java<p>I have a list <code>Graph</code>, consisting of <code>Node</code>-Maps:</p> <pre><code>public static M...
73,018,755
What is different btw useState<string[]>([]); and useState([]);<p>I was browing stackoverflow while looking for the question that I can answer and I came accross this <a href="https://stackoverflow.com/questions/72994491/react-form-input-stops-working-after-opening-and-closing-custom-drop-down">question</a></p> <p>This...
<p>This is typeScript</p> <pre><code>// the state can hold a value with type string const [nameInput, setNameInput] = useState&lt;string&gt;(''); // the state can hold an array of strings const [availableDays, setAvailableDays ] = useState&lt;string[]&gt;([]) </code></pre> <p>if you try to put an integer into one of ...
What is different btw useState<string[]>([]); and useState([]);
reactjs|react-hooks|state|use-state|react-state
-1
42
1
73,018,914
73,018,914
1
true
2022-07-18T07:36:47.870Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is different btw useState<string[]>([]); and useState([]);<p>I was browing stackoverflow while looking for the question that I can answer and I came acc...
73,018,837
RequestError: Column "" is invalid in the ORDER BY clause because it is not contained in either an aggregate function or the GROUP BY clause<p>I have 2 tables using sequelize as follows</p> <pre><code>sequelize.define(&quot;campaign&quot;,{ id:{ type:Sequelize.INTEGER, autoIncrement:true, ...
<p>So the SQL that's being generated under-the-hood is invalid.</p> <p>Order is being applied because you're asking for <code>limit</code> and <code>offset</code> (usually used for paging) which <em>requires ordering</em> to be deterministic.</p> <p>To mitigate this you can either:</p> <ol> <li>remove the <code>limit</...
RequestError: Column "" is invalid in the ORDER BY clause because it is not contained in either an aggregate function or the GROUP BY clause
node.js|sql-server|sequelize.js
0
42
1
73,018,964
73,018,964
1
true
2022-07-18T07:45:05.747Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: RequestError: Column "" is invalid in the ORDER BY clause because it is not contained in either an aggregate function or the GROUP BY clause<p>I have 2 table...
73,016,948
jQuery/Javascript counter with animation always reset from 0 to N value<p>I have these below counter js function. It's working OK.</p> <p>But now when I try to add the new value to <code>$(&quot;.set&quot;)</code> to 30, the counter is reset from 0 until 30.</p> <p>What I need is just continue the counter from the last...
<p>If you want to continue the animation adding another delay of custom duration, one option is to add a parameter <code>start</code> to the <code>counter</code> function to define the number it should begin counting.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <...
jQuery/Javascript counter with animation always reset from 0 to N value
jquery|counter
0
42
1
73,022,206
73,022,206
1
true
2022-07-18T03:13:33.567Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: jQuery/Javascript counter with animation always reset from 0 to N value<p>I have these below counter js function. It's working OK.</p> <p>But now when I try ...
73,011,256
Flink sending same data to the same partition<p>I'm getting data from kafka topic, then exploding array and producing multiple events using flatMap.</p> <p>Incoming event format:</p> <pre><code>Event(eventId: Long, time: Long) IncomingEvent(customerId: Long, events: List[Event]) </code></pre> <p>Event format after expl...
<p>Yes, that code will have the effect you are looking for. All events for the same customerId and eventId will go to the same instance of the sink.</p>
Flink sending same data to the same partition
apache-flink|flink-streaming
1
42
1
73,022,361
73,022,361
1
true
2022-07-17T11:10:17.310Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Flink sending same data to the same partition<p>I'm getting data from kafka topic, then exploding array and producing multiple events using flatMap.</p> <p>I...
73,024,498
Type for all keys which would give numeric values<p>Let's say I want to write a <code>sortBy</code> function, that takes a list of <code>T</code>s and a key of T to sort the list by.</p> <p>To properly work I want the key to only accept keys of T that are numeric.</p> <p>I have this, but I don't know how to restrict <c...
<p>There are two issues with</p> <pre><code>type NumericAttributesOf&lt;T&gt; = { [K in keyof T]: T[K] extends number ? T[K] : never } </code></pre> <ol> <li><code>T[K] extends number ? T[K] : never</code> selects <strong>value</strong> type while you're looking for key type, so it should be <code>[K in keyof T]: T[K...
Type for all keys which would give numeric values
typescript|typescript-generics
1
42
2
73,025,031
73,025,031
1
true
2022-07-18T15:04:01.620Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Type for all keys which would give numeric values<p>Let's say I want to write a <code>sortBy</code> function, that takes a list of <code>T</code>s and a key ...
73,026,129
How can update each row of a table based on two columns of it's previous row?<p>I have following table:</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th style="text-align: center;">Id</th> <th style="text-align: center;">offset</th> <th style="text-align: center;">length</th> </tr> </thead> ...
<p>If your version of SQLite is 3.33.0+ you can use the <a href="https://www.sqlite.org/lang_update.html#update_from" rel="nofollow noreferrer"><code>UPDATE ... FROM...</code></a> syntax with <code>SUM()</code> window function:</p> <pre><code>UPDATE tablename AS t1 SET offset = t2.offset FROM ( SELECT Id, SUM(length)...
How can update each row of a table based on two columns of it's previous row?
sqlite|join|sum|sql-update|window-functions
-1
42
1
73,026,894
73,026,894
1
true
2022-07-18T17:11:47.357Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can update each row of a table based on two columns of it's previous row?<p>I have following table:</p> <div class="s-table-container"> <table class="s-t...
73,026,935
IF and AND in Google apps script<p>I have a google spreadsheet with many sheets which is used for requirement gathering. the stakeholder fills the data in every sheet</p> <p>Now, some fields in each spreadsheet are very critical, hence we plan to highlight in some manner and the validation to take place</p> <ol> <li>On...
<p>Here is a script you can use to achieve this:</p> <pre class="lang-js prettyprint-override"><code>function toastMessageTitle() { var sheet = SpreadsheetApp.getActive(); var rg1= sheet.getRange('B2'); //var rg1_lbl = sheet.getRange('A2').getValue(); var rg2 = sheet.getRange('B5') //var rg2_lbl = sheet.getRa...
IF and AND in Google apps script
google-apps-script|google-sheets
0
42
1
73,027,206
73,027,206
1
true
2022-07-18T18:25:02.267Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: IF and AND in Google apps script<p>I have a google spreadsheet with many sheets which is used for requirement gathering. the stakeholder fills the data in ev...
73,029,035
List Retains Data But Not String?<p>So I was doing some practice exercises from a Python programming book, we were supposed to be manipulating a list. I decided to define some functions for this task, and my first function was the following:</p> <pre><code>guest_list = [] guest_list_text = &quot;&quot; def invite_gues...
<p>Python understand that <code>guest_list</code> is global, because you use it inside the function (<code>guest_list.append(...)</code>) without a local declaration, but for <code>guest_list_text</code> is different, because you are assigning a value to it in <code>guest_list_text = &quot;, &quot;.join(guest_list)</co...
List Retains Data But Not String?
python|string|list
0
42
2
73,029,188
73,029,188
1
true
2022-07-18T21:56:21.563Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: List Retains Data But Not String?<p>So I was doing some practice exercises from a Python programming book, we were supposed to be manipulating a list. I deci...
73,030,406
Unable to display string from backend to Django Template<p>Hi I am unable to display some string from my custom view backend to django template. The string from backend is able to send over to the client side browser but still unable to display. The error message that I am trying to display is a lockout message from dj...
<p>The error message in the browser screenshot isn't included in <code>views.py</code>.</p> <p>Are you sure that's the correct file?</p> <p>Also, I'm not sure if <code>{{ errors }}</code> can display a list, but it should be a string defined as <code>errors = 'list of error messages'</code> instead of a list defined as...
Unable to display string from backend to Django Template
django|django-templates
0
42
1
73,030,521
73,030,521
1
true
2022-07-19T02:14:24.427Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unable to display string from backend to Django Template<p>Hi I am unable to display some string from my custom view backend to django template. The string f...
73,031,231
How to combine these regex expressions together<p>I'm working with Laravel and I have used this custom regular expression for validating user password request:</p> <pre><code>'user_password'=&gt; ['required','min:6','regex:/[a-z]/','regex:/[A-Z]/','regex:/[0-9]/','regex:/[@$!%*#?&amp;]/'] </code></pre> <p>Now I needed ...
<p>One general way to do this via a single regex would be to use positive lookaheads to assert each requirement:</p> <pre><code>/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[@$!%*#?&amp;]).{6,}$/ </code></pre> <p>The above pattern says to match:</p> <pre><code>^ from the start of the user password (?=.*[a-z]...
How to combine these regex expressions together
php|regex|laravel|validation|laravel-request
-4
42
1
73,031,246
73,031,246
1
true
2022-07-19T04:44:52.493Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to combine these regex expressions together<p>I'm working with Laravel and I have used this custom regular expression for validating user password reques...
72,989,444
ImageView + scaleAspectFit in containerView, then in cell<p>i have a cell, that contains containerView with top and bottom cornerRadius = 8. Then i have to put UIImageView with contentMode = .scaleAspectFit and corner radius ONLY on the top (cornerRadius = 8) But the problem that code 'corner radius' is not working wit...
<p>You haven't given the image view a height constraint, and a <code>UIImageView</code> has no intrinsic size until its <code>.image</code> has been set.</p> <p>So, when you set the image, the image view will use the height of the <strong>image</strong> to set its own height. Then, because you're telling it to use <cod...
ImageView + scaleAspectFit in containerView, then in cell
swift|uikit|rounded-corners|snapkit
0
42
1
73,068,888
73,068,888
1
true
2022-07-15T05:33:06.020Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ImageView + scaleAspectFit in containerView, then in cell<p>i have a cell, that contains containerView with top and bottom cornerRadius = 8. Then i have to p...
73,026,138
How to get current stock of a product using stock_quant and sql query by date in odoo?<p>I can get current stock of a product in a warehouse in current time using stock_quant table and sql query.</p> <p>But how is it possible to get the current stock in a specific date using stock_quant table and sql query?</p>
<p>It is not possible to get the stock of a product at a specific date using the <code>stock.quant</code> table. If you need to get the stock of a product at a certain date, you can try using the <code>qty_available</code> field in <code>product.product</code> model. You can pass to_date as context while fetching the <...
How to get current stock of a product using stock_quant and sql query by date in odoo?
odoo
0
42
1
73,080,378
73,080,378
1
true
2022-07-18T17:13:09.313Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get current stock of a product using stock_quant and sql query by date in odoo?<p>I can get current stock of a product in a warehouse in current time ...
72,978,673
How to get object of AppDomain.CurrentDomain.ActivationContext in Console application?<pre><code>using System; namespace ActivationContextSample { public class Program : MarshalByRefObject { public static void Main(string[] args) { ActivationContext ac = AppDomain.CurrentDomain.ActivationContext; ...
<p>Try creating executable application and run it. In that case you will get the required object.</p>
How to get object of AppDomain.CurrentDomain.ActivationContext in Console application?
c#
1
42
2
73,124,124
73,124,124
1
true
2022-07-14T09:59:54.017Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get object of AppDomain.CurrentDomain.ActivationContext in Console application?<pre><code>using System; namespace ActivationContextSample { public cl...
72,796,327
Is their a better way to populate ignored column from another table using room<p>I have two related tables <code>item</code> and <code>purchase</code>. The <code>purchase</code> class contains an <code>ignored</code> column <code>itemName</code> which I want to fill with <code>itemName from item</code></p> <blockquote>...
<p>First, create another data class based on the columns needed, then use a <code>@Query</code> to get the needed columns from the database or a join query for multiple tables like the one below</p> <pre><code>Query(&quot;SELECT P.purchaseID, P.itemOwnerID, P.quantity, P.soldPrice, I.itemName FROM purchases as P INNER ...
Is their a better way to populate ignored column from another table using room
android|kotlin|android-room
1
42
1
72,799,601
72,799,601
1
true
2022-06-29T05:45:55.350Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is their a better way to populate ignored column from another table using room<p>I have two related tables <code>item</code> and <code>purchase</code>. The <...
72,787,038
Creating table with insert command to recreate every row<p>I have table named workerTab:</p> <pre><code>| Id | Name | Age | Cityid | | ---| ---- | --- | --- | | 1| John | 22 | 5 | | 2| Adam | 34 | 5 | | 3| Eve | 19 | 5 | </code></pre> <p>And I would like to have in column: Build, insert qu...
<p>You should build the insert for each row using values only from that row.</p> <pre><code>SELECT Id, Name, Age, Cityid, 'INSERT INTO workerTab (Id, Name, Age, Cityid) VALUES (' + CAST(Id AS NVARCHAR(MAX)) + ', ' + QUOTENAME(Name, '''') + ', ' + CAST(Age AS NVARCHAR(MAX)) + ', ' + CAST(Cityid AS N...
Creating table with insert command to recreate every row
sql|sql-server|tsql
2
42
1
72,787,112
72,787,112
1
true
2022-06-28T13:08:31.097Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Creating table with insert command to recreate every row<p>I have table named workerTab:</p> <pre><code>| Id | Name | Age | Cityid | | ---| ---- | --- | --...
72,781,357
Pandas find value count cross tab for past 3 years<p>I have a dataframe like as below</p> <pre><code>ID,design_id,year,category 1,21345,1978,DC 1,3456,2019,DC 1,5678,2021,DF 1,7890,2021,DC 1,5678,2021,OT 1,1357,2020,np.nan 2,9876,2021,DC 2,9865,2021,DC 2,9876,2021,DC </code></pre> <p>I would like to do the below</p> <p...
<p>Use:</p> <pre><code>#define range of years r = range(2020, 2023) #dynamic count years #y = pd.Timestamp('now').year #r = list(range(y-2, y+1)) #because huge df filter expected years tf = tf[tf['year'].isin(r)] #processing unique counts per year and add missing years df1 = (pd.crosstab( index=tf['ID'], colum...
Pandas find value count cross tab for past 3 years
python|pandas|list|dataframe|pandas-groupby
2
42
1
72,781,479
72,781,479
1
true
2022-06-28T05:55:27.517Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pandas find value count cross tab for past 3 years<p>I have a dataframe like as below</p> <pre><code>ID,design_id,year,category 1,21345,1978,DC 1,3456,2019,D...
72,800,271
convert 2D dataframe to 3D dataframe<p>I have a T 2D dataframe as Follow :</p> <pre><code>dfB = pd.DataFrame([[cheapest_brandB[0],wertBereichB]], columns=['brand', 'price'], index= ['cheap']) dfC = pd.DataFrame([[cheapest_brandC[0],wertBereichC]], columns=['brand', 'price'], index= ['cheap']) the Result...
<p>Use <a href="http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.concat.html" rel="nofollow noreferrer"><code>concat</code></a> with <code>keys</code> parameter:</p> <pre><code>df = pd.concat([dfB, dfC], axis=1, keys=('Gaming','Casual')) print (df) Gaming Casual brand price bra...
convert 2D dataframe to 3D dataframe
python|pandas|dataframe|numpy|3d
3
42
1
72,800,288
72,800,288
1
true
2022-06-29T11:01:15.977Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: convert 2D dataframe to 3D dataframe<p>I have a T 2D dataframe as Follow :</p> <pre><code>dfB = pd.DataFrame([[cheapest_brandB[0],wertBereichB]], columns=['b...
72,907,538
Pandas groupby the same column multiple times based on other category column<p>I have a <code>dataframe</code> that I am trying to use <code>pandas.groupby</code> on to get the sum. The values that I am grouping are as follows:</p> <pre><code> order_id otype score 0 id1 1 1.23 1 id1 2 1.56 2 id1 3 ...
<p>I think the best is test both solutions in real data - but in my opinion <code>pd.concat</code> solution is simplier and if few keys in dictionary should be faster:</p> <pre><code>d= {'class1': [1,2,3], 'class2': [4,5], 'class3': [1,2,3,4,5], 'class4': [2,3,5]} df1 = pd.concat({k: df.loc[df['otype'].is...
Pandas groupby the same column multiple times based on other category column
pandas|pandas-groupby
1
42
1
72,907,645
72,907,645
1
true
2022-07-08T06:36:30.310Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pandas groupby the same column multiple times based on other category column<p>I have a <code>dataframe</code> that I am trying to use <code>pandas.groupby</...
72,824,617
Regex: Match all characters in between an underscore and a period<p>I have a set of file names in which I need to extract their dates. The file names look like:</p> <pre><code>['1 120836_1_20210101.csv', '1 120836_1_20210108.csv', '1 120836_20210101.csv', '1 120836_20210108.csv', '10 120836_1_20210312.csv', '10 1...
<p>You weren't that far off, but there were a few issues:</p> <ul> <li>you extend <code>dates</code> by the result of the <code>.findall</code>, but you only expect to find one and are constructing all of <code>dates</code>, so that would be a lot simpler with a <code>re.search</code> in a list comprehension</li> <li>y...
Regex: Match all characters in between an underscore and a period
python|regex
0
42
1
72,824,667
72,824,667
1
true
2022-07-01T05:09:54.217Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Regex: Match all characters in between an underscore and a period<p>I have a set of file names in which I need to extract their dates. The file names look l...
72,777,903
How to deserialize DateTimeOffset during aggregation<p>I have the following code.</p> <pre><code>class TheThing { public int Number { get; set; } public DateTimeOffset Date { get; set; } } static void Main(string[] args) { var client = new MongoClient(); var database = client.GetDatabase(&quot;test&quo...
<p>The main problem is that MongoDB serializes the DateTimeOffset as a BsonArray of the ticks (long/Int64) and offset (in minutes). If you do not want to change this, you can deserialize it like this:</p> <pre><code>var array = theFirstItem[&quot;firstDate&quot;].AsBsonArray; var timestamp = array[0].AsInt64; var offse...
How to deserialize DateTimeOffset during aggregation
c#|mongodb|aggregation-framework|datetimeoffset
1
42
1
72,789,806
72,789,806
1
true
2022-06-27T20:22:50.640Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to deserialize DateTimeOffset during aggregation<p>I have the following code.</p> <pre><code>class TheThing { public int Number { get; set; } pub...
72,803,947
Calculate the days to reach a certain date - PostgreSQL<p>I need to create a query to calculate the difference in days until a date reach another date. Something like the &quot;how many days until my birthday&quot;.</p> <p>Current_date | Reach_date</p> <p>2000-01-01 | <strong>2015</strong>-01-<strong>03</strong> -- <em...
<p>Try if this works for you. It checks where it's a leap year to calculate the difference correctly, and then uses different logic to calculate the difference between the dates depending on whether the dates are in the same year or not.</p> <pre><code>with cte as ( SELECT *, CASE WHEN extract(year from ...
Calculate the days to reach a certain date - PostgreSQL
sql|postgresql
0
42
3
72,804,886
72,804,886
1
true
2022-06-29T15:20:35.790Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Calculate the days to reach a certain date - PostgreSQL<p>I need to create a query to calculate the difference in days until a date reach another date. Somet...
72,861,671
Add foreach for toarray to a JsonResource in Laravel REST API<p>I have a collection of genres for every movie and I wanna display every one that each movie has in the api request. Here's the resource:</p> <pre><code> public function toArray($request) { return [ 'id' =&gt; $this-&gt;id, ...
<p>Create a genre resouce.</p> <pre><code>class GenreResource extends JsonResource { public function toArray($request) { return [ 'name' =&gt; $this-&gt;name, ]; } } </code></pre> <p>Load it in the controller using <code>with()</code>.</p> <pre><code>public function index() { ...
Add foreach for toarray to a JsonResource in Laravel REST API
php|laravel|api|rest|eloquent
0
42
1
72,861,754
72,861,754
1
true
2022-07-04T20:18:26.853Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Add foreach for toarray to a JsonResource in Laravel REST API<p>I have a collection of genres for every movie and I wanna display every one that each movie h...
72,943,903
Can't find elements but they exist Selenium Python<p>I have encountered a problem: the program does not see the elements and cannot print them. Though, I use it several times in code and it worked the first time. A little later, as I said, it stops seeing the element:</p> <p>HTML code:</p> <pre><code>&lt;div class=&quo...
<p>To get string value from the text nodes you have to invoke <code>.text</code> method. The following xpath expression selects all the div elements</p> <pre><code>elements = driver.find_elements(By.XPATH, &quot;//div[@class='entries-container']/div&quot;) for element in elements: print(element.text) </code></pre> ...
Can't find elements but they exist Selenium Python
python|selenium
0
42
1
72,943,957
72,943,957
1
true
2022-07-11T19:47:54.083Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can't find elements but they exist Selenium Python<p>I have encountered a problem: the program does not see the elements and cannot print them. Though, I use...
72,797,629
How to efficiently find duplicate database entries (HSQL)<p>I have a large table of names. Each entry has a unique ID, a FORENAME, and a SURNAME. If different IDs have the same forename and surname that is not necessarily an error, but it often is, so I want a query that lists the suspects. Because the table is large I...
<p>You use GROUP BY and HAVING in SQL to do what you want. For example:</p> <pre><code>SELECT FIRSTNAME, LASTNAME FROM CUSTOMER GROUP BY LASTNAME, FIRSTNAME HAVING COUNT(*) &gt; 1 ORDER BY LASTNAME </code></pre> <p>Note the ORDER BY clause is optional.</p>
How to efficiently find duplicate database entries (HSQL)
sql|duplicates|hsqldb|processing-efficiency
1
42
1
72,798,853
72,798,853
1
true
2022-06-29T07:47:19.827Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to efficiently find duplicate database entries (HSQL)<p>I have a large table of names. Each entry has a unique ID, a FORENAME, and a SURNAME. If differen...
72,955,136
How to create rectangles on canvas as in a graph (picture)<p>Can you please tell me how to implement such a graph as in the example? I have the following test data:</p> <pre><code>[ { day: 2, sum: 7799857 }, { day: 3, sum: 6986099 }, { day: 4, sum: 6471975, }, { day: 7, sum: 5895399, }, { day: 8...
<p>It will be really hard for you to make this using canvas. I would suggest using some library like <code>chart-js</code> which operates on canvas.</p> <p>I tried to do something with canvas for you, but it seems like your data is not related to the picture you added or there is some algorithm that sum the <code>sum</...
How to create rectangles on canvas as in a graph (picture)
javascript|reactjs|canvas
0
42
1
72,955,737
72,955,737
1
true
2022-07-12T15:53:50.087Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to create rectangles on canvas as in a graph (picture)<p>Can you please tell me how to implement such a graph as in the example? I have the following tes...
72,868,084
Remove space between symbol and text when using 'expression'<p>I want to use the function 'expression' in r to be able to add symbols as '≤' Example:</p> <pre><code>plot(1:10,1:10) legend(3,8, c(expression(&quot;&quot;&lt;=&quot;test &quot;))) </code></pre> <p>With this code there will be a space between ≤ and test, I ...
<p>You could use unicode symbols (<code>\U2264</code> for <code>≤</code>) and do it without the expression?</p> <pre class="lang-r prettyprint-override"><code>plot(1:10,1:10) legend(3,8, &quot;\U2264test&quot;) # legend(3,8, &quot;≤test&quot;) </code></pre> <p><a href="https://i.stack.imgur.com/c8tJu.png" rel="nofollow...
Remove space between symbol and text when using 'expression'
r
1
42
1
72,868,158
72,868,158
1
true
2022-07-05T10:43:51.783Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Remove space between symbol and text when using 'expression'<p>I want to use the function 'expression' in r to be able to add symbols as '≤' Example:</p> <pr...
72,926,350
Moving object to targets within an array on the canvas<p>I have some P5js code that I made.</p> <p>It basically moves the circle around the screen to predetermined targets stored in an array. I will be using it within my game that uses A* pathfinding and stores the path points in an array. I then am looking at moving t...
<p>The main problem in your code is that when you increase the speed you shoot over the target as you may not hit the target accurately.</p> <p>First of all the initial <code>position</code> vector should be a copy of the first target:</p> <pre class="lang-js prettyprint-override"><code>position = targets[0].copy() </c...
Moving object to targets within an array on the canvas
javascript|position|p5.js|lerp
1
42
1
72,926,700
72,926,700
1
true
2022-07-10T05:35:39.620Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Moving object to targets within an array on the canvas<p>I have some P5js code that I made.</p> <p>It basically moves the circle around the screen to predete...
72,835,237
Error in `mutate()` while creating a new variable using R<p>So I have a dataframe and I want to create a new variable randomly using other factors; my data contains this key variables:</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th style="text-align: center;">iQ</th> <th style="text-align:...
<p>This error message is occurring because the <code>case_when()</code> statement evaluates all the right-hand-side expressions, and then selects based on the left-hand-side.. Therefore, even though, for example row 4 of your sample dataset will default to <code>TRUE~0</code>, the RHS side of the the first two conditio...
Error in `mutate()` while creating a new variable using R
r|database|dataframe|variables|var
1
42
2
72,835,455
72,835,455
1
true
2022-07-01T22:51:01.893Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error in `mutate()` while creating a new variable using R<p>So I have a dataframe and I want to create a new variable randomly using other factors; my data c...
72,782,016
remove bottom border for specific screen size<p>As you can see outer border are lighter than inner border in this form i tried to remove the bottom border for specific screen size but its not working I want when screen size matches then bottom border will remove</p> <p><div class="snippet" data-lang="js" data-hide="fal...
<p>Does this work?</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>var x = window.matchMedia("(max-width: 992px)"); myFunction(x); x.addListener(myFunction); function myFuncti...
remove bottom border for specific screen size
javascript
1
42
2
72,782,145
72,782,145
1
true
2022-06-28T07:02:40.050Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: remove bottom border for specific screen size<p>As you can see outer border are lighter than inner border in this form i tried to remove the bottom border fo...
72,793,973
Firebase custom claims returns Object is possibly 'undefined'<p>I am trying to read the user's custom claims and I would like to return the values of the claims to the client individually.</p> <p>This code has worked for months. However, all of a sudden it returns the error &quot;Object is possibly undefined&quot;.</p>...
<p>the user maybe undefined, this could happen if you use invalid userId. Use optional chaining to get rid of this error.</p> <pre><code> return { role: userRecord?.customClaims?.[&quot;role&quot;], type: userRecord?.customClaims?.[&quot;type&quot;], }; </code></pre> <p>simply check f...
Firebase custom claims returns Object is possibly 'undefined'
node.js|typescript|google-cloud-functions|claims-authentication
0
42
1
72,794,144
72,794,144
1
true
2022-06-28T22:50:17.933Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Firebase custom claims returns Object is possibly 'undefined'<p>I am trying to read the user's custom claims and I would like to return the values of the cla...
72,812,413
Line gestion csv bash<p>sorry if this issue has been covered before but I couldn't find the topic.</p> <p>My csv.csv :</p> <pre><code>uid:titi 20220310 uid:toto 20220410 uid:tata 20220805 uid:tuti 20220304 </code></pre> <p>What I want is that my new csv look like this:</p> <p>newcsv.csv</p> <pre><co...
<p>Try this:</p> <pre><code>cat csv.csv | sed 's/uid://g' | awk '{key=$0; getline; print key &quot;;&quot; $0;}' | tr -d ' ' </code></pre> <p>The output as you prefer:</p> <pre><code>titi;20220310 toto;20220410 tata;20220805 tuti;20220304 </code></pre>
Line gestion csv bash
bash|csv|line
0
42
1
72,815,690
72,815,690
1
true
2022-06-30T08:14:58.967Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Line gestion csv bash<p>sorry if this issue has been covered before but I couldn't find the topic.</p> <p>My csv.csv :</p> <pre><code>uid:titi 20220310...
72,876,667
Should all API calls be asynchronous in React?<p>When making API calls in React, should they all be asynchronous?</p> <p>Is this a one-size-fits-all answer, or is this scenario-based? If so, what are some good examples of where to use async calls, and where not to use them?</p>
<p>The only way to perform sync API calls is by using <a href="https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest" rel="nofollow noreferrer"><code>XMLHttpRequest</code></a> in <a href="https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Synchronous_and_Asynchronous_Requests#synchronous_request"...
Should all API calls be asynchronous in React?
reactjs
-3
42
1
72,876,725
72,876,725
1
true
2022-07-06T00:05:24.303Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Should all API calls be asynchronous in React?<p>When making API calls in React, should they all be asynchronous?</p> <p>Is this a one-size-fits-all answer, ...
72,912,630
Can anyone tell me how to replace strings with floats in an np.array(of several genotypes) by frequence per column?<p>I have a np.array matrix(1826*5000) where the rows are my samples and the columns are the features. That means I have a genotype in each line with the individual nucleotides as a string. like this:</p> ...
<p>Given an array arr, the easiest way of solving it is:</p> <pre><code>import pandas as pd df = pd.DataFrame(arr) for column in df: df[column] = np.where(df[column]==df[column].mode()[0], &quot;2&quot;, &quot;0&quot;) arr1 = df.to_numpy() </code></pre> <p>Explanation: First, you turn the array into a Pandas datafr...
Can anyone tell me how to replace strings with floats in an np.array(of several genotypes) by frequence per column?
python|scikit-learn|artificial-intelligence|genome
1
42
3
72,914,333
72,914,333
1
true
2022-07-08T14:06:47.510Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can anyone tell me how to replace strings with floats in an np.array(of several genotypes) by frequence per column?<p>I have a np.array matrix(1826*5000) whe...
72,956,373
Select Extensions that the user is not subscribed to already<p>I've been searching for a solution for my problem on Stack Overflow but I can't seem to find a solution that fits, or that I'm able to implement.</p> <p>I have three tables: &quot;Extensions&quot;, &quot;Subscriptions&quot;, &quot;Accounts&quot;.</p> <p>Ext...
<p>You are mixing old and new styles of `JOIN, when you keep to the newer one nothing can go almost wrong.</p> <p>besides test yor queries before using them in code, if you are not firm with the syntax</p> <pre><code>SELECT ex.*, su.*,ac.* FROM codium.extensions ex JOIN codium.subscriptions su ON ex.exte...
Select Extensions that the user is not subscribed to already
php|mysql|sql|phpmyadmin
1
42
1
72,956,539
72,956,539
1
true
2022-07-12T17:41:00.510Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Select Extensions that the user is not subscribed to already<p>I've been searching for a solution for my problem on Stack Overflow but I can't seem to find a...
72,819,833
XQuery tumbling window: group by start item of first window<p>Using BaseX 9.7.3, I have a sorted list of names that has been produced using a <code>tumbling window</code> clause.</p> <p>A snippet of the data looks like this:</p> <pre><code>&lt;data&gt; &lt;group&gt; &lt;key id=&quot;0c7b0bca-0349-489c-b45f-2612f3...
<p>With extended (Java like) regular expressions as supported in Saxon I think</p> <pre><code>for tumbling window $w in /data/group/key start $s when true() end next $n when not(matches($n, '^' || $s || '\b', ';j')) return &lt;group&gt;{$w}&lt;/group&gt; </code></pre> <p>gives the two groups you want.</p> <p>I have ...
XQuery tumbling window: group by start item of first window
xquery|basex
0
42
1
72,828,801
72,828,801
1
true
2022-06-30T17:30:11.210Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: XQuery tumbling window: group by start item of first window<p>Using BaseX 9.7.3, I have a sorted list of names that has been produced using a <code>tumbling ...
72,888,709
Going through a list in Capybara?<p>I have a drop down menu. I want capybara to go through it and find the specific element and click on it. I'm currently trying to do a within clause and having it iterate through the list and find this element: &quot;Cow_poop&quot;</p> <pre><code>&lt;li role=&quot;option&quot; unselec...
<p>It's not a <code>&lt;div&gt;</code> but a <code>&lt;li&gt;</code> element.</p> <p>Your effective line of code will be:</p> <pre><code>find('li.ant-select-dropdown-menu-item-selected', title: 'Cow_poop').click </code></pre> <p>Alternative:</p> <pre><code>find('li.ant-select-dropdown-menu-item-selected[title=Cow_poop]...
Going through a list in Capybara?
ruby-on-rails|ruby|selenium|selenium-webdriver|capybara
3
42
1
72,888,733
72,888,733
1
true
2022-07-06T19:05:20.650Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Going through a list in Capybara?<p>I have a drop down menu. I want capybara to go through it and find the specific element and click on it. I'm currently tr...
73,028,752
How to select calender month using Selenium Select method using python selenium<p>I am trying to select a month from the calender using Select method of selenium in python. URL of site is: <a href="https://www.vegasinsider.com/mlb/matchups/" rel="nofollow noreferrer">https://www.vegasinsider.com/mlb/matchups/</a> . I a...
<p>The dates of the calendar are <em><code>&lt;button&gt;</code></em> tags</p> <p><img src="https://i.stack.imgur.com/saYXZ.png" alt="vegasinsider" /></p> <p>So you can't use <a href="https://stackoverflow.com/a/69996687/7429447"><code>Select()</code></a> class.</p> <hr /> <h2>Solution</h2> <p>To chose a date e.g. <em>...
How to select calender month using Selenium Select method using python selenium
python|selenium|selenium-webdriver|css-selectors|webdriverwait
1
42
1
73,029,216
73,029,216
1
true
2022-07-18T21:18:44.123Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to select calender month using Selenium Select method using python selenium<p>I am trying to select a month from the calender using Select method of sele...
72,944,974
Crosstab to show count of rows per weekday for each group<p>I have a database with a single table. The table includes a column called <code>threat_group</code>, and another called <code>post_date</code>. This query gives me a list of all posts for each <code>threat_group</code> per weekday:</p> <pre><code>SELECT di...
<p>To get <code>NULL</code> for missing values, you need the 2-parameter variant of <code>crosstab()</code>:</p> <pre class="lang-sql prettyprint-override"><code>SELECT * FROM crosstab( $$ SELECT threat_group -- AS grp , extract('isodow' FROM post_date) -- AS weekday , count(*) ...
Crosstab to show count of rows per weekday for each group
sql|postgresql|crosstab
1
42
1
72,946,349
72,946,349
1
true
2022-07-11T21:46:04.767Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Crosstab to show count of rows per weekday for each group<p>I have a database with a single table. The table includes a column called <code>threat_group</cod...
72,828,346
naming elements of a list in R<p>I am new to R. I just started 2 days ago, I was following along with my instructor on the topic of naming list. I had seen an example done, and decided to do on my own.</p> <pre><code>list('Chicago' = 1, 'New York' = 2, 'Los Angeles' = 3) $Chicago </code></pre> <p>Every time I run thi...
<p>You should assign your list to a name to access it again.</p> <pre class="lang-r prettyprint-override"><code>mylist &lt;- list('Chicago' = 1, 'New York' = 2, 'Los Angeles' = 3) mylist$Chicago # [1] 1 </code></pre>
naming elements of a list in R
r|data-analysis
0
42
1
72,828,358
72,828,358
1
true
2022-07-01T11:09:11.670Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: naming elements of a list in R<p>I am new to R. I just started 2 days ago, I was following along with my instructor on the topic of naming list. I had seen ...
72,858,863
How to open the Sidebar so that it sits on over of the main information page<p>My website has a sidebar (FiltersSideBar in my code) with filters. The sidebar is on the left.</p> <p>I also made a functionality that would hide the Sidebar at certain sizes of the browser window. The sidebar hides and a button appears with...
<p>Start by actually using the value set by <code>setHideSidebar</code></p> <pre class="lang-js prettyprint-override"><code>const [filters, setFilters] = useState({.....}) const size = WindowSize(); // Actually use the state here const [hideSidebar, setHideSidebar] = useState(true); </code></pre> <p>And then below that...
How to open the Sidebar so that it sits on over of the main information page
javascript|css|reactjs|sidebar
0
42
1
72,859,261
72,859,261
1
true
2022-07-04T15:12:30.670Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to open the Sidebar so that it sits on over of the main information page<p>My website has a sidebar (FiltersSideBar in my code) with filters. The sidebar...
72,964,068
Shell: Filter list by array of sed expressions<p>I have a list like this:</p> <pre><code>&gt; echo $candidates ENV-NONPROD-SANDBOX ENV-NONPROD-SANDBOX-SECRETS ENV-NONPROD-DEMO ENV-NONPROD-DEMO-SECRETS ENV-PROD-EU ENV-PROD-EU-SECRETS ENV-PROD-US ENV-PROD-US-SECRETS </code></pre> <p>I also have a dynamically created list...
<blockquote> <pre><code>filterParam=$(printf &quot;-e '%s' &quot; </code></pre> </blockquote> <p>No, you can't store command line arguments in variables. Read <a href="https://mywiki.wooledge.org/BashFAQ/050" rel="nofollow noreferrer">https://mywiki.wooledge.org/BashFAQ/050</a> .</p> <p>You can use bash arrays, <em>whi...
Shell: Filter list by array of sed expressions
bash|zsh
1
42
2
72,964,409
72,964,409
1
true
2022-07-13T09:39:04.443Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Shell: Filter list by array of sed expressions<p>I have a list like this:</p> <pre><code>&gt; echo $candidates ENV-NONPROD-SANDBOX ENV-NONPROD-SANDBOX-SECRET...
72,974,571
Find groups of adjacent cells in a numpy ndarray with the same value<p>I'm analyzing some 3D images from a microscope to identify discrete objects in the images. I'm at a step where I've reduced the image to a mask, where 0s are not part of an object, and positive integers are objects. The value of the integer is the t...
<p>Apply the <code>label</code>ing to a mask of <em>each class</em> individually, then combine.</p> <pre class="lang-py prettyprint-override"><code>from scipy.ndimage import label x = np.array([ # class label map, given [0, 0, 1, 1], [2, 0, 2, 1], [2, 0, 3, 3], [0, 1, 0, 0]]) classes = set(x.flat) - {0...
Find groups of adjacent cells in a numpy ndarray with the same value
python|numpy|image-processing
1
42
1
72,979,239
72,979,239
1
true
2022-07-14T02:33:38.913Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Find groups of adjacent cells in a numpy ndarray with the same value<p>I'm analyzing some 3D images from a microscope to identify discrete objects in the ima...
72,821,259
Creating a numpy matrix from given min and max priors<p>I have 3 priors given minimum and maximum ranges. By using them, I need to create a NumPy array in the form of;</p> <p><code>M = [[x_0, y_0, z_0], [x_1, y_1, z_1], ...,[x_N, y_N, z_N]]</code></p> <p>where <code>x=[0.60, 0.80]</code>, <code>y=[1, 80]</code>, <code>...
<p>it can be achieved by:</p> <pre><code>np.array([x, y, z]).T </code></pre> <p>some benchamrks:</p> <pre><code>size = 3 * 1000 50 loops, best of 5: 8.14 µs per loop # np.vstack 50 loops, best of 5: 2.95 µs per loop # this answer size = 3 * 10000 50 loops, best of 5: 27.3 µs per loop 50 loops, best of 5: 19.9 ...
Creating a numpy matrix from given min and max priors
python|arrays|numpy|matrix
0
42
2
72,821,608
72,821,608
1
true
2022-06-30T19:46:14.707Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Creating a numpy matrix from given min and max priors<p>I have 3 priors given minimum and maximum ranges. By using them, I need to create a NumPy array in th...
72,888,971
Swap elements in a MongoDB array given only their ids (in-place)<p>I read some threads about it, such as <a href="https://stackoverflow.com/questions/22327066/swap-the-values-in-a-mongodb-array">this one</a> and <a href="https://stackoverflow.com/questions/7223273/get-n-th-element-of-an-array-in-mongodb">that one</a>, ...
<p>This is a nice question that I didn't meet before. The catch here, is that you need a pipeline to refer existing values, but this prevents working with direct index like dot notation or even <code>$push</code>. Hence, one option is using <code>$reduce</code>:</p> <ol> <li><code>$set</code> keys for the wanted values...
Swap elements in a MongoDB array given only their ids (in-place)
arrays|mongodb|aggregation-framework|insert-update
1
42
1
72,889,749
72,889,749
1
true
2022-07-06T19:32:43.643Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Swap elements in a MongoDB array given only their ids (in-place)<p>I read some threads about it, such as <a href="https://stackoverflow.com/questions/2232706...
72,976,128
Subscription-id, resourceGroupName and name of the App from inside the web-app PowerShell<p>I have an application hosted in Azure PAAS. The connection string for the application is stored under <code>'Configuration' -&gt; 'Connection strings'</code></p> <p>My application has a PowerShell instance. I want to iterate thr...
<blockquote> <p>As my application itself is the app, can there be a way to skip the details like 'subscriptionId', 'resourceGroupName' and 'name'?</p> </blockquote> <p><em><strong>AFAIK, Its not possible to acquire the connection strings using Rest API, or PowerShell of an Azure web application without providing Resour...
Subscription-id, resourceGroupName and name of the App from inside the web-app PowerShell
azure|powershell|azure-web-app-service
0
42
2
72,977,177
72,977,177
1
true
2022-07-14T06:29:39.397Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Subscription-id, resourceGroupName and name of the App from inside the web-app PowerShell<p>I have an application hosted in Azure PAAS. The connection string...
72,964,603
Search for pattern in column data from csv file<p>I have a csv file with data like below</p> <pre><code>SYMM_ID DATE INSTANCE Total Response Time 297900076 01-06-2022 05:00 SG_SG_ORACLUL_L_PRDPRF 0.31 297900076 01-06-2022 05:05 SG_SG_ORACLUL_L_NPRDPRF 0.5 297900076 01-...
<p>I would use a regex like <code>'^SG_SG_.+_L_N??PRD(?:PRF|STD)$'</code>.</p> <p>Using your example data:</p> <pre><code>$Local_Data = $GetData | Where-Object { $_.Instance -match '^SG_SG_.+_L_N??PRD(?:PRF|STD)$' } </code></pre> <p>will return</p> <pre><code>SYMM_ID DATE INSTANCE Total Res...
Search for pattern in column data from csv file
powershell
0
42
1
72,966,933
72,966,933
1
true
2022-07-13T10:16:50.800Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Search for pattern in column data from csv file<p>I have a csv file with data like below</p> <pre><code>SYMM_ID DATE INSTANCE ...
72,941,703
Wordpress Home is redirecting to a duplicated version of itself after copying site to local<p>Background: I have multiple websites running on a rpi4 using nginx and wordpress. I wanted to copy one of the sites to my local network for development and testing purposes. I copied the database, and wordpress files, and set...
<p>I move sites almost daily.</p> <p>First, get and install the official <a href="https://wp-cli.org/" rel="nofollow noreferrer">WP CLI</a> installed.</p> <p>Next, from the site that you are moving <strong>from</strong>, <code>cd</code> into the WordPress root directory and export the database using:</p> <pre class="la...
Wordpress Home is redirecting to a duplicated version of itself after copying site to local
php|mysql|wordpress|nginx
0
42
2
72,941,983
72,941,983
1
true
2022-07-11T16:24:18.670Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Wordpress Home is redirecting to a duplicated version of itself after copying site to local<p>Background: I have multiple websites running on a rpi4 using ng...
72,908,642
Bar chart starting out of axis in python<p>I need to copy the bar chart in the image with python.</p> <p><a href="https://i.stack.imgur.com/ZpbHI.png" rel="nofollow noreferrer">bar chart I have to copy</a></p> <p>What I have been able to achieve is next image.</p> <p><a href="https://i.stack.imgur.com/1c1Ri.png" rel="n...
<p>For the first question, just add a value for the <code>bottom</code> parameter. I have also added the arrow using <code>annotate</code>:</p> <pre class="lang-py prettyprint-override"><code>import matplotlib.pyplot as plt ausgaben = 130386 einnahmen = 147233 profit = einnahmen-ausgaben titles = [&quot;Ausgaben&quot...
Bar chart starting out of axis in python
python|matplotlib|bar-chart|coordinates|axis
2
42
1
72,908,796
72,908,796
1
true
2022-07-08T08:24:18.700Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Bar chart starting out of axis in python<p>I need to copy the bar chart in the image with python.</p> <p><a href="https://i.stack.imgur.com/ZpbHI.png" rel="n...
72,986,453
react firebase firestore empty useEffect useState<p>having an issue, when the when nav to the comp the items state is empty, if I edit the code and page refreshes its shows up and if I add the state to the useEffect &quot;[itemCollectionRef, items]&quot; it's an inf loop but the data is their anyone have a better idea ...
<p>It will depend how you will render the data from the <code>useEffect</code>. <code>setState</code> does not make changes directly to the state object. It just creates queues for React core to update the state object of a React component. If you add the state to the useEffect, it compares the two objects, and since t...
react firebase firestore empty useEffect useState
javascript|reactjs|firebase|google-cloud-firestore
0
42
1
72,993,899
72,993,899
1
true
2022-07-14T20:43:25.653Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: react firebase firestore empty useEffect useState<p>having an issue, when the when nav to the comp the items state is empty, if I edit the code and page refr...
72,935,208
How to display WooCommerce Featured Products but in custom order<p>Is there any way to display featured products in the way I want? Assume there are 5 products A,B,C,D and E. Now I want them to display like D, C, A, B, and E. Is this possible?</p>
<p>Yes there is an option to do that already. In each product ( inside Woocommerce ) click on the TAB &quot;Advanced&quot;. Inside this tab, you will find an option called menu order.</p> <p>A greater number here simply means it will be further away from the beginning of the display list</p>
How to display WooCommerce Featured Products but in custom order
wordpress|woocommerce
0
42
1
72,935,463
72,935,463
1
true
2022-07-11T07:44:32.637Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to display WooCommerce Featured Products but in custom order<p>Is there any way to display featured products in the way I want? Assume there are 5 produc...
72,831,326
Find the average value of n largest in a month, but day has to be unique (Pandas)<p>How can I find the average value of n largest values in a month, but day has to be unique?</p> <p>I do have a timestamp column as well, but I would guess making columns of them is the way to go?</p> <p>I tried <code>df['peak_avg'] = df....
<p>IIUC, you can drop the duplicate in <code>month</code> and <code>day</code> columns and at last fill them</p> <pre class="lang-py prettyprint-override"><code>df['peak_avg'] = (df.sort_values(['month', 'day', 'value'], ascending=[True, True, False]) .drop_duplicates(['month', 'day']) ...
Find the average value of n largest in a month, but day has to be unique (Pandas)
python|pandas
2
42
3
72,831,570
72,831,570
1
true
2022-07-01T15:14:01.563Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Find the average value of n largest in a month, but day has to be unique (Pandas)<p>How can I find the average value of n largest values in a month, but day ...
72,990,988
Can you get original, system's PATH variable value in python?<p>So, when I import a certain module in my python script, a new path gets added to <code>os.environ['PATH']</code>. Also I launch my script in conda enviroment, which also adds a bunch of new entries to PATH. Is there an any way I can get original value of P...
<p>You can save the original value of the environment variable in a separate variable before you import the said module, so that you can restore the value of the environment variable from that variable before calling <code>subprocess.run</code>. Use <code>unittest.mock.patch.dict</code> as a context manager around the ...
Can you get original, system's PATH variable value in python?
python|path|operating-system
1
42
1
72,991,429
72,991,429
1
true
2022-07-15T08:14:05.427Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can you get original, system's PATH variable value in python?<p>So, when I import a certain module in my python script, a new path gets added to <code>os.env...
72,816,992
Header in a XWPFDocument is only on the last page when adding section breaks<p>I am trying to create a word document using Apache POI. This document includes images, and I need to flip the page with the image to be landscape oriented, while keeping the rest of the document portrait oriented. However, I also need to use...
<p>The problem is that sections not only have separate page settings but have separate header/footer settings too.</p> <p><code>XWPFDocumnet.createHeader</code> creates a header which reference gets stored in document body section properties. If you create a paragraph having own section properties - a section break par...
Header in a XWPFDocument is only on the last page when adding section breaks
kotlin|apache-poi|xwpf
0
42
1
72,825,944
72,825,944
1
true
2022-06-30T13:50:07.560Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Header in a XWPFDocument is only on the last page when adding section breaks<p>I am trying to create a word document using Apache POI. This document includes...
72,838,819
JS Array.push acts in unexpected way<p>I am experiencing unexpected behaviour of push function. The problem is with the latest line of code cited below.</p> <pre><code>export enum non_searchFieldsNames { language = 'language', categories = 'categories', subtitle = 'subtitle', publishedDate = 'publishedD...
<p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push" rel="nofollow noreferrer"><code>push</code></a> modifies the main array directly, and it does not return a new array as you expected, but the count of items in that array.</p> <p>You can check the below demo for <co...
JS Array.push acts in unexpected way
javascript|arrays
0
42
1
72,838,844
72,838,844
1
true
2022-07-02T11:49:51.247Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JS Array.push acts in unexpected way<p>I am experiencing unexpected behaviour of push function. The problem is with the latest line of code cited below.</p> ...
72,817,360
Pandas: Combine DataFrame with a vector - pairwise rows<p>My first question here! I have two DataFrames:</p> <pre><code>df1 = pd.DataFrame({&quot;A&quot;:[1,0,1,2,1],&quot;B&quot;:[2,2,1,0,1],&quot;C&quot;:[1,1,1,2,1],&quot;D&quot;:[2,1,2,1,1]}) df1 A B C D 0 1 2 1 2 1 0 2 1 1 2 1 1 1 2 3 2 0 2 1...
<p>Try this:</p> <pre><code>df1 = pd.DataFrame({&quot;A&quot;:[1,0,1,2,1],&quot;B&quot;:[2,2,1,0,1],&quot;C&quot;:[1,1,1,2,1],&quot;D&quot;:[2,1,2,1,1], 'E': [1,1,2,2,2]}) df2 = pd.DataFrame({&quot;A&quot;:[1],&quot;B&quot;:[2],&quot;D&quot;:[4]}) col = list(set(df1.columns) - set(df2.columns)) df2[col] = np.NaN df =...
Pandas: Combine DataFrame with a vector - pairwise rows
python|pandas|dataframe
0
42
1
72,818,435
72,818,435
1
true
2022-06-30T14:13:39.347Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pandas: Combine DataFrame with a vector - pairwise rows<p>My first question here! I have two DataFrames:</p> <pre><code>df1 = pd.DataFrame({&quot;A&quot;:[1,...
72,913,796
How in JS to execute inside a batch loop only on first iteration one function<p>On the following snippet inside the <code>forEach</code> loop, I'm executing a function called <code>saveCandidatesData({ screeningNumbers, pruneScreeningNumbers: prune })</code></p> <p>The function generally is about saving some data in ba...
<p><code>map()</code> receives the array index as the 2nd argument. So you can test if this is <code>0</code> to tell if you're in the first batch.</p> <p>Also, you should use <code>forEach()</code> rather than <code>map()</code> if you don't need the array of the results of each call that <code>map()</code> creates.</...
How in JS to execute inside a batch loop only on first iteration one function
javascript
1
42
1
72,913,896
72,913,896
1
true
2022-07-08T15:35:51.223Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How in JS to execute inside a batch loop only on first iteration one function<p>On the following snippet inside the <code>forEach</code> loop, I'm executing ...
72,394,206
replace string of symbol+ rational number python<p>I have a large corpus which contains sentences such as</p> <pre><code>text = [&quot;$3.4 million but not section 4.1&quot;] </code></pre> <p>that I want to clean as</p> <pre><code>text = [&quot;$3,4 million but not section 4.1&quot;] </code></pre> <p>using a simple lin...
<pre><code>def rep(m): return m.group(1) + &quot;,&quot; + m.group(2) re.sub(&quot;([$][0-9]+).([0-9]+)&quot;,rep,text) </code></pre>
replace string of symbol+ rational number python
python|sentence
1
42
2
72,394,485
72,394,485
1
true
2022-05-26T15:22:56.983Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: replace string of symbol+ rational number python<p>I have a large corpus which contains sentences such as</p> <pre><code>text = [&quot;$3.4 million but not s...
72,392,292
XPath expression to select the complete document excluding one element<p>I have an XML document</p> <pre><code>&lt;root&gt; &lt;a&gt;Foo&lt;/a&gt; &lt;b&gt;Bar&lt;/b&gt; &lt;c&gt;Baz&lt;/c&gt; &lt;/root&gt; </code></pre> <p>and need an XPath 1.0 query to obtain the <em>entire</em> document <em>excluding</em...
<p>XPath can only select nodes that are there in the input, it cannot modify the input tree in any way. Your input does not contain a root element whose only children are <code>a</code> and <code>c</code>, so you cannot select such an element.</p> <p>For that you need XSLT or XQuery.</p>
XPath expression to select the complete document excluding one element
xpath
1
42
1
72,394,524
72,394,524
1
true
2022-05-26T13:04:26.570Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: XPath expression to select the complete document excluding one element<p>I have an XML document</p> <pre><code>&lt;root&gt; &lt;a&gt;Foo&lt;/a&gt; &l...
72,394,157
Losing protected ranges when downloading excel from sheets and sheets to excel<p>I have been using excel documents containing protected ranges and hidden sheets, it seems like this can be circum navigated by importing into google sheets and likewise when doing the same in google sheets the functionality is lost when do...
<p>I am afraid it is not possible since both are different technologies. Microsoft's protection works with the file itself while Google's protection checks the permissions from each Google account.</p> <p>Not long ago Google added a <a href="https://support.google.com/docs/answer/9406611" rel="nofollow noreferrer">comp...
Losing protected ranges when downloading excel from sheets and sheets to excel
excel|google-sheets
0
42
1
72,398,634
72,398,634
1
true
2022-05-26T15:19:14.790Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Losing protected ranges when downloading excel from sheets and sheets to excel<p>I have been using excel documents containing protected ranges and hidden she...
72,265,723
Changing the angle of a SKSpriteNode during a rotation<p>I am trying to make a drifting game. In order for the car to drift, the car (when turning) needs to be at an angle. I have tried rotation, however this conflicts with the code I already have for turning the car. Here is my code, any help?</p> <pre><code>override ...
<p>one approach is you could nest your car inside another <code>SKNode</code> as a container. apply your steering rotation to the car node, as you're doing it now. then apply the drift rotation to the container node. the result effect will be the sum of the two.</p> <pre><code>//embed car inside a SKNode container so y...
Changing the angle of a SKSpriteNode during a rotation
swift|xcode|sprite-kit
2
42
1
72,452,949
72,452,949
1
true
2022-05-16T21:16:13.173Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Changing the angle of a SKSpriteNode during a rotation<p>I am trying to make a drifting game. In order for the car to drift, the car (when turning) needs to ...
72,399,511
Having trouble creating a subdomain record on CloudFlare that will eventually point to my AWS S3 bucket’s static url<p>I’m using CloudFlare as a hosting provider for my website, and AWS S3 to serve my static content. From CloudFlare I created a CNAME for my root domain (example.com) that points to my S3 bucket’s static...
<p>A much simpler solution, that doesn't require creating extra S3 buckets and redirect rules in S3, is to create a page rule in Cloudflare that forwards/redirects <code>www</code> to the root domain</p>
Having trouble creating a subdomain record on CloudFlare that will eventually point to my AWS S3 bucket’s static url
amazon-web-services|amazon-s3|dns|cloudflare|amazon-route53
-1
42
1
72,477,191
72,477,191
1
true
2022-05-27T01:15:18.447Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Having trouble creating a subdomain record on CloudFlare that will eventually point to my AWS S3 bucket’s static url<p>I’m using CloudFlare as a hosting prov...
72,320,768
batch file remove text before and after word<p>i want to remove everything before <code>url=https://</code> and after <code>.ap.ngrok.io</code> mean I just want the code link <code>d045-113-172-146-154</code></p> <p>this is ngrok.log</p> <pre><code>t=2022-05-20T21:33:03+0700 lvl=info msg=&quot;no configuration paths su...
<p>The task getting the hostname from the single line containing the full URL can be done with the following batch file:</p> <pre><code>@echo off setlocal EnableExtensions DisableDelayedExpansion if not exist &quot;ngrok.log&quot; exit /B 2 for /F delims^=^ eol^= %%I in ('%SystemRoot%\System32\findstr.exe /R &quot;url=...
batch file remove text before and after word
batch-file
1
42
1
72,322,748
72,322,748
1
true
2022-05-20T14:39:20.200Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: batch file remove text before and after word<p>i want to remove everything before <code>url=https://</code> and after <code>.ap.ngrok.io</code> mean I just w...
72,388,898
How to exclude -sources pattern in bash with space in file name<p>I want to use bash command line to match the file name &quot;<code>file 9.3.0.zip</code>&quot;.</p> <p>Here is the test script for explaining the folder structure:</p> <pre><code>mkdir -p /tmp/test touch &quot;/tmp/test/file 9.3.0.zip&quot; touch &quot;/...
<p>I think the issue is that the <code>*</code> in <code>file*!(-sources).zip</code> can match something that means the remainder of the filename is not <code>-sources.zip</code>.</p> <p>This seems to work, but I haven't tested it thoroughly:</p> <pre><code>file!(*-sources).zip </code></pre> <p>This also seems to work ...
How to exclude -sources pattern in bash with space in file name
bash|ubuntu
2
42
1
72,389,542
72,389,542
1
true
2022-05-26T08:27:23.783Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to exclude -sources pattern in bash with space in file name<p>I want to use bash command line to match the file name &quot;<code>file 9.3.0.zip</code>&qu...
72,329,746
How to relate size parameter of .scatter() with radius?<p>I want to draw some circles using `ax3.scatter(x1, y1, s=r1 , facecolors='none', edgecolors='r'), where:</p> <ul> <li>x1 and y1 are the coordinates of these circles</li> <li>r1 is the radius of these circles</li> </ul> <p>I thought typing <code>s = r1</code> I ...
<p>If you change the value of 'r' (now 5) to your desired radius, it works. This is adapted from the matplotlib.org website, &quot;Scatter Plots With a Legend&quot;. Should be scatter plots with attitude!</p> <pre><code>import numpy as np import matplotlib.pyplot as plt np.random.seed(19680801) fig, ax = plt.sub...
How to relate size parameter of .scatter() with radius?
python|scatter
0
42
1
72,333,497
72,333,497
1
true
2022-05-21T12:53:43.037Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to relate size parameter of .scatter() with radius?<p>I want to draw some circles using `ax3.scatter(x1, y1, s=r1 , facecolors='none', edgecolors='r'), ...
72,317,559
Python - file does not write all of the data<p>I have JSON data which I am pulling in via API.</p> <p>here's my code</p> <pre><code># list of each api url to use link =[] #for every id in the accounts , create a new url link into the link list for id in accounts: link.append('https://example.ie:0000/v123/accounts/'...
<p>Are you trying to write each data point to the file? Your write function is outside the nested for loop, so you are actually only writing the last <code>list</code> variable that you create to the file. You should move the f.write() under the for loop if you intend to write every single data point into the file.</p>...
Python - file does not write all of the data
python|json|txt
1
42
1
72,317,892
72,317,892
1
true
2022-05-20T10:42:05.690Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python - file does not write all of the data<p>I have JSON data which I am pulling in via API.</p> <p>here's my code</p> <pre><code># list of each api url to...
72,394,156
shiny DT::renderDT() multiple tables<p>I can't get renderDT() to display multiple data tables that my script creates. The code below. Reading the input table works, the progress indicator progresses through each line, but the hg38 and hg19 tabs are empty in the display. If I move the hg38 <code>renderDT()</code> inside...
<p>Please consider posting a <a href="https://stackoverflow.com/help/minimal-reproducible-example">MRE</a> in the future. If you access the data as <code>my_data()[[1]]</code> it should work. However, if you define a named list, your method works. Take a look at an MRE below.</p> <pre><code>library(DT) ui &lt;- fluidPa...
shiny DT::renderDT() multiple tables
shiny|dt
0
42
1
72,397,844
72,397,844
1
true
2022-05-26T15:19:09.140Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: shiny DT::renderDT() multiple tables<p>I can't get renderDT() to display multiple data tables that my script creates. The code below. Reading the input table...
72,349,762
How can I change setTimeout to send the request until a value is received?<p>In my app I've got functionality where user can import spreadsheet file. The file itself is sending to backend app and after some time it the result can be fetched from different endpoint based on ID. The thing is it can take a very long time ...
<p>Try sending several requests using setInterval until the file will be processed on backend and will return a non-null value. You can also use websockets but that will require updating backend API.</p> <pre><code>export default { name: 'BackboneSyncProducts', data() { return { styleCodes: [], fetc...
How can I change setTimeout to send the request until a value is received?
javascript|vue.js|axios
0
42
1
72,349,877
72,349,877
1
true
2022-05-23T13:53:37.883Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I change setTimeout to send the request until a value is received?<p>In my app I've got functionality where user can import spreadsheet file. The fil...
72,333,665
iFrame not showing inline HTML content<p>I have an iFrame on my site, and instead of using an <code>src</code> attribute, I want to show inline HTML within the iFrame. Is there any way I can do this? Example:</p> <pre><code>&lt;iframe&gt;&lt;p&gt;Hello World&lt;/p&gt;&lt;/iframe&gt; </code></pre> <p>Should show text sa...
<p>Use the <a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/srcdoc" rel="nofollow noreferrer"><code>srcdoc</code></a> attribute.</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-html lang-h...
iFrame not showing inline HTML content
html|iframe
1
42
1
72,333,707
72,333,707
1
true
2022-05-21T22:35:01.603Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: iFrame not showing inline HTML content<p>I have an iFrame on my site, and instead of using an <code>src</code> attribute, I want to show inline HTML within t...
72,247,826
Google sheet web app search data from sheet error<pre><code>I want to search data from google sheet and show it in form by web app. </code></pre> <p>PAN is unique and 5 digit number. When we enter PAN ,5 digit number to( PAN) input form and click update button then it should search data for PAN in sheet and if match ...
<p>From <code>But when we check it by Logger.log() , it show right data .</code> and your showing script, I thought that the reason of your issue might be due to that the values of <code>panList</code> are the number while <code>var pan=document.getElementById(&quot;userpan&quot;).value</code> is the string. In this ca...
Google sheet web app search data from sheet error
google-apps-script|google-sheets|search
1
42
1
72,248,156
72,248,156
1
true
2022-05-15T11:27:29.860Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Google sheet web app search data from sheet error<pre><code>I want to search data from google sheet and show it in form by web app. </code></pre> <p>PAN is...
72,385,183
Find the top matches comparing table columns<p>I have a database with up to 400 tables mixed from different sources. I need to group those tables in an excel file by column similarity (considering that tables have 0, 1, 2, or all columns with the same name). The challenge is as the example follows:</p> <pre><code>fac.t...
<p>You wanted to count the number of columns which the column name exists in another table ?</p> <pre><code>select sch_name, tbl_name, ncols = count(*), nmatches = sum(case when col_cnt &gt; 1 then 1 else 0 end), percentage = sum(case when col_cnt &gt; 1 then 1 else 0 end) * 100 / count(*)...
Find the top matches comparing table columns
sql|sql-server|intersect
0
42
1
72,385,832
72,385,832
1
true
2022-05-25T23:39:09.163Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Find the top matches comparing table columns<p>I have a database with up to 400 tables mixed from different sources. I need to group those tables in an excel...
72,380,744
Extracting rows and columns of a matrix if row names and column names have a partial match<p>I will give an example of my problem using a smaller matrix. Say I have a matrix with row names and column names such as this:</p> <pre><code>set.seed(10) a &lt;- matrix(rexp(200), ncol=9,nrow = 3) colnames(a) &lt;- paste(rep(...
<p>An easier option is to reshape to 'long' by converting to <code>data.frame</code> from <code>table</code>, and then <code>subset</code> the rows based on the values of 'Var1' and 'Var2'</p> <pre><code>out &lt;- subset(as.data.frame.table(a), Var1 == sub(&quot;\\d+&quot;, &quot;&quot;, Var2), select =c(Var2, Fre...
Extracting rows and columns of a matrix if row names and column names have a partial match
r|grepl
0
42
1
72,380,785
72,380,785
1
true
2022-05-25T15:50:40.833Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Extracting rows and columns of a matrix if row names and column names have a partial match<p>I will give an example of my problem using a smaller matrix. Say...
72,340,064
How to compare one value in a row to see if it is higher than 75% of all values in the same column?<p>I have a table that looks like this:</p> <pre><code>groups created_utc score count_comments d_posts ups downs ratio group1 2011-07-11T19:05:19Z 6988 3742 56 8530 1572 .42(85...
<p>To get result of <code>percent_rank()</code> you can use common table expression as below:</p> <pre><code>with cte as (SELECT *, ups / SUM(ups) OVER () AS ratio FROM table) select *,(case when percent_rank()over(order by ration) &gt;0.75 then 'yes' else 'no' end) greater_75p from cte </code></pre> <p>Please clarif...
How to compare one value in a row to see if it is higher than 75% of all values in the same column?
sql|google-bigquery|comparison
1
42
1
72,340,157
72,340,157
1
true
2022-05-22T17:58:02.103Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to compare one value in a row to see if it is higher than 75% of all values in the same column?<p>I have a table that looks like this:</p> <pre><code>gro...
72,287,481
Macro expansion for copy and pasting won't work<p>I've been trying to expand this macro which works for the first 3 sheets to a total of 6 sheets, but no matter what I try the macro seems to fail. Is there a problem with the way I'm doing it ?</p> <p>Here's the original macro</p> <pre><code>Public Sub copyData() Dim a...
<pre><code>Sub CopyData() Const SourceFolderPath As String = &quot;C:\Users\bob\Downloads\&quot; Const SourceRangeAddress As String = &quot;A1:M150&quot; 'Target sheetname | Source filename Dim ArrConfig(0 To 1, 0 To 5) As String ArrConfig(0, 0) = &quot;10k I&quot;: ArrConfig(1, 0) = &quot;1.x...
Macro expansion for copy and pasting won't work
excel|vba
2
42
2
72,289,235
72,289,235
1
true
2022-05-18T10:30:49.873Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Macro expansion for copy and pasting won't work<p>I've been trying to expand this macro which works for the first 3 sheets to a total of 6 sheets, but no mat...
72,385,476
Column in iif function invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause<p>Trying to use an unincluded field in an IIF function and get the error that the field is not part of the GROUP BY CLAUSE.</p> <pre><code>SELECT IIF(T1.a = 0, 'none', T1.type) AS type, C...
<p>You need to have same GROUP BY expression in the select clause. You can have code as given below:</p> <pre class="lang-sql prettyprint-override"><code>SELECT IIF(T1.a = 0, 'none', T1.type) AS type, COUNT(*) AS mycnt FROM T1 GROUP BY IIF(T1.a = 0, 'none', T1.type) </code></pre>
Column in iif function invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause
sql|sql-server|group-by
0
42
2
72,386,736
72,386,736
1
true
2022-05-26T00:34:35.493Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Column in iif function invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause<p>Trying to use an uninc...
72,272,936
How to check if there are two (or more) forward slashes in a string of an Array item with Javascript<p>I have below response from a graphql query:</p> <pre class="lang-js prettyprint-override"><code>&quot;menu&quot;: [{ &quot;url&quot;: &quot;&quot; }, { &quot;url&quot;: &quot;/&quot; }, { &quot;url...
<p>The <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map" rel="nofollow noreferrer"><code>.map()</code></a> method returns an array, as you're after a boolean, you need to use something different. The <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
How to check if there are two (or more) forward slashes in a string of an Array item with Javascript
javascript|arrays
0
42
3
72,273,048
72,273,048
1
true
2022-05-17T11:05:45.617Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to check if there are two (or more) forward slashes in a string of an Array item with Javascript<p>I have below response from a graphql query:</p> <pre c...
72,314,193
NodeJS and MongoDB - use aggregate and $lookup together with findById<p>I want to make a relation between two collections - a book and author collections. If i use only get and display all of my books and integrate the data about author by id it works.</p> <p>Author schema:</p> <pre><code> const AuthorSchema = new mong...
<p>use the $match to find only one book for the same query</p> <pre><code>const mongoose = require('mongoose'); const ObjectId = mongoose.Types.ObjectId(); router.get(&quot;/:bookId&quot;, async (req, res) =&gt; { try { let book= await Book.aggregate([ { $match: ...
NodeJS and MongoDB - use aggregate and $lookup together with findById
node.js|mongodb|express|mongoose
0
42
1
72,314,375
72,314,375
1
true
2022-05-20T06:00:24.317Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: NodeJS and MongoDB - use aggregate and $lookup together with findById<p>I want to make a relation between two collections - a book and author collections. If...
72,271,914
PDO MySQL external connection stale after being inactive for specific amount of seconds<p>Software versions:</p> <pre><code>PHP 8.1.5 (cli) mysql Ver 8.0.29-0ubuntu0.20.04.3 for Linux on x86_64 ((Ubuntu)) </code></pre> <p>After migrating our database to the new server and new software I noticed strange behaviour which...
<p>This ended up being on the Azure side. Since both servers were hosted there, I found that Azure Firewall considers TCP connection dead and drops it after 4 minutes of inactivity as stated here <a href="https://docs.microsoft.com/en-us/azure/firewall/firewall-faq#what-is-the-tcp-idle-timeout-for-azure-firewall" rel="...
PDO MySQL external connection stale after being inactive for specific amount of seconds
php|mysql|pdo|connection|backend
2
42
1
72,273,890
72,273,890
1
true
2022-05-17T09:58:39.237Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PDO MySQL external connection stale after being inactive for specific amount of seconds<p>Software versions:</p> <pre><code>PHP 8.1.5 (cli) mysql Ver 8.0.29...
72,330,597
How to execute a specific method from my java program on cmd?<p>I have a java program define like this :</p> <pre><code>public class MyClass{ public String getPathBetween(String path,String folderName,String extension){..} public static void main(String[] args) throws Exception{...} } </code></pre> <p>After c...
<pre><code>//You can create an instance of MyClass in your main() method // and then call getPathBetween(): public class MyClass{ public String getPathBetween(String path, String folderName, String extension){..} public static void main(String[] args) throws Exception{ MyClass myClassInstance = new MyCl...
How to execute a specific method from my java program on cmd?
java|cmd
1
42
3
72,330,694
72,330,694
1
true
2022-05-21T14:47:35.927Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to execute a specific method from my java program on cmd?<p>I have a java program define like this :</p> <pre><code>public class MyClass{ public S...