question_id
int64
37.6M
73.2M
input_text
stringlengths
88
52.4k
output_text
stringlengths
37
35.6k
title
stringlengths
15
150
tags
stringlengths
1
107
q_score
int64
-19
397
view_count
int64
3
879k
answer_count
int64
1
21
accepted_answer_id
int64
37.6M
73.8M
answer_id
int64
37.6M
73.8M
a_score
int64
-5
1.29k
is_accepted
bool
1 class
creation_date
stringlengths
20
24
input_text_instruct
stringlengths
251
52.6k
72,904,653
python socket & Tkinter: Starting tkinter class not working in a python socket program<p>Hello I'm trying to do an <strong>online python game</strong> with <strong>socket</strong> and <strong>tkinter</strong>. Here are my 2 files: <code>server.py</code> and <code>client.py</code>.</p> <p><em><strong>Don't worry of the ...
<p>You can accomplish this with threads. This is a <strong>very</strong> rough example from hacking on your code. Run the server, then the client, then type some coordinates. I dropped pickle since it isn't secure and you can just send the input text and parse it. I used <code>socket.makefile</code> and its <code>....
python socket & Tkinter: Starting tkinter class not working in a python socket program
python|sockets|tkinter|python-sockets
0
43
1
72,907,547
72,907,547
1
true
2022-07-07T21:56:54.597Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: python socket & Tkinter: Starting tkinter class not working in a python socket program<p>Hello I'm trying to do an <strong>online python game</strong> with <...
72,905,852
How to run GitHub Actions workflow only if a new file is pushed<p>Let's say that I have an <strong><code>action</code></strong> like such:</p> <pre class="lang-yaml prettyprint-override"><code> name: Another_Action on: push: - ... pull_request: - ... </code></pre> <p>And I want it so ...
<p>There is no such option. You can only abort the pipeline early by checking for new files after the checkout step has run</p>
How to run GitHub Actions workflow only if a new file is pushed
github|continuous-integration|github-actions
1
43
1
72,907,828
72,907,828
1
true
2022-07-08T01:42:54.103Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to run GitHub Actions workflow only if a new file is pushed<p>Let's say that I have an <strong><code>action</code></strong> like such:</p> <pre class="la...
72,906,849
Using Auth0 as external identity provider for Keycloak. How do I configure Auth0? Where would I obtain this information?<p>I'm trying to configure Auth0 as an external identity provider for Keycloak. Although I believe I can configure it on Keycloak's side, I'm not sure about Auth0:</p> <p><a href="https://i.stack.imgu...
<p>Assuming you want to use SAML, you can add Auth0 as a SAML identity provider to Keycloak first. Once you have done that, click on the <code>SAML 2.0 Service Provider Metadata</code> link as shown.</p> <p><a href="https://i.stack.imgur.com/wCRjy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wCRjy...
Using Auth0 as external identity provider for Keycloak. How do I configure Auth0? Where would I obtain this information?
keycloak
0
43
1
72,912,611
72,912,611
1
true
2022-07-08T05:02:34.023Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using Auth0 as external identity provider for Keycloak. How do I configure Auth0? Where would I obtain this information?<p>I'm trying to configure Auth0 as a...
72,907,674
MySQL Clustered vs Non Clustered Index Performance<p>I'm running a couple tests on MySQL Clustered vs Non Clustered indexes where I have a table <code>100gb_table</code> which contains ~60 million rows:</p> <pre><code>100gb_table schema: CREATE TABLE 100gb_table ( id int PRIMARY KEY NOT NULL AUTO_INCREMENT, c1 ...
<p>The answer comes in how the data is laid out.</p> <p>The <code>PRIMARY KEY</code> is &quot;clustered&quot; with the data; that is, the data is order ed by the PK in a B+Tree structure. To read all of the <code>ids</code>, the entire BTree must be read.</p> <p>Any secondary index is also in a B+Tree structure, but i...
MySQL Clustered vs Non Clustered Index Performance
mysql|performance|indexing|clustered-index|non-clustered-index
1
43
1
72,914,487
72,914,487
1
true
2022-07-08T06:51:11.423Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MySQL Clustered vs Non Clustered Index Performance<p>I'm running a couple tests on MySQL Clustered vs Non Clustered indexes where I have a table <code>100gb_...
72,912,241
Flask API security token with curl Python<p>I am building a Flask server and I want to check for the access key when sending the curl request. Atm I am adding @token_required before every method and this way works good. However if I send a wrong request or something else happens it return &quot;wrong key&quot; or &quot...
<p>This is how I usually implement jwt authorization. Note that I'm using the <code>g</code> global variable to store and share the user object between blueprints. Hope this helps.</p> <pre><code>def require_jwt(f): &quot;&quot;&quot; Decorator to require JWT token &quot;&quot;&quot; @wraps(f) def decorated_function(*...
Flask API security token with curl Python
python|flask|curl
1
43
1
72,915,557
72,915,557
1
true
2022-07-08T13:36:32.273Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Flask API security token with curl Python<p>I am building a Flask server and I want to check for the access key when sending the curl request. Atm I am addin...
72,915,519
Getting 'Method was expected to be called 1 times, actually called 0 times.' while testing in Symfony<p>I need a small help with a simple test. I'm trying to test blog post delete endpoint where it deletes both the post and its comments. In the postController method, it calls two other methods from two other repositori...
<p>When you make the call via <code>$this-&gt;client-&gt;request...</code> you invoke the unchanged controller and therefore unchanged (not mocked) repositories.</p> <p>You should substitute repositories in your container before issuing the request and 'running' the it on mocked classes. This can be achieved by Symfony...
Getting 'Method was expected to be called 1 times, actually called 0 times.' while testing in Symfony
php|symfony|phpunit
0
43
1
72,916,257
72,916,257
1
true
2022-07-08T18:21:22.907Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Getting 'Method was expected to be called 1 times, actually called 0 times.' while testing in Symfony<p>I need a small help with a simple test. I'm trying to...
72,917,286
Why "xargs find | xargs mv" and "xargs find -exec mv" work but produce error printouts "No such file or directory"?<p>I get error printouts when I use methods of (1) <code>xargs find | xargs mv</code> and (2) <code>xargs find -exec mv</code> to move files, but the moving of the files works as expected. I get no error p...
<p>Short answer: <code>find</code> is being told to search all 4 subdirectories, even after some of them have been deleted.</p> <p>Detailed eplanation: The root problem is that the wildcard in the <code>xargs -I abc find ./testdir/* -maxdepth 1 ...</code> part gets expanded by the shell before any of the commands get r...
Why "xargs find | xargs mv" and "xargs find -exec mv" work but produce error printouts "No such file or directory"?
macos|find|xargs|mv
0
43
1
72,918,001
72,918,001
1
true
2022-07-08T21:44:50.680Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why "xargs find | xargs mv" and "xargs find -exec mv" work but produce error printouts "No such file or directory"?<p>I get error printouts when I use method...
72,918,608
Is there any way to make common function out of these two blocks<p>I have two blocks; in each block, I am retrieving the data from a table using command and reader and transforming the data, and then updating the same. What I am looking to extract the common function by passing the table name, type, and transform funct...
<p>Use generics, and ask for the table name and a method to transform the object.</p> <pre><code>void DoTheThing&lt;TSystem&gt;(string tableName, Func&lt;TSystem, TSystem&gt; transform) { using var command = dbContext.Database.GetDbConnection().CreateCommand(); command.CommandText = @$&quot;SELECT &quot;&quot;I...
Is there any way to make common function out of these two blocks
c#|generics|.net-core|refactoring
0
43
1
72,918,681
72,918,681
1
true
2022-07-09T02:55:26.863Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there any way to make common function out of these two blocks<p>I have two blocks; in each block, I am retrieving the data from a table using command and ...
72,920,163
Change values smoothly over time in R<p>I have a variable called &quot;exposed&quot; and I know already the sum of exposed people over time: have a look to understand</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th style="text-align: center;">i</th> <th style="text-align: center;">exposed</...
<p>If I'm understanding you correctly, you want a list of dataframes based on the exposed sums.</p> <p>Using lapply you can do</p> <pre><code>exposed &lt;- c(3,4,1,4,5) evol &lt;- lapply(exposed, \(x) data.frame(i = seq_along(exposed), exposed = c(rep(&quot;y&quot;, x), rep(&quot;n&quot;, length(exposed) - x ))) ) </...
Change values smoothly over time in R
r|database|dataframe|variables|var
0
43
1
72,920,234
72,920,234
1
true
2022-07-09T09:05:02.003Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Change values smoothly over time in R<p>I have a variable called &quot;exposed&quot; and I know already the sum of exposed people over time: have a look to u...
72,921,359
Dereferencing a string pointer from a FreeRTOS queue<p>I'm trying to use the queue API that FreeRTOS provides to read a string data from an Interrupt Service Routine (ISR) on an ESP32 device.</p> <p>As strings are quite large data, I actually send the address of the string using a pointer. This seems to work as I can r...
<p>Basically the pointers outlive the objects they point to.</p> <p>Let's break the ISR down as an example:</p> <pre class="lang-cpp prettyprint-override"><code> void IRAM_ATTR ISR_GSM_RI(){ BaseType_t xHigherPriorityTaskWoken = pdFALSE; String sGsmEventData = &quot;String sent from ISR&quot;; //string is created...
Dereferencing a string pointer from a FreeRTOS queue
c++|pointers|queue|freertos|arduino-c++
0
43
1
72,921,562
72,921,562
1
true
2022-07-09T12:28:12.020Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Dereferencing a string pointer from a FreeRTOS queue<p>I'm trying to use the queue API that FreeRTOS provides to read a string data from an Interrupt Service...
72,866,649
Key Value not Store in session storage after deploying site in Gatsby<p>I make my site in gatsby, and I try to sawing a popup form using session storage it works fine in the local server and also it works fine in the development server but when I live on the production server then it does not store key-value in session...
<p>Use a React-based approach instead of dealing with the DOM, as you are doing at:</p> <pre><code>window.addEventListener(&quot;load&quot;, function() { addPopUp() }) </code></pre> <p>You are manipulating the DOM, while React (hence Gatsby) deals with the virtual DOM (vDOM). The changes you do in one of them are not n...
Key Value not Store in session storage after deploying site in Gatsby
gatsby
0
43
1
72,922,937
72,922,937
1
true
2022-07-05T08:58:31.107Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Key Value not Store in session storage after deploying site in Gatsby<p>I make my site in gatsby, and I try to sawing a popup form using session storage it w...
72,924,316
Circular progress indicator without Future Builder flutter<p>How can I add circular progress indicator by the time I press the Elevated Button while I am waiting for my data to show? It would be possible without the need of implementing Future Builder?</p> <pre><code> ElevatedButton( onPressed: (() async { ...
<p>A way is to have a boolean variable what you set true when you wanna start showing the CircularProgressIndicator, and then set false when you don't want to show it anymore:</p> <pre><code>bool _loading = true; build() { return _loading ? CircularProgressIndicator() : mainWidget(); } </code></pre> <p>But the best ...
Circular progress indicator without Future Builder flutter
flutter|dart
0
43
1
72,924,458
72,924,458
1
true
2022-07-09T20:11:59.407Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Circular progress indicator without Future Builder flutter<p>How can I add circular progress indicator by the time I press the Elevated Button while I am wai...
72,926,978
Git-Bundle creating a empty .bundle?<p>I have cloned a repository and created a local branch named main.</p> <p>After that I made some changes in the code, committed and wanted to create a .bundle with the commits.</p> <p>I generate the .bundle using <code>git bundle create test.bundle main</code> and want to unbundle ...
<p>A Git bundle is not a repository. It only contains objects (blobs, trees and commits) but no <em>references</em> (branches, tags, etc.)</p> <p>When you clone a bundle into a new directory, you get all the commits in that bundle, but no branches or tags to refer to those commits. You need to find the commits and crea...
Git-Bundle creating a empty .bundle?
git|git-bundle
0
43
1
72,927,026
72,927,026
1
true
2022-07-10T07:57:54.590Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Git-Bundle creating a empty .bundle?<p>I have cloned a repository and created a local branch named main.</p> <p>After that I made some changes in the code, c...
72,923,385
How to redirect looped plots to a grid<p>I know that my question has been asked several times, but it took me already too much time and I can't find the solution, even if I am sure it's quite simple... The data is coming from 3 separate dataframes which are shaped the same, to get the boxplot I had to transpose the dat...
<p>You are pretty close.... one change is you need to define the subplot() before the loop and mention the number of array (2,4) you need. Inside the loop, you need to indicate the ax[row, col]. I have updated your code and used some random numbers to generate the same below.</p> <pre><code>cm = pd.DataFrame(np.random....
How to redirect looped plots to a grid
python|pandas|matplotlib
0
43
1
72,927,876
72,927,876
1
true
2022-07-09T17:22:58.537Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to redirect looped plots to a grid<p>I know that my question has been asked several times, but it took me already too much time and I can't find the solu...
72,927,548
Show how when values rise in one column, so does the values in another one<p>I'm working with a covid dataset for some python exercises I am working through to try learn. I've got it by doing the normal:</p> <p>import pandas as pd import numpy as np</p> <pre><code>df = pd.read_csv(&quot;C:/Users/Desktop/Python Short Co...
<p>you need to change the scale of y-axis. try this.</p> <pre><code>plt.ylim((df['SpO2'].min()-.5, df['SpO2'].max()+.5)) </code></pre> <p>If this didn't work, it's probably because there are very small values in the column <code>SpO2</code>. These gaps between the bars may be small values that are distorting the data. ...
Show how when values rise in one column, so does the values in another one
python|pandas|matplotlib
0
43
1
72,928,223
72,928,223
1
true
2022-07-10T09:43:40.960Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Show how when values rise in one column, so does the values in another one<p>I'm working with a covid dataset for some python exercises I am working through ...
72,911,788
DistinctUntilChanged fires multiple times on multiple subscribers<p>I have one observable (<code>mainSequence</code>). If a condition is meet it should invoke an async method <strong>once</strong> until the condition changes. The methods return value will indicate success.</p> <p>On failure I have a subscription which ...
<p>You have misunderstanding with regard to the distinction between an observable and a subscription. They are two distinct things.</p> <p>The best parallel, in my mind, is that an observable is like a class and a subscription is like an instance of a class. Like a class, the observable is defined once. Each subscripti...
DistinctUntilChanged fires multiple times on multiple subscribers
c#|system.reactive
0
43
1
72,928,274
72,928,274
1
true
2022-07-08T12:59:21.813Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: DistinctUntilChanged fires multiple times on multiple subscribers<p>I have one observable (<code>mainSequence</code>). If a condition is meet it should invok...
72,928,399
Data processing from COM port (C + win api)<p>The program's goal is to endlessly wait for data from the com port. When it receives specific data - it does specific action.</p> <p>The problem is that the program processes the incoming data 2 times and I can't figure out why.</p> <p>It was assumed that <code>WaitCommEven...
<p>You must always check the return value from input functions. In this case you have ignored it, and processed the input from the first iteration twice. It wasn't sent twice, but on the second iteration was already in the buffer.</p> <p>Also, you should nul-terminate any data that you are going to pass to a string-han...
Data processing from COM port (C + win api)
c|winapi|serial-port
0
43
1
72,928,861
72,928,861
1
true
2022-07-10T12:15:47.213Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Data processing from COM port (C + win api)<p>The program's goal is to endlessly wait for data from the com port. When it receives specific data - it does sp...
72,929,652
What is wrong with my stopwatch in Unity?<p>I created a script to display how long the player has played my game.</p> <pre><code>using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using System; public class Stopwatch : MonoBehaviour { bool stopwatchActive = false; ...
<p>It seems that your <code>currentTimeText</code> public variable is not assigned in the inspector.</p>
What is wrong with my stopwatch in Unity?
c#|unity3d
0
43
2
72,930,069
72,930,069
1
true
2022-07-10T15:27:47.463Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is wrong with my stopwatch in Unity?<p>I created a script to display how long the player has played my game.</p> <pre><code>using System.Collections; us...
72,929,526
How to get Stripe response after payment with client-side-only-integration?<p>I've got this simple component, which sends a <code>client-side-only</code> payment order to my stripe account. Everything works but I can't figure out how to get a <code>response</code>/<code>token</code> from stripe with the order informati...
<p>The integration path you chose here is called client-only Checkout but this was deprecated a couple of years ago by Stripe and is mostly discouraged at this point. Instead, Stripe built their new product called <a href="https://stripe.com/docs/payments/payment-links" rel="nofollow noreferrer">Payment Links</a> which...
How to get Stripe response after payment with client-side-only-integration?
javascript|vue.js|stripe-payments
0
43
1
72,930,198
72,930,198
1
true
2022-07-10T15:09:42.650Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get Stripe response after payment with client-side-only-integration?<p>I've got this simple component, which sends a <code>client-side-only</code> pay...
72,932,394
ArchUnit: Prevent assertJ statements without assertion<p>Is it possible to create an ArchUnit rule which prevents AssertJ statements without an assertion?</p> <p>For exampel: This AssertJ statement is perfectly ok, because it has both a <code>assertThat</code> part and an assertion.</p> <pre class="lang-java prettyprin...
<p>I don't think that ArchUnit can catch such statements, but some static code analysis tools can, cf. <a href="https://stackoverflow.com/q/49406872/">Verify that assertions have been called in Assertj</a>.</p>
ArchUnit: Prevent assertJ statements without assertion
testing|assertj|archunit
0
43
1
72,932,451
72,932,451
1
true
2022-07-10T22:55:45.950Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ArchUnit: Prevent assertJ statements without assertion<p>Is it possible to create an ArchUnit rule which prevents AssertJ statements without an assertion?</p...
72,933,333
how to change rows to column in python<p>I want to convert my dataframe rows to column and take last value of last column.</p> <p>here is my dataframe</p> <pre><code>df=pd.DataFrame({'flag_1':[1,2,3,1,2,500],'dd':[1,1,1,7,7,8],'x':[1,1,1,7,7,8]}) print(df) flag_1 dd x 0 1 1 1 1 2 1 1 2 3 ...
<p>Assuming you want a list as output, you can mask the initial values of the list column and stack:</p> <pre><code>import numpy as np out = (df .assign(**{df.columns[-1]: np.r_[[pd.NA]*(len(df)-1),[df.iloc[-1,-1]]]}) .T.stack().to_list() ) </code></pre> <p>Output:</p> <pre><code>[1, 2, 3, 1, 2, 500, 1, 1, 1, 7, 7, ...
how to change rows to column in python
python-3.x|pandas|numpy-ndarray
1
43
1
72,933,494
72,933,494
1
true
2022-07-11T03:13:42.763Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to change rows to column in python<p>I want to convert my dataframe rows to column and take last value of last column.</p> <p>here is my dataframe</p> <p...
72,933,339
Find and replace match after string in different file from bash script - not working<p>I have a string stored in a variable called newOccupation in file2.sh. When I run file2.sh, I would like it to replace whatever is after the word &quot;occupation=&quot; with the string stored in newOccupation.</p> <p>So in this case...
<p>Changing your file2.sh:</p> <pre><code>newOccupation=&quot;Teacher&quot; sed -i &quot;s/occupation=\&quot;.*\&quot;/occupation=\&quot;${newOccupation}\&quot;/&quot; file1.txt </code></pre>
Find and replace match after string in different file from bash script - not working
linux|bash|shell|sed|script
0
43
2
72,933,496
72,933,496
1
true
2022-07-11T03:14:09.997Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Find and replace match after string in different file from bash script - not working<p>I have a string stored in a variable called newOccupation in file2.sh....
72,935,295
FLUTTER API: can't use ".body"<p>I can't use &quot;.body&quot; , even if im trying to just &quot;print(result.body);&quot;</p> <p>Im getting this error message: <a href="https://i.stack.imgur.com/kHQiY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kHQiY.png" alt="Error i get" /></a></p> <p><div cla...
<p>make your function <code>async</code>, then</p> <pre><code>var result = await http.get(Uri.parse(url)); </code></pre>
FLUTTER API: can't use ".body"
json|flutter|api|dart
-1
43
1
72,935,332
72,935,332
1
true
2022-07-11T07:52:00.990Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: FLUTTER API: can't use ".body"<p>I can't use &quot;.body&quot; , even if im trying to just &quot;print(result.body);&quot;</p> <p>Im getting this error messa...
72,938,108
python 3d list manipulation<p>I have a 3d list aa = [[[2, 3, 4, 5], [ 6, 7, 8, 9]], [[11, 12, 14, 15]]], which consists of two 2d lists how do I get this result <code>[[2, 6], [11]] </code> the first element of each sub list.</p> <pre><code>b = [] for i, row in enumerate(aa): for j, rr in enumerate(row): b.append...
<p>You can do it with a list comprehension:</p> <pre><code>[[i[0] for i in j] for j in aa] </code></pre> <p>Output:</p> <pre><code>[[2, 6], [11]] </code></pre>
python 3d list manipulation
python|list|3d|2d
0
43
2
72,938,138
72,938,138
1
true
2022-07-11T11:48:20.290Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: python 3d list manipulation<p>I have a 3d list aa = [[[2, 3, 4, 5], [ 6, 7, 8, 9]], [[11, 12, 14, 15]]], which consists of two 2d lists how do I get this res...
72,938,978
Filter within dplyr::summarise to make calculation<p>I need to use information from a subset of my data within a <code>dplyr::summarise</code> function.</p> <p>My example data is grouped by <code>unit</code>. Each unit has a number of parts of different <code>type</code> with a number of dates.</p> <pre><code>library(d...
<p>You can try,</p> <pre><code>library(dplyr) q%&gt;% ungroup()%&gt;% group_by(type)%&gt;% summarise(Total = n(), working_at_6m = sum(case_when(!is.na(fail) &amp; interval(create,fail)/months(1) &gt;= 6 ~T, last_for_unit ==T &amp; interval(create,last)/months...
Filter within dplyr::summarise to make calculation
r|dplyr|summarize
0
43
1
72,939,088
72,939,088
1
true
2022-07-11T12:56:49.827Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Filter within dplyr::summarise to make calculation<p>I need to use information from a subset of my data within a <code>dplyr::summarise</code> function.</p> ...
72,938,994
How to make the color of a TextView like this image?<p>I want to set the color of a textview like this image, It has a vertical red color line and entire textview is like pink or reddish color.</p> <p><a href="https://i.stack.imgur.com/PVaEf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PVaEf.png" ...
<p>You can use a linear layout with orientation horizontal and put a view inside it.</p> <pre><code> &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt; &lt;androidx.constraintlayout.widget.ConstraintLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot; xmlns:app=&quot;http://s...
How to make the color of a TextView like this image?
java|android|textview
0
43
2
72,939,297
72,939,297
1
true
2022-07-11T12:57:48.530Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to make the color of a TextView like this image?<p>I want to set the color of a textview like this image, It has a vertical red color line and entire tex...
72,940,652
Why is my App component not rendering wrapped under Provider?<pre><code>import React from 'react'; import ReactDOM from 'react-dom/client'; import &quot;./index.css&quot;; import App from &quot;./App&quot;; import reportWebVitals from &quot;./reportWebVitals&quot;; import { applyMiddleware } from &quot;redux&quot;; imp...
<p><code>configureStore</code> works very differently from how you are using it. It is not a 1:1 drop-in replacement for <code>createStore</code> (in that case it would be pretty pointless to replace that).</p> <p>It's very likely that you had an error message on the console that you just didn't notice.</p> <pre class=...
Why is my App component not rendering wrapped under Provider?
reactjs|redux|redux-saga
0
43
1
72,940,768
72,940,768
1
true
2022-07-11T15:03:32.110Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is my App component not rendering wrapped under Provider?<pre><code>import React from 'react'; import ReactDOM from 'react-dom/client'; import &quot;./in...
72,940,807
Rpart Plot in R<p>I am doing some regression analysis on the small data I have based on the admission number where I want to see the effect of other variables on it. Regression works fine and I do get a good output but how can I build a regression Tree. Can anyone please help me! It is only giving me 1 node, not the co...
<p>It is not possible to plot the tree using its default settings. You can <code>control</code> these in the <code>rpart</code> function. Here is a reproducible example:</p> <pre class="lang-r prettyprint-override"><code>library(rpart.plot) Tree &lt;- rpart(Adm.Numbers ~. - YEAR, data = FACTORS_Thesis_1_, method = &quo...
Rpart Plot in R
r|regression
0
43
1
72,941,051
72,941,051
1
true
2022-07-11T15:14:50.880Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Rpart Plot in R<p>I am doing some regression analysis on the small data I have based on the admission number where I want to see the effect of other variable...
72,941,007
Nested Optional.get generates warning when checked and chained in orElse()<p>I've just stumbled upon a warning generated by IntelliJ and I'm wondering, do I miss something or is IntelliJ just ignoring the right side of the following or clause?</p> <p>Example Code:</p> <pre><code> Random random = new Random(); public...
<p>Yes-ish. <code>||</code> short-circuits but <code>orElse</code> doesn't, so <code>b.get</code> still runs and raises an exception if <code>b</code> is absent, even if <code>a</code> is present. That's why Java provides <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Optional.html#orElseGet-java.util.fun...
Nested Optional.get generates warning when checked and chained in orElse()
java|intellij-idea|option-type
0
43
2
72,941,162
72,941,162
1
true
2022-07-11T15:29:08.907Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Nested Optional.get generates warning when checked and chained in orElse()<p>I've just stumbled upon a warning generated by IntelliJ and I'm wondering, do I ...
72,941,571
Pundit context access<p>An application defines a pundit user according to its context of shop</p> <pre><code> def pundit_user CurrentContext.new(current_user, @shop) end </code></pre> <p>In practice, the following policy for <code>Contact class</code></p> <pre><code> def initialize(user, contact) @user = ...
<p>You have to set up <code>CurrentContext</code> class so you can use it inside the policy classes:</p> <pre class="lang-rb prettyprint-override"><code>class CurrentContext # &lt;= FIXME: the name is not very descriptive # maybe `AuthorizationContext` # NOTE: create reader methods to ...
Pundit context access
ruby-on-rails|pundit
1
43
1
72,945,562
72,945,562
1
true
2022-07-11T16:13:14.093Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pundit context access<p>An application defines a pundit user according to its context of shop</p> <pre><code> def pundit_user CurrentContext.new(curren...
72,945,524
How to manage local authentication AND external authentication (OAuth)?<p>Auth newbie here.</p> <p>I am currently working on a project where I have to implement authentication. First I will be doing a basic local authentication as the target users might not have any kind of social network, so I will be using a database...
<p>You don't <em>need</em> to store anything for the social auth. You're offloading the authentication to the social provider. They have the required table and info to authenticate the user.</p> <p>The info you get about the user, either from something like a user info endpoint or in the ID token, is usually just used ...
How to manage local authentication AND external authentication (OAuth)?
sql|authentication|oauth-2.0|openid-connect
0
43
1
72,946,818
72,946,818
1
true
2022-07-11T23:12:48.560Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to manage local authentication AND external authentication (OAuth)?<p>Auth newbie here.</p> <p>I am currently working on a project where I have to implem...
72,947,221
How to avoid creating multiple docs in firebase everytime user update his profile info in flutter<p>So I just created a form for the user to key in his/her personal info in flutter. This is the code as a begining:</p> <pre><code> import 'package:cloud_firestore/cloud_firestore.dart'; class InsertProfInfoToDB { Strin...
<p>you can use update method</p> <pre><code>await FirebaseFirestore.instance .collection('users') .doc(userID).update(); </code></pre>
How to avoid creating multiple docs in firebase everytime user update his profile info in flutter
flutter|firebase|dart|google-cloud-firestore|firebase-authentication
1
43
2
72,947,529
72,947,529
1
true
2022-07-12T04:58:23.307Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to avoid creating multiple docs in firebase everytime user update his profile info in flutter<p>So I just created a form for the user to key in his/her p...
72,950,532
Numpy Array replace booleans with string depending on position of "True"<p>To process to output of a multi-class classification I'd like to process a numpy array in such a way, that every <code>True</code> from the first column results in a <code>class1</code> and a <code>True</code> in <code>class2</code> correspondin...
<p>You can use <a href="https://numpy.org/doc/stable/reference/generated/numpy.select.html" rel="nofollow noreferrer"><code>numpy.select</code></a>.</p> <pre><code>import numpy as np cls = np.array([[True, False],[False, False],[False, True],[True, False],[False, True]]) mask = cls.any(-1) condlist = [(mask &amp; cls[...
Numpy Array replace booleans with string depending on position of "True"
python|numpy
1
43
1
72,950,615
72,950,615
1
true
2022-07-12T10:05:17.157Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Numpy Array replace booleans with string depending on position of "True"<p>To process to output of a multi-class classification I'd like to process a numpy a...
72,944,064
How to add the scrape iterator to a pandas dataframe for each row?<p>I am scraping data from a website using this code and loading the data to a pandas dataframe. I get multiple entries per iteration:</p> <pre><code>data = [] for i in range (0,24): for j in range (1,15): if i &lt; 9: URL = 'http...
<p>Instead of using list to append dataframes, use a dictionary to store the dataframes for each iteration <code>(i, j)</code> then <code>concat</code> will automatically take care of adding the multiindex for you.</p> <h3>Update your code</h3> <pre><code>data = {} for i in range (0,2): for j in range (1,3): ...
How to add the scrape iterator to a pandas dataframe for each row?
python|pandas|web-scraping
1
43
1
72,952,032
72,952,032
1
true
2022-07-11T20:03:46.800Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to add the scrape iterator to a pandas dataframe for each row?<p>I am scraping data from a website using this code and loading the data to a pandas dataf...
72,937,629
Object Array, Array class and need for a full array declaration<p>Pls note that it may seem that I am asking many questions but they are all related. Its just that I am unable to frame a crisp question due to lack of understanding of the underlying concepts and therefore tried to give scenarios to highlight my confusio...
<p>In a comment, the question notes some additional context, which is that this is prompted by <a href="https://docs.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/constants-enums/how-to-iterate-through-an-enumeration#to-iterate-through-an-enumeration" rel="nofollow noreferrer">an article i...
Object Array, Array class and need for a full array declaration
vb.net
0
43
2
72,953,271
72,953,271
1
true
2022-07-11T11:11:48.230Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Object Array, Array class and need for a full array declaration<p>Pls note that it may seem that I am asking many questions but they are all related. Its jus...
72,951,026
Can't get expected output when I invoke another Bash script in current Bash script<p>It's my Bash script homework, I am confused about the output of my programs. Suppose I need to use script <code>debugger.sh</code> to invoke script <code>program.sh</code> until the second one failed, and capture all the output of <cod...
<p>There are many unrelated errors here.</p> <p>You are comparing the string <code>n</code> to 42, not the variable <code>$n</code>, so of course that will always fail.</p> <p>You are overwriting the output file on each iteration, so you are overwriting the diagnostics from all previous iterations.</p> <p>There are var...
Can't get expected output when I invoke another Bash script in current Bash script
linux|bash|sh
0
43
1
72,955,648
72,955,648
1
true
2022-07-12T10:44:27.730Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can't get expected output when I invoke another Bash script in current Bash script<p>It's my Bash script homework, I am confused about the output of my progr...
72,956,650
flutter dynamic navigation bar: identify which icon/button is tapped<p>I am creating a dynamic list of BottomNavigationBarItem and assigning it to 'items' of BottomNavigationBar. So based on a condition (here is my case, checks and add one more BottomNavigationBarItem if it is not billed. So the number of Icons display...
<p>If I understand you correctly, you can use the following approach to get the &quot;label&quot;.</p> <p>Call:</p> <pre class="lang-dart prettyprint-override"><code>getNavbarItems()[index].label </code></pre> <p>And have a button to dynamically toggle <code>isBilled</code>.</p> <p>Complete example:</p> <pre class="lan...
flutter dynamic navigation bar: identify which icon/button is tapped
flutter|dynamic|bottom-navigation-bar
1
43
1
72,957,637
72,957,637
1
true
2022-07-12T18:05:55.797Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: flutter dynamic navigation bar: identify which icon/button is tapped<p>I am creating a dynamic list of BottomNavigationBarItem and assigning it to 'items' of...
72,960,141
Data manipulation in R: Starting a new row if i > i-1<p>I have a long (one row) data file with many values. It needs to be broken up into multiple rows. While the specifics of why I need to do this isn't important, the logic is that column i should always be bigger than column i+1. I.e. The values along a row should be...
<p>Here is a tidy solution. Please let me know if this solves your question:</p> <pre class="lang-r prettyprint-override"><code>library(tidyverse) df &lt;- data.frame(matrix(ncol = 9, nrow = 1)) df[1,] &lt;- c(3, 2, 1, 2, 1, 1, 3, 2, 1) df %&gt;% pivot_longer(cols = everything(), names_to = &quot;vars&quot;) %&gt;...
Data manipulation in R: Starting a new row if i > i-1
r|function|reshape|data-manipulation
1
43
3
72,960,398
72,960,398
1
true
2022-07-13T02:05:17.010Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Data manipulation in R: Starting a new row if i > i-1<p>I have a long (one row) data file with many values. It needs to be broken up into multiple rows. Whil...
72,959,456
how can i send data to server interval times<ul> <li>it's my code</li> </ul> <pre><code>class TrackingManager { Location locate = new Location(); Future&lt;Map&lt;String, double&gt;&gt; trackOn() async { LocationData getlocationdata = await locate.getLocation(); Map&lt;String, double&gt; locationdata = {}; ...
<p>using location callback</p> <p><a href="https://pub.dev/packages/location" rel="nofollow noreferrer">https://pub.dev/packages/location</a></p> <pre><code>location.onLocationChanged.listen((LocationData currentLocation) { // call network api // Use current location }); </code></pre>
how can i send data to server interval times
flutter|dart
0
43
1
72,960,455
72,960,455
1
true
2022-07-12T23:46:35.663Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how can i send data to server interval times<ul> <li>it's my code</li> </ul> <pre><code>class TrackingManager { Location locate = new Location(); Future&...
72,960,711
Set all string properties of a class to empty in batch<p>The C# class have 20 properties in string. After some code execution, some of the properties are assgined value. Now I need a <code>Clear()</code> method to set all of them into <code>string.Empty</code>. I can write 20 lines of code, just assgin <code>string.Emp...
<p>Just for a laugh ;)</p> <pre><code>string1 = string2 = string3 = string4 = string5 = string6 = string7 = string8 = string9 = string10 = string11 = string12 = string13 = string14 = string15 = string16 = string17 = string18 = string19 = string20 = string.Empty; </code></pre>
Set all string properties of a class to empty in batch
c#|properties
-1
43
1
72,960,771
72,960,771
1
true
2022-07-13T03:48:40.363Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Set all string properties of a class to empty in batch<p>The C# class have 20 properties in string. After some code execution, some of the properties are ass...
72,963,093
Python pandas using an If..elif..else with multiple or<p>I'm looking to use something simialr to .isin instead of multiple or's in this code:</p> <pre><code>def func(row): if row['Office'] == 'USA' or row['Office'] == 'UK' or row['Office'] == 'Aus' or row['Office'] == 'Can': return 1 else: ...
<p>If using <strong>Python +3.10</strong>, you can use the <code>match - case</code> in replace of <code>IF</code> statements:</p> <pre><code>def func(row): match row['Office']: case 'USA': return 1 case 'UK': return 1 case 'Aus': return 1 case 'Can': return 1 case _: ...
Python pandas using an If..elif..else with multiple or
python|pandas|if-statement
-1
43
1
72,963,282
72,963,282
1
true
2022-07-13T08:24:47.237Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python pandas using an If..elif..else with multiple or<p>I'm looking to use something simialr to .isin instead of multiple or's in this code:</p> <pre><code>...
72,963,307
Align input fields on the same line<p>I have three input fields in a form and I want to put them on the same line.</p> <p><a href="https://i.stack.imgur.com/oWE3R.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oWE3R.png" alt="enter image description here" /></a></p> <p>The whole section looks like t...
<p>from what I see, You want the input fields like this <a href="https://i.stack.imgur.com/SDttP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SDttP.png" alt="inputs" /></a></p> <hr /> <p>For that you need to add give your input1 <code>width:50%</code>, input2 <code>width:20%</code> and input3 <cod...
Align input fields on the same line
css|reactjs
0
43
3
72,963,817
72,963,817
1
true
2022-07-13T08:43:27.490Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Align input fields on the same line<p>I have three input fields in a form and I want to put them on the same line.</p> <p><a href="https://i.stack.imgur.com/...
72,957,469
Neo4j Cypher GROUP BY and create a collection by conditions<p>as the result of my current Neo4j Cypher query, I have the following rows with nodes:</p> <pre><code>WITH node, rootNode, resultNode </code></pre> <p>now, I need to transform this structure into the following:</p> <ol> <li><p><code>GROUP BY resultNode</code>...
<p>You can try this:</p> <ol> <li>For each <code>resultNode</code>, collect <code>node</code> and <code>rootNode</code> in a list.</li> <li>Combine the lists of both <code>node</code> and <code>rootNode</code>.</li> <li>From the final list, filter out all the nodes matching the <code>resultNode</code>.</li> </ol> <p>Li...
Neo4j Cypher GROUP BY and create a collection by conditions
neo4j|cypher
0
43
1
72,964,725
72,964,725
1
true
2022-07-12T19:29:39.400Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Neo4j Cypher GROUP BY and create a collection by conditions<p>as the result of my current Neo4j Cypher query, I have the following rows with nodes:</p> <pre>...
72,966,028
Map specific columns to different pandas dataframe<p>I have a dataframe df1 with latitude and longitude.</p> <pre><code>df1 = pd.DataFrame({ 'place': [&quot;London&quot;, &quot;Paris&quot;, &quot;Berlin&quot;, &quot;London&quot;, &quot;Berlin&quot;], 'sale': [12, 6, 4, 3, 14], 'lat': [54, 23, 13, 54, 13]...
<p>try this:</p> <pre><code>a = df2.merge(df1[['place','lat', 'lon']], on='place') a.loc[~a.duplicated()] &gt;place sale_sum lat lon 0 London 15 54 13 2 Paris 6 23 32 3 Berlin 18 13 64 </code></pre>
Map specific columns to different pandas dataframe
python|pandas|dataframe|aggregate
0
43
2
72,966,148
72,966,148
1
true
2022-07-13T12:07:21.493Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Map specific columns to different pandas dataframe<p>I have a dataframe df1 with latitude and longitude.</p> <pre><code>df1 = pd.DataFrame({ 'place': [&...
72,966,382
Compare and fetch the missing keys between 2 nested dictionaries<p>I am trying to compare 2 nested dictionaries and trying to find the missing keys between them.</p> <p>Let us say, we have 2 dictionaries d1 and d2 as following.</p> <pre><code>d = {'A': {'B': {'C': True, 'H': 'h', 'D': {'E': 'e', 'F': 'f'}}}} e = {'A': ...
<p>There's a library <code>dictdiffer</code> that might help you:</p> <pre class="lang-py prettyprint-override"><code>import dictdiffer d = {'A': {'B': {'C': True, 'H': 'h', 'D': {'E': 'e', 'F': 'f'}}}} e = {'A': {'B': {'C': True, 'D': {'E': 'e', 'F': 'f', 'G': [2, 3, 4, 5, 6, 7]}}}} list(dictdiffer.diff(d, e)) # -&gt...
Compare and fetch the missing keys between 2 nested dictionaries
python|python-3.x|dictionary
0
43
1
72,966,470
72,966,470
1
true
2022-07-13T12:33:50.630Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Compare and fetch the missing keys between 2 nested dictionaries<p>I am trying to compare 2 nested dictionaries and trying to find the missing keys between t...
72,967,514
Why is my variable emptied in React.js when I use setState()<p>I am creating a simple list of cards and I need to filter it according to which tags are selected. I have:</p> <pre><code>function Homepage() { const [cards, setCards] = useState([]); const [filteredCards, setFilteredCards] = useState([]); let filtere...
<p><code>filteredTags</code> is declared and defined as a new empty array with each component render:</p> <pre><code>let filteredTags = []; </code></pre> <p>If you want the value to persist across renders, that's what state is for:</p> <pre><code>const [filteredTags, setFilteredTags] = useState([]); </code></pre> <p>Ju...
Why is my variable emptied in React.js when I use setState()
javascript|reactjs|use-state
0
43
2
72,968,043
72,968,043
1
true
2022-07-13T13:54:09.347Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is my variable emptied in React.js when I use setState()<p>I am creating a simple list of cards and I need to filter it according to which tags are selec...
72,966,632
"Your environment is not configured properly" with Svelte-native<p>I try to build a little application with svelte-native. When I installed NativeScript I created an application and I wanted to run it with</p> <pre><code>ns run ios </code></pre> <p>and I have this problem with the environment:</p> <p><a href="https://...
<p>I found a solution to my problem <a href="https://docs.nativescript.org/environment-setup.html#macos-ios" rel="nofollow noreferrer">here</a></p> <p>In my terminal this command:</p> <pre><code>sudo ln -s $(which python3) /usr/local/bin/python </code></pre> <p>next step is to install pip six</p> <pre><code> python3 -m...
"Your environment is not configured properly" with Svelte-native
javascript|ios|svelte|environment|svelte-native
0
43
1
72,968,159
72,968,159
1
true
2022-07-13T12:50:39.267Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: "Your environment is not configured properly" with Svelte-native<p>I try to build a little application with svelte-native. When I installed NativeScript I c...
72,969,226
Generate Form Fields for each Record in Angular<p>I have <a href="https://stackblitz.com/edit/ingecalc?file=src/app/app.component.ts" rel="nofollow noreferrer">https://stackblitz.com/edit/ingecalc?file=src/app/app.component.ts</a></p> <pre><code> paramsFormArray: FormArray; properties: Record&lt;string, number&gt;...
<p>There is a lot of things going wrong. So Ill give my level best to explain, please ask any doubts if you have any.</p> <ol> <li><p>Calculator needs to be a service ( basically the same as class, but is accessible through constructor, like how you did, class cannot be accessed through constructor ( through Dependency...
Generate Form Fields for each Record in Angular
angular|typescript|angular-dynamic-forms
-1
43
1
72,969,684
72,969,684
1
true
2022-07-13T15:55:28.100Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Generate Form Fields for each Record in Angular<p>I have <a href="https://stackblitz.com/edit/ingecalc?file=src/app/app.component.ts" rel="nofollow noreferre...
72,968,390
Grid that has uneven number of rows<p>I would like to achieve the following grid</p> <p><a href="https://i.stack.imgur.com/AJFcy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AJFcy.png" alt="enter image description here" /></a></p> <p>Basically have 5 rows in the first column and 3 rows in the seco...
<p>To achieve this you need to use the <code>grid-row-start</code> css property on the last element and also will fix the <code>repeat()</code> since <code>repeat()</code> has 2 arguments to work correctly.</p> <blockquote> <p>The repeat() function takes two arguments <a href="https://developer.mozilla.org/en-US/docs/W...
Grid that has uneven number of rows
reactjs|css-grid
1
43
2
72,969,941
72,969,941
1
true
2022-07-13T14:56:03.340Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Grid that has uneven number of rows<p>I would like to achieve the following grid</p> <p><a href="https://i.stack.imgur.com/AJFcy.png" rel="nofollow noreferre...
72,971,634
How to add background to image in react native?<p>I added a picture and I want to add a background to the image in a fixed size.</p> <pre><code>import React, {useState} from 'react'; import { Alert, View, Image, StyleSheet , Text , Button, ImageBackground} from 'react-native' function Test1(props) { return ( ...
<p>If you want something like Create New, you can do like this. <em><strong>You need to add height and width in ImageBackground. You cannot use flex:1 as it wont work.</strong></em></p> <pre><code> &lt;TouchableOpacity&gt; &lt;ImageBackground source={YOUR SOURCE} style={{width:100,height:100,alignItems:'center'...
How to add background to image in react native?
react-native
0
43
1
72,972,450
72,972,450
1
true
2022-07-13T19:27:53.643Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to add background to image in react native?<p>I added a picture and I want to add a background to the image in a fixed size.</p> <pre><code>import React,...
72,974,932
How to calculate the numpy.sum(axis=1) and numpy.angle<p>From the following test code, it is easy to understand the <code>x.sum()</code> and <code>x.sum(axis=0)</code>.</p> <p><strong>Question 1:</strong> How to calculate <code>each value</code> in <code>x.sum(axis=1)</code>?</p> <p><strong>Question 2:</strong> What do...
<p>You can think of a 3D array, like the one you have shown here as having the following dimensions (batch, rows, columns).</p> <p>When using <code>x.sum()</code> you get the result of the sum of all of the values in the 3D array.</p> <p>When using <code>x.sum(axis=0)</code> you get an array with shape (1,3,3) where yo...
How to calculate the numpy.sum(axis=1) and numpy.angle
python|numpy
1
43
1
72,975,052
72,975,052
1
true
2022-07-14T03:40:57.743Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to calculate the numpy.sum(axis=1) and numpy.angle<p>From the following test code, it is easy to understand the <code>x.sum()</code> and <code>x.sum(axis...
72,975,290
SQL update multiple table using inner join<p>I have three tables &quot;batch&quot;, &quot;batchyield&quot;, &quot;batchsop&quot;</p> <pre><code>BATCH |----------|--------------|----------------|-------| | batch_id | batch_status | actual_produce | stage | |----------|--------------|----------------|-------| BATCHYIEL...
<pre class="lang-sql prettyprint-override"><code>UPDATE igrow.farm_management_batch b INNER JOIN ( SELECT batch_id, SUM(actual_harvest) actual_harvest FROM igrow.farm_management_batchyield GROUP BY batch_id ) byl ON b.id = byl.batch_id INNER JOIN igrow.sop_management_batchsopmanagement bsop ON...
SQL update multiple table using inner join
mysql|sql|sql-update|inner-join|where-clause
1
43
1
72,976,162
72,976,162
1
true
2022-07-14T04:43:52.430Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL update multiple table using inner join<p>I have three tables &quot;batch&quot;, &quot;batchyield&quot;, &quot;batchsop&quot;</p> <pre><code>BATCH |-----...
72,977,226
YAML file requires different amounts of indentation for different nodes<p>I'm attempting to write a YAML config script for a load testing utility called Artillery.</p> <p>The YAML syntax is not making any sense to me though. Artillery appears to deserialize the YAML to a Javascript object syntax so it expects nodes in ...
<p>Hohoho, I understand how you feel about <a href="https://www.tutorialspoint.com/yaml/yaml_indentation_and_separation.htm" rel="nofollow noreferrer">YAML indentations</a>.</p> <p>It's like Python-based indentation but with a mix of JSON.</p> <p>In your code:</p> <pre class="lang-yaml prettyprint-override"><code> con...
YAML file requires different amounts of indentation for different nodes
yaml|artillery
0
43
1
72,977,365
72,977,365
1
true
2022-07-14T08:08:36.123Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: YAML file requires different amounts of indentation for different nodes<p>I'm attempting to write a YAML config script for a load testing utility called Arti...
72,974,740
pinescript V5 I'd like to have more than 5 candles of clearance between entry<p><a href="https://i.stack.imgur.com/zO6pn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zO6pn.png" alt="enter image description here" /></a></p> <p>I'd like to have more than 5 candles of clearance between entry</p> <p>B...
<pre><code>can_buy = (t[1] &gt; 5) </code></pre> <p>is wrong, just use t:</p> <pre><code>can_buy = (t &gt; 5) </code></pre> <p>This for example works, every five candles it opens and closes a position</p> <pre><code>s = strategy.position_size &gt; 0 if s strategy.close(&quot;long&quot;) t = ta.barssince(s) can_b...
pinescript V5 I'd like to have more than 5 candles of clearance between entry
pine-script|pinescript-v5|candlestick-chart
0
43
1
72,978,268
72,978,268
1
true
2022-07-14T03:04:50.350Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: pinescript V5 I'd like to have more than 5 candles of clearance between entry<p><a href="https://i.stack.imgur.com/zO6pn.png" rel="nofollow noreferrer"><img ...
72,981,549
Utilizing loop for repetitive analyses and outputs using R<p>I have a dataset that contains numerous items that were measured using a pre- and posttest instrument. Here is an example dataset:</p> <pre><code>Question Score Test QA 5 Pre QA 2 Pre QA 3 Post QA ...
<p>If <code>d</code> is your data:</p> <pre><code>library(data.table) setDT(d)[, effectsize::cohens_d(Score~Test), Question] </code></pre> <p>Output:</p> <pre><code> Question Cohens_d CI CI_low CI_high &lt;char&gt; &lt;num&gt; &lt;num&gt; &lt;num&gt; &lt;num&gt; 1: QA 0.3706247 0.9...
Utilizing loop for repetitive analyses and outputs using R
r|function|loops|data-wrangling
0
43
2
72,981,801
72,981,801
1
true
2022-07-14T13:43:20.423Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Utilizing loop for repetitive analyses and outputs using R<p>I have a dataset that contains numerous items that were measured using a pre- and posttest instr...
72,983,701
check whether a url is part of angular application<p>I have a web app that was partly migrated from PHP and angular-js to angular(currently v13) after a successful login, there's a redirection to other pages. since my login page is angular-based, I'd like to use angular routing to redirect to pages that are angular-bas...
<p>You can use router events for that. Do this code in a service or your root navigation component:</p> <pre><code>constructor(private router: Router) { router.events.pipe( filter(event =&gt; event instanceof NavigationError), takeUntil(this.destroy), ).subscribe(.. here you should redirect with win...
check whether a url is part of angular application
angular|angular-routing|angular-router
1
43
1
72,983,973
72,983,973
1
true
2022-07-14T16:18:44.193Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: check whether a url is part of angular application<p>I have a web app that was partly migrated from PHP and angular-js to angular(currently v13) after a succ...
72,984,714
Delete all text file content except one string chosen with C#<p>I have this txt file:</p> <blockquote> <p>********** Welcome to file*********************This test file.It can gives value.It returns if the validation is successful or shows errors where the XML validation fails.It checks for syntax and content as well.**...
<p>Use regex to match content after &quot;value needed = &quot;. Then it shouldn't matter what comes before.</p> <p>A good pattern would be:</p> <pre><code>&quot;(?&lt;=value needed = ).+&quot; </code></pre> <p>Which translates to:</p> <ul> <li><code>(?&lt;=value needed = )</code>: look for the term &quot;value needed...
Delete all text file content except one string chosen with C#
c#|text|replace|texttrimming
0
43
1
72,984,836
72,984,836
1
true
2022-07-14T17:49:13.267Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Delete all text file content except one string chosen with C#<p>I have this txt file:</p> <blockquote> <p>********** Welcome to file*********************This...
72,936,313
Python mockito - how to verify method's fields<p>I'm working with python mockito in my unit test. I'm familiar with the abilities of mockito, such as verify, mock, capture, etc., but I wonder how to verify the value of the method's fileds.</p> <p>My production code.</p> <pre><code>class Dog(BaseModel): type: str ...
<p>It looks like you don't inject <code>Dog</code> into <code>FlowManager</code> or its methods. Within <code>foo</code> you call a modules global <code>Dog</code> so you probably have to intercept that:</p> <pre><code>when(module_under_test).Dog(type=&quot;bulldog&quot;, age=3).thenReturn(mock()) </code></pre> <p>Sin...
Python mockito - how to verify method's fields
python|unit-testing|mockito
0
43
1
72,987,412
72,987,412
1
true
2022-07-11T09:25:49.457Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python mockito - how to verify method's fields<p>I'm working with python mockito in my unit test. I'm familiar with the abilities of mockito, such as verify,...
72,992,302
(Java, Jackson) How to map a json not having field name to a class with a field of given type<p>I have a json string like this:</p> <pre><code>{ &quot;a&quot;: [&quot;cat&quot;, &quot;dog&quot;], &quot;b&quot; : [&quot;jaguar&quot;], &quot;c&quot;: [&quot;sparrow&quot;, &quot;penguin&quot;] } </code></pre> <p>and I wan...
<p>It is possible without much work. Looking at <a href="https://www.baeldung.com/jackson-map#2-mapltobject-stringgt-deserialization" rel="nofollow noreferrer">this link</a>, we create our class like this:</p> <pre><code>@Data class MyClass { private Map&lt;String, List&lt;String&gt;&gt; someField; @JsonCreato...
(Java, Jackson) How to map a json not having field name to a class with a field of given type
java|json|jackson|jackson-databind
0
43
1
72,992,840
72,992,840
1
true
2022-07-15T10:01:47.313Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: (Java, Jackson) How to map a json not having field name to a class with a field of given type<p>I have a json string like this:</p> <pre><code>{ &quot;a&quot...
72,993,758
Formatting datetime object in df.query(), Python<p>'I would like to format a datetime object within df.query(). The following command works for me</p> <pre><code>df.query(''''2001-01-01'&lt;eventdate''') </code></pre> <p>where <code>eventdate</code> is a multi index column in <code>df</code>. However, I cannot get the ...
<p>If you want it with quotation marks around the date inside the query string, use this:</p> <pre><code> m=&quot;'2001-01-01'&quot; df.query('''{}&lt;eventdate'''.format(m)) </code></pre>
Formatting datetime object in df.query(), Python
python|format
0
43
1
72,994,019
72,994,019
1
true
2022-07-15T12:07:51.737Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Formatting datetime object in df.query(), Python<p>'I would like to format a datetime object within df.query(). The following command works for me</p> <pre><...
72,987,863
Azure Event Hub - Consume Events using an Auth token<p>I have an Event Hub and I want to restrict who can and cannot publish and consume events. The publishing of events works as described here: <a href="https://docs.microsoft.com/en-us/rest/api/eventhub/get-azure-active-directory-token" rel="nofollow noreferrer">https...
<p>Receiving events is not supported using the <a href="https://docs.microsoft.com/en-us/rest/api/eventhub/event-hubs-runtime-rest#tasks" rel="nofollow noreferrer">Event Hubs REST API</a>.</p> <p>In order to consume events, you'll need to either use the AMQP or Kafka protocols. The easiest path to do so is using one o...
Azure Event Hub - Consume Events using an Auth token
azure-eventhub
0
43
1
72,994,229
72,994,229
1
true
2022-07-15T00:18:19.247Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Azure Event Hub - Consume Events using an Auth token<p>I have an Event Hub and I want to restrict who can and cannot publish and consume events. The publishi...
72,995,863
Python- Getting a random object from a list based on attribute<p>For a python role-playing game, I am trying to randomly grab a monster from a list of objects based on the player object's attribute 'self.level'. Eventually, I will have over 100 unique monsters. Currently I have something like,</p> <pre><code>MONSTERS ...
<p>You could use a dictionary.</p> <pre class="lang-py prettyprint-override"><code>import random monsters = { 1: ['rat', 'spider', 'flying snake'], 2: ['giant rat', 'giant spider', 'kobold'], 3: ['drow', 'orc', 'mummy'] } player_level = 1 monster = random.choice(monsters[player_level]) </code></pre>
Python- Getting a random object from a list based on attribute
python|list|object|attributes
0
43
1
72,996,546
72,996,546
1
true
2022-07-15T14:53:51.553Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python- Getting a random object from a list based on attribute<p>For a python role-playing game, I am trying to randomly grab a monster from a list of object...
72,995,735
How to limit calendar entry size in oracle apex<p><a href="https://i.stack.imgur.com/lySGb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lySGb.png" alt="Example calendar" /></a></p> <p>I was wondering if anyone knows if it's possible and how to limit a calendar entry size so it doesn't look like in...
<p>There is no option to limit the width of calendar entry in declarative way but here is an alternate solution. Although, I wouldn't recommend limiting the width as it goes against the responsive design of Oracle APEX Theme UI.</p> <p><strong>Step 1:</strong> Update SQL Query, specifically CSS_COLUMN to have something...
How to limit calendar entry size in oracle apex
oracle|oracle-apex
0
43
1
72,996,634
72,996,634
1
true
2022-07-15T14:43:15.273Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to limit calendar entry size in oracle apex<p><a href="https://i.stack.imgur.com/lySGb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com...
72,995,578
How to take the select word from python code and printing in script shell after calling the script from python?<p>I have the code python</p> <pre><code>import os # put the words you want to match into a list matching_words = [&quot;apple&quot;, &quot;pear&quot;, &quot;car&quot;, &quot;house&quot;] # get some text from...
<p>You need to include your word as an argument in your python program.</p> <p>Following is a snippet of code with some minor revisions to your program.</p> <pre><code>import os # put the words you want to match into a list matching_words = [&quot;apple&quot;, &quot;pear&quot;, &quot;car&quot;, &quot;house&quot;] # ge...
How to take the select word from python code and printing in script shell after calling the script from python?
python|bash
0
43
2
72,996,791
72,996,791
1
true
2022-07-15T14:29:01.760Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to take the select word from python code and printing in script shell after calling the script from python?<p>I have the code python</p> <pre><code>impor...
72,997,547
Why is bool([]) == False while [] == False is False and not True in python boolean logic<p>I've just started learning Python and i was trying this</p> <pre><code>[] == False #False </code></pre> <p>but :</p> <pre><code>bool([]) #False </code></pre> <p>from what i got values like [],0 .. are <strong>False</strong> what...
<p>The operator <code>==</code> is very literal. If the 2 things you are comparing are not exactly the same (this includes types, like <code>&quot;2&quot; == 2</code> is <code>False</code>) then the result will always be <code>False</code>. So the boolean <code>False</code> is not literally the same thing as an empty l...
Why is bool([]) == False while [] == False is False and not True in python boolean logic
python|boolean|logic|boolean-logic|boolean-expression
0
43
2
72,997,688
72,997,688
1
true
2022-07-15T17:11:19.653Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is bool([]) == False while [] == False is False and not True in python boolean logic<p>I've just started learning Python and i was trying this</p> <pre><...
72,994,387
Find items and chech if it has the same id as in parent scope and if it has add isDisable to item<p>Hi everyone I need to get advice on how to realize such a function for searching and adding property if the children's scope has the same ids as the parent scope and add <code>isDisable</code> key.</p> <p>The data which ...
<p>We can do this by capturing the list of ids for the current level to pass on to the recursive call for our children.</p> <p>Here is a version which does not mutate the input -- we're not barbarians! -- but returns a new tree with the <code>isDisable</code> property set appropiately.</p> <p><div class="snippet" data-...
Find items and chech if it has the same id as in parent scope and if it has add isDisable to item
javascript|algorithm|object|search|nested
1
43
2
72,998,006
72,998,006
1
true
2022-07-15T12:59:12.533Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Find items and chech if it has the same id as in parent scope and if it has add isDisable to item<p>Hi everyone I need to get advice on how to realize such a...
72,999,730
Postgres order by difference<p>I am comparing query result set between PostgreSql 9.6 and PostgreSql 12 version. Noticed a very strange behavior in query result. Running below query from psql</p> <pre><code>SELECT current_database(),table_name FROM information_schema.tables WHERE table_type = 'BASE TABLE' AND tab...
<p>If you want the 9.6 version, you can have it collate by the locality that worked in the days before UTF finally got fixed to the point of being usable:</p> <pre><code>create table key_req_user (); create table key_request_user (); select current_database(), table_name, pg_typeof(table_name) from information_schem...
Postgres order by difference
postgresql
2
43
1
73,000,123
73,000,123
1
true
2022-07-15T21:24:03.437Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Postgres order by difference<p>I am comparing query result set between PostgreSql 9.6 and PostgreSql 12 version. Noticed a very strange behavior in query res...
73,003,537
javascript detect scrolling past the end of the window when scroll event doesn't fire<p>I have a site in which all sections take 100vh/vw, and I want to animate the opacity transition when user attempts to scroll up/down.</p> <p>The thing is, the scroll event doesn't fire because the window hasn't really scrolled.</p> ...
<p>Change keyword scroll to wheel, this event fires when you try to scroll from mouse/pad(using fingers)even there is not scroll</p> <pre><code>window.addEventListener(&quot;wheel&quot;, () =&gt; { console.log(&quot;event fires&quot;) }) </code></pre>
javascript detect scrolling past the end of the window when scroll event doesn't fire
javascript|dom|browser
0
43
3
73,003,585
73,003,585
1
true
2022-07-16T10:46:47.133Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: javascript detect scrolling past the end of the window when scroll event doesn't fire<p>I have a site in which all sections take 100vh/vw, and I want to anim...
73,002,764
Automatically generating cloud functions when group created<p>What is the best approach for my case? A user creates a messaging group in my app. Then the group will get its own auto id. Now I want to use cloud func from firebase to check for new messages and to do a push notification.</p> <p>The code below checks if a ...
<p>You can make the group ID a parameter on your Cloud Function declaration:</p> <pre><code>exports.Push = functions.database.ref('/placeID/{groupID}/{messageID}/') </code></pre> <p>Then you can access that group ID in your functions code with:</p> <pre><code>const groupID = context.params.groupID; </code></pre> <p>And...
Automatically generating cloud functions when group created
node.js|firebase-realtime-database|google-cloud-functions
1
43
1
73,004,942
73,004,942
1
true
2022-07-16T08:38:41.367Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Automatically generating cloud functions when group created<p>What is the best approach for my case? A user creates a messaging group in my app. Then the gro...
73,000,862
Built-in function or Cmdlets to store all folders names in an array in PowerShell<p>I have found an answer of how to store the folders names of the current folder in an array. by <a href="https://stackoverflow.com/users/9833/shay-levy">@Shay Levy</a> - <a href="https://stackoverflow.com/questions/13998777/storing-direc...
<p>I think you want to use every single element in array for other scopes:</p> <pre><code>$wDir = '\\QNAP\wpbackup' $arr = Get-ChildItem -Directory -Name -Path $wDir </code></pre> <hr /> <p>Another solution:</p> <pre><code>$wDir = '\\QNAP\wpbackup' $arr = @(Get-ChildItem -Directory -Name -Path $wDir) </code></pre>
Built-in function or Cmdlets to store all folders names in an array in PowerShell
powershell
0
43
1
73,005,513
73,005,513
1
true
2022-07-16T01:05:54.050Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Built-in function or Cmdlets to store all folders names in an array in PowerShell<p>I have found an answer of how to store the folders names of the current f...
73,006,269
KQL reformat table add columns based on distinct values in column<p>I'm looking for a smart way in Kusto Query Language (KQL) to reformat a table. One Column (in this example Car-column) gives the kind of new rows. So I'm looking for a KQL pipe command to add columns and reduce the number of rows by reordering the cont...
<p>The short answer for your question is to use the <a href="https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/pivotplugin" rel="nofollow noreferrer">pivot plugin</a></p> <p>for example:</p> <pre><code>datatable(Distance:long, avg_Velocity:long, Car:string) [ 0, 0, &quot;Audi&quot;, 0, 0, &quot;...
KQL reformat table add columns based on distinct values in column
azure-data-explorer|kql
0
43
1
73,006,556
73,006,556
1
true
2022-07-16T17:18:36.210Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: KQL reformat table add columns based on distinct values in column<p>I'm looking for a smart way in Kusto Query Language (KQL) to reformat a table. One Column...
73,006,343
Is it possible to to get parsed node through monaco editor<p>The monaco editor I use for web seems to understand where an HTML begins and ends. So it feels like it parses it. So can I use the parsing of monaco to create a nodes tree. Is it possible to do?</p> <p>Ex: If I load an HTML file content in monaco editor can I...
<p>No, Monaco has no parser, just tokenizers for certain languages, which means it cannot give you a parse tree.</p>
Is it possible to to get parsed node through monaco editor
reactjs|parsing|html-parsing|monaco-editor
0
43
1
73,010,234
73,010,234
1
true
2022-07-16T17:29:48.633Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to to get parsed node through monaco editor<p>The monaco editor I use for web seems to understand where an HTML begins and ends. So it feels l...
73,010,563
If I compile a C/C++ program on a linux machine, does it automatically have rwx perms<p>I am currently learning penetration testing as part of a cybersecurity career path. I was working on a vulnhub machine that required me writing some malware to exploit a buffer overflow bug. I decided to write it in C for the sake o...
<p>From my experience, <code>rsync</code> would be able to retain file permission when transferring between machines, maybe give it a try?</p> <p>From local machine: <code>rsync -aP source_path remote_machine:destination_path</code></p> <p><code>-a</code> is archive mode, preserves file properties</p> <p><code>-P</code...
If I compile a C/C++ program on a linux machine, does it automatically have rwx perms
c|linux|security|penetration-testing
0
43
1
73,010,749
73,010,749
1
true
2022-07-17T09:12:04.983Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: If I compile a C/C++ program on a linux machine, does it automatically have rwx perms<p>I am currently learning penetration testing as part of a cybersecurit...
73,011,232
pass data through the component tree without having to pass props down manually at every level<p>I have a sidebar on my site. The sidebar contains filters (date and time, model, category, etc.). Each filter is made in the form of a drop-down list.</p> <p>I made the sidebar in such a way that the filters could save thei...
<p>I made a wrapper component called <code>FiltersContextWrapper</code>, to hold the filters <code>states</code> and a <code>context</code> to control the state, this will clean the <code>App.js</code> component from the <code>states</code> and will keep the functionality as it is, please check.</p> <p><a href="https:/...
pass data through the component tree without having to pass props down manually at every level
javascript|reactjs
0
43
1
73,011,523
73,011,523
1
true
2022-07-17T11:05:56.637Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: pass data through the component tree without having to pass props down manually at every level<p>I have a sidebar on my site. The sidebar contains filters (d...
73,013,326
JavaScript createElement() not affecting HTML<p>I am following along with a tutorial to create an audio player. The <code>index.html</code> file has a class named <code>audioPlayer</code> as shown below:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; ... &lt;/head&gt; &lt;body&gt; ...
<p>It seems you didn't (first) have the code that actually creates an instance of your <code>AudioPlayer</code> class, so neither <code>constructor()</code> nor <code>createPlayerElements()</code> gets executed.</p> <p>In the video you referenced, check again what is discussed at around 4:10-4:30.</p> <ul> <li><p>In an...
JavaScript createElement() not affecting HTML
javascript|html|dom
0
43
1
73,013,468
73,013,468
1
true
2022-07-17T16:04:14.400Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JavaScript createElement() not affecting HTML<p>I am following along with a tutorial to create an audio player. The <code>index.html</code> file has a class ...
73,013,893
Running crontab from dockerfile to execute java program<p>This is my Dockerfile</p> <pre><code>FROM Base-Image COPY --from=baseimage:version / ENTRYPOINT [&quot;/bin/Startup.py&quot;] RUN yum install --setopt=obsoletes=0 graalvm20-ee-8-jdk-20.3.3 &amp;&amp; \ yum -y install cronie &amp;&amp; \ yum clean all R...
<p><code>--classpath</code> can be tricky, but the snippet from Oracle documentation at the end of this post explains it quite well.</p> <p>You seem to copy both your class files and jar to the container, but do not copy the classes appropriately, nor set the classpath to include the jar file.</p> <p>To specify a class...
Running crontab from dockerfile to execute java program
java|cron|dockerfile
0
43
1
73,014,062
73,014,062
1
true
2022-07-17T17:24:15.250Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Running crontab from dockerfile to execute java program<p>This is my Dockerfile</p> <pre><code>FROM Base-Image COPY --from=baseimage:version / ENTRYPOINT [&q...
73,014,942
How to get numbers outside ranges<p>How can I write a function that asks the user to specify multiple set of numbers and return the numbers outside of these ranges?</p> <p>Let's say I want the numbers that are not included in 3-8 and 11-15 within the range 1 to 20, therefore it would have to return 1-2,9-10,16-20</p>
<pre><code>first, last = tuple(map(int, input(&quot;what are first and last numbers?&quot;).split(&quot; &quot;))) data = set(range(first, last + 1)) while True: inp = input(&quot;entre set: &quot;) if inp == &quot;&quot;: break first, last = tuple(map(int, inp.split(&quot; &quot;))) numbers_set...
How to get numbers outside ranges
python
-1
43
2
73,015,095
73,015,095
1
true
2022-07-17T19:56:00.133Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get numbers outside ranges<p>How can I write a function that asks the user to specify multiple set of numbers and return the numbers outside of these ...
73,015,430
TS Record type: ...expression of type 'HeaderName' can't be used to index type '{} | Record<HeaderName, string>'<p>The subject line says it all. I have a record type Record&lt;HeaderName, str&gt; and I am trying to add to the Record object by indexing. <code>headerMap['name'] = 'somename'</code></p> <p>In a typescript ...
<p>Let's simplify the problem:</p> <pre><code>type ab = 'a' | 'b'; let headerMap: Record&lt;ab, string&gt; | {}; headerMap['a']; // Element implicitly has an 'any' type because expression of type '&quot;a&quot;' can't be used to index type '{} | Record&lt;ab, string&gt;'. // Property 'a' does not exist on type '{} | ...
TS Record type: ...expression of type 'HeaderName' can't be used to index type '{} | Record<HeaderName, string>'
typescript
0
43
1
73,015,589
73,015,589
1
true
2022-07-17T21:18:22.757Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: TS Record type: ...expression of type 'HeaderName' can't be used to index type '{} | Record<HeaderName, string>'<p>The subject line says it all. I have a rec...
73,020,190
Python Byte to List<p>I am using redis.get method and it's returns me byte.</p> <p>In redis ı have a list like that:</p> <pre><code>[ &quot;ADA/USD&quot;, &quot;ADA/USDT&quot;, &quot;ALGO/USD&quot;, &quot;ATOM/USD&quot; ] </code></pre> <p>When get this list inside of my script with redis.get</p> <p>It's...
<pre class="lang-py prettyprint-override"><code>import json json.loads(b'[&quot;ADA/USD&quot;,&quot;ADA/USDT&quot;,&quot;ALGO/USD&quot;,&quot;ATOM/USD&quot;]'.decode()) </code></pre>
Python Byte to List
python|list|byte
0
43
3
73,020,266
73,020,266
1
true
2022-07-18T09:38:54.450Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python Byte to List<p>I am using redis.get method and it's returns me byte.</p> <p>In redis ı have a list like that:</p> <pre><code>[ &quot;ADA/USD&quot;...
73,024,770
Too many versions of Ruby in my app - which one are really necessary?<p>I have a ruby on rails 7 app so I have ruby listed in my gemfile.</p> <p><strong>app/Gemfile</strong></p> <pre><code>source &quot;https://rubygems.org&quot; git_source(:github) { |repo| &quot;https://github.com/#{repo}.git&quot; } ruby &quot;~&gt;...
<p>You usually should not use a version manager with Docker (<code>asdf</code>, <code>rbenv</code>, <code>rvm</code>, ...). At a mechanical level, most paths to running a Docker container don't read the <code>.bashrc</code> or <code>.profile</code> files you set up, and you need a pretty roundabout path to &quot;activ...
Too many versions of Ruby in my app - which one are really necessary?
ruby-on-rails|ruby|docker
0
43
1
73,025,565
73,025,565
1
true
2022-07-18T15:22:42.427Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Too many versions of Ruby in my app - which one are really necessary?<p>I have a ruby on rails 7 app so I have ruby listed in my gemfile.</p> <p><strong>app/...
73,026,063
MemberNotNullWhen along with a parameter name<p>If <code>heartbeat</code> is <code>true</code>, the nullability warning over <code>heartbeatTarget</code> should go away. I remember there was the MemberNotNullWhen attribute. How do I use it in this case in order to disable the nullability warning over <code>heartbeatTar...
<p><code>MemberNotNullWhen</code> doesn't work like that. You are only allowed to attribute Methods and Properties with it which is why you put a <code>[property:]</code> as a compiler workaround.</p> <p>Null annotations is supposed to help with compile time null-ref exceptions, but I don't think any of the current ann...
MemberNotNullWhen along with a parameter name
c#|.net
0
43
1
73,027,620
73,027,620
1
true
2022-07-18T17:05:23.390Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MemberNotNullWhen along with a parameter name<p>If <code>heartbeat</code> is <code>true</code>, the nullability warning over <code>heartbeatTarget</code> sho...
73,029,657
Name Services under started process in cmd<p>In windows 10 cmd, I started a process <code>C:\Windows\system32\svchost.exe -k RPCSS -p</code> successfully. How do I list the services it is currently managing?</p> <p>I've looked at <code>tasklist</code>, however, that requires the image name, and I am unsure how to ident...
<p>You can try with <a href="/questions/tagged/wmic" class="post-tag" title="show questions tagged &#39;wmic&#39;" rel="tag">wmic</a> in cmd to get the commandline of the process :</p> <hr /> <pre><code>wmic process where &quot;name like 'svchost.exe' And CommandLine!=Null&quot; get commandline /Value </code></pre>
Name Services under started process in cmd
windows|cmd|service|svchost
1
43
1
73,035,127
73,035,127
1
true
2022-07-18T23:38:11.240Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Name Services under started process in cmd<p>In windows 10 cmd, I started a process <code>C:\Windows\system32\svchost.exe -k RPCSS -p</code> successfully. Ho...
73,029,228
How to prevent automatic download of a linked mp3 file<p>I am making a website using only HTML and CSS. I am trying to link to an online mp3 file (that I do not own) so that the mp3 plays in the browser. This simple code does what I want on Firefox and Safari:</p> <pre><code> &lt;a href=&quot;https://www.allaboutbir...
<p>You can't guarantee that all the browsers will have a built-in in-frame player for the audio file.</p> <p>The best thing to do in this case is to embed the audio player into a page with the audio element:</p> <pre><code>&lt;audio src=&quot;https://example.com/some-sound.mp3&quot; controls&gt;&lt;/audio&gt; </code></...
How to prevent automatic download of a linked mp3 file
google-chrome|download|mp3
1
43
1
73,040,520
73,040,520
1
true
2022-07-18T22:23:03.313Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to prevent automatic download of a linked mp3 file<p>I am making a website using only HTML and CSS. I am trying to link to an online mp3 file (that I do ...
72,941,815
Ics file is "sending update" instead of creating a "send"<p>I have this meeting appointment i'm trying to send from an <code>.ics</code> file. This is the data</p> <pre class="lang-js prettyprint-override"><code>&quot;BEGIN:VCALENDAR\n&quot; + &quot;CALSCALE:GREGORIAN\n&quot; + &quot;METHOD:PUBLISH\n&quot; + &quot;PROD...
<p>I believe it’s because you have static UID for all <code>.ics</code> you generated. <code>&quot;UID:gestionprojetsCalendarInvite\n&quot;</code></p> <p>UID aka unique ID, is supposed to uniquely represent a calendar event. When you open an ics file containing duplicated UID, your app (Outlook I guess?) thinks you wan...
Ics file is "sending update" instead of creating a "send"
javascript|outlook|icalendar
0
43
1
73,060,228
73,060,228
1
true
2022-07-11T16:35:31.450Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Ics file is "sending update" instead of creating a "send"<p>I have this meeting appointment i'm trying to send from an <code>.ics</code> file. This is the da...
73,030,342
Move files from one directory to another based on file names in csv using macOS Terminal<p>I am trying to move thousands of files from one directory to another based on the file names that are in a CSV document (one column with just the names).</p> <p>CSV:</p> <pre><code>filename1 filename2 filename3 </code></pre> <p>F...
<p>In your terminal window, you can use this command to move files listed in CSV from Folder to NewFolder:</p> <p><code>for file in $(cat CSV); do mv Folder/$file NewFolder; done</code></p>
Move files from one directory to another based on file names in csv using macOS Terminal
macos|terminal|macos-big-sur
0
43
1
73,103,734
73,103,734
1
true
2022-07-19T02:02:14.620Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Move files from one directory to another based on file names in csv using macOS Terminal<p>I am trying to move thousands of files from one directory to anoth...
72,798,559
PHP Mongo Multiple "AND" using "find" method<p>I am trying to fetch data with &quot;AND&quot; condition but its not matching all conditions. I want to fetch result only when all conditions match.</p> <pre><code>My conditions are :- $and1 = array( '$and' =&gt; array( array( &quot;users.23315&quo...
<p>Solution for multiple &quot;AND was</p> <pre><code>$where = ['$and' =&gt; [ [&quot;users.$user_id&quot; =&gt; ['$exists' =&gt; true]], ['messages.type' =&gt; 'whatsapp'], ['delete' =&gt; ['$ne' =&gt; 1]], ...
PHP Mongo Multiple "AND" using "find" method
mongodb-query|php-mongodb
1
43
1
73,121,822
73,121,822
1
true
2022-06-29T08:56:09.830Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PHP Mongo Multiple "AND" using "find" method<p>I am trying to fetch data with &quot;AND&quot; condition but its not matching all conditions. I want to fetch ...
72,851,921
createAsyncThunk not working Canceling While Running<p>Abort is not working on createAsyncThunk. I am trying to abort the dispatch method while dependencies change in useEffect hooks. In the below code, I try to call API on btn click with help of a counter and try to abort the previous call also. But I didn't get the p...
<pre><code>const abort = React.useRef(); React.useEffect(() =&gt; { // Dispatching the thunk returns a promise abort.current = new AbortController(); dispatch(getDataAction({ signal: abort.current.signal })); return () =&gt; { abort.current.abort(); }; }, [search]); </code></pre>
createAsyncThunk not working Canceling While Running
reactjs|redux|react-redux|redux-toolkit
2
43
1
73,220,891
73,220,891
1
true
2022-07-04T04:55:41.200Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: createAsyncThunk not working Canceling While Running<p>Abort is not working on createAsyncThunk. I am trying to abort the dispatch method while dependencies ...
72,988,320
Importing two python modules from each other<p>I have two modules one for the Main Menu lets call it <code>MainMenu.py</code> and another one for the game <code>InGame.py</code>, there is a button in each module that when clicked should take me to the other module:</p> <p>NOTE: I always run MainMenu.py first then i ope...
<p>I believe what you are trying to do is discouraged, there are a number of alternative approaches you can take which will remove the need for such cyclic references. The first immediate idea I have to solve your problem involves using an event driven design pattern. The general concept behind it is to have the MainMe...
Importing two python modules from each other
python
0
43
1
72,988,353
72,988,353
1
true
2022-07-15T01:53:20.847Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Importing two python modules from each other<p>I have two modules one for the Main Menu lets call it <code>MainMenu.py</code> and another one for the game <c...
72,800,422
How to test whether a pandas series contains elements from another list (or NumPy array or pandas series)?<p>Assume that I have this <code>DataFrame</code> (<code>Animals</code> column is of type <code>pandas.Series</code>):</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>ID</th> <th>Animal...
<p>You can create dictionary for test if match at least one value by converting to sets with <code>isdisjoint</code> and if necessary <code>0.0</code> and <code>1.0</code> casting boolean to <code>floats</code>, for <code>0, 1</code> use <code>.astype(int)</code>:</p> <pre><code>d = {'Birds':birds, 'Mammals':mammals} ...
How to test whether a pandas series contains elements from another list (or NumPy array or pandas series)?
python|python-3.x|pandas|dataframe|series
2
43
2
72,800,503
72,800,503
1
true
2022-06-29T11:12:28.693Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to test whether a pandas series contains elements from another list (or NumPy array or pandas series)?<p>Assume that I have this <code>DataFrame</code> (...
72,985,525
Identifying & Adding values in an Array<pre><code>class Member { constructor (membershipType, pointsEarned) { this.membershipType = membershipType; this.pointEarned = pointsEarned; } } </code></pre> <pre><code>var John = new Member ('Gold', 1400); var Luke = new Member ('Ruby', 250); var Sam = n...
<p>I'm going to try and explain this without using your original code, just to try and keep things minimal.</p> <p>So lets's forget having a class, as it's extra noise in the code for now. We can just as easily define an object literal:</p> <pre class="lang-js prettyprint-override"><code>var John = { membershipType: 'G...
Identifying & Adding values in an Array
javascript|arrays
-1
43
2
72,985,718
72,985,718
1
true
2022-07-14T19:06:44.297Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Identifying & Adding values in an Array<pre><code>class Member { constructor (membershipType, pointsEarned) { this.membershipType = membershipTyp...
72,820,793
Add new column with value based on other column starting character<p>Using pandas I want to be fill DVZ column with data (data1, data2, etc..) based on starting sting of column DV2 for example if start with 9 will add data1 to DVZ first raw and second if start with 7 will add data2 if start with 7 will be data3 in DVZ...
<p>IIUC, you can use:</p> <pre><code>c = df['DV2'].astype(str).str[0] df['DVZ'] = 'data' + c.ne(c.shift()).cumsum().astype(str) print(df) # Output DV1 DV2 DVZ 0 9412 941 data1 1 9434 911 data1 2 9412 717 data2 3 3114 311 data3 4 6314 631 data4 5 6622 662 data4 </code></pre> <p><strong>Update<...
Add new column with value based on other column starting character
python|pandas|numpy
0
43
1
72,820,965
72,820,965
1
true
2022-06-30T18:56:40.017Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Add new column with value based on other column starting character<p>Using pandas I want to be fill DVZ column with data (data1, data2, etc..) based on start...
72,802,056
Create new column from a row value in a grouped data frame?<p>I have a data frame <code>data</code></p> <pre><code>data_ = {'ID': [777, 777, 777,777,777,777],'Month':[1,1,1,2,2,2], 'Salary': [130,170,50,140,180,60], 'O': [&quot;AC&quot;,&quot;BR&quot;,&quot;BR&quot;,&quot;AC&quot;,&quot;BR&quot;,&quot;BR&quot;], 'D':[&...
<p>Filter by B False before groupby then join with your initial dataframe</p> <pre><code>Subgroup = data[~data['B']] \ .groupby(['ID','Month']) \ .agg(NEW_SALARY = ('Salary', 'mean')) \ .reset_index() final_df = data.merge(Subgroup, on=['ID', 'Month']) final_df </code></pre> <p>Output:</p> <p><a href="https:/...
Create new column from a row value in a grouped data frame?
python|pandas|dataframe|pandas-groupby
1
43
3
72,802,130
72,802,130
1
true
2022-06-29T13:14:48.863Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Create new column from a row value in a grouped data frame?<p>I have a data frame <code>data</code></p> <pre><code>data_ = {'ID': [777, 777, 777,777,777,777]...
72,884,734
Python adding a string leaves extra characters<p>If you need any more info just Let Me Know</p> <p>I have a python script that adds a string after each line on a CSV file. the line <code>file_lines = [''.join([x.strip(), string_to_add, '\n']) for x in f.readlines()]</code> is the trouble maker. For each file line it wi...
<p>As they said above you should use <code>.strip()</code>:</p> <pre><code>shutil.copy(os.path.join(src, filename.strip()), os.path.join(dst, filename.strip())) </code></pre> <p>This way it gives you the file name or string you need and then it removes anything else.</p>
Python adding a string leaves extra characters
python
0
43
1
72,884,934
72,884,934
1
true
2022-07-06T13:48:17.460Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python adding a string leaves extra characters<p>If you need any more info just Let Me Know</p> <p>I have a python script that adds a string after each line ...
72,963,487
Is it possible to simplify browser JWT security using in-memory CSRF token?<br> I was reading articles about `JWT` security in SPA apps, but got confused about it being prone to many types of attacks, and unintuitively hard to grasp and set up. <p>As far as I am aware, this whole thing with the user-friendly security i...
<p>the answer to your question is no.</p> <p>If i manage to do a XSS on your site, i will have access to everything that your javascript has access to and that includes both the CSRF token, and the JWT. Its your javascript that will run my malicious javascript, which means i have all access to everything you have.</p> ...
Is it possible to simplify browser JWT security using in-memory CSRF token?
http|cookies|spring-security|jwt
0
43
1
72,965,176
72,965,176
1
true
2022-07-13T08:55:00.783Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to simplify browser JWT security using in-memory CSRF token?<br> I was reading articles about `JWT` security in SPA apps, but got confused abo...
72,836,092
Why do I get only a part of string when I use getString in Kotlin?<p>I saved a string in resources file, I run Code A and get Result A, I hope to get the Result B.</p> <p>What's wrong with my code?</p> <p><strong>Result A</strong></p> <pre><code>Recommend the app to a friend </code></pre> <p><strong>Code A</strong></p>...
<p>I know that this has been downvoted and all, but have you tried:</p> <pre><code> &lt;string name=&quot;myRecommendContent&quot;&gt;&amp;lt;a href=&amp;quot;#&amp;quot;&amp;gt;Recommend&amp;lt;/a&amp;gt; the app to a friend&lt;/string&gt; </code></pre> <p>By what I can see, it ignores you're &quot;other&quot; elem...
Why do I get only a part of string when I use getString in Kotlin?
android-studio|kotlin
-1
43
1
72,836,143
72,836,143
1
true
2022-07-02T02:37:25.087Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why do I get only a part of string when I use getString in Kotlin?<p>I saved a string in resources file, I run Code A and get Result A, I hope to get the Res...
72,952,388
Opening a file in append mode but truncating the file if not empty in JAVA 11<p>I would like to create a result.csv file if it does not exist, then I call <code>write</code> several times and append corresponding messages one by a call.</p> <p>But If the file already exists and contain something before the run of the p...
<p>This code should do the job according to your description from the question:</p> <pre class="lang-java prettyprint-override"><code>public final class Writer { private static final Set&lt;String&gt; m_AppendMarkers = new HashMap&lt;&gt;(); public static void write( final String message, final String destination...
Opening a file in append mode but truncating the file if not empty in JAVA 11
java|append|filewriter|truncation
-1
43
1
72,954,170
72,954,170
1
true
2022-07-12T12:32:59.197Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Opening a file in append mode but truncating the file if not empty in JAVA 11<p>I would like to create a result.csv file if it does not exist, then I call <c...
72,955,471
Adding a theme (one of three themes) when you switch, and a mode (dark or light) when you toggle, to a HTML element in pure JavaScript?<p>I am going to generate from Markdowm to a single offline HTML page with inline styles and inline scripts. It has a selection list of three themes, using <code>:root</code> and a togg...
<p>Try this simple solution to switch between themes.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>// Initial elements const select = document.getElementById('theme-select')...
Adding a theme (one of three themes) when you switch, and a mode (dark or light) when you toggle, to a HTML element in pure JavaScript?
javascript|html|css
1
43
1
72,958,975
72,958,975
1
true
2022-07-12T16:23:37.533Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Adding a theme (one of three themes) when you switch, and a mode (dark or light) when you toggle, to a HTML element in pure JavaScript?<p>I am going to gener...
72,920,913
WPF Datatrigger should fire only once<p>I have a simple application: There's a DataGrid, and every time the user adds a new row and finished editing, the row turns yellow. In the background a thread tries to save the data and if this worked, it sets the property IsSaved to true. In the view the row then changes to a tr...
<p>The virtualization of DataGrid causes animation to repeat. You can turn off virtualization, but it can degrade performance, so I wrote the following example.</p> <p>Disable virtualizing:</p> <pre><code>VirtualizingPanel.IsVirtualizing=&quot;False&quot; </code></pre> <p>Example (XAML):</p> <pre><code>&lt;Grid&gt; ...
WPF Datatrigger should fire only once
c#|wpf|datatrigger
1
43
1
72,925,117
72,925,117
1
true
2022-07-09T11:17:07.680Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: WPF Datatrigger should fire only once<p>I have a simple application: There's a DataGrid, and every time the user adds a new row and finished editing, the row...
72,877,408
Center viewport after resize OpenGL / GLUT<p>Im working in my reshape callback but i cant get the viewport centered after resize, it stays in the top-left corner. Im working with FreeGLUT.</p> <p>This is my reshape function:</p> <pre><code>void reshape(int w, int h) { glViewport(0, 0, w, h); glMatrixMode(GL_PRO...
<p>The problem is the orthographic projection and the view space coordinates:</p> <blockquote> <pre class="lang-cpp prettyprint-override"><code>gluOrtho2D(0, w, h, 0); </code></pre> </blockquote> <p>In this projection, the upper left coordinate is (0, 0) and the lower right is (<code>w</code>, <code>h</code>), so the c...
Center viewport after resize OpenGL / GLUT
c++|opengl|glut|freeglut|glu
1
43
1
72,878,033
72,878,033
1
true
2022-07-06T02:42:03.757Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Center viewport after resize OpenGL / GLUT<p>Im working in my reshape callback but i cant get the viewport centered after resize, it stays in the top-left co...
72,905,636
How do I change the background colour and foreground colour using a button in Tkinter?<p>So what I am trying to do is create a theme picker for my application</p> <p>For example, the user could click on a the Green/Black button and it would change every widgets background to Black and it would change every widgets fore...
<p><code>Widget.config(bg=color)</code> is what your looking for.</p> <p>Here is a small example of a theme-changing app:</p> <pre class="lang-py prettyprint-override"><code>from tkinter import * from tkmacosx import Button root = Tk() def changethemetoblack(): root.config(bg=&quot;#000000&quot;) def changethe...
How do I change the background colour and foreground colour using a button in Tkinter?
python|tkinter|tkinter-button
0
43
1
72,906,211
72,906,211
1
true
2022-07-08T00:56:58.147Z
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I change the background colour and foreground colour using a button in Tkinter?<p>So what I am trying to do is create a theme picker for my applicatio...