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,199,826
What will be Time Complexity if we use include function inside the some function of array<p>As we know that Array.prototype.some() and Array.prototype.includes() has time complexity of o(n). Now I want to know that what if I will use include inside some method. The time complexity will be linear or quadratic?</p> <pre>...
<p>It's <em>O(mn)</em>, where <em>m</em> is <code>arr1.length</code> and <em>n</em> is <code>arr2.length</code>.</p>
What will be Time Complexity if we use include function inside the some function of array
javascript|arrays|algorithm
0
79
3
72,200,458
72,200,458
2
true
2022-05-11T10:58:59.783Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What will be Time Complexity if we use include function inside the some function of array<p>As we know that Array.prototype.some() and Array.prototype.includ...
72,200,099
A single global variable that is always a random number each time it's referenced<p>I'd like to use one global variable that is random every time it's used. My current method creates a random number once and that number stays the same. I don't need the number to be unique, just always random.</p> <pre><code>var randomN...
<p>You can define a getter on the global object:</p> <pre class="lang-js prettyprint-override"><code>Object.defineProperty(globalThis, 'randomNumber', { get: () =&gt; Math.floor(Math.random() * 100) }) console.log(randomNumber) console.log(randomNumber) console.log(randomNumber) </code></pre> <p>...but I find this o...
A single global variable that is always a random number each time it's referenced
javascript|jquery|random|global-variables
0
89
1
72,200,725
72,200,725
2
true
2022-05-11T11:18:06.297Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: A single global variable that is always a random number each time it's referenced<p>I'd like to use one global variable that is random every time it's used. ...
72,200,630
How to get details from two models in django<p>I am trying to build an api endpoint that performs a GET request, path -&gt; {url}/api/v1/users/:id</p> <p>I have three models</p> <pre><code>class PvSystem(models.Model): modelNo = models.CharField(max_length=10, blank=False, default='') modelName = models.CharField...
<p>You can try it in this way:</p> <pre><code>user = User.objects.get(dsoId=id)#I am assuming dsoId as primary key enrgydata = EnergyData.objects.get(dsoId=user.dsoId) </code></pre> <p>If the relation between <code>Users</code> and <code>EnergyData</code> is One-to-One, then you can directly use <code>id</code> from u...
How to get details from two models in django
python|django|django-models|django-rest-framework
0
62
2
72,200,810
72,200,810
2
true
2022-05-11T11:56:15.093Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get details from two models in django<p>I am trying to build an api endpoint that performs a GET request, path -&gt; {url}/api/v1/users/:id</p> <p>I h...
72,200,467
Property 'ExclusiveStartKey' does not exist on type '{ TableName: any; }'<p>I am trying to scan a DynamoDB table which may be more than 1 MB, so I'm using <code>ExclusiveStartKey</code>. I've been going through all the examples in <a href="https://stackoverflow.com/questions/44589967/how-to-fetch-scan-all-items-from-aw...
<p>Hint the shape of <code>params</code> to Typescript:</p> <pre class="lang-js prettyprint-override"><code>const params = { TableName: tableName, ExclusiveStartKey: undefined, // &lt;-- add this }; </code></pre> <p>Or, if you want to get really fancy, import and use the library's defined type. If you are using the...
Property 'ExclusiveStartKey' does not exist on type '{ TableName: any; }'
node.js|typescript|amazon-dynamodb|dynamodb-queries
0
208
1
72,200,811
72,200,811
2
true
2022-05-11T11:43:54.387Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Property 'ExclusiveStartKey' does not exist on type '{ TableName: any; }'<p>I am trying to scan a DynamoDB table which may be more than 1 MB, so I'm using <c...
72,200,537
Haskell lambda function - parse error on input ‘)’<p>I have the following code in Haskell and I want to change the line</p> <pre><code>toNanoStmt (VarDeclStmt _ array)= SeqList (toNanoStmt (map (\(VarDecl _ (Id a x) (Just exp))) array )) </code></pre> <p>Basically I want to use VarDeclStmt by creating a sequence of ass...
<p>Your lambda-expression has no body.</p> <p>After parameters, there has to come a right arrow <code>-&gt;</code> followed by the body, for example:</p> <pre><code>addTwo = (\x -&gt; x + 2) </code></pre> <p>So in your case you need to do something like this:</p> <pre><code>toNanoStmt (VarDeclStmt _ array)= SeqList (to...
Haskell lambda function - parse error on input ‘)’
haskell
0
77
1
72,200,925
72,200,925
2
true
2022-05-11T11:49:35.673Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Haskell lambda function - parse error on input ‘)’<p>I have the following code in Haskell and I want to change the line</p> <pre><code>toNanoStmt (VarDeclStm...
72,199,114
Any downside of having SortKey for GSI in dynamoDB<p>I want to create a DynamoDB table with a GSI. For this GSI, currently I need only PartitionKey because I want to query by only one attribute. But in future I may need to query by other attributes. So, I am thinking of adding a SortKey just in case if I need to query ...
<p>The (probably very) minor downsides of this approach are:</p> <ol> <li>marginally higher storage costs and</li> <li>added developer overhead of having to provide the (currently meaningless) index SK as part of the primary Key in CRUD operations.</li> </ol>
Any downside of having SortKey for GSI in dynamoDB
amazon-web-services|amazon-dynamodb|amazon-cloudformation|amazon-dynamodb-index
0
39
1
72,201,087
72,201,087
2
true
2022-05-11T10:04:12.507Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Any downside of having SortKey for GSI in dynamoDB<p>I want to create a DynamoDB table with a GSI. For this GSI, currently I need only PartitionKey because I...
72,200,827
Compare whether incident is new or already exists<p>There is an algorithm that identifies issues/incidents in a network. After that it writes all the cases into a DB. Lets say it looks like (simplified):</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th style="text-align: left;">ID</th> <th s...
<p>How about this:</p> <pre><code>df[order(Date), d:=c(1,diff(Date)), by = ID][ order(d,ID),case:=rleid(ID,d)][ ,d:=NULL] </code></pre> <p>Output:</p> <pre><code> ID Date case 1: A1 2022-01-01 1 2: B1 2022-01-01 2 3: C1 2022-01-01 3 4: A1 2022-01-02 1 5: C1 2022-01-02 3 6: A1 2022-01-03 ...
Compare whether incident is new or already exists
r|dplyr|data.table
0
47
1
72,201,138
72,201,138
2
true
2022-05-11T12:09:42.467Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Compare whether incident is new or already exists<p>There is an algorithm that identifies issues/incidents in a network. After that it writes all the cases i...
72,201,286
Why am I able to access a variable that was defined in a try-except in Python from outside the try-catch?<p>Here is an example of some Python code:</p> <pre><code>try: x = l[4] except Exception as e: x = 7 print(x) </code></pre> <p>I am wondering, what is the reason that I have access to <code>x</code>? I ...
<p>It is a scoping thing, or rather, the <em>lack</em> of a scope. Python does not have block scopes; the only thing that defines a new scope in Python is a function definition. (Comprehensions do, too, but that's because they are implemented using anonymous functions.)</p> <p>There is no &quot;local&quot; <code>x</cod...
Why am I able to access a variable that was defined in a try-except in Python from outside the try-catch?
python|python-3.x
0
27
1
72,201,333
72,201,333
2
true
2022-05-11T12:43:28.373Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why am I able to access a variable that was defined in a try-except in Python from outside the try-catch?<p>Here is an example of some Python code:</p> <pre>...
72,200,791
`.background` goes wrong in `.background()` modifier in SwiftUI<p>I'm trying to create a <code>ButtonStyle</code>. I want to let the background color be <code>buttonBackgroundHover</code> color which is already created in <code>Assets.xcassets</code>, and other time remains the default background color (same as the bac...
<p>The <code>background</code> method is declared like this:</p> <pre><code>func background&lt;S&gt;(_ style: S, ignoresSafeAreaEdges edges: Edge.Set = .all) -&gt; some View where S : ShapeStyle </code></pre> <p>Notice that the argument it takes is of type <code>S</code> where <code>S : ShapeStyle</code>. When you do <...
`.background` goes wrong in `.background()` modifier in SwiftUI
swift|swiftui
0
130
2
72,201,530
72,201,530
2
true
2022-05-11T12:07:03.630Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: `.background` goes wrong in `.background()` modifier in SwiftUI<p>I'm trying to create a <code>ButtonStyle</code>. I want to let the background color be <cod...
72,201,397
Get Sheet By Name with an OR statement<p>I currently have a script that looks into multiple spreadsheets and pulls in data from a sheet contained within depending on user input.</p> <p>Unfortunately there are times when users add new sheets in and do not follow the correct format for example each sheet should have four...
<p>You can get the full list of sheets using <a href="https://developers.google.com/apps-script/reference/spreadsheet/spreadsheet#getsheets" rel="nofollow noreferrer"><code>getSheets()</code></a>, then use the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find" rel="nof...
Get Sheet By Name with an OR statement
google-apps-script|google-sheets|google-sheets-api
0
41
1
72,201,535
72,201,535
2
true
2022-05-11T12:51:47.340Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get Sheet By Name with an OR statement<p>I currently have a script that looks into multiple spreadsheets and pulls in data from a sheet contained within depe...
72,201,598
Syntax error in query expression, SQL via PYODBC<p>The exact error message is:</p> <blockquote> <p>ProgrammingError: ('42000', &quot;[42000] [Microsoft][ODBC Microsoft Access Driver] Syntax error (comma) in query expression 'occupied = False, electric = False, family = False, disabled = False'. (-3100) (SQLExecDirectW)...
<p>Try this :</p> <pre><code>spacelist = cursor.execute(&quot;SELECT space, distance1, distance2, distance3, distance4, distance5 FROM spaces WHERE occupied = False AND electric = True&quot;) </code></pre>
Syntax error in query expression, SQL via PYODBC
python|sql|ms-access|pyodbc
0
66
1
72,201,838
72,201,838
2
true
2022-05-11T13:05:52.457Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Syntax error in query expression, SQL via PYODBC<p>The exact error message is:</p> <blockquote> <p>ProgrammingError: ('42000', &quot;[42000] [Microsoft][ODBC...
72,201,516
How can I fetch CouchDB server version via PouchDB<p>All I want to get is this object:</p> <pre class="lang-json prettyprint-override"><code>{ &quot;couchdb&quot;: &quot;Welcome&quot;, &quot;version&quot;: &quot;3.1.1&quot;, &quot;git_sha&quot;: &quot;ce596c65d&quot;, &quot;uuid&quot;: &quot;ff0e85a5e76efdf116e...
<p>After a digging a bit into the source code, I have found the solution.</p> <pre class="lang-js prettyprint-override"><code>infoDb .fetch('/') .then((res) =&gt; { return res.json(); }) .then((res) =&gt; { console.log('FETCH', res); }); </code></pre> <p>Result:</p> <pre cl...
How can I fetch CouchDB server version via PouchDB
couchdb|pouchdb
0
41
1
72,202,679
72,202,679
2
true
2022-05-11T13:00:13.347Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I fetch CouchDB server version via PouchDB<p>All I want to get is this object:</p> <pre class="lang-json prettyprint-override"><code>{ &quot;couchd...
72,202,300
why does this vuelidate function not work within setup, but only outside, within methods?<p>I'm using vuelidate with the composition API and I don't understand why the <code>v$.validate()</code> works correctly when I put within <code>methods</code>, after <code>setup</code>, but not within <code>setup</code>.</p> <p>S...
<p><a href="https://vuelidate-next.netlify.app/advanced_usage.html#composition-api" rel="nofollow noreferrer">Composition API</a></p> <blockquote> <p><code>useVuelidate</code> returns a <code>computed</code>, so you need to use <code>.value</code> when accessing any of it's properties, like <code>$error</code>, <code>$...
why does this vuelidate function not work within setup, but only outside, within methods?
vuejs3|vue-composition-api|vuelidate
0
417
1
72,202,814
72,202,814
2
true
2022-05-11T13:52:43.940Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: why does this vuelidate function not work within setup, but only outside, within methods?<p>I'm using vuelidate with the composition API and I don't understa...
72,183,704
To add a startup script when deploying a windows instance in GCP<p>I'm deploying a Windows Instance in GCP with couple of startup scripts using the metadata option in the gcp_compute_instance module, as the instance is getting created as expected but the startup scripts are not getting executing, kindly refer the below...
<p><a href="https://cloud.google.com/compute/docs/instances/startup-scripts/windows#metadata-keys" rel="nofollow noreferrer">The fine manual</a> says the key should be, in your case, <code>windows-startup-script-ps1:</code> since that script is powershell</p>
To add a startup script when deploying a windows instance in GCP
windows|google-cloud-platform|ansible|startupscript
0
79
1
72,202,963
72,202,963
2
true
2022-05-10T09:19:04.117Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: To add a startup script when deploying a windows instance in GCP<p>I'm deploying a Windows Instance in GCP with couple of startup scripts using the metadata ...
72,202,832
Standard Bluetooth SIG Characteristic decoding<p>I am looking for documentation or examples on the data structure of the defined/default Bluetooth characteristics (<a href="https://btprodspecificationrefs.blob.core.windows.net/assigned-values/16-bit%20UUID%20Numbers%20Document.pdf" rel="nofollow noreferrer">https://btp...
<p>There is official documentation on this called <a href="https://www.bluetooth.com/specifications/specs/gatt-specification-supplement-6/" rel="nofollow noreferrer">GATT Specification Supplement 6</a></p>
Standard Bluetooth SIG Characteristic decoding
bluetooth|bluetooth-lowenergy
0
19
1
72,203,131
72,203,131
2
true
2022-05-11T14:28:03.493Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Standard Bluetooth SIG Characteristic decoding<p>I am looking for documentation or examples on the data structure of the defined/default Bluetooth characteri...
72,203,226
How can I make my Javascript .map functions more efficient?<p>I'm currently returning a large set of data from AWS OpenSearch into an array called <code>eventList</code>. Each event within the array has the following structure:</p> <pre><code>{ _source: { &quot;key&quot;: value &quot;key&quot;: value &quo...
<p>As you say in the question, you can combine those two <code>map</code> calls:</p> <pre><code>eventList = eventList.map(({_source}) =&gt; ( ..._source, tags: _source.tags?.split(&quot;,&quot;) ?? [], )); </code></pre> <p>I've used destructuring in the parameter list, but you don't <em>have</em> to do that if ...
How can I make my Javascript .map functions more efficient?
javascript|opensearch
0
24
1
72,203,301
72,203,301
2
true
2022-05-11T14:55:48.787Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I make my Javascript .map functions more efficient?<p>I'm currently returning a large set of data from AWS OpenSearch into an array called <code>even...
72,203,280
I'm getting a weird error in my python script<pre><code>Traceback (most recent call last): File &quot;main.py&quot;, line 17, in &lt;module&gt; max_height = max(botmoves) TypeError: '&gt;' not supported between instances of 'tuple' and 'int' </code></pre> <p>This is the error I'm trying to find the biggest value ...
<p>The <code>max</code> function needs to be able to compare values to each other, and it does that with the <code>&gt;</code> operator. What the error is telling you is that there are different types of elements in the list, which cannot sensibly be compared to each other. In this case, an <code>int</code> and a <a hr...
I'm getting a weird error in my python script
python
0
30
1
72,203,329
72,203,329
2
true
2022-05-11T14:58:32.820Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I'm getting a weird error in my python script<pre><code>Traceback (most recent call last): File &quot;main.py&quot;, line 17, in &lt;module&gt; max_hei...
72,203,201
Send email via mail command in python script<p>I'm trying to send text with multiple lines:</p> <pre><code>text = &quot;This is a line 1 This is a line 2 This is a line 3&quot; </code></pre> <p>in a python script with:</p> <pre><code>cmd = &quot;echo {} | mail -s 'Test email' name@server.com&quot;.format(text) os.syste...
<p>The immediate problem is that strings in the shell need to be quoted if they contain newlines or etc. See <a href="https://stackoverflow.com/questions/10067266/when-to-wrap-quotes-around-a-shell-variable">When to wrap quotes around a shell variable</a>.</p> <p>But more fundamentally, you really don't want to use <co...
Send email via mail command in python script
python|email|terminal
0
282
1
72,203,364
72,203,364
2
true
2022-05-11T14:54:21.347Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Send email via mail command in python script<p>I'm trying to send text with multiple lines:</p> <pre><code>text = &quot;This is a line 1 This is a line 2 Thi...
72,202,818
Entire row and column turning zero for a zero element in matrix<p>I tried to do the code by following method in colab, but its not working for some unknown reason.</p> <pre><code> def convertMatrix(matrix): matrixc=matrix for i in range(len(matrix)): for j in range(len(matrix[0])): if(m...
<p>Once you find your first. &quot;0&quot; you do not stop scanning the matrix for more zeros with i, j: the elements set to &quot;0&quot; on the first match will cause extra &quot;0 crosses&quot; to be added.</p> <p>If you want to act just on the first &quot;0&quot; found, just stop the scanning once you find it. Othe...
Entire row and column turning zero for a zero element in matrix
python
0
94
1
72,203,366
72,203,366
2
true
2022-05-11T14:26:40.853Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Entire row and column turning zero for a zero element in matrix<p>I tried to do the code by following method in colab, but its not working for some unknown r...
72,203,061
Comparing Two Lists, Updating if Different<p>I have a program written in JavaScript that runs CRUD operations depending if the items in one lists are different from the other. Basically comparing two lists, main list and mirror list. The constraints are:</p> <ul> <li><p>If an object is in the main list, but not the mir...
<p>From your codes it looks like you are comparing keys of objects, not just arbitrary arrays. Therefore you would want <code>mirrorItems</code> to have the same keys as <code>mainItems</code> but not the same values (otherwise that would just be a copy).</p> <p>Using a <a href="https://developer.mozilla.org/en-US/docs...
Comparing Two Lists, Updating if Different
javascript|array-algorithms
0
58
1
72,203,547
72,203,547
2
true
2022-05-11T14:43:33.023Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Comparing Two Lists, Updating if Different<p>I have a program written in JavaScript that runs CRUD operations depending if the items in one lists are differe...
72,204,412
EOF error when using sql query in Snowflake<p>I am getting an error here on this Snowflake query and am not sure what is incorrect. Not quite sure why I would have an issue, so was hoping for some help.</p> <p>Any ideas?</p> <pre><code> SELECT EXTRACT (YEAR FROM t1.DOC_POST_DT) AS sap_post_year, t1.FISCL...
<p>You're missing a closing parenthesis on your to_number. Should be</p> <pre><code>(t1.FISCL_YR_MO_NBR BETWEEN 2021001 AND to_number(to_char(current_date, 'YYYYMMDD'))) </code></pre>
EOF error when using sql query in Snowflake
sql|snowflake-cloud-data-platform
0
493
1
72,204,522
72,204,522
2
true
2022-05-11T16:18:20.877Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: EOF error when using sql query in Snowflake<p>I am getting an error here on this Snowflake query and am not sure what is incorrect. Not quite sure why I wou...
72,201,442
Count showing (visible) rows of a QTreeView<p>I found <a href="https://stackoverflow.com/q/41634176/595305">this question</a> and <a href="https://stackoverflow.com/q/15817429/595305">this question</a>.</p> <p>I've also searched elsewhere.</p> <p>The situation is that (starting with all root item children collapsed) my...
<p>QTreeView provides the <a href="https://doc.qt.io/qt-5/qtreeview.html#indexAbove" rel="nofollow noreferrer"><code>indexAbove()</code></a> and <a href="https://doc.qt.io/qt-5/qtreeview.html#indexBelow" rel="nofollow noreferrer"><code>indexBelow()</code></a> functions, and the latter:</p> <blockquote> <p>Returns the m...
Count showing (visible) rows of a QTreeView
pyqt5|qt5|qtreeview
0
78
1
72,204,712
72,204,712
2
true
2022-05-11T12:55:03.393Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Count showing (visible) rows of a QTreeView<p>I found <a href="https://stackoverflow.com/q/41634176/595305">this question</a> and <a href="https://stackoverf...
72,203,954
How to change color buttons of navigation<p><a href="https://i.stack.imgur.com/Ukd1X.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ukd1X.jpg" alt="enter image description here" /></a></p> <p>all the words I wrote in the picture i need change color buttons of navigation warning color buttons not an...
<p>From API 27 you can use this code:</p> <pre><code>&lt;item name=&quot;android:navigationBarColor&quot;&gt;@android:color/white&lt;/item&gt; &lt;item name=&quot;android:windowLightNavigationBar&quot;&gt;true&lt;/item&gt; </code></pre> <p>in the first line, you set the navigation bar background color and in second-lin...
How to change color buttons of navigation
java|android|xml
0
56
2
72,205,209
72,205,209
2
true
2022-05-11T15:44:08.773Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to change color buttons of navigation<p><a href="https://i.stack.imgur.com/Ukd1X.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ukd1X...
72,204,957
Changing a macro in C (or C++)<p>In other words, how can I redefine a macro based on it's previous definition? Specifically, I want to add a string to the end of a string macro in C++. This is what I've tried so far:</p> <pre><code>#define FOO &quot;bla&quot; // code here will read FOO as &quot;bla&quot; #define FOO FO...
<p>This is not possible.</p> <p>From the <a href="https://gcc.gnu.org/onlinedocs/cpp/Undefining-and-Redefining-Macros.html#Undefining-and-Redefining-Macros" rel="nofollow noreferrer">gcc documentation</a> (emphasis is mine):</p> <blockquote> <p>However, if an identifier which is currently a macro is redefined, then <st...
Changing a macro in C (or C++)
c++|c|macros
0
107
1
72,205,281
72,205,281
2
true
2022-05-11T17:02:00.803Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Changing a macro in C (or C++)<p>In other words, how can I redefine a macro based on it's previous definition? Specifically, I want to add a string to the en...
72,205,730
Creating a dummy variable based on whether words appear in multiple columns<p>I'm working with a large <code>df</code> on cross-national time-series protest patterns. I would like to create a dummy variable based on whether one or a select group of words appears in any of those columns. I have included data below. Here...
<h2>base R</h2> <pre class="lang-r prettyprint-override"><code>found &lt;- sapply(dat[c(&quot;protesterdemand1&quot;, &quot;protesterdemand2&quot;, &quot;protesterdemand3&quot;, &quot;protesterdemand1&quot;)], grepl, pattern = &quot;political behavior|police brutality|removal of politician&quot;, ignore...
Creating a dummy variable based on whether words appear in multiple columns
r|if-statement|dummy-variable
0
16
1
72,205,795
72,205,795
2
true
2022-05-11T18:10:16.453Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Creating a dummy variable based on whether words appear in multiple columns<p>I'm working with a large <code>df</code> on cross-national time-series protest ...
72,205,304
Instruct Kafka Consumer App To Start Reading From Offset<p>If I have an application AppA that contains a Kafka consumer class, is it possible to instruct this consumer's behaviour pragmatically? For example, I may want to tell AppA over a rest API (or even via another topic) to wake up and begin consuming and processin...
<p>The Kafka consumer is able to consume topics at arbitrary positions.</p> <p>You can use the <a href="https://kafka.apache.org/31/javadoc/org/apache/kafka/clients/consumer/KafkaConsumer.html#seek(org.apache.kafka.common.TopicPartition,long)" rel="nofollow noreferrer"><code>seek()</code></a> method to start consuming ...
Instruct Kafka Consumer App To Start Reading From Offset
apache-kafka|kafka-consumer-api
0
108
1
72,205,822
72,205,822
2
true
2022-05-11T17:33:51.193Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Instruct Kafka Consumer App To Start Reading From Offset<p>If I have an application AppA that contains a Kafka consumer class, is it possible to instruct thi...
72,206,063
Pandas : Executing a function based on the values from two dataframes<p>I have two dataframes as shown below:</p> <pre><code>df1 = A B C D timestamp 2022-04-08 10:07:00 40 50 NaN 50 2022-04-08 10:07:01 70 80 80 10 ...
<p>Here is one approach:</p> <pre><code>for c in ('C', 'D'): P2 = tuple(df2.loc[c]) df1[f'ans_{c}'] = [func(P1, P2) for P1 in zip(df1['A'], df1['B'])] </code></pre>
Pandas : Executing a function based on the values from two dataframes
python|pandas|dataframe
0
41
2
72,206,222
72,206,222
2
true
2022-05-11T18:37:37.787Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pandas : Executing a function based on the values from two dataframes<p>I have two dataframes as shown below:</p> <pre><code>df1 = ...
72,188,957
Npgsql EF 6: inserting a UTC date time value fails although the underlying column has a timestampTz type<p>I recently updated my app to: Vs 2019, EntityFramework.6.4.4, EntityFramework6.Npgsql.6.4.3 and Npgsql.6.0.4</p> <p>Before, everything was working well. After the update, I tested different use cases on inserting ...
<p>You're using the old (non-core) EF6, which most probably would have to be adjusted as well in order to account for the new timestamp behavior (the EF Core provider definitely did). That's unfortunately not going to happen, since EF6 isn't being developed any more.</p> <p>I would in general recommend against running ...
Npgsql EF 6: inserting a UTC date time value fails although the underlying column has a timestampTz type
postgresql|entity-framework|datetime|npgsql
0
264
1
72,206,325
72,206,325
2
true
2022-05-10T15:17:43.130Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Npgsql EF 6: inserting a UTC date time value fails although the underlying column has a timestampTz type<p>I recently updated my app to: Vs 2019, EntityFrame...
72,197,627
How to run EventListener in background in a Spring/Kotlin Coroutines project<p>Currently I am using Spring 2.6.7 + WebFlux/Kotlin Coroutines stack in a project.</p> <p>In a Java project, it is easy to run the EventListener in an async thread like this.</p> <pre><code>@Component class MyEventListener{ @EventListe...
<p>One way I can think is to use application specific coroutine context in your application configuration.</p> <pre><code>@Configuration class ApplicationConfiguration { private val applicationCoroutineScope = CoroutineScope(SupervisorJob() + Dispatchers.IO) @Bean fun applicationScope(): CoroutineScope = ...
How to run EventListener in background in a Spring/Kotlin Coroutines project
kotlin|spring-webflux|kotlin-coroutines
0
323
1
72,206,455
72,206,455
2
true
2022-05-11T08:15:39.087Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to run EventListener in background in a Spring/Kotlin Coroutines project<p>Currently I am using Spring 2.6.7 + WebFlux/Kotlin Coroutines stack in a proje...
72,206,187
seaborn histplot - print y-values above each bar<p>How to print y-values above each bar, please? Thank you</p> <pre><code>import matplotlib.pyplot as plt import seaborn as sns data = [6, 3, 1, 5, 2, 7, 3, 1, 9, 2, 1, 4, 2, 6, 3, 9, 4, 1, 7, 3, 1, 9, 2, 1, 4, 2, 1, 3, 1, 4, 2, 7, 3, 1, 5, 2, 7, 3, 1, 5, 1, 8, 4, 1, 6, ...
<p>If you have matplotlib 3.4.0 or higher, you can use <code>bar_label</code>. More info <a href="https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.bar_label.html" rel="nofollow noreferrer">here</a></p> <p>Code would be something like this...</p> <pre><code>ax = sns.histplot(data, discrete=True, kde=False,...
seaborn histplot - print y-values above each bar
python-3.x|seaborn
0
247
1
72,206,477
72,206,477
2
true
2022-05-11T18:49:44.867Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: seaborn histplot - print y-values above each bar<p>How to print y-values above each bar, please? Thank you</p> <pre><code>import matplotlib.pyplot as plt imp...
72,202,944
Spark csv file size 2x bigger than with pandas<p>As I save data to a single csv file with pyspark I get a 2x bigger file size than if it was after transforming it with <code>.toPandas()</code> and then saving it using <code>to_csv()</code>.</p> <p>Any thoughts on what can cause that big discrepancy?</p>
<p>There are a couple of things that can take an effect on size difference.</p> <ol> <li><strong>emptyValue</strong>: By default, Spark's <code>df.write.csv</code> will save the null value with wrapping double quote. This increases 2 chars per a single null value for Spark's <code>write</code>. To disable the double q...
Spark csv file size 2x bigger than with pandas
pandas|csv|apache-spark|pyspark
0
130
1
72,206,721
72,206,721
2
true
2022-05-11T14:35:37.957Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Spark csv file size 2x bigger than with pandas<p>As I save data to a single csv file with pyspark I get a 2x bigger file size than if it was after transformi...
72,205,539
Change axis title text color in ggradar<p>I want the tiles around the radar chart (eg <code>mpg</code>, <code>cyl</code>, <code>disp</code>, etc) to be a different color. Is there a way to do this in ggradar? I have tried to do this with the <code>theme()</code> argument but doesn't seem to be working. There is an argu...
<p>After a look at the docs and the source code of <code>ggradar()</code> I'm afraid there is no option to set the &quot;axis&quot; text color. Actually the axis text is added via multiple <code>geom_text</code> layers which is the reason why <code>theme</code> options will not work.</p> <p>One option would be to mani...
Change axis title text color in ggradar
r|ggplot2|ggradar
0
93
2
72,206,740
72,206,740
2
true
2022-05-11T17:53:41.740Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Change axis title text color in ggradar<p>I want the tiles around the radar chart (eg <code>mpg</code>, <code>cyl</code>, <code>disp</code>, etc) to be a dif...
72,204,552
How to download and extract a tar file with Python<p>Apologies for a really basic question, but I'm at my wits' end here. I cannot figure out how to download and extract an <code>.xz</code> tar file with Python. See the sample code below where I try multiple approaches both for downloading and for extracting, from two ...
<p>These files are .xz files and <strong>not</strong> tar.xz files. So <a href="https://docs.python.org/3/library/tarfile.html" rel="nofollow noreferrer">Tarfile</a> module won't work. Instead, use <a href="https://docs.python.org/3/library/lzma.html" rel="nofollow noreferrer">lzma</a>:</p> <pre><code>import lzma with ...
How to download and extract a tar file with Python
python|tar
0
394
1
72,206,813
72,206,813
2
true
2022-05-11T16:29:04.233Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to download and extract a tar file with Python<p>Apologies for a really basic question, but I'm at my wits' end here. I cannot figure out how to download...
72,206,920
Sorting an array with a compare function - javascript<p>I came across this sorting of an array and I do not understand the compare function at the point where '-1 : 1' is included. Please can some one explain to me what the compare function is doing exactly?</p> <p><div class="snippet" data-lang="js" data-hide="false"...
<p>The comparison function returns <code>-1</code> if the first argument <code>a</code> as lower than <code>b</code> if its status is <code>pending</code>. This indicates that <code>a</code> is lower than <code>b</code>, so it should be sorted ahead. The intended result is that all the <code>pending</code> elements wil...
Sorting an array with a compare function - javascript
javascript
0
45
3
72,207,002
72,207,002
2
true
2022-05-11T19:54:20.307Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sorting an array with a compare function - javascript<p>I came across this sorting of an array and I do not understand the compare function at the point wher...
72,207,239
Cannot deserialize value of type java.time.LocalDate from String<p>I have input json payload like below. My Entity Class ImportTrans eventTime type currently is LocalDate . How i can format it to accept the json input format.</p> <pre><code>{ &quot;eventId&quot;:&quot;ep9_0579af51-4b5c&quot;, &quot;eventTime&quot;:&qu...
<p>Based on your spring-boot version, if its &gt;=2.2 , then below might work straight-away</p> <pre><code>import com.fasterxml.jackson.annotation.JsonFormat; .. @JsonFormat(pattern = &quot;dd/MM/yyyy HH:mm:ss&quot;) private LocalDate eventTime; </code></pre>
Cannot deserialize value of type java.time.LocalDate from String
json|spring|spring-boot|java-time
0
1,199
1
72,207,571
72,207,571
2
true
2022-05-11T20:25:47.270Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cannot deserialize value of type java.time.LocalDate from String<p>I have input json payload like below. My Entity Class ImportTrans eventTime type currentl...
72,207,787
Hangman with dashes in Python - can't figure out why the code is not working<p>I started to learn Python. I use Thonny and the Python version is 3.7.9</p> <p>This Hangman code choses random word from the list successfully and it shows dashes instead of letters. However, when I guess a letter, dash doesn't get replaced ...
<p>You are only storing upper letters in <code>used_letters</code>. So you should do:</p> <pre><code>word_list = [letter if letter.upper() in used_letters else &quot;-&quot; for letter in word] </code></pre>
Hangman with dashes in Python - can't figure out why the code is not working
python
0
37
1
72,207,880
72,207,880
2
true
2022-05-11T21:29:10.807Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Hangman with dashes in Python - can't figure out why the code is not working<p>I started to learn Python. I use Thonny and the Python version is 3.7.9</p> <p...
72,208,565
Search for word in a phrase and return match<p>I need to build a formula that:</p> <p>If in column X, has the values ​​of column B (regardless of position), returns the values ​​of A</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th style="text-align: left;">Column A</th> </tr> </thead> <tbod...
<p>use:</p> <pre><code>=ARRAYFORMULA(IFNA(REGEXEXTRACT(B1:B, TEXTJOIN(&quot;|&quot;, 1, A1:A)))) </code></pre> <p><a href="https://i.stack.imgur.com/ATmeQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ATmeQ.png" alt="enter image description here" /></a></p>
Search for word in a phrase and return match
arrays|regex|google-sheets|google-sheets-formula|textjoin
0
54
2
72,208,679
72,208,679
2
true
2022-05-11T23:19:47.590Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Search for word in a phrase and return match<p>I need to build a formula that:</p> <p>If in column X, has the values ​​of column B (regardless of position), ...
72,174,384
Querying from a view takes minutes in SSMS, but times out in Excel. How to diagnose?<p>I have a set of queries against views that run just fine in SSMS. They completed in SSMS in, at most, 3 minutes and not all that much longer in Excel (via Power Query). I recently added some more <code>PARTITION BYs</code> to one of ...
<p>This behaviour - &quot;fast in SSMS, slow in application&quot; can be caused by a feature of SQL Server called <a href="https://www.brentozar.com/archive/2013/06/the-elephant-and-the-mouse-or-parameter-sniffing-in-sql-server/" rel="nofollow noreferrer">Parameter sniffing</a>.</p> <blockquote> <p>SQL Server uses a pr...
Querying from a view takes minutes in SSMS, but times out in Excel. How to diagnose?
sql|sql-server|excel|tsql|powerquery
0
142
1
72,208,833
72,208,833
2
true
2022-05-09T15:18:31.240Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Querying from a view takes minutes in SSMS, but times out in Excel. How to diagnose?<p>I have a set of queries against views that run just fine in SSMS. They...
72,208,737
While navigating HTML Elements with forEach, the getElementsByClassName function does not work on these elements<p>Let me try to explain, but you will understand better when you see the codes. I get my div elements with the <code>getElementsByClassName</code> function and then convert it to an array with the <code>Arra...
<p>You're doing everything right except for one, tiny thing that a linter could help you with in the future...</p> <p>Change <code>getELementsByClassName</code> to <code>getElementsByClassName</code></p> <p>Happens to everyone at some point.</p>
While navigating HTML Elements with forEach, the getElementsByClassName function does not work on these elements
javascript|html
0
42
1
72,208,851
72,208,851
2
true
2022-05-11T23:52:31.650Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: While navigating HTML Elements with forEach, the getElementsByClassName function does not work on these elements<p>Let me try to explain, but you will unders...
72,208,933
custom claim for multi sub users at once using cloud function?<p>What is the best way to update the custom claim of multiple sub users at once using a cloud function ? I mean is would a forEach on an array of lets say a list of users emails (strings) do this job ?</p> <p><div class="snippet" data-lang="js" data-hide="f...
<p>There is no API to updated multiple users at the same time. You have to process them each individually.</p>
custom claim for multi sub users at once using cloud function?
node.js|firebase-authentication|firebase-admin
0
26
1
72,208,953
72,208,953
2
true
2022-05-12T00:34:42.117Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: custom claim for multi sub users at once using cloud function?<p>What is the best way to update the custom claim of multiple sub users at once using a cloud ...
72,206,460
Python/Matplotlib plot vertical line for specific dates in line chart<p>I used pandas to read a CSV file of the stock data of Tesla and plotted a line chart of the price in 2021. Also, I have <code>dates = []</code> with a collection of dates, which I want to plot in the same line chart with vertical lines.</p> <p>My ...
<p>Create a DataFrame with a <code>DatetimeIndex</code> (not just strings), but you can safely leave the dates corresponding to vertical lines as strings of format <code>yyyy-mm-dd</code>. Your plotting code can be cleaned up somewhat, which may have been part of the issue.</p> <h3>Setup</h3> <p>Based on your sample da...
Python/Matplotlib plot vertical line for specific dates in line chart
python|pandas|matplotlib|data-science
0
267
1
72,208,990
72,208,990
2
true
2022-05-11T19:15:10.077Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python/Matplotlib plot vertical line for specific dates in line chart<p>I used pandas to read a CSV file of the stock data of Tesla and plotted a line chart ...
72,194,151
How to get error variance for each item in lavaan cfa?<p>I want to extract the error variance for each item (i.e. indicator) from a lavaan CFA.</p> <pre class="lang-r prettyprint-override"><code>library(lavaan) HS.model &lt;- ' visual =~ x1 + x2 + x3 textual =~ x4 + x5 + x6 speed =~ x7 +...
<p><code>lavInspect(fit, what = &quot;est&quot;)$theta</code></p> <p>This is the entire covariance matrix of residuals. The diagonal has residual variances.</p>
How to get error variance for each item in lavaan cfa?
r|r-lavaan|factor-analysis
0
44
1
72,208,991
72,208,991
2
true
2022-05-11T00:18:37.273Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get error variance for each item in lavaan cfa?<p>I want to extract the error variance for each item (i.e. indicator) from a lavaan CFA.</p> <pre clas...
72,209,042
Pandas multicolumn cumsum() on a subset of rows<p>I can get this to work if I do the cumsum one column at a time. However doing it together outputs NaNs.</p> <pre><code>df = pd.DataFrame({&quot;category&quot;: [1,2,2], &quot;value1&quot;: [10,11,12], &quot;value2&quot;: [20,21,22]}) m = df[&quot;category&quot;] == 2 df...
<p>You can just assign new column</p> <pre><code>df[[&quot;cum_value1&quot;, &quot;cum_value2&quot;]] = df.loc[m, [&quot;value1&quot;, &quot;value2&quot;]].cumsum() df Out[520]: category value1 value2 cum_value1 cum_value2 0 1 10 20 NaN NaN 1 2 11 21 11...
Pandas multicolumn cumsum() on a subset of rows
pandas
0
19
1
72,209,055
72,209,055
2
true
2022-05-12T01:04:41.280Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pandas multicolumn cumsum() on a subset of rows<p>I can get this to work if I do the cumsum one column at a time. However doing it together outputs NaNs.</p>...
72,178,235
What does the attribute 'reminderEnabled' do on the reminders DocuSign API?<p>I think that the text under envelopes-&gt;getNotificationSettings-&gt;reminder-&gt;reminderEnabled is incorrect and feels like a copy &amp; paste error on DocuSign. Anyone know what this means? Essentially, i'm trying to send out a reminder ...
<p>You're right - it is a copy pasting error. <a href="https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/envelopes/getnotificationsettings/" rel="nofollow noreferrer">The correct definition is in the v2.1 Documentation</a></p> <blockquote> <p>When true, reminders are enabled. The default value is ...
What does the attribute 'reminderEnabled' do on the reminders DocuSign API?
docusignapi
0
29
1
72,209,523
72,209,523
2
true
2022-05-09T21:09:09.650Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What does the attribute 'reminderEnabled' do on the reminders DocuSign API?<p>I think that the text under envelopes-&gt;getNotificationSettings-&gt;reminder-...
72,209,087
Assert that a function changes a stateful value<p>So, here is a simplified version of my code.</p> <p>This is my custom hook.</p> <pre><code>export const useStep = () =&gt; { const [step, setStep] = useState&lt;Steps&gt;(&quot;sending&quot;); const changeStep = (newStep: Steps) =&gt; setStep(newStep); return { ...
<p>There is an example in the doc, see <a href="https://react-hooks-testing-library.com/usage/basic-hooks#updates" rel="nofollow noreferrer">Updates</a>.</p> <blockquote> <p>NOTE: There's a gotcha with updates. <code>renderHook</code> mutates the value of <code>current</code> when updates happen so <strong>you cannot d...
Assert that a function changes a stateful value
reactjs|typescript|react-hooks|react-testing-library|react-hooks-testing-library
0
27
1
72,209,770
72,209,770
2
true
2022-05-12T01:13:29.410Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Assert that a function changes a stateful value<p>So, here is a simplified version of my code.</p> <p>This is my custom hook.</p> <pre><code>export const use...
72,209,434
How to change the pixel quality and size of Image using Google Apps Script?<p>I have a list of image URLs and I want to get all those images which are more than 14Mb in size or 14 Megapixel in quality and resize them to under 5Mb in size and 10 Megapixel in quality. I used <a href="https://github.com/tanaikech/ImgApp" ...
<p>I believe your goal is as follows.</p> <ul> <li>You want to reduce the image size from 4480x4480 to 2000x2000. At this time, you want to reduce the lower quality of the image.</li> <li>You want to achieve this using Google Apps Script.</li> </ul> <h2>Issue and workaround:</h2> <p>I thought that in this case, for exa...
How to change the pixel quality and size of Image using Google Apps Script?
google-apps-script|google-sheets|pixel
0
68
1
72,210,016
72,210,016
2
true
2022-05-12T02:18:35.487Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to change the pixel quality and size of Image using Google Apps Script?<p>I have a list of image URLs and I want to get all those images which are more t...
72,210,017
How to sort or create a new array by grouping year and data<p>I need to sort this array of objects, in the format that gives me reading for the development of the layout below:</p> <p><a href="https://i.stack.imgur.com/HZzz5.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HZzz5.jpg" alt="enter image ...
<p>You can group the data using <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce" rel="nofollow noreferrer">Array.prototype.reduce</a>. Refer to snippet below:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div ...
How to sort or create a new array by grouping year and data
javascript|reactjs
0
32
1
72,210,062
72,210,062
2
true
2022-05-12T04:05:27.523Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to sort or create a new array by grouping year and data<p>I need to sort this array of objects, in the format that gives me reading for the development o...
72,209,896
Use Environ("LOCALAPPDATA") with a Public Const. (or an alternative solution)<p>I have been using the following VBA code</p> <pre><code>Public Const COSTER_FOLDER = &quot;C:\Coster&quot; </code></pre> <p>But this will no longer work when they shift the folder location.</p> <p>The new Coster folder is Environ(&quot;LOCA...
<p>Here's another option. Remove the old definition, and use this.</p> <pre><code>Public Function COSTER_FOLDER() As String COSTER_FOLDER = Environ(&quot;LOCALAPPDATA&quot;) &amp; &quot;\Coster&quot; End Function </code></pre> <p>Then you can use it the same way:</p> <pre><code>Debug.Print COSTER_FOLDER &amp; &quot...
Use Environ("LOCALAPPDATA") with a Public Const. (or an alternative solution)
excel|vba|constants
0
42
1
72,210,097
72,210,097
2
true
2022-05-12T03:41:34.460Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Use Environ("LOCALAPPDATA") with a Public Const. (or an alternative solution)<p>I have been using the following VBA code</p> <pre><code>Public Const COSTER_F...
72,210,106
How to efficiently update the firestore while listening to any changes<p>I want to update the firestore database every time a change in its value is encountered. I have discussed it in the post</p> <blockquote> <p><a href="https://stackoverflow.com/questions/72204808/cannot-read-data-after-updating-it-in-firestore-from...
<p>Read the Documentation of <a href="https://api.flutter.dev/flutter/widgets/StreamBuilder-class.html" rel="nofollow noreferrer">Stream Builder</a>. It will help you in this regard...</p>
How to efficiently update the firestore while listening to any changes
firebase|flutter|dart|google-cloud-firestore
0
52
1
72,210,176
72,210,176
2
true
2022-05-12T04:22:06.560Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to efficiently update the firestore while listening to any changes<p>I want to update the firestore database every time a change in its value is encounte...
72,210,076
Use variable from another script or define it?<p>I have a Manager class and it has lots of variables so I can reference it when I need it.</p> <p>Will this reduce the performance ? or should I define it</p> <pre><code>public class Controller: MonoBehaviour { public GameObject Manager; } </code></pre> <pre><code>pub...
<p><strong>TLDR;</strong> <code>Getcomponent()</code> calls are expensive. It is OK if used once/rarely, but starts to have an effect when called continiously.</p> <p>Store a reference (define) to it:</p> <pre class="lang-cs prettyprint-override"><code>public class GetController : MonoBehaviour { // Will show up in...
Use variable from another script or define it?
c#|unity3d
0
74
2
72,210,481
72,210,481
2
true
2022-05-12T04:15:22.720Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Use variable from another script or define it?<p>I have a Manager class and it has lots of variables so I can reference it when I need it.</p> <p>Will this r...
72,211,074
Having trouble including header files<p>I can only use header files that I add to C:\SDL2-w64\include, but I Can't get it to link to the include folder inside my project folder.</p> <p>for example: I have a folder called &quot;MyProject&quot; and its located at C:\Users\User\Desktop\MyProject, inside the project folder...
<p>Assuming the file doing the including is located at <code>C:\Users\User\Desktop\MyProject</code>, try using <code>#include &quot;Include/head.h&quot;</code>. This is because there is a difference between using quotations (&quot;&quot;) and angle brackets (&lt;&gt;) in your includes.</p> <p>The reason is explained in...
Having trouble including header files
c++|header-files
0
47
1
72,211,197
72,211,197
2
true
2022-05-12T06:38:24.797Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Having trouble including header files<p>I can only use header files that I add to C:\SDL2-w64\include, but I Can't get it to link to the include folder insid...
72,205,693
Problem trying to configure an interface and connect to the cluster<p>Hello people and good day, i'm trying to build an interface so, the interface it will be an external client that i need to get access from my linux console and execute the commands, this is the interface</p> <pre class="lang-java prettyprint-override...
<p><em>I suppose you have a Hazelcast cluster running somewhere and you just want to access it from your &quot;interface&quot;. You don't want to manage the cluster, but you are only concerned about the liveness of the client in the interface/cache.</em></p> <p>Use the Hazelcast client configuration options to take car...
Problem trying to configure an interface and connect to the cluster
hazelcast|hazelcast-imap|hazelcast-jet
0
41
1
72,211,348
72,211,348
2
true
2022-05-11T18:06:57.947Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Problem trying to configure an interface and connect to the cluster<p>Hello people and good day, i'm trying to build an interface so, the interface it will b...
72,211,265
LEFT JOIN : display null for the right side<p>Let's say we have 2 tables</p> <pre><code>TABLEA TABLEB 1 1 01/03/2022 2 2 01/01/2022 3 </code></pre> <p>This SQL statement:</p> <pre><code>select id from tableA left join tableB on tableA.id = tableB.id </code></pre> <p>disp...
<pre><code> CREATE TABLE #TABLEA ( ID tinyint ); CREATE TABLE #TABLEB ( ID tinyint ,Date date ); INSERT INTO #TABLEA VALUES(1),(2),(3) INSERT INTO #TABLEB VALUES(1,'2022-03-01'),(2,'2022-01-01'),(3,NULL) SELECT * FROM #TABLEA t1 LEFT JOIN #TABLEB t2 ON t2.ID= t1.ID AND t2.Date &gt; '2022-01...
LEFT JOIN : display null for the right side
sql|join
0
66
1
72,211,397
72,211,397
2
true
2022-05-12T06:57:35.683Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: LEFT JOIN : display null for the right side<p>Let's say we have 2 tables</p> <pre><code>TABLEA TABLEB 1 1 01/03/2022 2 ...
72,211,646
when converting charter in to numeric the higher value data becomes Na<p>I have tried to convert the total column in to numeric data$total&lt;-as.numeric(data$total) using this code it is working fine for small number when it comes to big(&quot;7,29,842&quot; )it becomes na</p> <p>So kindly share your thoughts and any...
<p>You can use the following code:</p> <pre><code>as.numeric(gsub(&quot;,&quot;,&quot;&quot;,df$revenue)) </code></pre> <p>Output:</p> <pre><code>[1] 20.00 1.46 52.00 1.50 32.59 11.31 0.37 0.65 0.00 [10] 5.58 729842.00 58.00 8.70 0.32 113.00 0.84 2...
when converting charter in to numeric the higher value data becomes Na
r|dplyr
0
34
1
72,211,734
72,211,734
2
true
2022-05-12T07:31:58.690Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: when converting charter in to numeric the higher value data becomes Na<p>I have tried to convert the total column in to numeric data$total&lt;-as.numeric(da...
72,211,597
Do all API responses need to explicitly be returned with a json function?<p>I'm getting into <code>api controllers</code> and am wondering if this <code>index function</code>:</p> <pre><code>public function index() { $data = DB::table('galleries')-&gt;get(); return response()-&gt;json($data); } </code></pre> <p...
<p>the <code>return $data</code> will just convert the <code>$data</code> into a json response. no header will be set and your frontend will not recognize it as a json object.</p> <p><code>return response()</code> will return a full <code>Response</code> instance. from the doc</p> <blockquote> <p>Returning a full Respo...
Do all API responses need to explicitly be returned with a json function?
php|laravel|controller|laravel-api
0
48
3
72,212,070
72,212,070
2
true
2022-05-12T07:27:03.800Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Do all API responses need to explicitly be returned with a json function?<p>I'm getting into <code>api controllers</code> and am wondering if this <code>inde...
72,211,700
Subprocess no output when running a shell<p>I tried to run a system shell in Python subprocess module:</p> <pre><code>p = subprocess.Popen(&quot;/bin/bash&quot;, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) p.wait() print(p.communicate()) </code></pre> <p>However, it printed <code>(b'', b'')</code><br />...
<p>It works for me as you would expect I guess.</p> <pre><code>(base) tzane:~/python_test$ python test_1.py whereis ls exit (b'ls: /bin/ls /usr/share/man/man1/ls.1.gz\n', b'') (base) tzane:~/python_test$ </code></pre> <p>You are not getting any output if you are not telling bash to output anything. Calling <code>.wait(...
Subprocess no output when running a shell
python|subprocess
0
50
1
72,212,429
72,212,429
2
true
2022-05-12T07:36:36.400Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Subprocess no output when running a shell<p>I tried to run a system shell in Python subprocess module:</p> <pre><code>p = subprocess.Popen(&quot;/bin/bash&qu...
72,211,800
What is the Powershell equivalent to C's argv[0]?<p>That is to say - how can I get the name of the called script from within said script? For example, if I do this:</p> <pre><code>.\foobar.ps1 -param1 10 -param2 20 </code></pre> <p>How would I get the string 'foobar.ps1'?</p>
<p>There is an <a href="https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_automatic_variables" rel="nofollow noreferrer">automatic variable</a> that provides this information: <a href="https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_automat...
What is the Powershell equivalent to C's argv[0]?
powershell
0
46
1
72,212,765
72,212,765
2
true
2022-05-12T07:45:10.223Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the Powershell equivalent to C's argv[0]?<p>That is to say - how can I get the name of the called script from within said script? For example, if I d...
72,211,323
How can I turn off vim in terminal of Mac?<p>I was trying to setup Mongo DB Community on my Mac(m1). I installed Home-brew first and followed the install instruction of the Mongo DB. However I could not run the command brew and I found that it was the problem that I didn't set up the Path in the zshell. So I tried it w...
<p>You are in this situation because you typed the wrong command in the terminal and I suspect it is because you copy-pasted it instead of typing it out.</p> <p>Your command is helpfully spelled out in the title bar of the window:</p> <pre><code>$ vi ~/.zshrcexport PATH=/opt/homebrew/bin: </code></pre> <p>Judging by th...
How can I turn off vim in terminal of Mac?
mongodb|vim|terminal
0
51
1
72,212,861
72,212,861
2
true
2022-05-12T07:02:20.230Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I turn off vim in terminal of Mac?<p>I was trying to setup Mongo DB Community on my Mac(m1). I installed Home-brew first and followed the install ins...
72,212,704
Is it possible to fill an svg with a gradient color or background image?<p>I have this Instagram svg logo and I want to change it's color to either a linear-gradient or a background image on hover, is it possible using css?<br /> I've tried:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="tru...
<p>I got it working by having the gradient within the SVG:</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-css lang-css prettyprint-override"><code>#instagram:hover path { fill: url(#myGradient); }</code></pre> <p...
Is it possible to fill an svg with a gradient color or background image?
html|css|svg
0
70
1
72,212,935
72,212,935
2
true
2022-05-12T08:57:06.497Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to fill an svg with a gradient color or background image?<p>I have this Instagram svg logo and I want to change it's color to either a linear-...
72,212,536
how to iterate through several vectors with DIFFERENT types?<p>Here, I have a custom collection of entities (vectors of different types: <code>Type1</code>, <code>Type2</code>, <code>Type3</code> , <code>Type4</code>, for simplicity I reduced to two types) with different sizes:</p> <pre><code>#include &lt;stdio.h&gt; #...
<p>Make your <code>run_function</code> member function take a functor instead of a function pointer:</p> <pre class="lang-cpp prettyprint-override"><code> template&lt;typename Entity, typename F, typename... Ts&gt; static void fun_per_entity(std::vector&lt;Entity*&gt;&amp; entities, F&amp;&amp; f, Ts&amp;&amp;.....
how to iterate through several vectors with DIFFERENT types?
c++|for-loop|c++17
0
84
1
72,213,799
72,213,799
2
true
2022-05-12T08:45:27.423Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to iterate through several vectors with DIFFERENT types?<p>Here, I have a custom collection of entities (vectors of different types: <code>Type1</code>, ...
72,203,054
How to use count() and sum() in serializer?<p>I want to calculate the average rating on sum_of_rating/number_of_rating.</p> <pre><code>class SearchWorkingProfessionals(APIView): def post(self,request,format=None): tags = request.data.get('tag_arr') city_name = request.data.get('city_name') t...
<p>The only option you have is this case is to use a <code>SerializerMethodField</code>. Something like this should work (if I understood what you asked for):</p> <pre class="lang-py prettyprint-override"><code>from django.db.models import Avg class SearchWorkingProgessionalsSerializer(serializers.Serializer): cou...
How to use count() and sum() in serializer?
django|django-models|django-rest-framework|django-views|django-serializer
0
201
3
72,213,911
72,213,911
2
true
2022-05-11T14:42:36.470Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use count() and sum() in serializer?<p>I want to calculate the average rating on sum_of_rating/number_of_rating.</p> <pre><code>class SearchWorkingPro...
72,213,661
Test connection to postgres with SSL with the command line<p>I need to test a connection to a distant postgres database with SSL turned on, and be notified of the result. I have the following command:</p> <pre><code>psql &quot;sslmode=verify-ca sslrootcert=myRootCert.crt sslcert=myPublicCert.crt sslkey=myPrivateKey.key...
<p>You can use your connection string like this:</p> <pre class="lang-sh prettyprint-override"><code>pg_isready -d 'sslmode=verify-ca sslrootcert=myRootCert.crt sslcert=myPublicCert.crt sslkey=myPrivateKey.key hostaddr=host user=user port=port dbname=db password=passwd' </code></pre>
Test connection to postgres with SSL with the command line
postgresql|bash|psql
0
376
1
72,214,071
72,214,071
2
true
2022-05-12T10:06:30.990Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Test connection to postgres with SSL with the command line<p>I need to test a connection to a distant postgres database with SSL turned on, and be notified o...
72,212,625
Get the value from a loop in Shiny<p>I want to get the loop variable from a loop. However, renderText function utilizes the last loop's value.</p> <pre><code>library(shiny) ui &lt;- fluidPage( mainPanel(&quot;main panel&quot;, textOutput(&quot;ts_txt1&quot;), textOutput(&quot;ts_txt2&quot;), textOutput(&quot;ts_t...
<p>Try this</p> <pre><code>library(shiny) ui &lt;- fluidPage( mainPanel(&quot;main panel&quot;, textOutput(&quot;ts_txt1&quot;), textOutput(&quot;ts_txt2&quot;), textOutput(&quot;ts_txt3&quot;), textOutput(&quot;ts_txt4&quot;), textOutput(&quot;ts_txt5&quot;), textOutput(&quot;ts_txt6&quot;), textOutput(&quot;ts_tx...
Get the value from a loop in Shiny
r|shiny
0
23
1
72,214,171
72,214,171
2
true
2022-05-12T08:51:48.663Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get the value from a loop in Shiny<p>I want to get the loop variable from a loop. However, renderText function utilizes the last loop's value.</p> <pre><code...
72,214,470
bash script not writing into a file<p>I'm trying to write bash script that can be launched with operational arguments and based on that either append, delete or overwrite data file, but when I use -a or -o arguments, the file stays empty or only white characters. What is the problem? Thanks!</p> <pre><code> #!/bin/bash...
<p>Your <code>getopts</code> command has the wrong syntax. You must seperate the optional arguments with a <code>?</code>, if you don't expect a argument value, and <code>:</code> if you expect a argument value.<br /> So your code with <code>while</code>-line replaced with this</p> <pre><code>while getopts 'h?a:d?o:v' ...
bash script not writing into a file
linux|bash
0
87
1
72,214,615
72,214,615
2
true
2022-05-12T11:08:49.510Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: bash script not writing into a file<p>I'm trying to write bash script that can be launched with operational arguments and based on that either append, delete...
72,214,233
xargs split string by space<p>I have the following shell script:</p> <pre><code>serial_numbers=$(ddcutil detect | grep &quot;Serial number&quot; | awk '{print $3}' | uniq) echo $serial_numbers | xargs -P $(echo $serial_numbers | wc -w) -I % ddcutil setvcp 10 100 --sn % </code></pre> <p>The variable <code>$serial_number...
<p><code>xargs</code> works fine if you pipe it directly from a command, but not if you <code>echo</code> the result of the same command output.</p> <p>Add this transformation in your command:</p> <pre><code>#!/bin/bash echo $serial_numbers | tr ' ' '\n' | xargs -P $(echo $serial_numbers | wc -w) -I % ddcutil setvcp 1...
xargs split string by space
bash|shell|sh|xargs
0
339
1
72,215,036
72,215,036
2
true
2022-05-12T10:48:37.683Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: xargs split string by space<p>I have the following shell script:</p> <pre><code>serial_numbers=$(ddcutil detect | grep &quot;Serial number&quot; | awk '{prin...
72,214,931
Java - JAR file would not execute from the terminal command line<p>I am relatively new to Java I finished tutorial where an example of how to create and run JAR file was explained. Could you give an advice of what should be done in order to run my JAR in command line, please?</p> <p>I created JAR file:</p> <p><a href="...
<p>When you type <code>java -jar myjar.jar</code> on the command line, your command line first does all sorts of stuff to figure out what you actually mean. In particular, <code>java</code> gets translated to the absolute path of some executable file. It does this (generally - each shell is different, but most work thi...
Java - JAR file would not execute from the terminal command line
java|intellij-idea|jar
0
89
2
72,215,134
72,215,134
2
true
2022-05-12T11:43:46.777Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Java - JAR file would not execute from the terminal command line<p>I am relatively new to Java I finished tutorial where an example of how to create and run ...
72,215,488
What's AWS S3 GET byte range maximum offset?<p>I'm trying to find this information but without much luck so far.</p> <p>I have a fairly large file on S3(in a range of 64-128Gb) and I would like to read random byte ranges from it - is it doable? I guess byte-range offset would be very large for chunks somewhere close to...
<p>This won't be a problem.</p> <p>The <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html#API_GetObject_RequestSyntax" rel="nofollow noreferrer">Amazon docs</a> state that the <code>Range</code> header as supported as per spec (but only one range per request):</p> <blockquote> <p>Range</p> <p>D...
What's AWS S3 GET byte range maximum offset?
amazon-web-services|amazon-s3
0
108
1
72,215,599
72,215,599
2
true
2022-05-12T12:20:48.720Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What's AWS S3 GET byte range maximum offset?<p>I'm trying to find this information but without much luck so far.</p> <p>I have a fairly large file on S3(in a...
72,215,084
How to handle multiple API requests when the auth token is expired?<p>I have a use case wherein I am calling 2 different APIs at almost the same time, but while executing the 1st API it turns out that my auth token is expired. Now I can pause the execution of API 1 while I get a new token, I want the execution of the 2...
<p>You can do this with dio. You can lock particular Object by lock(). If lock() is called all the further request will be placed in a queue, the calls will be made after when the unlock() is called.</p> <pre><code>Dio _dio= Dio(); _dio.lock(); _dio.unlock(); </code></pre>
How to handle multiple API requests when the auth token is expired?
flutter|http|jwt|dio
0
591
2
72,215,605
72,215,605
2
true
2022-05-12T11:53:08.583Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to handle multiple API requests when the auth token is expired?<p>I have a use case wherein I am calling 2 different APIs at almost the same time, but wh...
72,215,732
I am getting a 403 error when trying to implement OAuth 1.0a with twitter API<p>i am trying to generate a OAuth 1.0a link with twitter api in JS using the twitter-api-v2</p> <pre class="lang-js prettyprint-override"><code>const client = new TwitterApi({ appKey: process.env.API_KEY, appSecret: process.env.API_KEY_SECRET...
<p>Turns out, i made a mistake, and just needed to edit the URL in my twitter developer portal.</p>
I am getting a 403 error when trying to implement OAuth 1.0a with twitter API
twitter|twitter-oauth|twitter-api-v2
0
65
1
72,215,960
72,215,960
2
true
2022-05-12T12:37:44.297Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I am getting a 403 error when trying to implement OAuth 1.0a with twitter API<p>i am trying to generate a OAuth 1.0a link with twitter api in JS using the tw...
72,205,069
How to restrict Google Places Autocomplete to radius<p>I want to bias the Places autocomplete API results to a radius around the users location.</p> <p>I see in the <a href="https://developers.google.com/maps/documentation/places/web-service/autocomplete#location_biasing" rel="nofollow noreferrer">Places API Documentat...
<p>You are looking at the wrong documentation. The one you linked in your question is for the web-service, not the widget which is part of the Javascript API.</p> <p>The correct documentation is <a href="https://developers.google.com/maps/documentation/javascript/places-autocomplete" rel="nofollow noreferrer">here</a>....
How to restrict Google Places Autocomplete to radius
javascript|html|google-maps|google-places-api
0
156
1
72,216,136
72,216,136
2
true
2022-05-11T17:12:33.420Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to restrict Google Places Autocomplete to radius<p>I want to bias the Places autocomplete API results to a radius around the users location.</p> <p>I see...
72,154,101
Add location marker on plotted Geopandas Dataframe using Folium<h1>Context</h1> <p>I have an merged geodataframe of 1). Postalcode areas and 2). total amount of deliveries within that postalcode area in the city of Groningen called <code>results</code>. The geodataframe includes geometry that include Polygons and Multi...
<ul> <li>you have not provided the geometry. Have found postal districts of Netherlands and used that</li> <li><code>explore()</code> supports will draw a point as a marker with appropriate parameters</li> <li>hence two layers, <ul> <li>one is postal areas coloured using number of deliveries</li> <li>second is point, ...
Add location marker on plotted Geopandas Dataframe using Folium
geopandas|folium
0
244
1
72,216,379
72,216,379
2
true
2022-05-07T15:49:09.470Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Add location marker on plotted Geopandas Dataframe using Folium<h1>Context</h1> <p>I have an merged geodataframe of 1). Postalcode areas and 2). total amount...
72,216,503
SQL Filter Each Record By The Latest Date<p>I have two tables I am joining.</p> <pre><code>asset assetid length 1 10 2 190 3 8 inspection flag date assetid 0 2/3/2021 3 1 5/4/2022 3 1 3/19/2021 1 1 6/14/2020 2 </code></pre> <p>When I join I get thi...
<p>One option uses <code>ROW_NUMBER</code>:</p> <pre class="lang-sql prettyprint-override"><code>WITH cte AS ( SELECT i.flag, i.date, a.assetid, a.length, ROW_NUMBER() OVER (PARTITION BY a.assetid ORDER BY i.date DESC) rn FROM asset a INNER JOIN inspection i ON a.assetid = i.assetid ) SELECT fla...
SQL Filter Each Record By The Latest Date
sql
0
23
2
72,216,598
72,216,598
2
true
2022-05-12T13:28:43.053Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL Filter Each Record By The Latest Date<p>I have two tables I am joining.</p> <pre><code>asset assetid length 1 10 2 190 3 8 ...
72,217,001
Not able to describe EBS snapshots more than 1000<p>Trying to list all the snapshots present in a region using boto3, but not able to list more than 1000. Is there a workaround for this to list all the ebs snapshots?</p> <pre><code>def ebssnapsot(aws_id): response = ec2_client.describe_snapshots( MaxResults...
<p>You have to paginate through multiple requests to get all the values. You can either do this yourself via the <code>NextToken</code> parameter in the <code>describe_snapshots()</code> call, or you can use the built-in <a href="https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ec2.html#EC2.Pa...
Not able to describe EBS snapshots more than 1000
amazon-web-services|amazon-ec2|boto3
0
53
1
72,217,164
72,217,164
2
true
2022-05-12T13:59:56.643Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Not able to describe EBS snapshots more than 1000<p>Trying to list all the snapshots present in a region using boto3, but not able to list more than 1000. Is...
72,216,017
For loop on pandas dataframe causing slow performance<p>I currently have a loop in a script that is designed to process a raw test data file, and perform a bunch of calculations during the sanitised data. During the script, I need to figure out exactly how many cycles there are in each test. A cycle can be defined by w...
<p>You can do it like this:</p> <pre><code>import pandas as pd raw_data = {'Step':[1,1,2,2,2,3,3,4,4,4,1,2,2,3,3,3,4,4,4,4,1,2,2,3,3,4,4,4]} df = pd.DataFrame(raw_data) df['CycleTest'] = (df['Step'].diff() &lt; 0).cumsum() + 1 print(df) </code></pre> <pre><code> Step CycleTest 0 1 1 1 1 ...
For loop on pandas dataframe causing slow performance
python|pandas|dataframe|performance|running-count
0
119
1
72,217,245
72,217,245
2
true
2022-05-12T12:58:18.660Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: For loop on pandas dataframe causing slow performance<p>I currently have a loop in a script that is designed to process a raw test data file, and perform a b...
72,217,187
Checking if an image of a certain type (png) exists in a directory in Python<p>I'm wondering how can I check in a certain directory if it has a png image(it's name can be anything). If yes, then save the name of the images in a list.</p> <p>Thanks</p>
<p>You can use the <code>glob</code> library and &quot;<code>*</code>&quot; as a wildcard e.g.</p> <pre class="lang-py prettyprint-override"><code>import glob pngs = glob.glob(&quot;yourdir/*.png&quot;) # len(pngs) == 0 means we have no matches # ['image1.png', 'image2.png' ...] </code></pre> <p>See more examples <a hr...
Checking if an image of a certain type (png) exists in a directory in Python
python|directory
0
161
2
72,217,269
72,217,269
2
true
2022-05-12T14:11:11.993Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Checking if an image of a certain type (png) exists in a directory in Python<p>I'm wondering how can I check in a certain directory if it has a png image(it'...
72,216,803
Azure Powershell: How Do I search for files in a BLOB storage quickly?<p>We store log files in an Azure storage account, sorted in directories, by date and customer, like this:</p> <p>YYYY/MM/DD/customerNo/.../.../somestring.customerNo.applicatoinID.log</p> <p>I need to parse some of these files automatically every day...
<p>Azure Blob Storage supports server-side filtering of blobs by prefix however your code is not taking advantage of that.</p> <pre><code>$files = (Get-AzStorageBlob -Container logfiles -Context $context) | Where-Object { $_.Name -like &quot;$prefix*$customerId.$appID.txt&quot; } </code></pre> <p>Essentially the code a...
Azure Powershell: How Do I search for files in a BLOB storage quickly?
azure|powershell|azure-blob-storage|azure-powershell
0
402
1
72,217,321
72,217,321
2
true
2022-05-12T13:48:34.007Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Azure Powershell: How Do I search for files in a BLOB storage quickly?<p>We store log files in an Azure storage account, sorted in directories, by date and c...
72,197,323
Peewee - Set a default time as a future datetime<p>I'm trying to have a column on one of my tables have a default value of whenever the entry is created + 2 weeks.</p> <p>Here is the column definition I currently have:</p> <pre><code> dt_end = DateTimeField(default=datetime.datetime.utcnow + datetime.timedelta(weeks=...
<p>Here you go:</p> <pre><code>def two_weeks(): return datetime.datetime.utcnow() + datetime.timedelta(days=14) dt_end = DateTimeField(default=two_weeks) </code></pre>
Peewee - Set a default time as a future datetime
python|peewee
0
51
2
72,217,522
72,217,522
2
true
2022-05-11T07:51:34.877Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Peewee - Set a default time as a future datetime<p>I'm trying to have a column on one of my tables have a default value of whenever the entry is created + 2 ...
72,177,940
Get authorization CodeArtifact token from Bitbucket Pipelines run<p>I'm using Bitbucket as a source control service and I'm interested to start using its pipelines capability to build and deploy my app. I'm using AWS CodeArtifact to host my Java artifacts.</p> <p>The thing I'm struggle with is how to authenticate AWS C...
<p>I think the exportation of the <code>CODEARTIFACT_AUTH_TOKEN</code> env var is quite fine. For the first authentication to AWS, you probably want to take a look into Bitbucket OIDC capabilities:</p> <ul> <li><a href="https://bitbucket.org/blog/bitbucket-pipelines-and-openid-connect-no-more-secret-management" rel="no...
Get authorization CodeArtifact token from Bitbucket Pipelines run
bitbucket|bitbucket-pipelines|aws-codeartifact
0
351
1
72,217,711
72,217,711
2
true
2022-05-09T20:33:20.643Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get authorization CodeArtifact token from Bitbucket Pipelines run<p>I'm using Bitbucket as a source control service and I'm interested to start using its pip...
72,217,371
Can I add a local instance of a pointer to a struct with memory allocated with malloc to a global array of structs and free() properly<h1>Problem</h1> <p>Valgrind is informing me of a memory leak, however no matter what I cannot seem to figure out how I haven't freed all my allocated memory, leading to the question in ...
<p>This line allocates some bytes and stores a pointer to those bytes in the variable <code>struct1.arr_s2[total_s2 - 1]</code>:</p> <pre><code>struct1.arr_s2[total_s2 - 1] = malloc(sizeof(struct s2)); // !mem lost! </code></pre> <p>This line stores a pointer to some other bytes in the variable <code>struct1.arr_s2[to...
Can I add a local instance of a pointer to a struct with memory allocated with malloc to a global array of structs and free() properly
arrays|c|struct|memory-leaks
0
43
1
72,217,863
72,217,863
2
true
2022-05-12T14:23:19.210Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can I add a local instance of a pointer to a struct with memory allocated with malloc to a global array of structs and free() properly<h1>Problem</h1> <p>Val...
72,217,746
vanilla js error "cannot set property of undefined" on the chrome console<p>Hey I'm new to chartjs and js in general and keep getting the error &quot;&quot;cannot set property of undefined&quot; on the chrome console</p> <pre><code>const dataPie = { labels: ['Good Packs', 'Bad Packs'], datasets: [{ lab...
<p>It looks like you were accessing the data wrong, I will include a link to the documentation. I have modified your snippet below (I don't have a timer, but I have the code changing). Make sure you call <code>update</code> after changing the value so it will reflect in the HTML.</p> <p><code>datasets</code> is an arra...
vanilla js error "cannot set property of undefined" on the chrome console
javascript|arrays|chart.js
0
76
1
72,217,921
72,217,921
2
true
2022-05-12T14:49:07.770Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: vanilla js error "cannot set property of undefined" on the chrome console<p>Hey I'm new to chartjs and js in general and keep getting the error &quot;&quot;c...
72,217,867
Javascript is changing style of all elements instead of one<p>I am trying to change the background color of div one by one with an interval of 1sec but my code changes the color of all divs after one 1sec</p> <p><strong>HTML:</strong></p> <pre><code>&lt;div class=&quot;container&quot;&gt; &lt;div class=&quot;bar&quot...
<p>You're starting all the timeouts at the same time, so they all finish 1 second later.</p> <p>You need to use different timeouts for each element. Multiply the timeout by the index.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre cla...
Javascript is changing style of all elements instead of one
javascript|html
0
27
2
72,217,924
72,217,924
2
true
2022-05-12T14:58:16.487Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Javascript is changing style of all elements instead of one<p>I am trying to change the background color of div one by one with an interval of 1sec but my co...
72,218,129
SQL - how to filter by timestamp looking for anything after a certain time on a previous day<p>I need to filter a query results to only bring in rows of data that were created after 5pm the previous BUSINESS DAY up until current time, with business day being Monday to friday. I can filter for previous business day, and...
<p>If <code>prevbd</code> is a function you've defined that returns a <code>date</code> from the previous business day (I'm guessing from the fact that you're calling <code>trunc</code> that it returns a <code>date</code> that is the current time on the previous business day which seems like a weird design choice), the...
SQL - how to filter by timestamp looking for anything after a certain time on a previous day
sql|oracle|filter
0
42
2
72,218,362
72,218,362
2
true
2022-05-12T15:12:58.013Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL - how to filter by timestamp looking for anything after a certain time on a previous day<p>I need to filter a query results to only bring in rows of data...
72,218,051
Access IBM Db2 from Visual Studio 2022<p>I'm looking for some tooling to manage Db2 from within the Visual Studio 2022 IDE but I'm having no luck.</p> <p>It seems that there is a package called &quot;IBM Database Add-Ins for Visual Studio&quot; available from IBM, but the download page has a broken link.</p> <p><a href...
<p>Note: There are buttons on the documentation page to provide feedback, e.g., to notify about broken links. I just did that for the page you referenced.</p> <p>You should be able to download the Visual Studio Add-ins from this <a href="https://www.ibm.com/support/pages/download-initial-version-115-clients-and-drivers...
Access IBM Db2 from Visual Studio 2022
db2|visual-studio-2022
0
283
1
72,218,577
72,218,577
2
true
2022-05-12T15:08:30.223Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Access IBM Db2 from Visual Studio 2022<p>I'm looking for some tooling to manage Db2 from within the Visual Studio 2022 IDE but I'm having no luck.</p> <p>It ...
72,218,809
Define a function that returns the number of prime in range in processing language<p>Define a function that when passed an integer (n), returns the number of primes in the range [1, n]. For example,</p> <p>if n = 5, return 3, since the numbers 2, 3 and 5 are primes.</p> <p>if n = -5, return 0.</p> <p>if n = 10, return ...
<pre><code> int countPrimes(int n) { if(n &lt;= 2){ return 0; } else if(n == 3){ return 1; } int count = 0; for(int i = 2; i &lt;= n; i++){ if(IsPrime( i )){ count++; } } return count; } bo...
Define a function that returns the number of prime in range in processing language
processing
0
36
1
72,218,868
72,218,868
2
true
2022-05-12T16:03:05.213Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Define a function that returns the number of prime in range in processing language<p>Define a function that when passed an integer (n), returns the number of...
72,198,820
Why can't I map a boolean response from http request in Angular?<p>I am calling a .Net method in my WebAPI from Angular, which sends a boolean to switch something off and returns a boolean with the current status. However when trying to map the response in Angular it is returning undefined. (.Net 6, Angular 13)</p> <...
<p>You are getting <code>undefined</code> because you are not returning the nested http promise.</p> <p>But you can simplify your implementation quite a bit using a high-order mapping operator like <code>concatMap</code>, <code>switchMap</code>,...</p> <p>Itd be something like this.</p> <pre><code>return from(this.auth...
Why can't I map a boolean response from http request in Angular?
.net|angular|rxjs|webapi
0
62
1
72,218,998
72,218,998
2
true
2022-05-11T09:43:55.560Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why can't I map a boolean response from http request in Angular?<p>I am calling a .Net method in my WebAPI from Angular, which sends a boolean to switch some...
72,218,409
React Native Error - TypeError: null is not an object (evaluating '_reactNative.NativeModules.RNShare.FACEBOOK')<p>I'm working on react native project and I am using expo. I want to add the react-native-share package to my project, however I keep getting this error before I even add any code.</p> <pre><code> TypeError:...
<p>You can't normally use dependencies with native code using Expo. At least when using the classic build system (you're using it when you run <code>expo start</code> in the terminal to run your project). <code>react-native-share</code> has native code (you can check that by going to the repo and seeing if the library ...
React Native Error - TypeError: null is not an object (evaluating '_reactNative.NativeModules.RNShare.FACEBOOK')
react-native|expo|typeerror|react-native-share
0
1,458
1
72,219,005
72,219,005
2
true
2022-05-12T15:33:09.190Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React Native Error - TypeError: null is not an object (evaluating '_reactNative.NativeModules.RNShare.FACEBOOK')<p>I'm working on react native project and I ...
72,219,011
Django submit form POST not valid<p>I am attempting to submit a form to populate the database. I can't get the POST working. It doesn't look valid, but I can't figure out what I need to do to correct it.</p> <p>I have put some debugging on to see what happens when I click submit &amp; the POST gets sent. I can't figure...
<p>If don't pass the data in the form, the validation fails.</p> <pre><code>form = OrderForm(request.POST) </code></pre>
Django submit form POST not valid
django
0
33
1
72,219,058
72,219,058
2
true
2022-05-12T16:17:30.363Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Django submit form POST not valid<p>I am attempting to submit a form to populate the database. I can't get the POST working. It doesn't look valid, but I can...
72,219,013
SQL: Making a conditional WHERE clause?<p>I'm pretty new to SQL and am struggling to get the syntax/logic correct for what I need.</p> <p>Right now I have a query ending in a where statement:</p> <pre><code>WHERE business IN ('A','B','C') AND CASE WHEN queue = 'Q1' THEN (queue = 'Q1' AND queue_type = 'Y') END </co...
<pre class="lang-sql prettyprint-override"><code>SELECT * FROM mtable WHERE business IN ('A','B','C') AND (queue = 'Q1' AND queue_type = 'Y') OR (queue != 'Q1') </code></pre>
SQL: Making a conditional WHERE clause?
sql
0
32
1
72,219,090
72,219,090
2
true
2022-05-12T16:17:40.297Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL: Making a conditional WHERE clause?<p>I'm pretty new to SQL and am struggling to get the syntax/logic correct for what I need.</p> <p>Right now I have a ...
72,217,638
Ansible OR not working correctly (I know its me!)<p>I know this is something I am doing wrong but its slowly driving me crazy. Please note, this cannot be yum controlled unfortunately. I have an ansible playbook that checks for the presence of tomcat, then contents of a file and retrieves a version:</p> <p>Vars:</p> ...
<p>Just to put you on track, the following playbook:</p> <pre class="lang-yaml prettyprint-override"><code>--- - hosts: localhost gather_facts: false vars: # Fake the original example vars from extra_vars on this example existing_tomcat_version: stdout: &quot;{{ f_tomcat_version | d('0.0.0') }}&quot;...
Ansible OR not working correctly (I know its me!)
ansible
0
39
1
72,219,247
72,219,247
2
true
2022-05-12T14:40:05.050Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Ansible OR not working correctly (I know its me!)<p>I know this is something I am doing wrong but its slowly driving me crazy. Please note, this cannot be y...
72,218,473
GET http://localhost:3000/api/auth/user/:id 401 (Unauthorized)<p>I'm using vue3 with axios and prisma, but I have a problem getting user info.</p> <p>My postman request is ok (http://localhost:3000/api/auth/user/7), but my axios req is not.</p> <p>Can you help me please ?</p> <pre><code> async created () { ...
<p>Axios does not support URL parameters. <a href="https://github.com/axios/axios/issues/706" rel="nofollow noreferrer"></a></p> <p>One solution would be to use template strings to build the request URL.</p> <p>For example:</p> <pre class="lang-js prettyprint-override"><code>function getID(id) { const response = aw...
GET http://localhost:3000/api/auth/user/:id 401 (Unauthorized)
javascript|vue.js|axios
0
534
1
72,219,256
72,219,256
2
true
2022-05-12T15:38:06.233Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: GET http://localhost:3000/api/auth/user/:id 401 (Unauthorized)<p>I'm using vue3 with axios and prisma, but I have a problem getting user info.</p> <p>My post...
72,219,326
Search List Stored in Column and Eliminate Row with SQL<p>I have a table (MYTABLE) in an Oracle database that has a column which stores a list of items. Something like:</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>ITEM_ID</th> <th>ITEMS</th> </tr> </thead> <tbody> <tr> <td>5476301</td> <...
<p>Your column is just a string and not recognized by Oracle as a &quot;list&quot; in any sense. So, you need to implement your logic via string manipulation. E.g.,</p> <pre><code>SELECT item_id, items FROM my_table WHERE ','||replace(items,' ','')||',' NOT LIKE '%,M,%'; </code></pre> <p>Full example, for interest...
Search List Stored in Column and Eliminate Row with SQL
sql|oracle|list
0
27
1
72,219,441
72,219,441
2
true
2022-05-12T16:42:04.933Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Search List Stored in Column and Eliminate Row with SQL<p>I have a table (MYTABLE) in an Oracle database that has a column which stores a list of items. Some...
72,219,320
How to convert Powershell to Python for AD group creation<p>I have a Powershell command</p> <pre><code>New-ADGroup -Name &quot;Group_Name&quot; -SamAccountName Group_Name -GroupCategory Security -GroupScope Global -DisplayName &quot;Group_Name&quot; -Path &quot;CN=Users,DC=domain,DC=local&quot; </code></pre> <p>I am t...
<p>Both the <code>GroupCategory</code> (also known as &quot;Group Type&quot;) and the <code>GroupScope</code> are both set in <a href="https://docs.microsoft.com/en-us/windows/win32/adschema/a-grouptype" rel="nofollow noreferrer">the <code>groupType</code> attribute</a>, which is a bitmask (or bitflag): a binary value ...
How to convert Powershell to Python for AD group creation
python-3.x|powershell|active-directory
0
29
1
72,220,010
72,220,010
2
true
2022-05-12T16:41:27.303Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to convert Powershell to Python for AD group creation<p>I have a Powershell command</p> <pre><code>New-ADGroup -Name &quot;Group_Name&quot; -SamAccountN...
72,211,871
Powershell - delete folder if name exists in text file<p>I have a text file with a list of folder name.</p> <p>I want to delete the folders from my directory for which the name appears in the text file</p> <p>Here is my try</p> <pre><code>#I get the contents of the text file $textfile = Get-Content &quot;C:\Users\s611...
<p>You could use</p> <pre><code>#I get the contents of the text file $textfile = Get-Content &quot;C:\Users\s611284\Desktop\Dossiers.txt&quot; #I get the name of the folders from the directory $Foldersname = Get-ChildItem -Path $Directory | ForEach-Object { $_.BaseName } #I get the names present in...
Powershell - delete folder if name exists in text file
powershell|compare
0
56
1
72,220,522
72,220,522
2
true
2022-05-12T07:50:30.813Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Powershell - delete folder if name exists in text file<p>I have a text file with a list of folder name.</p> <p>I want to delete the folders from my directory...
72,211,555
How to import Secret in airflow?<p>I was trying to use a module in airflow called Secrets to pass secrets to KubernetesOperator in Airflow. It should be imported as <code>from airflow.contrib.kubernetes.secret import Secret</code></p> <p>But I'm getting an error <code>ModuleNotFoundError: No module named 'airflow.contr...
<p>The import is:</p> <pre><code>from airflow.kubernetes.secret import Secret </code></pre> <p>Note that the Secret class in Airflow can only <strong>reference</strong> secrets already exist in Kubernetes.</p> <p>If you are looking to &quot;pass&quot; = generate secrets then it won't work. You first must create them in...
How to import Secret in airflow?
kubernetes|airflow|kubernetes-secrets
0
202
1
72,220,598
72,220,598
2
true
2022-05-12T07:22:51.600Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to import Secret in airflow?<p>I was trying to use a module in airflow called Secrets to pass secrets to KubernetesOperator in Airflow. It should be impo...
72,220,557
Passing both TRUE and FALSE to a parameter in a SQL function<p>I have a PostgreSQL function which looks basically like this...</p> <pre><code>create or replace function myfunction(myparam boolean) returns table language 'sql' as $BODY$ select * from mytable where myIndicator = myparam $BODY$ </code></pre> <p>...and ...
<p>You can use <code>null</code> for this:</p> <pre><code>create or replace function myfunction(myparam boolean) returns table (...) language sql as $BODY$ select * from mytable where myIndicator = myparam or myparam is null $BODY$ </code></pre> <p>To get all rows use:</p> <pre><code>select * from myfunc...
Passing both TRUE and FALSE to a parameter in a SQL function
sql|postgresql
0
51
2
72,220,797
72,220,797
2
true
2022-05-12T18:33:57.333Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Passing both TRUE and FALSE to a parameter in a SQL function<p>I have a PostgreSQL function which looks basically like this...</p> <pre><code>create or repla...
72,212,468
Tailwindcss v3 not working with next.js v12<p>tailwindcss styles are not getting applied. What might be the issue? Tried multiple solutions in the <code>tailwind.config.js</code> file, but none of it worked.</p> <p><strong>package.json :</strong></p> <pre><code>{ &quot;name&quot;: &quot;twitter-clone&quot;, &quot;v...
<p>This might be because of not importing the <code>globals.css</code> in <code>_app.tsx</code> file.</p> <pre><code>import '../styles/globals.css' </code></pre> <p>I myself have removed the above line from my <code>_app.js</code> file multiple times (unknowingly) while removing the boilerplate code.</p>
Tailwindcss v3 not working with next.js v12
reactjs|typescript|next.js|tailwind-css
0
290
1
72,220,925
72,220,925
2
true
2022-05-12T08:40:00Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Tailwindcss v3 not working with next.js v12<p>tailwindcss styles are not getting applied. What might be the issue? Tried multiple solutions in the <code>tail...
72,220,530
Different results with df.dropna(axis='rows') and df.drop(index=np.where(df.isnull().sum()!=0)[0], axis='index')<p>I am trying to remove all rows that contain NaN values from a dataframe. However, I have realized that using <code>df.dropna(axis='rows')</code>, but using <code>df.drop(index=np.where(df.isnull().sum()!=0...
<p>You need to sum on columns</p> <pre class="lang-py prettyprint-override"><code>df.isnull().sum(axis=1)!=0 # or df.isnull().sum(axis='columns')!=0 </code></pre>
Different results with df.dropna(axis='rows') and df.drop(index=np.where(df.isnull().sum()!=0)[0], axis='index')
python|pandas|dataframe|data-cleaning
0
58
1
72,220,926
72,220,926
2
true
2022-05-12T18:31:37.330Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Different results with df.dropna(axis='rows') and df.drop(index=np.where(df.isnull().sum()!=0)[0], axis='index')<p>I am trying to remove all rows that contai...
72,218,744
I don't understand why this works with an unbuffered channel, or why a wait group is needed<p>In this code, I call a function which counts the number of letters in a string, and return a map of runes. To leverage concurrency, I call the function using goroutines:</p> <pre><code>func ConcurrentFrequency(l []string) Freq...
<p><a href="https://go.dev/ref/spec#For_range" rel="nofollow noreferrer">A for-range loop over a channel continues until the channel is closed</a>.</p> <p>If you remove the goroutine that eventually closes the channel, the for loop can never terminate. Once all goroutines sending values are done there is only one gorou...
I don't understand why this works with an unbuffered channel, or why a wait group is needed
go|concurrency|goroutine
0
94
1
72,221,324
72,221,324
2
true
2022-05-12T15:57:48.077Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I don't understand why this works with an unbuffered channel, or why a wait group is needed<p>In this code, I call a function which counts the number of lett...
72,220,773
String search for range of ICD codes<p>I want to search in Stata for C00-D49 and flag them as Neoplasms.</p> <p>I could do</p> <pre><code>gen neo =1 if strmatch(diagnosis, &quot;C*&quot;) </code></pre> <p>But, unsure of how to make the string search limited only upto D49.</p> <p>Also, I need to flag O00-O9A as Pregnanc...
<p>The way I understand ICD codes to be organized, they are all in alphabetic order. So you do not need to search any strings, just compare them alphabetically like this:</p> <pre><code>* Example generated by -dataex-. For more info, type help dataex clear input str7 diagnosis &quot;ABB&quot; &quot;A12&quot; &quot;C34&...
String search for range of ICD codes
stata
0
26
1
72,221,380
72,221,380
2
true
2022-05-12T18:54:21.540Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: String search for range of ICD codes<p>I want to search in Stata for C00-D49 and flag them as Neoplasms.</p> <p>I could do</p> <pre><code>gen neo =1 if strma...
72,221,347
How to prevent back div from showing through the front div<p>I am struggling to get a hamburger menu to work correctly.</p> <p>It drops down as expected, but for some reason, it does not cover up the elements behind it. In other words, the background appears transparent. But I cannot find a way to prevent this.</p> <p...
<p>set the z-index to something higher.</p> <pre><code>.e-menu-item{ opacity: 1; background-color: white; z-index:100; } </code></pre>
How to prevent back div from showing through the front div
html
0
16
2
72,221,385
72,221,385
2
true
2022-05-12T19:46:55.837Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to prevent back div from showing through the front div<p>I am struggling to get a hamburger menu to work correctly.</p> <p>It drops down as expected, but...