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
71,156,494
Why does powershell ConvertFrom-Json not work when converting json array and streaming output to ForEach-Object<p>This JSON array converted to powershell object seems to be somehow get handled as single string when streamed to ForEach-Object.</p> <pre><code>&quot;[1, 2, 3]&quot; | ConvertFrom-Json | ForEach-Object {Wri...
<p>This is by design, the Windows PowerShell version of <code>ConvertFrom-Json</code> explicitly requests the runtime doesn't immediately enumerate array output (<code>Write-Output $array -NoEnumerate</code> basically).</p> <p>The reason is that a JSON document with a top-level single-item array like <code>[1]</code> w...
Why does powershell ConvertFrom-Json not work when converting json array and streaming output to ForEach-Object
json|powershell
0
272
1
71,156,746
71,156,746
3
true
2022-02-17T10:35:48.917Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does powershell ConvertFrom-Json not work when converting json array and streaming output to ForEach-Object<p>This JSON array converted to powershell obj...
71,162,394
Error in ABS When Non-Numeric Value is in Array<p>I have a formula <code>=IFERROR(INDEX($A$1:$A$24, MATCH(MIN(ABS($B$1:$B$24)), ABS($B$1:$B$24),0)),&quot;NA&quot;)</code> and it does not work when there is a cell in array containing non-numeric value. For instance, I have this data:</p> <div class="s-table-container"> ...
<p>Wrap the ABS part in IFERROR:</p> <pre><code>=INDEX($A$1:$A$25, MATCH(MIN(IFERROR(ABS($B$1:$B$25),99999)), ABS($B$1:$B$25),0)) </code></pre> <p>Please note that some versions of Excel will require the use of Ctrl-Shift-Enter instead of Enter when exiting edit mode to force the array entry of the formula.</p> <p><a h...
Error in ABS When Non-Numeric Value is in Array
excel|excel-formula
0
39
1
71,162,443
71,162,443
3
true
2022-02-17T17:02:51.410Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error in ABS When Non-Numeric Value is in Array<p>I have a formula <code>=IFERROR(INDEX($A$1:$A$24, MATCH(MIN(ABS($B$1:$B$24)), ABS($B$1:$B$24),0)),&quot;NA&...
71,164,188
Angular - chaining Observables and combining their results<p>I want to run the following 2 requests in sequence and combine their results in the end.</p> <ol> <li>If the first request's response body contains<code>isSuccessful = false</code>, then the second one should not run.</li> <li>If the first request fails for w...
<p>The first thing everybody needs to know when starting out with rxjs is don't subscribe to an observable inside an observable. (I used to do this all the time too). There are operators which merge the outputs of observables that you should learn.</p> <p>In this case I will use <strong>switchMap</strong> inside the ...
Angular - chaining Observables and combining their results
javascript|angular|typescript|rxjs|observable
0
271
1
71,164,477
71,164,477
3
true
2022-02-17T19:18:43.203Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Angular - chaining Observables and combining their results<p>I want to run the following 2 requests in sequence and combine their results in the end.</p> <ol...
71,167,260
Column with # of times index is repeated<p>I have a pandas DataFrame in which some rows are repeated hence they have the same index</p> <p>Example:</p> <pre><code> A 0. 34 1. 12 1. 12 2. 21 2. 21 2. 21 </code></pre> <p>How can I create a column &quot;B&quot; which contains how ma...
<p>You can create a dummy column of 1s and <code>groupby</code> the index and use <code>cumsum</code> on the dummy column:</p> <pre><code>df['B'] = df.assign(one=1).groupby(level=0)['one'].cumsum() </code></pre> <p>Another option is to use <code>groupby</code> the index and use <code>cumcount</code> (and add 1) to get ...
Column with # of times index is repeated
python|pandas|dataframe|indexing|count
0
36
1
71,167,283
71,167,283
3
true
2022-02-18T01:02:20.453Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Column with # of times index is repeated<p>I have a pandas DataFrame in which some rows are repeated hence they have the same index</p> <p>Example:</p> <pre>...
71,163,241
How to scroll view pager (accompanist library) on button click in jetpack compose Android<p>i want to scroll the view pager horizontally on button click in jetpack compose.Anyone have any idea about this ? Here i am using Accompanist library.</p>
<p>You need to use pager state like this:</p> <pre><code>val state = rememberPagerState() val scope = rememberCoroutineScope() Button(onClick = { scope.launch { state.scrollToPage(state.currentPage + 1) // or state.scrollBy(100f) } }) { } VerticalPager( pagesCount, state = stat...
How to scroll view pager (accompanist library) on button click in jetpack compose Android
android-viewpager|android-jetpack-compose|jetpack-compose-accompanist
0
1,546
1
71,168,583
71,168,583
3
true
2022-02-17T18:05:01.687Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to scroll view pager (accompanist library) on button click in jetpack compose Android<p>i want to scroll the view pager horizontally on button click in j...
71,160,737
Tailwind/LaravelMix - Infinity Loop on watch<p>Problem is when I run <code>npm run watch</code> in console constantly looping. My CPU will explode. I found problem is in tailwind.config.js file.</p> <pre><code>purge: [ '**/*.+(html|php)', 'partials/*.+(html|php)', '*.php', '*.html' ], </code></pre> <p...
<blockquote> <p>yarn add fast-glob -D and then or npm i fast-glob -D</p> </blockquote> <pre><code>module.exports = { content: require('fast-glob').sync([ './**/*.php' ]), theme: { extend: {}, }, plugins: [], </code></pre> <p><a href="https://tailwindcss.com/docs/content-configuration#styles-rebuild-in-an-infini...
Tailwind/LaravelMix - Infinity Loop on watch
tailwind-css|laravel-mix
0
557
1
71,179,230
71,179,230
3
true
2022-02-17T15:16:15.227Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Tailwind/LaravelMix - Infinity Loop on watch<p>Problem is when I run <code>npm run watch</code> in console constantly looping. My CPU will explode. I found p...
71,179,165
Make position: absolute div the same width as the parent div<p>I have the following set up:</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>.nav-menu-container { display: f...
<p>You need to use <code>position: relative</code> on <code>.nav-option-container</code>, so that when setting <code>left: 0; right: 0;</code> in the inner child, it will refer to the bounds of its parent:</p> <pre class="lang-css prettyprint-override"><code>.nav-option-container { /* Add this */ position: relative...
Make position: absolute div the same width as the parent div
html|css
0
35
1
71,179,237
71,179,237
3
true
2022-02-18T19:53:07.960Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Make position: absolute div the same width as the parent div<p>I have the following set up:</p> <p><div class="snippet" data-lang="js" data-hide="false" data...
71,180,018
Font size not changing in HTML<p>So, after I tried all the answers in the forums over here, the font size of my webpage won't change. Here's what I currently have: <code>&lt;font size=&quot;40px&quot; face=&quot;Didot&quot;&gt;Hello&lt;/font&gt;</code> Okay, it will set to 40px, but if I try to make another one using 2...
<p><code>&lt;font&gt;</code> tag is deprecated. ( <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/font" rel="nofollow noreferrer">https://developer.mozilla.org/en-US/docs/Web/HTML/Element/font</a> )</p> <p>Use CSS styling instead. See the example below.</p> <p><div class="snippet" data-lang="js" data...
Font size not changing in HTML
html|css|fonts|size
0
519
3
71,180,079
71,180,079
3
true
2022-02-18T21:25:57.613Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Font size not changing in HTML<p>So, after I tried all the answers in the forums over here, the font size of my webpage won't change. Here's what I currently...
71,195,540
Can the main function be declared before is defined?<p>I know that the main function is just a &quot;special&quot; function, but can it be declared and then defined like any other function or not?</p> <p>This is also correct :</p> <pre><code>int main(void); int main(void) { } </code></pre> <p>or just this is correct ...
<p>It's fine to create a declaration for the <code>main</code> function (provided it matches the definition).</p> <p>It just won't be of any use because nothing else in your program calls <code>main</code>, or at least it shouldn't.</p>
Can the main function be declared before is defined?
c|function|declaration|program-entry-point|function-definition
0
26
1
71,195,566
71,195,566
3
true
2022-02-20T14:45:59.280Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can the main function be declared before is defined?<p>I know that the main function is just a &quot;special&quot; function, but can it be declared and then ...
71,186,173
How to query to sum facts in prolog?<p>I'm completely new to prolog and can't figure out how to query the following, creating a small example of what I'm trying to do:</p> <p>There is the set of facts:</p> <pre><code>calories(pizzaSlice, 250). calories(porkFillet, 400). </code></pre> <p>I need to know <em>&quot;How man...
<p>Please remember that Prolog is a declarative programming language based on first order logic. You cannot write functions in Prolog that return a value (as for example in Python), you always define logical predicates.</p> <p>The query for your example would be:</p> <pre><code>?- calories(pizzaSlice, CalPS), calor...
How to query to sum facts in prolog?
prolog
0
33
1
71,197,753
71,197,753
3
true
2022-02-19T15:02:33.993Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to query to sum facts in prolog?<p>I'm completely new to prolog and can't figure out how to query the following, creating a small example of what I'm try...
71,201,805
Avoid select data from other tables<p>I'm coding a movies web app, for showing some tags I'm trying to write a query that returns the movie name and the count of how many categorys has assigned it. I'm trying to add a filter that for example: if X movie contains a &quot;Comedy&quot; category this movie doesn't even nee...
<p>You need to put that condition in the <code>having</code> clause wich is the <code>where</code> clause of a group.</p> <pre><code>SELECT m.name, count(g.name) [Genres] FROM movies m INNER JOIN moviesGenres mg ON m.id = mg.movieId INNER JOIN genres g ON mg.genreId = g.id GROUP BY m.name HAVING sum(case when g.name ...
Avoid select data from other tables
sql-server|tsql|inner-join
0
36
2
71,201,851
71,201,851
3
true
2022-02-21T05:59:31.483Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Avoid select data from other tables<p>I'm coding a movies web app, for showing some tags I'm trying to write a query that returns the movie name and the coun...
71,224,141
How to make a cursor pick table data change?<p>I have the following cursor in a procedure :</p> <pre><code>procedure Run is Cur Cursor is select * from table where condition; R Cur%rowtype; Open Cur; loop fetch Cur into R; exit when Cur%notfound; -- Run some time consuming oper...
<p>No.</p> <p>The set of rows the cursor will return is determined at the time the cursor is opened. At that point, Oracle knows the current SCN (system change number) and will return the data as it existed at that point in time.</p> <p>Depending on the nature of the problem, you could write a loop that just keeps ask...
How to make a cursor pick table data change?
oracle|plsql
0
38
3
71,224,540
71,224,540
3
true
2022-02-22T15:39:38.307Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to make a cursor pick table data change?<p>I have the following cursor in a procedure :</p> <pre><code>procedure Run is Cur Cursor is select * from t...
71,227,971
Kubernetes Ingress - expose two paths under different hosts<p>I'm struggling with a following case. I have one service written in .NET Core with some sort of gateway, and because of that two following GraphQL endpoints are under:</p> <pre><code>https://my-local-cluster.svc/api/abc/graphql https://my-local-cluster.svc/a...
<p>Are you trying to make a request for <code>https://abc.ingresswebsite.com/graphql</code> go to <code>/api/abc/graphql</code> on your <code>my-abc-service</code> service?</p> <p>If so, then perhaps the nginx-ingress' <code>rewrite</code> functionality (<a href="https://kubernetes.github.io/ingress-nginx/examples/rewr...
Kubernetes Ingress - expose two paths under different hosts
kubernetes|kubernetes-ingress
0
273
1
71,228,772
71,228,772
3
true
2022-02-22T20:35:35.813Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Kubernetes Ingress - expose two paths under different hosts<p>I'm struggling with a following case. I have one service written in .NET Core with some sort of...
71,231,003
Is there an easy way to make my bot mention the person its moving?<p>so basically I wanted to make my bot move people to afk as soon as they deafen. and I have a command to make it generate messages in chat, but the question is, can I make it @ them as well? and if so how?</p> <p>code:</p> <pre><code> const Discord = r...
<p>To tag a user in discord, the format is &lt;@USERID&gt; so if a user's id is 1, you'd have to include &lt;@1&gt; in what you are sending.</p> <p>So onto your code, you'd have to change the last line to something like the following:</p> <pre class="lang-js prettyprint-override"><code>client.channels.cache.get(&quot;6...
Is there an easy way to make my bot mention the person its moving?
discord.js
0
37
1
71,231,049
71,231,049
3
true
2022-02-23T03:19:35.087Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there an easy way to make my bot mention the person its moving?<p>so basically I wanted to make my bot move people to afk as soon as they deafen. and I ha...
71,231,177
How make eloquent laravel relathionship migration with the same table?<p>if instead of having a users table where one user can follow many users. I would have a cows table where each cow has a single father and a single mother, where the parents can have many children. do I require an external table to store that or ca...
<p>You could do this. I've tested as well.</p> <p>Migration</p> <pre><code>Schema::create('cows', function (Blueprint $table) { $table-&gt;id(); $table-&gt;string('name'); $table-&gt;integer('father_id')-&gt;nullable(); $table-&gt;integer('mother_id')-&gt;nullable(); $table-&gt;timestamps(); }); </c...
How make eloquent laravel relathionship migration with the same table?
laravel|database|eloquent|migration|relationship
0
27
1
71,231,507
71,231,507
3
true
2022-02-23T03:52:02.960Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How make eloquent laravel relathionship migration with the same table?<p>if instead of having a users table where one user can follow many users. I would hav...
71,237,097
couldn't view image url even after setting to public aws s3<p><a href="https://thestobookimages.s3.ap-south-1.amazonaws.com/mark.jpeg" rel="nofollow noreferrer">https://thestobookimages.s3.ap-south-1.amazonaws.com/mark.jpeg</a> this image is in my aws s3 bucket and the bucket permissions are set to allow all public. Bu...
<p>You also have to edit bucket policy to allow public read.</p> <pre><code> { &quot;Version&quot;: &quot;2012-10-17&quot;, &quot;Statement&quot;: [ { &quot;Effect&quot;: &quot;Allow&quot;, &quot;Principal&quot;: &quot;*&quot;, &quot;Action&quot;: [ &quot;...
couldn't view image url even after setting to public aws s3
amazon-web-services|amazon-s3
0
26
1
71,237,188
71,237,188
3
true
2022-02-23T12:40:00.887Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: couldn't view image url even after setting to public aws s3<p><a href="https://thestobookimages.s3.ap-south-1.amazonaws.com/mark.jpeg" rel="nofollow noreferr...
71,255,950
Combine different columns into a new column in a dataframe using pandas<p>I have a sample dataframe of a very huge dataframe as given below.</p> <pre><code>import pandas as pd import numpy as np NaN = np.nan data = {'Start_x':['Tom', NaN, NaN, NaN,NaN], 'Start_y':[NaN, 'Nick', NaN, NaN, NaN], 'Start_z':[NaN, ...
<p>One option could be to backfill <code>Start</code> columns by rows and then take the first column:</p> <pre><code>df['New_Column'] = df.filter(like='Start').bfill(axis=1).iloc[:, 0] df Start_x Start_y Start_z Start_a Start_b Sex New_Column 0 Tom NaN NaN NaN NaN Male Tom 1 NaN...
Combine different columns into a new column in a dataframe using pandas
python-3.x|pandas|dataframe|data-science|data-analysis
0
31
1
71,256,134
71,256,134
3
true
2022-02-24T17:29:19.187Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Combine different columns into a new column in a dataframe using pandas<p>I have a sample dataframe of a very huge dataframe as given below.</p> <pre><code>i...
71,261,489
How to use SQL IN operator with CASE in select query where clause<pre><code>DECLARE @AreaType NVARCHAR(250); SET @AreaType = 'Test Area 1'; ---Test Area 2, Test Area 3, XYX SELECT [Area_Category_Id] AreaCategoryId ,[Area_Category] AreaCategoryName ,[Is_Active] IsActive FROM [dbo]...
<p>You don't use a <code>CASE</code> <em>expression</em> for that (precisely because its an expression not a statement), you use regular AND/OR logic e.g.</p> <pre><code>WHERE (@AreaType = 'Test Area 1' AND Area_Category_Id in (1,2,3)) OR (@AreaType = 'Test Area 2' AND Area_Category_Id in (4,5,6)) OR (@AreaType = 'Test...
How to use SQL IN operator with CASE in select query where clause
sql|sql-server
0
42
1
71,261,526
71,261,526
3
true
2022-02-25T05:36:35.043Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use SQL IN operator with CASE in select query where clause<pre><code>DECLARE @AreaType NVARCHAR(250); SET @AreaType = 'Test Area 1'; ---Test Area 2, ...
71,266,280
executeJavascript in Vaadin Testbench<p>when I try to get via UI.getCurrent().getPage() to executeJs , it says getPage() (or something above is null). How can I execute Javascript Commands in Testbench then?</p>
<p>In a TestBench test you can use <code>executeScript(script, args);</code> to execute Javascript</p> <p>You can find some extra information in <a href="https://vaadin.com/docs/latest/tools/testbench/low-level-element-interactions/#executing-javascript" rel="nofollow noreferrer">TestBench docs</a></p>
executeJavascript in Vaadin Testbench
spring|spring-boot|vaadin|vaadin-testbench
0
38
1
71,266,624
71,266,624
3
true
2022-02-25T13:03:37.217Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: executeJavascript in Vaadin Testbench<p>when I try to get via UI.getCurrent().getPage() to executeJs , it says getPage() (or something above is null). How ca...
71,266,544
Exit code of a jvm application running as a systemd service<p>I'm running an application written in scala (running on the jvm) as a systemd service configured with <code>ExecStart=java -jar Darts-Backend-assembly-0.1.0.jar</code>.</p> <p>On <code>systemctl stop darts</code> the application is terminated by sending it a...
<p>systemd services do actually have an option to handle a non-zero exit status as successful.</p> <pre><code>[Service] SuccessExitStatus=143 </code></pre> <p>Consider that, as expected, this doesn't change the fact that <code>0</code> is still a successful exit status.</p> <p>More info in the <a href="https://www.free...
Exit code of a jvm application running as a systemd service
java|scala|jvm|systemd
0
289
1
71,267,218
71,267,218
3
true
2022-02-25T13:24:55.727Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Exit code of a jvm application running as a systemd service<p>I'm running an application written in scala (running on the jvm) as a systemd service configure...
71,273,613
Error encountered when running rails new command<p>I want to start learning Ruby on Rails. I have installed ruby 2.7.0 via RVM. SQLite3 is also installed by default in ubuntu 20.04.3 LTS. My rails version is 7.0.2.2. When I run the command:</p> <pre><code>rails new blog </code></pre> <p>from this guide: <a href="https:...
<p>I solved my problem. It looks like it also needs git installed.</p>
Error encountered when running rails new command
ruby-on-rails|ruby|ruby-on-rails-7
0
299
2
71,273,648
71,273,648
3
true
2022-02-26T02:24:25.743Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error encountered when running rails new command<p>I want to start learning Ruby on Rails. I have installed ruby 2.7.0 via RVM. SQLite3 is also installed by ...
71,274,172
Pandas GroupBy for Highest Counted String?<p>Given a DataFrame like this:</p> <p><a href="https://i.stack.imgur.com/bYcAc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bYcAc.png" alt="BeginningDataframe" /></a></p> <p>Desired outcome:</p> <p><a href="https://i.stack.imgur.com/LC6OP.png" rel="nofoll...
<p>You could apply <code>mode</code>:</p> <pre><code>new_df = df.groupby('Symbol')['Recommendation'].apply(lambda x: x.mode()) </code></pre> <p>I guess we could also do the following:</p> <pre><code>s = df.groupby(['Symbol','Recommendation']).size() s = s.groupby(level=0).transform('max').eq(s) out = s.index[s].to_fram...
Pandas GroupBy for Highest Counted String?
python|python-3.x|pandas|dataframe|pandas-groupby
0
37
1
71,274,212
71,274,212
3
true
2022-02-26T04:52:33.363Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pandas GroupBy for Highest Counted String?<p>Given a DataFrame like this:</p> <p><a href="https://i.stack.imgur.com/bYcAc.png" rel="nofollow noreferrer"><img...
71,287,936
Why is my tkinter loop not modifying variable?<p>I am a beginner and experimented with tkinter (in Python) for a project. I am trying to let a loop pack numbers in a window but I yust cannot get it to work. It shuld count up from 0 but it packs only 0. Would be great if someone could help! Philipp</p> <pre><code>from t...
<p>You set <code>text</code> to 0 at each iteration:</p> <pre><code>from tkinter import * window = Tk() window.title(&quot;window&quot;) window.resizable(False, False) window.geometry(&quot;500x500&quot;) window.configure(background=&quot;white&quot;) i = 0 text = 0 # &lt;- MOVE HERE while i &lt; 100: label = La...
Why is my tkinter loop not modifying variable?
python|loops|user-interface|tkinter|widget
0
25
1
71,287,943
71,287,943
3
true
2022-02-27T19:40:20.857Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is my tkinter loop not modifying variable?<p>I am a beginner and experimented with tkinter (in Python) for a project. I am trying to let a loop pack numb...
71,305,066
Converting a Python list into a pandas dataframe while specifying certain elements as row labels<p>I have the below list called my_list and want to convert it to a new pandas dataframe where the strings starting with 'I=' will become the dataframe's row labels.</p> <pre><code>my_list=['I=113', 'PLAN=1', 'A=0PDFGB', ...
<p>We could use a loop cut the list into sublists and use the DataFrame constructor:</p> <pre><code>tmp = [] for item in my_list: if item.startswith('I'): tmp.append([]) tmp[-1].append(item) out = pd.DataFrame(tmp) </code></pre> <p>Output:</p> <pre><code> 0 1 2 3 4 ...
Converting a Python list into a pandas dataframe while specifying certain elements as row labels
python|pandas|list|dataframe
0
34
2
71,305,107
71,305,107
3
true
2022-03-01T07:31:45.403Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Converting a Python list into a pandas dataframe while specifying certain elements as row labels<p>I have the below list called my_list and want to convert i...
71,301,561
How does setReceiveTimeout work in pooled actor context?<p>I am working on some logic which involves shutting down idle actors. However these actors are pooled actors, which means the <code>ReceiveTimeout</code> message is sent to all the actors in the pool.</p> <p>The problem I'm running into is that if I have 5 actor...
<p>By pooled actors I am assuming you mean a router with pool characteristics? Presuming that, look at broadcast messages under the <a href="https://doc.akka.io/docs/akka/current/routing.html#specially-handled-messages" rel="nofollow noreferrer">specially handled messages</a> handling section of the docs.</p> <p>Set th...
How does setReceiveTimeout work in pooled actor context?
java|scala|akka|akka-actor
0
45
1
71,310,164
71,310,164
3
true
2022-02-28T22:02:36.423Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How does setReceiveTimeout work in pooled actor context?<p>I am working on some logic which involves shutting down idle actors. However these actors are pool...
71,309,874
Hiding Edit Menu of a SwiftUI / MacOS app<p>My MacOS app doesn't have any text editing possibilities. How can I hide the <code>Edit</code> menu which is added to my app automatically? I'd prefer to do this in SwiftUI.</p> <p>I would expect the code below should work, but it doesn't.</p> <pre class="lang-swift prettypri...
<p>To my knowledge you cannot hide the whole menu, you can just hide element groups inside of it:</p> <pre><code> .commands { CommandGroup(replacing: .pasteboard) { } CommandGroup(replacing: .undoRedo) { } } </code></pre>
Hiding Edit Menu of a SwiftUI / MacOS app
swift|macos|swiftui
0
542
3
71,312,338
71,312,338
3
true
2022-03-01T14:16:51.963Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Hiding Edit Menu of a SwiftUI / MacOS app<p>My MacOS app doesn't have any text editing possibilities. How can I hide the <code>Edit</code> menu which is adde...
71,313,869
If function error. Not equals to function not working<p>I am writing this program and it works fine, I leave it for sometime and the code stops working.</p> <p>Please help me in this function; Here is the code:</p> <pre><code>acceptables = [1, 2, 3, 4, 5, 6, 10] try : toss = input(&quot;Toss a number from 1 to 6 (1...
<p>You've got two problems:</p> <ol> <li><p><code>toss = input(...)</code> returns a string, but you want to compare that value to <code>int</code>s. Try a type conversion: <code>toss = int(toss)</code> to transform your <code>str</code> from <code>&quot;1&quot;</code> to <code>1</code>.</p> </li> <li><p>You're checkin...
If function error. Not equals to function not working
python|python-3.x|if-statement
0
35
2
71,313,890
71,313,890
3
true
2022-03-01T19:46:17.297Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: If function error. Not equals to function not working<p>I am writing this program and it works fine, I leave it for sometime and the code stops working.</p> ...
71,318,704
Getting list of blobs (artifacts) exported as part of failed export operation<p>We can very much get a list of exported artifacts using <code>.show operation &lt;OperationId&gt; details</code>. But this only works for the export operation which succeeded. Let's say we have an export operation which ran for some time an...
<p>No, unfortunately this information is not available.</p>
Getting list of blobs (artifacts) exported as part of failed export operation
azure-data-explorer
0
20
1
71,321,723
71,321,723
3
true
2022-03-02T07:11:34.250Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Getting list of blobs (artifacts) exported as part of failed export operation<p>We can very much get a list of exported artifacts using <code>.show operation...
71,328,423
Can you subtract from multi DF columns based on DF2 single column?<p>I have DF1 with several int columns and DF2 with 1 int column</p> <p><code>DF1</code>:</p> <pre><code>Year Industrial Consumer Discretionary Technology Utilities Energy Materials Communications Consumer Staples Health Care #No L1 US Ag...
<p>Assuming &quot;Year&quot; is the index for both (if not, you can make it the index using <code>set_index</code>), you can use <code>sub</code> on axis:</p> <pre><code>df3 = df1.sub(df2['Values'], axis=0) </code></pre> <p>Output:</p> <pre><code> Industrial Consumer Discretionary Technology Utilities Energ...
Can you subtract from multi DF columns based on DF2 single column?
python|pandas|dataframe|numpy
0
32
1
71,328,514
71,328,514
3
true
2022-03-02T19:53:11.377Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can you subtract from multi DF columns based on DF2 single column?<p>I have DF1 with several int columns and DF2 with 1 int column</p> <p><code>DF1</code>:</...
71,331,415
Simple syntax to print out Nim address<p>How to print out Nim address just like in C:</p> <pre><code> int array[] = { 7, 8, 9 }; printf(&quot; %p &quot;, (void *)&amp;array); </code></pre> <p>? the try:</p> <pre><code> var arr = newSeq[array[2,int]](2) refVar = addr arr echo refVar </code></pre> <p>gave:</p> <...
<p>Use <code>repr</code> to get a string representation of a value that also contains the memory address:</p> <pre><code>var arr = newSeq[array[2,int]](2) refVar = addr arr echo arr.repr # 0x7f5c2fcbd050@[[0, 0], [0, 0]] echo refVar.repr # ptr 0x564bd37d7528 --&gt; 0x7f5c2fcbd050@[[0, 0], [0, 0]] </code></pre>
Simple syntax to print out Nim address
nim-lang
0
286
2
71,331,499
71,331,499
3
true
2022-03-03T02:22:50.080Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Simple syntax to print out Nim address<p>How to print out Nim address just like in C:</p> <pre><code> int array[] = { 7, 8, 9 }; printf(&quot; %p &quot;, (v...
71,338,453
Get the list based on its size from a Map of List using Java 8<p>I have a <code>Map&lt;String, List&lt;String&gt;&gt;</code>. I am trying to retrieve all the <code>List&lt;String&gt;</code> from the map which has size &gt; 1 and collect them to a new list.</p> <p>Trying to find out a way to do it in Java 8.</p> <p>Belo...
<p>You are streaming over the <em>entries</em> (key-value pairs), not the values themselves, hence the unexpected result. If you instead stream over the values (since it seems like you don't care about the keys), you get the desired output:</p> <pre class="lang-java prettyprint-override"><code>map.values().stream() ...
Get the list based on its size from a Map of List using Java 8
java|lambda|java-stream
0
289
1
71,338,584
71,338,584
3
true
2022-03-03T14:01:24.670Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get the list based on its size from a Map of List using Java 8<p>I have a <code>Map&lt;String, List&lt;String&gt;&gt;</code>. I am trying to retrieve all the...
71,353,396
lme can't find functions to set correlation / covariance structure and weights<p>I'm currently trying to fit a multivariate mixed model.</p> <p>I'm trying to include weights and a covariance structure like so:</p> <pre><code>model &lt;- nlme::lme(fixed = ..., data = ...., random = ..., weights = varIdent(form = ~ 1...
<p>Do you call <code>library(nlme)</code> before running? And did you try including <code>nlme::corAR1()</code>/<code>nlme::varIdent()</code> inside the call itself ?</p>
lme can't find functions to set correlation / covariance structure and weights
r|namespaces|covariance|mixed-models|nlme
0
40
1
71,353,510
71,353,510
3
true
2022-03-04T15:11:54.847Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: lme can't find functions to set correlation / covariance structure and weights<p>I'm currently trying to fit a multivariate mixed model.</p> <p>I'm trying to...
71,372,237
how to conditionally apply text to data variable based on props in VueJS<p>How can I conditionally apply value to the data variable based on props, the ternary operator is generating error, I would like to refer to this code:</p> <pre><code>&lt;template&gt; &lt;div class=&quot;absolute left-3 top-1/2&quot;&gt; &l...
<p>If you need a <code>data</code> variable that depends of another variable, you must use a computed property.</p> <p>You have to check about that on de official docs: <a href="https://vuejs.org/guide/essentials/computed.html" rel="nofollow noreferrer">Computed Properties</a></p> <p>And instead of hamburguerUrl on dat...
how to conditionally apply text to data variable based on props in VueJS
javascript|vue.js|vuejs2|vue-component
0
25
1
71,373,327
71,373,327
3
true
2022-03-06T16:44:27.397Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to conditionally apply text to data variable based on props in VueJS<p>How can I conditionally apply value to the data variable based on props, the terna...
71,381,955
Adding random integers to list if criteria met<p>I am trying to make function <code>make(ls)</code> generate a list of 4 random integers. If these integers passes the three checks in the function <code>check(ls)</code> they should be added as a list to res. If they do not pass another set will be generated until I have...
<p>You call the function with a nested list, dont do this</p> <pre><code>if check([tmp]) == True: </code></pre> <p>should just be</p> <pre><code>if check(tmp): </code></pre>
Adding random integers to list if criteria met
python|list|random
0
38
1
71,381,988
71,381,988
3
true
2022-03-07T13:38:32.443Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Adding random integers to list if criteria met<p>I am trying to make function <code>make(ls)</code> generate a list of 4 random integers. If these integers p...
71,382,685
Multiple inheritance - Child class problem in randomly choosing a method<p>My code should make the <code>Parrot</code> class randomly choose only one method of speaking, what the code currently does is repeat all the lines at the same time.</p> <ul> <li>Current output</li> </ul> <pre><code>This is my ninja way! Hi, I a...
<p>That's because you call all methods in the <code>choice()</code> call. Choose the method first, and then call it.</p> <pre class="lang-py prettyprint-override"><code>class Parrot(Naruto, Goku, Seiya): def repeat(self): print(random.choice((super().talk1, super().talk2, super().talk3))()) </code></pre> <p...
Multiple inheritance - Child class problem in randomly choosing a method
python|random
0
34
2
71,382,737
71,382,737
3
true
2022-03-07T14:36:11.290Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Multiple inheritance - Child class problem in randomly choosing a method<p>My code should make the <code>Parrot</code> class randomly choose only one method ...
71,383,142
dockerised react.js app, module not found<p>I need to dockerize my react app, but incurring in some troubles:</p> <pre><code>Compiled with problems: ERROR in ./node_modules/graphql-tag/lib/index.js 2:0-32 Module not found: Error: Can't resolve 'graphql' in '/app/node_modules/graphql-tag/lib' ERROR in ./node_modules...
<p><code>graphql</code> is not listed in your <code>package.json</code></p> <p>Run <code>npm i --save graphql</code>, then rebuild your Docker container.</p> <p>This should fix the error.</p>
dockerised react.js app, module not found
node.js|reactjs|docker
0
279
2
71,383,357
71,383,357
3
true
2022-03-07T15:10:25.640Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: dockerised react.js app, module not found<p>I need to dockerize my react app, but incurring in some troubles:</p> <pre><code>Compiled with problems: ERROR i...
71,384,236
Creating a new dataframe with averages from another dataframe with multiple conditions in R<p>I have fish count data and am trying to create a new dataframe using averages of the measurements based on conditions of two different columns. here is my data:</p> <pre><code>df &lt;- structure(list(SITE = structure(c(1L, 1L,...
<pre class="lang-r prettyprint-override"><code>library(dplyr) df %&gt;% group_by(SITE, ZONE) %&gt;% summarise( across(where(is.numeric), mean) ) # A tibble: 15 x 8 # Groups: SITE [3] SITE ZONE C_TOTAL C_M2 TRANS_A SCARID_T ACAN_T SIG_T &lt;fct&gt; &lt;fct&gt; &lt;dbl&gt; ...
Creating a new dataframe with averages from another dataframe with multiple conditions in R
r|dataframe
0
19
1
71,384,292
71,384,292
3
true
2022-03-07T16:30:11.670Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Creating a new dataframe with averages from another dataframe with multiple conditions in R<p>I have fish count data and am trying to create a new dataframe ...
71,394,586
data.table get the values in a column conditional to the results of another column<pre><code>df = data.table( ID = c(&quot;A&quot;,&quot;B&quot;,&quot;C&quot;,&quot;D&quot;,&quot;E&quot;,&quot;F&quot;,&quot;G&quot;), price = c(100,101,102,103,104,102,101), ID2=c(&quot;a&quot;,&quot;b&quot;,&quot;b&quot;,&quot;b&quot...
<p>You can do:</p> <pre class="lang-r prettyprint-override"><code>library(data.table) df[, .SD[which.max(price)], by=ID2] # ID2 ID price #1: a A 100 #2: b D 103 #3: c E 104 </code></pre> <hr /> <p>In <code>dplyr</code> you would have:</p> <pre class="lang-r prettyprint-override"><code>library(dplyr) d...
data.table get the values in a column conditional to the results of another column
r|data.table|conditional-formatting
0
38
1
71,394,635
71,394,635
3
true
2022-03-08T11:51:07.010Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: data.table get the values in a column conditional to the results of another column<pre><code>df = data.table( ID = c(&quot;A&quot;,&quot;B&quot;,&quot;C&quo...
71,402,693
Unpermitted parameter: :images in Rails<p>I'm new to Rails and have started building my first api; I'm attempting to send an array of strings down as one of the parameters in my api request, like this:</p> <pre><code>{ &quot;name&quot;: &quot;doot doot&quot;, &quot;plans&quot;: &quot;&quot;, &quot;sketches&quot;:...
<p>You need to specify that <code>images</code> is an array.</p> <pre><code> params.require(:project).permit(:name, :plans, :sketches, images: []) </code></pre> <p>See <a href="https://guides.rubyonrails.org/action_controller_overview.html#permitted-scalar-values" rel="nofollow noreferrer">Permitted Scalar Values</a> ...
Unpermitted parameter: :images in Rails
ruby-on-rails
0
31
1
71,402,792
71,402,792
3
true
2022-03-08T23:33:55.100Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unpermitted parameter: :images in Rails<p>I'm new to Rails and have started building my first api; I'm attempting to send an array of strings down as one of ...
71,423,094
Place Holder not visible react-number-format<h4>Current behavior</h4> <p>Place holder is not visible for phone number mask</p> <h4>Expected behavior</h4> <p>Place holder to be visible and on focus the input format and mask to be applied while user is entering data</p> <h4>CodeSandbox link illustrating the issue</h4> <p...
<p>It's because you have <code>allowEmptyFormatting ={true}</code>, which will format the box when empty and thus override the placeholder. <a href="https://github.com/s-yadav/react-number-format" rel="nofollow noreferrer">Docs</a></p> <p>You can see the placeholder if you set it to <code>false</code>. So confirming it...
Place Holder not visible react-number-format
javascript|css|reactjs|react-number-format
0
285
1
71,423,299
71,423,299
3
true
2022-03-10T11:08:32.537Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Place Holder not visible react-number-format<h4>Current behavior</h4> <p>Place holder is not visible for phone number mask</p> <h4>Expected behavior</h4> <p>...
71,306,860
How to check the Cortex-M4 VTOR register with gdb command?<p>(I am learning about ARM debugging so this may be a dumb question.)</p> <p>I checked the ARMv7-M Arch Ref Manual. It says the reset vector offset is stored in the VTOR (Vector Table Offset Register).</p> <p>I am using a gdb specific to the Cortex-M. So I expe...
<p>Add the missing region using the gdb <a href="https://sourceware.org/gdb/onlinedocs/gdb/Memory-Region-Attributes.html" rel="nofollow noreferrer"><code>mem</code> command.</a></p> <pre class="lang-none prettyprint-override"><code>mem 0xE0000000 0xE00FFFFF </code></pre> <p>Then you will be able to access the VTOR at 0...
How to check the Cortex-M4 VTOR register with gdb command?
arm|gdb|embedded|cortex-m|armv7
0
284
2
71,319,204
71,319,204
3
true
2022-03-01T10:16:23.347Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to check the Cortex-M4 VTOR register with gdb command?<p>(I am learning about ARM debugging so this may be a dumb question.)</p> <p>I checked the ARMv7-M...
71,259,942
How to notify user of a Google Script if the getUI method fails?<p>While coding a simple Google Script for multiple non-programmer users, I noticed a strange bug. If the browser is open too long, sometimes the document doesn't link to the script anymore. Then the initial methods fail. It crashes the script. This oc...
<p>From the question:</p> <blockquote> <p>Without the UI methods, is there a way to tell them info? Like a title, hint, tip, etc?</p> </blockquote> <p>In Google Sheets you might use SpreadsheetApp.toast.</p> <p>Another option is to designate an element in your file, a range in Google Sheets, a paragraph in Google Docu...
How to notify user of a Google Script if the getUI method fails?
html|user-interface|google-apps-script|google-sheets
0
40
1
71,260,325
71,260,325
3
true
2022-02-25T01:08:39.767Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to notify user of a Google Script if the getUI method fails?<p>While coding a simple Google Script for multiple non-programmer users, I noticed a strange...
71,135,726
How to programmatically refresh spring bean<p>We have a Spring application responsible for doing some integration work that is expected to be up and running 24 x 7.</p> <p>One of the integration patterns we use is JMS messaging using a bunch of clustered IBM MQ queue managers. With clustered IBM MQ queue managers if on...
<p>I understand what you wan to do, so I tested a few ways and got this:</p> <pre><code>@SpringBootApplication public class DemoApplication implements CommandLineRunner { @Autowired AnnotationConfigReactiveWebServerApplicationContext context; public static void main(String[] args) { SpringApplicat...
How to programmatically refresh spring bean
java|spring|spring-boot
0
286
1
71,136,044
71,136,044
3
true
2022-02-16T02:32:56.013Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to programmatically refresh spring bean<p>We have a Spring application responsible for doing some integration work that is expected to be up and running ...
71,286,902
Numba function No matching definition for argument type(s) ListType[array(float64, 2d, C)] error<p>I have a function in <code>Numba</code> that uses a <code>List(float64[:,::1])</code> type, this is a dummy function to try out the type, I will do a lot of operations under the for loop. It has an strange behavior, while...
<p>For anybody stuck in something trivial like this, turns out the correct signature type is:</p> <pre><code>@numba.njit('List(int64)(ListType(float64[:, ::1]))') </code></pre> <p>I do not understand the differences between <code>List</code> and <code>ListType</code> and I could not find it on the <code>Numba</code> of...
Numba function No matching definition for argument type(s) ListType[array(float64, 2d, C)] error
python|numba
0
542
1
71,305,043
71,305,043
3
true
2022-02-27T17:19:33.210Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Numba function No matching definition for argument type(s) ListType[array(float64, 2d, C)] error<p>I have a function in <code>Numba</code> that uses a <code>...
71,345,683
how to enable RabbitMQ management api for RabbitMQContainer of testcontainers<p>I am using RabbitMQContainer to do integration test, I have the below set up:</p> <pre><code>@Container final static RabbitMQContainer rabbitMQContainer = new RabbitMQContainer(DockerImageName.parse(RABBITMQ_IMAGE)) .withExposed...
<p>Using <code>withCommand</code> will override the default command of the Docker image and therefore break the startup contract with the <code>RabbitMQContainer</code> implementation.</p> <p>I am no RabbitMQ expert, but can you use such a config and enable <code>rabbitmq_management</code> via the plugin setter?</p> <p...
how to enable RabbitMQ management api for RabbitMQContainer of testcontainers
java|spring-boot|docker|testcontainers
0
535
1
71,348,852
71,348,852
3
true
2022-03-04T01:36:27.183Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to enable RabbitMQ management api for RabbitMQContainer of testcontainers<p>I am using RabbitMQContainer to do integration test, I have the below set up:...
71,126,351
How do I web-scrape this website using Beautiful Soup<p>I am trying to scrape a website to print out events with their time and date</p> <pre><code>with open('events.html', 'r', encoding='utf-8') as html_file: content = html_file.read() soup = BeautifulSoup(content, 'lxml') free_slot = soup.find_all('tr', class_='vie...
<h3>What happens?</h3> <p>ResultSet is empty cause there is no <code>&lt;tr&gt;</code> with these classes defined in your <code>find_all()</code>.</p> <h3>How to fix?</h3> <p>Remove the classes from your <code>find_all()</code> and iterate over:</p> <pre><code>free_slot = soup.find_all('tr') for slot in free_slot: ...
How do I web-scrape this website using Beautiful Soup
python|html|web-scraping|beautifulsoup
0
40
1
71,127,094
71,127,094
3
true
2022-02-15T12:20:55.427Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I web-scrape this website using Beautiful Soup<p>I am trying to scrape a website to print out events with their time and date</p> <pre><code>with open...
71,116,335
IF Statement for Range of Cells that Contain Specific Text<p>I wanted to create a formula whereby it can automatically return a statement if the range contains the certain text.</p> <p>Here's example of my data:</p> <p><a href="https://i.stack.imgur.com/5k7WJ.png" rel="nofollow noreferrer"><img src="https://i.stack.img...
<p>Change the logic up slightly by checking for <code>Both</code> first:</p> <pre><code>=IF(COUNTIF(I2:O2,&quot;B*&quot;),IF(COUNTIF(I2:O2,&quot;A*&quot;),&quot;Both&quot;,&quot;B&quot;),IF(COUNTIF(I2:O2,&quot;A*&quot;),&quot;A&quot;,&quot;Others&quot;)) </code></pre> <p><a href="https://i.stack.imgur.com/FgyhC.png" re...
IF Statement for Range of Cells that Contain Specific Text
excel|if-statement|excel-formula
0
280
1
71,116,429
71,116,429
3
true
2022-02-14T18:05:56.113Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: IF Statement for Range of Cells that Contain Specific Text<p>I wanted to create a formula whereby it can automatically return a statement if the range contai...
71,199,218
Getting a weird 'local variable referenced before assignment' error<p>Here's the code - it's a class method.</p> <pre><code> def update(self,xxx): print(&quot;update=&quot; + str(xxx)) str = &quot;{:.2f}&quot;.format(xxx) </code></pre> <p>getting error on the print statement.</p> <p><code>Na...
<p>The problem isn't with the <code>xxx</code> parameter, but with the local <code>str</code> variable.</p> <p>The intent of the code isn't entirely clear to me, but if you rename the <code>str</code> variable to something else (<code>foo</code>, for example), it should work:</p> <pre><code>def update(self, xxx): p...
Getting a weird 'local variable referenced before assignment' error
python-3.x
0
45
2
71,199,249
71,199,249
3
true
2022-02-20T22:04:07.937Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Getting a weird 'local variable referenced before assignment' error<p>Here's the code - it's a class method.</p> <pre><code> def update(self,xxx): ...
71,283,715
How to spawn a repeating task and await its first execution?<p>Re-building <code>setInterval</code> in JS:</p> <pre class="lang-rust prettyprint-override"><code>pub async fn set_interval&lt;T, F&gt;(interval: Duration, do_something: T) where T: (Fn() -&gt; F) + Send + Sync + 'static, F: Future + Send, { let...
<p>To answer your two questions:</p> <ol> <li>Don't worry about spawning a task too many: On your average hardware, you should be able to spawn a few 100,000 of them per second. It is unnecessary in this case, though, because:</li> <li>Tasks get &quot;detached&quot; if they are dropped, so the futures inside them conti...
How to spawn a repeating task and await its first execution?
rust|async-await|rust-tokio
0
259
1
71,283,781
71,283,781
3
true
2022-02-27T09:50:07.863Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to spawn a repeating task and await its first execution?<p>Re-building <code>setInterval</code> in JS:</p> <pre class="lang-rust prettyprint-override"><c...
71,238,890
In Android, how to test the if of a code that is from the DatabaseReference class to see if the code returns true or false?<p>The following code shows what I really mean:</p> <p><a href="https://i.stack.imgur.com/IzuXi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IzuXi.png" alt="enter image descri...
<p>The <code>reference</code> object in your code is of type <a href="https://firebase.google.com/docs/reference/android/com/google/firebase/database/DatabaseReference" rel="nofollow noreferrer">DatabaseRefence</a>, which cannot be used in an if statement as it doesn't return a <a href="https://docs.oracle.com/javase/7...
In Android, how to test the if of a code that is from the DatabaseReference class to see if the code returns true or false?
java|android|firebase|firebase-realtime-database
0
28
1
71,239,210
71,239,210
3
true
2022-02-23T14:36:13.097Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: In Android, how to test the if of a code that is from the DatabaseReference class to see if the code returns true or false?<p>The following code shows what I...
71,212,503
Changing a string with dates into days after Jan. 1, 2010<p>For the function below, I am inputting a string like &quot;6/29/2020&quot; and &quot;8/10/2010&quot; and I want to get a numbers of days after Jan. 1, 2010. For example, if I input &quot;1/29/2010&quot;, I want the integer 29 to be returned.</p> <p>Currently, ...
<p><code>datetime</code> has a function for parsing dates, and subtracting two <code>datetime</code> objects gives a <code>timedelta</code> object with a <code>.days</code> attribute:</p> <pre class="lang-py prettyprint-override"><code>from datetime import datetime def days_since_jan1_2010(date): dt = datetime.str...
Changing a string with dates into days after Jan. 1, 2010
python|datetime
0
35
2
71,212,595
71,212,595
3
true
2022-02-21T20:14:44.343Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Changing a string with dates into days after Jan. 1, 2010<p>For the function below, I am inputting a string like &quot;6/29/2020&quot; and &quot;8/10/2010&qu...
71,228,757
Delete all objects from a directory in google storage bucket using cloud storage options<p>I'm using cloud storage options from google cloud to manage data in a GCP bucket. I've a directory under which I want to delete all the objects before I start writing new objects. sample directory: gs://bucket-name/directory1/sub...
<p>Iterate over <code>objects</code> in the <code>bucket</code> with a prefix of the directory name.</p> <p>See the following snippet:</p> <pre><code>Storage storage = StorageOptions.newBuilder().setProjectId(projectId).build().getService(); Page&lt;Blob&gt; blobs = storage.list( bucketName, Storage.Blo...
Delete all objects from a directory in google storage bucket using cloud storage options
google-cloud-platform|google-cloud-storage|google-bucket
0
1,035
1
71,228,980
71,228,980
3
true
2022-02-22T21:51:31.313Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Delete all objects from a directory in google storage bucket using cloud storage options<p>I'm using cloud storage options from google cloud to manage data i...
71,257,331
How do I set Cache-Control metadata on a uniform bucket?<p>I have a bucket of images on Google Cloud storage. I've set the bucket's access control to uniform and made the bucket public. I'd now like to set the <code>Cache-Control</code> metadata for the bucket to have a <code>max-age</code> of one year, rather than the...
<p>The error you have is not related to setting object/s metadata! it means the <code>identity</code> (<code>google account</code> or the <code>service-account</code>) that you are using does not have permission to update objects in <code>buckets</code>.</p> <p>You need to review the IAM permissions given to your <code...
How do I set Cache-Control metadata on a uniform bucket?
google-cloud-platform|google-cloud-storage|firebase-storage|google-cloud-shell|google-cloud-console
0
282
1
71,260,470
71,260,470
3
true
2022-02-24T19:34:05.730Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I set Cache-Control metadata on a uniform bucket?<p>I have a bucket of images on Google Cloud storage. I've set the bucket's access control to uniform...
71,411,109
run moment(new Date()) each second in Reactjs<p>I have this code</p> <pre><code>import &quot;./assets/styles/App.scss&quot;; import moment from &quot;moment&quot;; import React from &quot;react&quot;; function App() { let date = moment(new Date()).format(&quot;dddd, MMMM Do YYYY, h:mm:ss a&quot;) return &lt;div c...
<p>The best way would be to register an interval to the browser when the component is mounted with the <a href="https://developer.mozilla.org/en-US/docs/Web/API/setInterval" rel="nofollow noreferrer">setInterval</a> function.</p> <blockquote> <p>The setInterval() method, offered on the Window and Worker interfaces, rep...
run moment(new Date()) each second in Reactjs
reactjs
0
41
2
71,411,184
71,411,184
3
true
2022-03-09T14:40:46.123Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: run moment(new Date()) each second in Reactjs<p>I have this code</p> <pre><code>import &quot;./assets/styles/App.scss&quot;; import moment from &quot;moment&...
71,375,854
How to find a regular expression to display headlines without extra characters?<p>I am attempting to figure out a regular expression that will display the headlines from a news feed of a stock.</p> <p>This is the code I have so far, with the special characters of the regular expression being &quot;&lt;title.*?&lt;/&quo...
<p>You can make a &quot;capturing group&quot; in the regex:</p> <pre class="lang-py prettyprint-override"><code>import re, requests def yahoo_hl(ticker): headers={&quot;User-Agent&quot;: &quot;Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:86.0) Gecko/20100101 Firefox/86.0&quot;} xml = requests.get(f'https://fee...
How to find a regular expression to display headlines without extra characters?
python|python-3.x
0
41
1
71,375,873
71,375,873
3
true
2022-03-07T02:30:13.483Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to find a regular expression to display headlines without extra characters?<p>I am attempting to figure out a regular expression that will display the he...
71,303,458
Getting data from Flutter Firebase Realtime Database when onChildAdded<p>I will first say that I am a firmware developer trying to make a web interface for a personal project. My question might be basic as this is my first web interface with a database. I have searched quite a bit on how to achieve what I am trying to ...
<blockquote> <p>My first issue is that this function is triggered for all the child at first before waiting for new ones which is unnecessary and could be a problem when I begin to have a lot of data.</p> </blockquote> <p>The Firebase Realtime Database synchronizes the state of the path/query that you listen to. So it ...
Getting data from Flutter Firebase Realtime Database when onChildAdded
firebase|flutter|dart|firebase-realtime-database
0
275
1
71,303,602
71,303,602
3
true
2022-03-01T03:38:28.340Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Getting data from Flutter Firebase Realtime Database when onChildAdded<p>I will first say that I am a firmware developer trying to make a web interface for a...
71,371,089
Pyautogui Clicks in Wrong Position on MacBook<p>I am trying to make a program that clicks a color on the screen. However, it clicks in the complete wrong position. I set the region to be the exact same resolution as my screen. I even tried saving the screenshot and it looked exactly as expected.</p> <p>I am on a MacBoo...
<p>Pixels are not the same as screen coordinates. If you have a <a href="https://support.apple.com/en-us/HT202471" rel="nofollow noreferrer">Retina display</a> (which many Apple screens after 2015 have), then every screen coordinate contains 4 pixels.</p> <p>To get the correct position, divide the pixel coordinates by ...
Pyautogui Clicks in Wrong Position on MacBook
python|pyautogui
0
270
1
71,371,233
71,371,233
3
true
2022-03-06T14:20:21.963Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pyautogui Clicks in Wrong Position on MacBook<p>I am trying to make a program that clicks a color on the screen. However, it clicks in the complete wrong pos...
71,143,651
Why is my matrix showing the wrong output?<p>I am trying to find the permutations of the array [1,2,3] using recursion. Everything is working fine if I directly print out the permutations in the base case but I want to store all the permutations in a separate array. I am doing that by pushing the arrays into the matrix...
<p>you are pushing the same array <code>arr</code> multiple time into <code>matrix</code>, so when you update it later, it update all the lines in <code>matrix</code> since they are the same reference to the same array.</p> <p>Try duplicating the array <code>arr</code> before:</p> <pre><code>matrix.push(arr.slice()); <...
Why is my matrix showing the wrong output?
javascript|arrays|recursion
0
37
1
71,143,765
71,143,765
3
true
2022-02-16T14:26:55.210Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is my matrix showing the wrong output?<p>I am trying to find the permutations of the array [1,2,3] using recursion. Everything is working fine if I direc...
71,093,912
Why does Rust require Copy and Clone traits for simple enum<p>The following code will not compile unless <code>Copy</code> and <code>Clone</code> traits are derived in the enum. Why is this a requirement given that the enum is basically an <code>i8</code> and <a href="https://doc.rust-lang.org/book/ch04-01-what-is-owne...
<p><code>Clone</code> has nothing to do with the heap. <code>Clone</code> does not imply heap-allocated for any type, be they <code>struct</code>s, <code>enum</code>s, and whether they have a <code>#[repr]</code> attribute or not. <code>Clone</code> is just a normal trait.</p> <p>And traits aren't implemented automatic...
Why does Rust require Copy and Clone traits for simple enum
rust|enums
0
550
1
71,094,046
71,094,046
4
true
2022-02-12T16:52:26.440Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does Rust require Copy and Clone traits for simple enum<p>The following code will not compile unless <code>Copy</code> and <code>Clone</code> traits are ...
71,113,115
Node axios not sending correct header: 'Content-Type': 'multipart/form-data'<p>I am attempting to upload a file using the Node example provided in the <a href="https://legacydocs.hubspot.com/docs/methods/files/v3/upload_new_file" rel="nofollow noreferrer">HubSpot docs</a>.</p> <p>I am receiving <code>415(Unsupported me...
<p>The Node example you link to uses the (deprecated) <a href="https://www.npmjs.com/package/request" rel="nofollow noreferrer"><code>request</code> module</a>, not Axios.</p> <p>To use Axios (<a href="https://github.com/axios/axios#form-data" rel="nofollow noreferrer">source</a>) you would rewrite that as:</p> <pre><c...
Node axios not sending correct header: 'Content-Type': 'multipart/form-data'
javascript|node.js|axios|fs|hubspot-api
0
1,545
2
71,113,189
71,113,189
4
true
2022-02-14T14:02:03.200Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Node axios not sending correct header: 'Content-Type': 'multipart/form-data'<p>I am attempting to upload a file using the Node example provided in the <a hre...
71,116,446
Most efficient way to create searchable "array" in VB.NET<p>I would like to create a multidimensional array of some description in VB.NET that can store and search the following data efficiently (search on the second dimension, to return the first).</p> <div class="s-table-container"> <table class="s-table"> <thead> <t...
<pre><code>Dim data As New Dictionary(Of String, String) From { {&quot;xls&quot;, &quot;excel&quot;}, {&quot;xlsx&quot;, &quot;excel&quot;}, {&quot;doc&quot;, &quot;word&quot;}, {&quot;docx&quot;, &quot;word&quot;}, {&quot;ppt&quot;, &quot;powerpoint&quot;}, {&quot;pptx&quot;, &quot;powerpoin...
Most efficient way to create searchable "array" in VB.NET
arrays|vb.net|dictionary|arraylist|multidimensional-array
0
33
1
71,116,485
71,116,485
4
true
2022-02-14T18:15:32.920Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Most efficient way to create searchable "array" in VB.NET<p>I would like to create a multidimensional array of some description in VB.NET that can store and ...
71,119,936
DiscordAPIError: Interaction has already been acknowledged. Discord.js react() function problem<p>I have this poll command that creates a new MessageEmbed, and then I want the bot to react to the votes with 4 emotes, to be able to vote in the poll. The problem is when I use the <code>reply()</code> function with an int...
<p>You forgot to <code>await</code> your <code>interaction.reply</code>.</p> <p>It should be</p> <pre class="lang-js prettyprint-override"><code>message = await interaction.reply({ embeds: [pollEmbed], fetchReply: true }); </code></pre>
DiscordAPIError: Interaction has already been acknowledged. Discord.js react() function problem
javascript|discord|discord.js
0
13,056
2
71,120,832
71,120,832
4
true
2022-02-15T00:44:28.903Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: DiscordAPIError: Interaction has already been acknowledged. Discord.js react() function problem<p>I have this poll command that creates a new MessageEmbed, a...
71,154,279
golang - struct in sync map access<p>I am trying to load struct type data arbitrarily defined in sync map. Is there any convenient way to access the map type by defining (like generic, sync.Map[struct]{})?</p> <pre><code>package main import ( &quot;sync&quot; ) type mystruct struct { cnt int } func (m *mystr...
<blockquote> <p>but is that really only solution?</p> </blockquote> <p>Yes. Or wait for Go 1.18 and wrap sync.Map in a generic container.</p>
golang - struct in sync map access
go
0
782
1
71,154,370
71,154,370
4
true
2022-02-17T07:54:55.587Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: golang - struct in sync map access<p>I am trying to load struct type data arbitrarily defined in sync map. Is there any convenient way to access the map type...
71,209,853
Testing for exceptions being raised<p>I'm new to ruby. Trying to write a test that passes when an exception is raised, for example:</p> <pre><code> def network_data_unavailable assert_raise StandardError, NetworkSim.sim(totalUse, 3, &quot;five&quot;) end </code></pre> <p>Those inputs will cause a StandardError to...
<p>First of all, I think the method you're looking for is <code>assert_raises</code>, not <code>assert_raise</code>. Then you need to call it correctly <a href="https://www.rubydoc.info/github/seattlerb/minitest/Minitest/Assertions#assert_raises-instance_method" rel="nofollow noreferrer">by giving it a block</a>:</p> <...
Testing for exceptions being raised
ruby|minitest
0
43
1
71,210,214
71,210,214
4
true
2022-02-21T16:35:29.543Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Testing for exceptions being raised<p>I'm new to ruby. Trying to write a test that passes when an exception is raised, for example:</p> <pre><code> def netwo...
71,211,046
Select by index and by boolean indexing<p>Input program:</p> <pre><code>import pandas as pd df = pd.DataFrame({&quot;A&quot; : [&quot;A0&quot;,&quot;A1&quot;,&quot;A2&quot;,&quot;A3&quot;], &quot;B&quot; : [&quot;dog&quot;,&quot;cat&quot;,&quot;dog&quot;,&quot;dog&quot;]}) myindexes = pd.Index([1,2...
<p>Instead of <code>(myindexes)</code>, use <code>df.index.isin(myindexes)</code>:</p> <pre><code>df.loc[df.index.isin(myindexes) &amp; (df[&quot;B&quot;] == &quot;dog&quot;), &quot;A&quot;] = &quot;match&quot; </code></pre> <p>Output:</p> <pre><code>&gt;&gt;&gt; df A B 0 A0 dog 1 A1 cat 2 match d...
Select by index and by boolean indexing
python|pandas|dataframe|object-slicing
0
41
1
71,211,076
71,211,076
4
true
2022-02-21T18:05:11.280Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Select by index and by boolean indexing<p>Input program:</p> <pre><code>import pandas as pd df = pd.DataFrame({&quot;A&quot; : [&quot;A0&quot;,&quot;A1&quot...
71,212,459
Replace every occurence in a file with a list elements - every next occurence with a list's next element<p>Suppose, I need to replace every 's' in the file, provided I know there are three of them, replacing every occurence on occurence-per-list-element basis:</p> <pre><code>This is my test </code></pre> <p>list: <code...
<p>You could replace <code>s</code>s with placeholders and use <code>str.format</code> to fill:</p> <pre><code>s = &quot;This is my test&quot;.replace('s','{}') lst = [1, 2, 3] out = s.format(*lst) </code></pre> <p>Output:</p> <pre><code>'Thi1 i2 my te3t' </code></pre>
Replace every occurence in a file with a list elements - every next occurence with a list's next element
python|python-3.x|string|list|replace
0
45
1
71,212,490
71,212,490
4
true
2022-02-21T20:10:52.663Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Replace every occurence in a file with a list elements - every next occurence with a list's next element<p>Suppose, I need to replace every 's' in the file, ...
71,153,534
Installing Mac OS Monterey on virtual box, it reboot and message show "Karnal Panic Reboot"<p>I am Installing Mac OS Monterey on virtual box but when I start installing the, it reboot and message show &quot;Karnal Panic Reboot&quot;, I want to install mac OS 12 monterey because of Xcode to build my IOS application for ...
<p>Virtualbox not support mac monterey for now. But the apparent solution is:</p> <ol> <li>Close ALL VirtualBox windows (otherwise the next setting will be overwritten)</li> <li>Run commandline command, where YOUR_VM_NAME is the name of your VM: VBoxManage setextradata &quot;YOUR_VM_NAME&quot; &quot;VBoxInternal/TM/TSC...
Installing Mac OS Monterey on virtual box, it reboot and message show "Karnal Panic Reboot"
macos|virtualbox|macos-monterey
0
3,861
2
71,237,841
71,237,841
4
true
2022-02-17T06:41:16.800Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Installing Mac OS Monterey on virtual box, it reboot and message show "Karnal Panic Reboot"<p>I am Installing Mac OS Monterey on virtual box but when I start...
71,244,296
My program runs into a Stack-overflow issue after some time of running. It works fine for sometime until it doesn't<p>I have made a little console BlackJack game. It is my first game when working with C#. The game works fine for a few rounds until I get an error message of &quot;Stackoverflow&quot;. When I look at the ...
<p>There's a flaw in the way you're trying to prevent duplicated cards using the <code>allCards</code> list. Once the deck is exhausted, your <code>PlayerCardGenerator</code> and <code>DealerCardGenerator</code> methods infinitely recurse. In general this isn't a great way to manage a deck (you'd be better off actual...
My program runs into a Stack-overflow issue after some time of running. It works fine for sometime until it doesn't
c#|debugging
0
35
1
71,244,379
71,244,379
4
true
2022-02-23T21:33:42.823Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: My program runs into a Stack-overflow issue after some time of running. It works fine for sometime until it doesn't<p>I have made a little console BlackJack ...
71,261,948
replace strings in unequal nested lists<p>I have an unequal nested list containing strings.</p> <pre><code>newlist=[['realoldbone', 'thenewhouse', 'oldking'], ['softhat', 'hatoldhat'], ['shirt', 'sweatshirt', 'myoldShirt']] </code></pre> <p>For two features say,</p> <pre><code>Features=[&quot;old&quot...
<p>The simplest case would be to loop through the lists and modify if feature exists:</p> <pre><code>for feature in Features: for lst in newlist: for i, item in enumerate(lst): if feature in item: lst[i] = feature print(newlist) </code></pre> <p>Output:</p> <pre><code>[['old', 'n...
replace strings in unequal nested lists
python|string|list|nested-lists
0
40
1
71,262,011
71,262,011
4
true
2022-02-25T06:33:32.950Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: replace strings in unequal nested lists<p>I have an unequal nested list containing strings.</p> <pre><code>newlist=[['realoldbone', 'thenewhouse', 'oldking']...
71,296,978
Changing titles after pivoting<p>Below you can see the format of my data. I am trying to pivot this data into a desirable format. Below you can see my data</p> <pre><code>df = pd.DataFrame({&quot;id_n&quot;:[&quot;1&quot;,&quot;2&quot;,&quot;3&quot;,&quot;4&quot;,&quot;5&quot;,&quot;6&quot;,&quot;7&quot;,&quot;8&quot;,...
<p>Change from dataframe pivot to series <code>pivot</code> , then <code>add_prefix</code></p> <pre><code>table = pd.pivot_table(df, values='gross_i', index='id_n', columns='kind_i', aggfunc=np.sum, fill_value=0).add_prefix('kind_') table Out[462]: kind_i kind_1 kind_10 kind_11 kind_12 ... ...
Changing titles after pivoting
python|pandas
0
21
1
71,297,028
71,297,028
4
true
2022-02-28T15:04:45.577Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Changing titles after pivoting<p>Below you can see the format of my data. I am trying to pivot this data into a desirable format. Below you can see my data</...
71,304,256
Why is foldRight not giving correct count?<p>I am trying to calculate the number of elements in a list using foldRight and foldLeft method while foldLeft gives me a correct count foldRight does not. Where am i wrong in the code ?</p> <pre><code> def count(arr:List[Int]):Int = { arr.foldRight(0)((B,_) =&gt; B+1) ...
<p>You've swapped the arguments around for <code>foldRight</code> because with fold right the tuple arguments are the other way round, so you are discarding the accumulator and instead adding 1 to the last element (which with foldRight is the first element in the input) so the end result is 2 (the first element 1, plus...
Why is foldRight not giving correct count?
scala
0
39
1
71,304,519
71,304,519
4
true
2022-03-01T05:51:55.407Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is foldRight not giving correct count?<p>I am trying to calculate the number of elements in a list using foldRight and foldLeft method while foldLeft giv...
71,308,125
Build date from year and month with quarter<p>I have a table with some columns. Unfortunately, I don't have column with classic date format like &quot;YYYY-MM-DD&quot;.</p> <p>I have columns year and month, like:</p> <pre class="lang-none prettyprint-override"><code>2021 | 7 2021 | 10 2021 | 1 </code></pre> <p>I want t...
<p>You an use <code>make_date()</code> to create a date, then use <code>to_char()</code> to format that date:</p> <pre><code>select t.year, t.month, make_date(t.year, t.month, 1), to_char(make_date(t.year, t.month, 1), '&quot;Q&quot;Q''YY') from the_table t; </code></pre>
Build date from year and month with quarter
sql|postgresql
0
41
2
71,308,213
71,308,213
4
true
2022-03-01T11:55:37.450Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Build date from year and month with quarter<p>I have a table with some columns. Unfortunately, I don't have column with classic date format like &quot;YYYY-M...
71,351,560
How to separate a time series panel by the number of missing observations at the end?<p>Consider a set of time series having the same length. Some have missing data in the end, due to the product being out of stock, or due to delisting.</p> <p>If the series contains at least four missing observations (in my case it is ...
<p>Here is one possibility to find delisted ids</p> <pre><code>data %&gt;% group_by(id) %&gt;% mutate(delisted = all(value[(n()- 3):n()] == 0)) %&gt;% group_by(delisted) %&gt;% group_split() </code></pre> <p>In the end I use <code>group_split</code> to split the data into two parts: one containing delisted ids ...
How to separate a time series panel by the number of missing observations at the end?
r|dataframe|dplyr|time-series
0
38
1
71,351,626
71,351,626
4
true
2022-03-04T12:39:50.987Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to separate a time series panel by the number of missing observations at the end?<p>Consider a set of time series having the same length. Some have missi...
71,356,502
How to migrate some route DTO object in NestJ?<p>I use NestJS and my app have some changes in the DTO objects that is expects to receive in the controller. The client side is a mobile app and I can’t force the users to update version, so I might get DTO objects that might not be in the updated version that my server si...
<p>A simple solution can be adding a field that indicates that the recived object is the DTO's updated version, check if that field exist or not, then apply the consequent logic.</p> <p>Another way is to use the API versioning, you can find how to use it in the <a href="https://docs.nestjs.com/techniques/versioning" re...
How to migrate some route DTO object in NestJ?
javascript|node.js|rest|migration|nestjs
0
45
1
71,356,834
71,356,834
4
true
2022-03-04T19:44:04.690Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to migrate some route DTO object in NestJ?<p>I use NestJS and my app have some changes in the DTO objects that is expects to receive in the controller. T...
71,364,613
Error in Flutter: A non-null value must be returned since the return type 'Widget' doesn't allow null<p>This class in main.dart won't work.</p> <pre><code>import 'package:flutter/material.dart'; void main() { runApp(new MyFlutterApp() ); } class MyFlutterApp extends StatelessWidget { @override Widget build(B...
<p><code>build</code> method has to return a widget. Try</p> <pre><code>class MyFlutterApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: &quot;My Flutter Application&quot;, home: Scaffold( appBar: AppBar(title: Text(&quot;hello&quot...
Error in Flutter: A non-null value must be returned since the return type 'Widget' doesn't allow null
flutter
0
802
2
71,364,656
71,364,656
4
true
2022-03-05T17:58:33.360Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error in Flutter: A non-null value must be returned since the return type 'Widget' doesn't allow null<p>This class in main.dart won't work.</p> <pre><code>im...
71,198,899
How to constrain type to types with index?<p>I decided to dive into Go since 1.18 introduced generics. I want to implement an algorithm that only accepts sequential types — arrays, slice, maps, strings, but I'm not able to crack how.</p> <p>Is there a method that can be targeted involving indexability?</p>
<p>You can use a constraint with a union, however the only <strong>meaningful</strong> one you can have is:</p> <pre><code>type Indexable interface { ~[]byte | ~string } func GetAt[T Indexable](v T, i int) byte { return v[i] } </code></pre> <p>And that's all, for the time being. Why?</p> <ol> <li><p>The operat...
How to constrain type to types with index?
dictionary|go|generics|indexing|slice
0
299
1
71,199,318
71,199,318
4
true
2022-02-20T21:22:01.297Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to constrain type to types with index?<p>I decided to dive into Go since 1.18 introduced generics. I want to implement an algorithm that only accepts seq...
71,220,339
Create Dataframe Columns Automatically with Different Names<p>How can I create dataframe columns automatically with different names</p> <p>I have this code</p> <pre><code>df=pd.DataFrame(columns=['A']*5) df.loc[len(df)]=[1,2,3,4,5] </code></pre> <p>Which gives the result</p> <pre><code> A A A A A 0 1 2 3 4 5...
<p>If possible pass to <code>DataFrame</code> correct columns names:</p> <pre><code>df=pd.DataFrame(columns=[f'A{i}' for i in range(1, 6)]) df.loc[len(df)]=[1,2,3,4,5] print (df) A1 A2 A3 A4 A5 0 1 2 3 4 5 </code></pre> <p>If need change values later with enumerate all columns names use:</p> <pre><code>df=pd.Dat...
Create Dataframe Columns Automatically with Different Names
pandas|dataframe|dynamic-columns
0
284
3
71,220,367
71,220,367
4
true
2022-02-22T11:17:43.100Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Create Dataframe Columns Automatically with Different Names<p>How can I create dataframe columns automatically with different names</p> <p>I have this code</...
71,161,324
Is Flight SQL similar to a library like turbodbc?<p>I was curious if Flight SQL will be an alternative to libraries like turbodbc? I am using turbodbc to query many different database flavors to return data in a pyarrow table, but I have had to add the OBDC drivers to my Docker image.</p> <p>Is this something that can ...
<p>Flight SQL requires something database-side, yes. It's lower level than something like ODBC or JDBC, which (for instance) don't specify anything about the wire protocol; instead, it's a set of libraries intended to be used with a particular RPC protocol.</p> <p>That said, it is intended to support use cases like you...
Is Flight SQL similar to a library like turbodbc?
apache-arrow
0
278
1
71,161,440
71,161,440
4
true
2022-02-17T15:53:33.980Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is Flight SQL similar to a library like turbodbc?<p>I was curious if Flight SQL will be an alternative to libraries like turbodbc? I am using turbodbc to que...
71,105,484
react-three/fiber creating 3D text<p>I'm trying to create 3d text using Threejs + react-three/fiber . I loaded the font using font loader like this :</p> <pre><code> const font = new FontLoader().parse('/Microsoft Tai Le_Regular.json'); </code></pre> <p>After that I tried to use component inside the mesh , for some ...
<p>So I'll preface this by saying that I'm still a student so I can't explain exactly why all these steps need to be done but here's what worked for me. It seems that your issue is with the path that you are using to parse. The file name itself seems inaccurate but even if the file path is valid, it still will not work...
react-three/fiber creating 3D text
reactjs|three.js|3d|jsx|react-three-fiber
0
2,336
1
71,131,188
71,131,188
4
true
2022-02-13T22:40:58.387Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: react-three/fiber creating 3D text<p>I'm trying to create 3d text using Threejs + react-three/fiber . I loaded the font using font loader like this :</p> <pr...
71,350,555
Np Array values are being changed without doing stuff<p>Why does :</p> <pre><code>print(np.delete(MatrixAnalytics(Cmp),[0],1)) MyNewMatrix = np.delete(MatrixAnalytics(Cmp),[0],1) print(&quot;SecondPrint&quot;) print(MyNewMatrix) </code></pre> <p>returns :</p> <pre><code>[[ 2. 2. 2. 2. 2.] [ 1. 2. 2. 2. 2.] [ ...
<p>I think I got the issue. In this code :</p> <pre class="lang-py prettyprint-override"><code>def MatrixAnalytics(DataMatrix): AnalyzedMatrix = DataMatrix ... ... return AnalyzedMatrix </code></pre> <p><code>AnalyzedMatrix</code> is not a copy of <code>DataMatrix</code>, it's <str...
Np Array values are being changed without doing stuff
python
0
38
2
71,350,895
71,350,895
4
true
2022-03-04T11:08:18.803Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Np Array values are being changed without doing stuff<p>Why does :</p> <pre><code>print(np.delete(MatrixAnalytics(Cmp),[0],1)) MyNewMatrix = np.delete(Matrix...
71,287,360
Getting API with useEffect, inside a handle change function<p>I'm using the YTS API and I need to change the link for the call, I have to use <em><strong>?query_term=</strong></em> and add the text that the user is typing, for autocomplete. I'm using mantine components for the autocomplete. I tried putting the call ins...
<p>You MUST use hooks in the execution context of Function Component, you used the <code>useEffect</code> inside a function not in the execution context of Function Component.</p> <pre class="lang-js prettyprint-override"><code>const YourComponent = () =&gt; { const [movieNames, setMovieNames] = useState([]); co...
Getting API with useEffect, inside a handle change function
javascript|reactjs|api|mantine
0
273
3
71,287,468
71,287,468
4
true
2022-02-27T18:16:03.940Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Getting API with useEffect, inside a handle change function<p>I'm using the YTS API and I need to change the link for the call, I have to use <em><strong>?qu...
71,425,587
why the COUNTS_BY_COLOUR.COUNTS is invalid identifier in oracle apex<p>The following code gives an error when I specify the name of the columns(<code>select counts_by_colour.colour,counts_by_colour.counts </code>), but if I say <code>select *</code> the code is executed. Why?</p> <pre><code>select counts_by_colour.colo...
<p>You have used a quoted identifier <code>&quot;counts_by_colour&quot;</code> and quoted identifiers a case sensitive.</p> <p>In contrast, unquoted identifiers are implicitly converted to upper-case so <code>counts_by_colour</code> is converted to <code>COUNTS_BY_COLOUR</code>.</p> <p>When you compare the two, <code>&...
why the COUNTS_BY_COLOUR.COUNTS is invalid identifier in oracle apex
oracle-apex
0
27
1
71,425,820
71,425,820
4
true
2022-03-10T14:14:10.350Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: why the COUNTS_BY_COLOUR.COUNTS is invalid identifier in oracle apex<p>The following code gives an error when I specify the name of the columns(<code>select ...
71,285,562
Python asyncio - how to await for retries in parallel<p>I'm doing a bunch of async calls in parallel like so:</p> <pre class="lang-py prettyprint-override"><code>txs = await asyncio.gather(*[fetch_tx_details(s[&quot;signature&quot;]) for s in sigs]) </code></pre> <p>These calls can sometimes fail and so I'm decorating ...
<p><strong>Don't use <code>time.sleep()</code></strong>. That will completely block execution, including other coroutines. Always use the <a href="https://docs.python.org/3/library/asyncio-task.html#asyncio.sleep" rel="nofollow noreferrer"><code>asyncio.sleep()</code> coroutine</a> in asyncio tasks as that'll yield ex...
Python asyncio - how to await for retries in parallel
python|python-asyncio
0
270
1
71,285,620
71,285,620
4
true
2022-02-27T14:27:37.560Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python asyncio - how to await for retries in parallel<p>I'm doing a bunch of async calls in parallel like so:</p> <pre class="lang-py prettyprint-override"><...
71,118,928
How do I include an image (jpg) with a lambda function?<p>I'm trying to write a lambda that puts a watermark on an image, then saves the result to S3. I'm using the <a href="https://sharp.pixelplumbing.com/" rel="nofollow noreferrer">Sharp library</a> to do so. I'm deploying with <a href="https://www.serverless.com/"...
<p>The path you are using (<code>/logos/white.png</code>) is an absolute path and that means that your code is &quot;looking&quot; in the wrong place.</p> <p>I am not 100% sure but one of the following two options should solve your issue:</p> <ol> <li>Use a relative path (<code>./logos/white.png</code>)</li> <li>Use th...
How do I include an image (jpg) with a lambda function?
javascript|aws-lambda|serverless-framework
0
553
1
71,119,145
71,119,145
4
true
2022-02-14T22:16:53.690Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I include an image (jpg) with a lambda function?<p>I'm trying to write a lambda that puts a watermark on an image, then saves the result to S3. I'm u...
71,094,734
Check for boolean and set variable value or default without using ELSE in Laravel 8 controller<p>I need to calculate points based on boolean selections and I'd like to reduce the amount of code by eliminating the <code>ELSE</code> part of my statements.</p> <p>Is there anyway to compress this statement down?</p> <pre><...
<p>something like this:</p> <p><code>$trackPTS = $this-&gt;track ? 20 : 0;</code></p>
Check for boolean and set variable value or default without using ELSE in Laravel 8 controller
php|laravel
0
42
1
71,094,759
71,094,759
5
true
2022-02-12T18:30:50.653Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Check for boolean and set variable value or default without using ELSE in Laravel 8 controller<p>I need to calculate points based on boolean selections and I...
71,116,581
Generate random number in python, such that the likelihood of a number being generated is inversely proportionate to it's value<p>I want to generate a pseudo random number from 1 to <em>n</em> in python, but the likelihood of a number being generated should be lesser the higher the number is. So, 1 will be the most lik...
<p>Would you accept an accurate hack?</p> <pre><code>random.choices(range(1,n+1),[1/k for k in range(1,n+1)]) </code></pre> <p>works. Furthermore it has an optional parameter <code>k</code> which lets you generate as many random numbers as you need.</p>
Generate random number in python, such that the likelihood of a number being generated is inversely proportionate to it's value
python|random
0
44
2
71,116,885
71,116,885
5
true
2022-02-14T18:26:38.477Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Generate random number in python, such that the likelihood of a number being generated is inversely proportionate to it's value<p>I want to generate a pseudo...
71,382,557
AWS Cognito: tokens automatically get stored in local storage. How to save them in session storage instead?<p>I am using AWS Amplify / AWS Cognito for my web app. It would automatically put tokens in browser's localStorage. This is the expected behavior of SDKs. It adds the tokens to local storage so user can use the a...
<p>This can be accomplished by passing <code>window.sessionStorage</code> into your auth configuration.</p> <pre class="lang-js prettyprint-override"><code>Auth.configure({ storage: window.sessionStorage }) </code></pre>
AWS Cognito: tokens automatically get stored in local storage. How to save them in session storage instead?
amazon-web-services|jwt|local-storage|amazon-cognito|session-storage
0
1,539
1
71,384,873
71,384,873
5
true
2022-03-07T14:25:36.557Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: AWS Cognito: tokens automatically get stored in local storage. How to save them in session storage instead?<p>I am using AWS Amplify / AWS Cognito for my web...
71,173,514
React Array not showing data in .map despite showing in console.log<p>I'm pulling in data from a GraphQL query and mapping through the array in my React app, I can see if I console log the array that all the data is there as requested but when I map through it, I just get nothing showing on my screen, no error, it does...
<p>You are not returning anything from the <code>.map</code> function: when you use curly brackets, the arrow function no longer implicitly returns. You will need to use the <code>return</code> statement:</p> <pre><code>{props.array.map((item, index) =&gt; { return ( &lt;CareerItem key={index}&gt; ...
React Array not showing data in .map despite showing in console.log
javascript|reactjs
0
31
2
71,173,575
71,173,575
5
true
2022-02-18T12:29:42.233Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React Array not showing data in .map despite showing in console.log<p>I'm pulling in data from a GraphQL query and mapping through the array in my React app,...
71,264,917
Problem with sending all emails to the same person when sending email with PHPMailer<p>I am trying to send mail to multiple emails with PHPMailer. First, I listed people's names from the table. Then I used the loop to send emails to those people. but the problem is that everyone's information goes to all emails.</p> <p...
<p>You need to clear the current address once the mail is sent otherwise you are adding a new email to the existing send list each time round the loop.</p> <pre><code>foreach ($id as $mailId) { $connect-&gt;connect('account where id=:id', array('id' =&gt; $mailId), '', 0); $users = $connect-&gt;connect-&gt;fetc...
Problem with sending all emails to the same person when sending email with PHPMailer
php|foreach|phpmailer
0
44
1
71,265,079
71,265,079
5
true
2022-02-25T11:05:46.100Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Problem with sending all emails to the same person when sending email with PHPMailer<p>I am trying to send mail to multiple emails with PHPMailer. First, I l...
71,330,403
Conditionally Joining One of Two Tables<p>I am trying to join one of two tables to a third table based on a logical evaluation. In this highly simplified example, I would like <code>result</code> to end up with the values from <code>df2</code> since in this case <code>option == 2</code>.</p> <p><strong>Example Data:</s...
<p>You can't pipe directory into an <code>if</code> statement. You could pipe in a block and then <code>maggrittr</code> defines the <code>.</code> variable for the data that was passed in. So you could so</p> <pre><code>result &lt;- df1 %&gt;% { if (option == 2){ left_join(., df2, by = &quot;index&quot;) } els...
Conditionally Joining One of Two Tables
r|dplyr
0
44
2
71,330,470
71,330,470
5
true
2022-03-02T23:28:52.450Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Conditionally Joining One of Two Tables<p>I am trying to join one of two tables to a third table based on a logical evaluation. In this highly simplified exa...
71,346,155
Flutter app running on web failing with error<p>**/C:/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging_web-2.2.8/lib/src/internals.dart:11:10: Error: Method not found: 'guardWebExceptions'. return internals.guardWebExceptions( ^^^^^^^^^^^^^^^^^^</p>
<p>I'm update flutter to</p> <blockquote> <p><strong>[version sdk 2.10.3]</strong></p> </blockquote> <p><a href="https://docs.flutter.dev/get-started/install/windows" rel="nofollow noreferrer">1</a> , if you have error</p>
Flutter app running on web failing with error
flutter
0
271
1
71,346,184
71,346,184
-2
true
2022-03-04T03:01:11.873Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Flutter app running on web failing with error<p>**/C:/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging_web-2.2.8/lib/src/internals.dart:11:10: E...
71,131,223
Node - async function inside an imported module<p>I have a Node 14 server which is initialized like this:</p> <pre><code>import express, { Express } from 'express'; import kafkaConsumer from './modules/kafkaConsumer'; async function bootstrap(): Promise&lt;Express&gt; { kafkaConsumer(); const app = express()...
<p>Twicked the Kafka initalzation, and tested with local Kafka. Everything works as expected.</p>
Node - async function inside an imported module
node.js|async-await
0
35
1
71,185,394
71,185,394
-1
true
2022-02-15T17:57:57.567Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Node - async function inside an imported module<p>I have a Node 14 server which is initialized like this:</p> <pre><code>import express, { Express } from 'ex...
71,186,580
Returning value from stream to parent function<p>I have a stream for writing some text to a cloud storage bucket. On finish I want a message to be returned to the parent function.</p> <p>I tried returning the bufferstream but this gives me the whole bufferstream object. I just want the message to be returned.</p> <p>e....
<p>The <code>toBucket</code> function should return a promise, then you can <code>await</code> it in your parent function. To do that, just wrap the logic of <code>toBucket</code> into a promise</p> <pre><code>const toBucket = (message, filename) =&gt; { return new Promise((resolve, reject) =&gt; { // return a prom...
Returning value from stream to parent function
javascript|asynchronous|async-await
0
35
1
71,191,280
71,191,280
-1
true
2022-02-19T15:51:26.057Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Returning value from stream to parent function<p>I have a stream for writing some text to a cloud storage bucket. On finish I want a message to be returned t...
71,213,637
Error: Type contract pSDATokenSale is not implicitly convertible to expected type contract pSDA<p>Type contract pSDATokenSale is not implicitly convertible to expected type contract pSDA.</p> <p>I am getting the error above ^^ at the line with <strong><code>tokenContract = _tokenContract;</code></strong>. Any suggestio...
<p>ehy you wrote wrong the type of <code>_tokenContract</code> inside the function <code>pSDAToken()</code></p> <p>you wrote <code>_tokenContract</code> with type <code>pSDATokenSale</code>, and want to save it inside <code>tokenContract</code> that is <code>pSDA</code> type</p> <p>this is the correct code:</p> <pre><c...
Error: Type contract pSDATokenSale is not implicitly convertible to expected type contract pSDA
javascript|token|solidity|truffle
0
39
1
71,213,729
71,213,729
-1
true
2022-02-21T22:12:29.627Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error: Type contract pSDATokenSale is not implicitly convertible to expected type contract pSDA<p>Type contract pSDATokenSale is not implicitly convertible t...
71,297,443
Return ID based on maximum date for each organisation SQL Sever 2012<p>I am trying to return a single ID for each organisation based on the maximum date and am a bit lost.</p> <p>I have created a dummy dataset below to replicate mine.</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th style="t...
<p>This can be done with a <code>top 1 with ties</code></p> <pre><code>select top 1 with ties o.id, o.organisationid, o.record_date from organisation o order by row_number() over (partition by o.organisationid order by o.record_date desc) </code></pre> <p>See this <a href="https://dbfiddle.uk/?rd...
Return ID based on maximum date for each organisation SQL Sever 2012
sql|sql-server
0
30
1
71,297,597
71,297,597
-1
true
2022-02-28T15:39:40.197Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Return ID based on maximum date for each organisation SQL Sever 2012<p>I am trying to return a single ID for each organisation based on the maximum date and ...
71,302,282
Var inside of object attribute<p>i got these code</p> <pre><code>`{%for number in List %} &lt;div class=&quot;top&quot;&gt; &lt;h3&gt; &lt;a href=&quot;/my-blog-post&quot;&gt;{{songs.history.0.Song}}&lt;/a&gt; &lt;/h3&gt; &lt;section&gt; &lt;...
<p>Something like:</p> <pre class="lang-html prettyprint-override"><code>{% for song in songs.history %} &lt;div&gt; Number: {{loop.index}} &lt;/div&gt; &lt;div&gt; Name: {{song.Song}} &lt;/div&gt; {% endfor %} </code></pre>
Var inside of object attribute
django|list|variables|django-templates|lookup
0
31
1
71,302,295
71,302,295
-1
true
2022-02-28T23:46:13.407Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Var inside of object attribute<p>i got these code</p> <pre><code>`{%for number in List %} &lt;div class=&quot;top&quot;&gt; &lt;h3&gt; ...
71,109,390
Apache IoTDB RaftLog grows rapidly in cluster mode. Will this log be snapshot regularly?<p>Notice that RaftLog grows rapidly in IoTDB cluster mode. Kind of worried about storage problem. So I wonder whether this log would be snapshot regularly.</p>
<p>You can use these two parameters <code>max_number_of_persist_raft_log_files</code> and <code>max_raft_log_persist_data_size_per_file</code> in <code>iotdb-cluster.properities</code> to control the size of the raftlog, as described in the comments in the configuration file.</p>
Apache IoTDB RaftLog grows rapidly in cluster mode. Will this log be snapshot regularly?
apache-iotdb
0
24
1
71,109,494
71,109,494
-1
true
2022-02-14T09:08:46.767Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Apache IoTDB RaftLog grows rapidly in cluster mode. Will this log be snapshot regularly?<p>Notice that RaftLog grows rapidly in IoTDB cluster mode. Kind of w...
71,863,428
Use rsa-pss algorithm to sign data<p>I want to use RSA-PSS algorithm to sign and verify data by using <a href="https://docs.rs/openssl/latest/openssl/" rel="nofollow noreferrer">rust openssl</a> crate. But I ran into some problems.</p> <p>Here is my code:</p> <pre><code> use openssl::sign::{Signer, Verifier, RsaPssS...
<p>Here is an example of using RSA-PSS algorithm: <a href="https://github.com/sfackler/rust-openssl/blob/d8aa8a9a6131bb859c51810ca6fe9ad70c315a21/openssl/src/sign.rs#L848-L873" rel="nofollow noreferrer">link</a>.</p> <p>Basically, you need to set the rsa_padding first.</p> <pre><code>let key = include_bytes!(&quot;../t...
Use rsa-pss algorithm to sign data
rust|openssl|rust-crates
0
279
1
72,035,067
72,035,067
0
true
2022-04-13T20:19:50.903Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Use rsa-pss algorithm to sign data<p>I want to use RSA-PSS algorithm to sign and verify data by using <a href="https://docs.rs/openssl/latest/openssl/" rel="...
72,034,955
How do you change the CircularPercentIndicator's circle area color?<p>I know that <code>backgroundColor</code> changes the line color, and that <code>progressColor</code> also changes part of the line color. What changes the area color?</p> <p>Here's what I have</p> <p><a href="https://i.stack.imgur.com/RxtWx.png" rel=...
<p>There is no predefined property to do that, but you can do some workaround like this:</p> <pre><code>ClipRRect( borderRadius: BorderRadius.circular(20), child: Container( child: CircularPercentIndicator( fillColor: Color.fromARGB(255, 206, 175, 138), ...
How do you change the CircularPercentIndicator's circle area color?
flutter|dart
0
35
1
72,035,129
72,035,129
0
true
2022-04-27T20:30:22.900Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do you change the CircularPercentIndicator's circle area color?<p>I know that <code>backgroundColor</code> changes the line color, and that <code>progres...
72,035,024
Unable to create Deck.gl layers and overlay<p>I installed deck.gl through npm and I'm unable to create layers. At first I was trying to create a google overlay, later I tried it with mapbox overelay. It keeps throwing same error I'm attaching error image and code snippet. I'm using it with angular and I'm trying to cre...
<p>Ok so the issue was with npm modules of deck.gl it was using loaders.gl so I installed it but it didn't work so I manually imported script in my index.html and it worked.</p> <pre><code> &lt;script src=&quot;https://unpkg.com/deck.gl@8.7.3/dist.min.js&quot;&gt;&lt;/script&gt; &lt;script src=&quot;https://unpkg.co...
Unable to create Deck.gl layers and overlay
javascript|angular|deck.gl
0
271
1
72,035,541
72,035,541
0
true
2022-04-27T20:38:04.467Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unable to create Deck.gl layers and overlay<p>I installed deck.gl through npm and I'm unable to create layers. At first I was trying to create a google overl...