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,889,871 | Copying a PostgreSQL table to GitHub<p>Using the Heroku CLI and following <a href="https://jamesbedont.com/export-a-heroku-postgres-table-to-a-csv-file" rel="nofollow noreferrer">these instructions</a>, I am trying to save the DB tables as CSVs.</p>
<p>I can see the tables on the CLI and when I use the copy command I s... | <p>This certainly won't end up on GitHub. Heroku's GitHub integration works in one direction only: from GitHub to Heroku. It is used for <em>deployment</em>, not for bidirectional syncing.</p>
<p><a href="https://www.postgresql.org/docs/14/app-psql.html#APP-PSQL-META-COMMANDS-COPY" rel="nofollow noreferrer">The Postgre... | Copying a PostgreSQL table to GitHub | postgresql|heroku | 0 | 60 | 1 | 72,917,038 | 72,917,038 | 1 | true | 2022-07-06T21:07:51.817Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Copying a PostgreSQL table to GitHub<p>Using the Heroku CLI and following <a href="https://jamesbedont.com/export-a-heroku-postgres-table-to-a-csv-file" rel=... |
72,910,375 | response from await browser.tabs.sendMessage is set in chrome, but not in firefox<p>I have successfully used await browser.tabs.sendMessage in chrome to get response from the listener, but the same code in firefox does not work. <code>await browser.tabs.sendMessage</code> return immediately and sets response to undefin... | <p>I guess for the tests in firefox you do the reload of the background script (F5 or the specific button in devtools)
Just as you have coded the background you have little hope of getting an answer because every time you reload the background you break the wire with all content scripts injected into the page(s).
Move ... | response from await browser.tabs.sendMessage is set in chrome, but not in firefox | firefox|google-chrome-extension|firefox-addon-webextensions | 1 | 60 | 1 | 72,917,745 | 72,917,745 | 1 | true | 2022-07-08T10:55:00.117Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
response from await browser.tabs.sendMessage is set in chrome, but not in firefox<p>I have successfully used await browser.tabs.sendMessage in chrome to get ... |
72,914,731 | How to permute dimmensions in tensorflow?<p>I am able to permute the dimmension of the tensor: I'm able to do this in pytorch! But not in tensorflow!</p>
<pre><code>A = torch.rand(1, 2,5)
A = A.permute(0,2,1)
A.shape
</code></pre>
<blockquote>
<p>torch.Size([1, 5, 2])</p>
</blockquote>
<p>Tensorflow (just a try,I don'... | <p>Use <code>tf.transpose</code>:</p>
<pre><code>import tensorflow as tf
A = tf.random.normal((1, 2, 5))
A_t = tf.transpose(A, perm=[0, 2, 1])
print(A.shape, A_t.shape)
# (1, 2, 5) (1, 5, 2)
</code></pre> | How to permute dimmensions in tensorflow? | python|tensorflow|tensor | 1 | 60 | 1 | 72,919,919 | 72,919,919 | 1 | true | 2022-07-08T17:04:23.663Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to permute dimmensions in tensorflow?<p>I am able to permute the dimmension of the tensor: I'm able to do this in pytorch! But not in tensorflow!</p>
<pr... |
72,918,914 | Show Average Per Month<p>I have the following dataset:</p>
<p><img src="https://i.stack.imgur.com/dSIoz.png" alt="Datset example" /></p>
<p>I am trying to create a graph using matplotlib that shows the average number of task by Month & Year.</p>
<p>I was able to complete the calculations for average and was convert... | <p>The data you have provided is very small (3 rows with same date). So, I couldn't create a month-wise plot. So, this is the data I used.</p>
<pre><code>>> df
Date Task Count
0 2022-06-25 04:00:00 700
1 2022-06-25 05:00:00 1100
2 2022-06-25 06:00:00 800
3 2022-06-25 07:00:00 1200
4 2022-06-25 08... | Show Average Per Month | python|matplotlib | 1 | 60 | 1 | 72,920,360 | 72,920,360 | 1 | true | 2022-07-09T04:19:11.747Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Show Average Per Month<p>I have the following dataset:</p>
<p><img src="https://i.stack.imgur.com/dSIoz.png" alt="Datset example" /></p>
<p>I am trying to cr... |
72,922,952 | Add modifier to all instances of view<p>I want to use my theme color on all instances of <code>Toggle()</code>, is there a way to do this with an extension?</p>
<pre><code>extension Toggle {
func content() -> some View {
self.tint(.red)
}
}
</code></pre>
<p>The above is not working, is there somethin... | <p>This is exactly what <a href="https://developer.apple.com/documentation/swiftui/togglestyle" rel="nofollow noreferrer"><code>.toggleStyle</code></a> is designed for. Create your own custom ToggleStyle:</p>
<pre><code>struct MyToggleStyle: ToggleStyle {
func makeBody(configuration: Configuration) -> some View ... | Add modifier to all instances of view | ios|swift|swiftui | 1 | 60 | 3 | 72,924,084 | 72,924,084 | 1 | true | 2022-07-09T16:16:10.190Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Add modifier to all instances of view<p>I want to use my theme color on all instances of <code>Toggle()</code>, is there a way to do this with an extension?<... |
72,917,837 | A few minor problems with my tkinter sand simulation<p>I have made a sand simulation in tkinter. Only tkinter. No pygame, no matplotlib, none of that. It works great, it looks great, but nothing in life is perfect.</p>
<p><a href="https://i.stack.imgur.com/Ux7wL.png" rel="nofollow noreferrer"><img src="https://i.stack.... | <p>Problem #1 is caused by the fact that your rendering function doesn't create a new rectangle if both the old and new block types are sand. As the sand falls in a column, the first bit of sand causes rectangles to be created with its color, and because another bit of sand always falls in its place on the next frame, ... | A few minor problems with my tkinter sand simulation | python|tkinter|game-physics | 1 | 60 | 1 | 72,925,411 | 72,925,411 | 1 | true | 2022-07-08T23:20:46.087Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
A few minor problems with my tkinter sand simulation<p>I have made a sand simulation in tkinter. Only tkinter. No pygame, no matplotlib, none of that. It wor... |
72,925,889 | Cost of cheapest Azure B2C offering?<p>I understand that Azure B2C is free for up to 50,000 users. But as soon as I want to add in ROLES, I have to take out a subscription. These subscriptions are prohibitively expensive (P1 and P2). Am I right in my assumption that AZURE is really only for big business. Not having rol... | <p>What do you mean by roles?</p>
<p>B2C does not handle roles but AAD does.</p>
<p>As per <a href="https://www.microsoft.com/en-nz/security/business/identity-access/azure-active-directory-pricing" rel="nofollow noreferrer">this</a>, role-based access control is covered by the free level.</p>
<p>B2C is free for the fir... | Cost of cheapest Azure B2C offering? | azure|azure-ad-b2c | 0 | 60 | 1 | 72,926,399 | 72,926,399 | 1 | true | 2022-07-10T03:02:58.710Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Cost of cheapest Azure B2C offering?<p>I understand that Azure B2C is free for up to 50,000 users. But as soon as I want to add in ROLES, I have to take out ... |
72,908,632 | Remove CSS on successful submission of a form using Reactive Form Angular<p>I am trying to remove below CSS from elements on successful submission of a form. I am currently using Reactive Form in Angular and I have used the below CSS to show <strong>red left border along with bold Font</strong> if value is invalid</p>
... | <p>So, after playing with the $event, I finally found the solution. Below is what I used:</p>
<pre><code>@ViewChild('data') data: ElementRef;
divElement: HTMLElement;
</code></pre>
<p>then on the submit event:</p>
<pre><code>async onSubmit(formGroup, target) {
this.divElement = this.data.nativeElement;
this.div... | Remove CSS on successful submission of a form using Reactive Form Angular | html|css|angular|typescript | 0 | 60 | 1 | 72,926,769 | 72,926,769 | 1 | true | 2022-07-08T08:23:25.813Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Remove CSS on successful submission of a form using Reactive Form Angular<p>I am trying to remove below CSS from elements on successful submission of a form.... |
72,926,533 | Check whether string contains other than specific word<p>I need to check whether a string contains other than the specified words/sentence (javascript), it will return true if:</p>
<ul>
<li>it contains an alphabets, except this phrase: <code>ANOTHER CMD</code></li>
<li>it contains other than specified multiple sequence... | <p>Yes you can replace all not in the array</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>const arr = ["ANOTHER CMD","8809 8805", "8809 8805"]
const okContent = str => {
... | Check whether string contains other than specific word | javascript | 0 | 60 | 3 | 72,928,558 | 72,928,558 | 1 | true | 2022-07-10T06:24:23.177Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Check whether string contains other than specific word<p>I need to check whether a string contains other than the specified words/sentence (javascript), it w... |
72,930,128 | Gettting the errror of my application can be served in heroku for django app<p>I am getting an error while deploying app on heroku</p>
<pre><code>Application error
An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from ... | <p>Your traceback is telling you that the 'DATABASE_NAME' environment variable has not been set, you can set that within your Heroku configuration.</p>
<p><a href="https://devcenter.heroku.com/articles/config-vars" rel="nofollow noreferrer">https://devcenter.heroku.com/articles/config-vars</a></p>
<p>Another point is t... | Gettting the errror of my application can be served in heroku for django app | django|heroku | 0 | 60 | 1 | 72,930,437 | 72,930,437 | 1 | true | 2022-07-10T16:32:33.073Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Gettting the errror of my application can be served in heroku for django app<p>I am getting an error while deploying app on heroku</p>
<pre><code>Application... |
72,930,239 | How to skip loginScreen and passwordScreen after launch the app<p><strong>Hello i would like to know How to skip the loginScreen and the passwordScreen and move to homeScreen after launching the app because i have Stored the username and password in Datastore, So how can i do that?</strong></p>
<p><strong>Here is my co... | <p>In your <code>fun Nav()</code> you should check if you have credentials stored and then based on that you should set <code>startDestination</code></p>
<p>for example:</p>
<pre><code>@Composable
fun Nav() {
val context = LocalContext.current
val navController = rememberNavController()
val isLoginRequired = /... | How to skip loginScreen and passwordScreen after launch the app | android|kotlin|android-jetpack-compose|android-jetpack|jetpack-compose-navigation | 1 | 60 | 1 | 72,930,469 | 72,930,469 | 1 | true | 2022-07-10T16:47:49.320Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to skip loginScreen and passwordScreen after launch the app<p><strong>Hello i would like to know How to skip the loginScreen and the passwordScreen and m... |
72,951,427 | Save merge conflict resolutions before git merge --abort<p>I am in the midst of a big merge request and already resolved a bunch of conflicts, when I realised that I want to run the merge command again with <code>-Xignore-all-space</code>. If I run <code>git merge --abort</code> I would also have to resolve all the con... | <p>I'm assuming you don't have rerere's auto mode turned on.</p>
<pre><code>git worktree add scratch @
git -C scratch merge otherbranch
git -C scratch rerere
git worktree remove -f scratch
</code></pre>
<p>these will rerun your current merge to get an index showing the un-resolved conflicts and run <code>git rerere<... | Save merge conflict resolutions before git merge --abort | git|version-control|git-merge|merge-conflict-resolution|git-merge-conflict | 0 | 60 | 1 | 72,951,682 | 72,951,682 | 1 | true | 2022-07-12T11:15:31.627Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Save merge conflict resolutions before git merge --abort<p>I am in the midst of a big merge request and already resolved a bunch of conflicts, when I realise... |
72,908,137 | WPF TreeView Hide certain Items<p>I'm trying to hide some elements being displayed in the TreeView by using the Enabled property from my ViewModel. I'm setting the Visibility to Collapsed using Data Trigger, but the problem is even though the items aren't visible it just leaves those lines empty.</p>
<p>My XAML:</p>
<p... | <blockquote>
<p>Previously when I was hiding it from the XAML the tree header didn't collapse everytime the item is disabled. But with this approach the whole tree is closed everytime I update. Is there any solution to this ?</p>
</blockquote>
<p>The solution is to add and remove items from the existing <code>Observabl... | WPF TreeView Hide certain Items | c#|wpf|data-binding | 0 | 60 | 1 | 72,953,190 | 72,953,190 | 1 | true | 2022-07-08T07:32:49.847Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
WPF TreeView Hide certain Items<p>I'm trying to hide some elements being displayed in the TreeView by using the Enabled property from my ViewModel. I'm setti... |
72,953,887 | save all word permutations that are in a sentence in to a list<p>I want to save all word <em>permutations</em> that are in a sentence in to a list.</p>
<p>I want to use this for autocomplete.</p>
<p>For example:
<code>s = "Stackoverflow is a platform"</code></p>
<p>When I split by a whitespace. I get ['Stacko... | <pre><code>s = "Stackoverflow is a platform"
L = s.split(' ')
K = [' '.join(L[0:i]) for i in range(1,len(L)+1)]
print(K)
</code></pre> | save all word permutations that are in a sentence in to a list | python|python-3.x | -7 | 60 | 3 | 72,953,993 | 72,953,993 | 1 | true | 2022-07-12T14:21:21.047Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
save all word permutations that are in a sentence in to a list<p>I want to save all word <em>permutations</em> that are in a sentence in to a list.</p>
<p>I ... |
72,957,160 | Cannot connect to firestore firebase in Python<p>I created a firebaseconfig.json file with my apikey, authodomain, databaseurl, projected, storagebucket, messagingsenderid, appid and measurementid. this comes standard in the SDK setup and configuration section of the yourapps section in project setting. but when I try ... | <p>The Firebase Admin SDK <a href="https://firebase.google.com/docs/admin/setup/#initialize-sdk" rel="nofollow noreferrer">requires a service account</a> for authentication, as opposed to a configuration file with the project keys (which is primarily used for web/iOS/Android clients).</p>
<p>If you have not used a serv... | Cannot connect to firestore firebase in Python | python|firebase|google-cloud-firestore | 2 | 60 | 1 | 72,970,374 | 72,970,374 | 1 | true | 2022-07-12T18:57:35.400Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Cannot connect to firestore firebase in Python<p>I created a firebaseconfig.json file with my apikey, authodomain, databaseurl, projected, storagebucket, mes... |
72,973,683 | x86, amd64: Why SIGTRAP' ucontext instruction pointer does not point to related int3<p>As the title says - <code>rip</code> from <code>ucontext_t</code> does not point to the <code>int3</code> that raised a <code>SIGTRAP</code>. Instead it points to the next instruction.</p>
<p>This deviates from my (naive) expectation... | <blockquote>
<p>Why is instruction pointer adjusted in SIGTRAP context to not retry related int3?</p>
</blockquote>
<p>It's not adjusted by the kernel; the exception-return address pushed by hardware is the one after an <code>int</code> instruction, including <code>int3</code>.</p>
<p>Keep in mind that <code>int3</code... | x86, amd64: Why SIGTRAP' ucontext instruction pointer does not point to related int3 | c|linux|x86|signals|x86-64 | 2 | 60 | 1 | 72,974,107 | 72,974,107 | 1 | true | 2022-07-13T23:30:25.247Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
x86, amd64: Why SIGTRAP' ucontext instruction pointer does not point to related int3<p>As the title says - <code>rip</code> from <code>ucontext_t</code> does... |
72,985,032 | Using vlookup while using web external data<p>Good afternoon,</p>
<p>I am pulling a fuel database from gasbuddy and trying to use the <code>VLOOKUP</code> function to grab address, prices and times last updated. However, all I am getting are #N/A (value not available) results. My code is below:</p>
<pre><code>=VLOOKUP(... | <p>There are several ways to achieve this. However, based on your data structure, a regular <code>VLOOKUP</code> won't work because <code>VLOOKUP</code> only searches to the right of the lookup value (i.e., the address) and, for example, the price is to the left of it. Thus, one possibility would be to restructure your... | Using vlookup while using web external data | excel|database|vlookup | 0 | 60 | 1 | 72,985,991 | 72,985,991 | 1 | true | 2022-07-14T18:16:51.627Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using vlookup while using web external data<p>Good afternoon,</p>
<p>I am pulling a fuel database from gasbuddy and trying to use the <code>VLOOKUP</code> fu... |
72,986,818 | R: sum across matrix elements in a vector that are of different dimensions<p>I have a list containing many matrices that correspond to repeated draws from a count distribution (columns represent the original count data, rows represent the simulated count data, and cell values are counts of observations from one simulat... | <p>Here is a way.</p>
<p>The main idea is to change <code>res</code>'s data structure from list to 3d array. The first two dimensions are <code>carb2</code> and <code>carb</code>, respectively, and the third dimension is the number of simulations. There's no way to guess the upper limit for <code>rpois</code> beforehan... | R: sum across matrix elements in a vector that are of different dimensions | r|matrix|data-wrangling | 1 | 60 | 1 | 72,987,246 | 72,987,246 | 1 | true | 2022-07-14T21:25:49.530Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
R: sum across matrix elements in a vector that are of different dimensions<p>I have a list containing many matrices that correspond to repeated draws from a ... |
72,983,665 | Map data with fields value<p>Ive a data set in below format and trying below big query</p>
<p><a href="https://i.stack.imgur.com/8Z45F.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8Z45F.png" alt="enter image description here" /></a></p>
<p>Some additional content, Key & value are array format.... | <p>With the data you shared you could use a <a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/conditional_expressions#case_expr" rel="nofollow noreferrer"><code>CASE</code> expression</a>. The Query below should work fine for you:</p>
<pre><code>SELECT
id,
key,
CASE key
WHEN 'abc' THEN 'FALSE... | Map data with fields value | sql|google-bigquery | 1 | 60 | 1 | 72,987,345 | 72,987,345 | 1 | true | 2022-07-14T16:15:45.893Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Map data with fields value<p>Ive a data set in below format and trying below big query</p>
<p><a href="https://i.stack.imgur.com/8Z45F.png" rel="nofollow nor... |
72,990,198 | how to detect change in useState except for first rendering?<p>If I change text of TextInput then I change useState named <code>name</code> and <code>setName</code>.</p>
<pre><code>const [name, setName] = useState("")
<TextInput
defaultValue={meData?.me?.name}
onChangeText={(text) => setNameV... | <p>Another way to achieve this would be using the <code>TextInput</code> as a controlled component.</p>
<ol>
<li>First, create a state with a default value.</li>
<li>Look for changes in that state variable, if it changes from what it was originally, then enable the submit button.</li>
</ol>
<p>Snack Implementation for ... | how to detect change in useState except for first rendering? | react-native|hook|use-effect|use-state | 1 | 60 | 1 | 72,990,517 | 72,990,517 | 1 | true | 2022-07-15T07:06:18.723Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to detect change in useState except for first rendering?<p>If I change text of TextInput then I change useState named <code>name</code> and <code>setName... |
72,992,554 | Matplotlib stacked bar chart set column order<p>I am plotting a stacked bar chart for a few fixed quantities using the usual:</p>
<pre><code>bar = df.plot.barh(x='Intervention', y={'Remuneration','Training','Supervision'}, stacked=True )
</code></pre>
<p>I however noticed that depending on the input dataset, matplotlib... | <p>to set a custom order for the stacked bars, you will need to order it by setting the <code>CategoricalIndex</code> and sorting the data by these categories. This will sort the three categories in the way you need. A small example to show the same is below...</p>
<p><strong>Data 'df'</strong></p>
<pre><code>Intervent... | Matplotlib stacked bar chart set column order | python|matplotlib|stacked-chart | 0 | 60 | 1 | 72,995,225 | 72,995,225 | 1 | true | 2022-07-15T10:24:58.793Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Matplotlib stacked bar chart set column order<p>I am plotting a stacked bar chart for a few fixed quantities using the usual:</p>
<pre><code>bar = df.plot.ba... |
72,989,327 | Why is the " UndefVarError: undef not defined " error happened?<p>It is used in the code:
<code>tt=Array{Int64}(undef,0)</code>
but the following error is shown:
<code>UndefVarError: undef not defined</code>
would you please say why it happened? and is there any alternative for the code?</p> | <p>If you want an empty vector just write (should work in very old and new Julia):</p>
<pre><code>tt = Int64[]
</code></pre>
<p>or even <code>tt = Int[]</code> if you are on a system with 64 bit ints (which is almost always true)</p> | Why is the " UndefVarError: undef not defined " error happened? | julia|julia-jump | 0 | 60 | 2 | 72,997,460 | 72,997,460 | 1 | true | 2022-07-15T05:17:46.463Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why is the " UndefVarError: undef not defined " error happened?<p>It is used in the code:
<code>tt=Array{Int64}(undef,0)</code>
but the following error is sh... |
72,991,471 | Advantages vs disadvantages of vm.overcommit_memory=1 vs vm.overcommit_memory=0<p>On Linux, if <code>vm.overcommit_memory=1</code>, you can allocate huge memory blocks, but if you use less, these will not affect memory usage.</p>
<p>Lets suppose following code:</p>
<pre><code>const size_t size = 128;
void p = malloc(si... | <blockquote>
<p>is second approach really takes 4 KB?</p>
</blockquote>
<p>In both cases it takes physical memory as much as accessed by <code>process()</code>, with one page granularity. Difference is process address space allocation.</p>
<blockquote>
<p>is second approach slower?</p>
</blockquote>
<p>It may be slower... | Advantages vs disadvantages of vm.overcommit_memory=1 vs vm.overcommit_memory=0 | linux|memory|memory-overcommitment | 0 | 60 | 1 | 72,997,687 | 72,997,687 | 1 | true | 2022-07-15T08:54:22.593Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Advantages vs disadvantages of vm.overcommit_memory=1 vs vm.overcommit_memory=0<p>On Linux, if <code>vm.overcommit_memory=1</code>, you can allocate huge mem... |
72,984,788 | Bash echo is changing two spaces into tabulator if string contains this *,*<p>I have a bash script that takes data from an Oracle database and prints them. (my script is bit more complicated then that but I cut the parts that are not important is this case).</p>
<p>So in Oracle DB I have a table</p>
<pre><code>CREATE T... | <p>The tabs were being inserted by the <code>sqlplus</code> command, and the solution was to add <code>SET TAB OFF</code> to the SQL commands. I found this in the <a href="https://docs.oracle.com/cd/B10501_01/server.920/a90842/ch13.htm" rel="nofollow noreferrer">Oracle SQL*Plus documentation</a>:</p>
<blockquote>
<p><s... | Bash echo is changing two spaces into tabulator if string contains this *,* | bash|oracle|plsql|echo | -1 | 60 | 1 | 72,999,317 | 72,999,317 | 1 | true | 2022-07-14T17:55:13.130Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Bash echo is changing two spaces into tabulator if string contains this *,*<p>I have a bash script that takes data from an Oracle database and prints them. (... |
73,009,427 | What does Subscription add function do with Promise's resolve call-back<p>I can see in GitHub project <code>angular-10-signup-verification-boilerplate</code> the following snippet:</p>
<pre><code>export function appInitializer(accountService: AccountService) {
return () => new Promise(resolve => {
// ... | <p>The <code>add</code> method of the <a href="https://rxjs.dev/api/index/class/Subscription#add" rel="nofollow noreferrer">subscription</a> returned from <code>subscribe</code> will run when the subscription completes (and is subsequently unsubscribed)</p>
<p>In your example the <code>resolve</code> will be called whe... | What does Subscription add function do with Promise's resolve call-back | angular|typescript|rxjs | 1 | 60 | 1 | 73,009,988 | 73,009,988 | 1 | true | 2022-07-17T05:20:02.320Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What does Subscription add function do with Promise's resolve call-back<p>I can see in GitHub project <code>angular-10-signup-verification-boilerplate</code>... |
72,994,607 | How to store properly a BigDecimal in Ruby on Rails<p>i have this big problem, i have a input where i format my amounts like this.</p>
<p>15,550.55, the problem is that once i submit that value it store it as 15.50 because of the BigDecimal Object, it is not taking the whole number.</p>
<p>In my Parameters Im recieving... | <p>There are a few ways to do this. First, if you want it coded to show in terminal correctly, this should work:</p>
<pre><code>'15550.55'.reverse.scan(/.{1,3}/).join(',').reverse
</code></pre>
<p>If you're displaying it on a webpage, this is the best:</p>
<pre><code><%= number_with_delimiter(@number, :delimiter =&g... | How to store properly a BigDecimal in Ruby on Rails | ruby-on-rails|ruby|postgresql|bigdecimal | 2 | 60 | 1 | 73,013,273 | 73,013,273 | 1 | true | 2022-07-15T13:16:23.843Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to store properly a BigDecimal in Ruby on Rails<p>i have this big problem, i have a input where i format my amounts like this.</p>
<p>15,550.55, the prob... |
73,017,804 | How To Change The PointBackgroundColor Dynamically In ChartJS?<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code><!DOCTYPE html>
<html>
<head>
<meta char... | <p>It should be an array if you want different colors for different points in the line.</p>
<pre><code>pointBackgroundColor:["#88c0d0ff"]
</code></pre>
<p>when you add a new dot then push the desired color in the above array.</p>
<pre><code>my_chart.data.datasets.forEach((dataset) => {
dataset.... | How To Change The PointBackgroundColor Dynamically In ChartJS? | javascript|html|charts|chart.js|linechart | 0 | 60 | 1 | 73,018,958 | 73,018,958 | 1 | true | 2022-07-18T05:50:05.980Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How To Change The PointBackgroundColor Dynamically In ChartJS?<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"... |
73,022,476 | Check the occurence of a group of items in a dictionary<p>This is an example of data I work with it :</p>
<pre><code>dictionary_of_elements = {'key1': ["a", "a", "a", "b", "b", "c", "a"],
'key2' : ["d", "d&quo... | <p>So you want to validate that the values are correct?</p>
<p>You can use <a href="https://docs.python.org/3/library/itertools.html#itertools.groupby" rel="nofollow noreferrer"><code>itertools.groupby</code></a> to aggregate the consecutive keys, and check if there are any duplicated keys:</p>
<pre><code>from itertool... | Check the occurence of a group of items in a dictionary | python|list|algorithm|dictionary | -2 | 60 | 1 | 73,022,643 | 73,022,643 | 1 | true | 2022-07-18T12:42:45.543Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Check the occurence of a group of items in a dictionary<p>This is an example of data I work with it :</p>
<pre><code>dictionary_of_elements = {'key1': ["... |
73,023,151 | Find a threshold value for confusion matrix in R<p>I was doing a logistic regression and made a table that represents the predicted probability ,actual class, and predicted class.
If the predicted probability is more than 0.5, I classified it as <code>1</code>,so the predicted class becomes <code>1</code>. But I want t... | <p>You can check a range of values pretty easily:</p>
<pre><code>probs <- seq(0, 1, by=.05)
names(probs) <- probs
results <- sapply(probs, function(x) df$actual_class == as.integer(df$predicted_probability > x))
</code></pre>
<p><code>results</code> is a 10 row by 21 column logical matrix showing when the p... | Find a threshold value for confusion matrix in R | r|optimization|confusion-matrix|threshold | 1 | 60 | 1 | 73,030,861 | 73,030,861 | 1 | true | 2022-07-18T13:31:26.597Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Find a threshold value for confusion matrix in R<p>I was doing a logistic regression and made a table that represents the predicted probability ,actual class... |
73,022,056 | Removing leading and trailing quotation marks in Google Sheets / Apps script<p>I am writing a script to populate a cell with some information for a mailer. I'm fairly new to this, so am guessing the coding isn't perfect. However, all I really need to achieve is to get a block of text - and it's pretty much there.</p>
... | <p>In this case after researching for a while it seems that whenever Sheets detects that there are special characters or line breaks you will get the quotation marks added when the text is copied, there is a similar <a href="https://stackoverflow.com/questions/59886559/why-does-copying-multi-row-text-from-google-sheets... | Removing leading and trailing quotation marks in Google Sheets / Apps script | javascript|google-apps-script | -1 | 60 | 1 | 73,043,195 | 73,043,195 | 1 | true | 2022-07-18T12:05:50.723Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Removing leading and trailing quotation marks in Google Sheets / Apps script<p>I am writing a script to populate a cell with some information for a mailer. I... |
72,945,563 | Water is on transparent parts of flow map three.js<p>I am trying to create a river using <code>three.js</code>, by following <a href="https://www.youtube.com/watch?v=FT1O2G55yS8" rel="nofollow noreferrer">this</a> tutorial.</p>
<p>Here is my displacement/height map:</p>
<p><a href="https://i.stack.imgur.com/WPaYS.jpg" ... | <p>I didn't set up my plane properly. I need to change this:</p>
<pre class="lang-js prettyprint-override"><code>var planeGeometry = new THREE.PlaneBufferGeometry(5000, 5000);
</code></pre>
<p>to:</p>
<pre class="lang-js prettyprint-override"><code>var planeGeometry = new THREE.PlaneBufferGeometry(5000, 5000, 512, 512)... | Water is on transparent parts of flow map three.js | three.js | 0 | 60 | 1 | 73,046,325 | 73,046,325 | 1 | true | 2022-07-11T23:22:40.713Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Water is on transparent parts of flow map three.js<p>I am trying to create a river using <code>three.js</code>, by following <a href="https://www.youtube.com... |
72,867,045 | MiniO docker container does not show files from local folder<p>I am trying to create a default bucket in MiniO docker container with my local files uploaded as a default content.</p>
<p>I have written a simple docker-compose file to run Minio client:</p>
<pre><code>version: "2.0"
services:
minio:
image:... | <p>I would like to update my situation.</p>
<p>My issue is mainly caused by the new feature from minio that applies versioning with metadata, as explained in <a href="https://blog.min.io/minio-versioning-metadata-deep-dive/" rel="nofollow noreferrer">their blog post</a>. As it turns out, developers who used the older v... | MiniO docker container does not show files from local folder | docker|minio | 2 | 60 | 2 | 73,047,454 | 73,047,454 | 1 | true | 2022-07-05T09:28:47.743Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
MiniO docker container does not show files from local folder<p>I am trying to create a default bucket in MiniO docker container with my local files uploaded ... |
73,004,883 | LLVM IR: Get AllocaInst from CreateLoad<p>I'm using the LLVM IR C++ API to generate IR for my compiler. My question boils down to:</p>
<blockquote>
<p>From a <code>CreateLoad</code> instruction, can I get the <code>AllocaInst*</code> it was loaded from so I can store the result of arithmetic instructions in that <code>... | <blockquote>
<p>From a CreateLoad instruction, can I get the AllocaInst* it was loaded from so I can store the result of arithmetic instructions in that AllocaInst* without needing to retrieve it from a namedValues table?</p>
</blockquote>
<p><code>IRBuilder::CreateLoad()</code> always returns a <code>LoadInst *</code>... | LLVM IR: Get AllocaInst from CreateLoad | c++|compiler-construction|llvm|llvm-ir | 0 | 60 | 1 | 73,056,432 | 73,056,432 | 1 | true | 2022-07-16T14:10:34.873Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
LLVM IR: Get AllocaInst from CreateLoad<p>I'm using the LLVM IR C++ API to generate IR for my compiler. My question boils down to:</p>
<blockquote>
<p>From a... |
72,938,099 | python Google Analytics setUserId<p>When triggering server events to Google Analytics, I can set the user ID in various programming languages as described in the official docs: <a href="https://developers.google.com/analytics/devguides/collection/ga4/user-id?platform=apps#swift" rel="nofollow noreferrer">https://develo... | <p>Google only shows how to set the user id for their SDKs/frameworks. Python is not something they have a supported framework for in this case. You should refer to the manual of the library you're using for it.</p>
<p>If you're not using a library for sending events, but rather building the requests from scratch, you ... | python Google Analytics setUserId | python|google-analytics|userid | 1 | 60 | 2 | 73,113,989 | 73,113,989 | 1 | true | 2022-07-11T11:47:33.533Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
python Google Analytics setUserId<p>When triggering server events to Google Analytics, I can set the user ID in various programming languages as described in... |
72,830,378 | How to shift a map and remove its border in R<p>I've created a world map with this code</p>
<pre><code>graph_world <-
rnaturalearth::ne_countries(
type = "countries",
scale = "large",
returnclass = "sf") %>%
filter(admin != "Antarctica") %>%
ggplot()... | <p>The solution to the rotation is to shift the the projection using st_crs(). We can set the Prime Meridian as 10 degrees east of Greenwich with "+pm=10 " which rotates the map.</p>
<pre><code># Download map data
df_world <-
rnaturalearth::ne_countries(
type = "countries",
scale = &qu... | How to shift a map and remove its border in R | r|ggplot2|sf | 0 | 60 | 1 | 73,146,637 | 73,146,637 | 1 | true | 2022-07-01T13:55:23.430Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to shift a map and remove its border in R<p>I've created a world map with this code</p>
<pre><code>graph_world <-
rnaturalearth::ne_countries(
... |
73,029,222 | Systemverilog: referencing to a register/variable with a string and changing its value<p>I have a sample of code of what I would like to do below</p>
<pre><code>logic [3:0] c0_var, c1_var, c2_var, c3_var;
string pref = "c1"
always_ff @(posedge clk) begin
//Change the value of c1_var to 11
pref + &qu... | <p>Preprocessor can handle this case.</p>
<pre><code>logic [3:0] c0_var, c1_var, c2_var, c3_var;
`define PREF c1
`define ADD_VAR(VAR) VAR``_var
always_ff @(posedge clk) begin
//Change the value of c1_var to 11
//pref + "_var" = 4'd11;
`ADD_VAR(`PREF) = 4'd11;
end
</code></pre> | Systemverilog: referencing to a register/variable with a string and changing its value | system-verilog | -1 | 60 | 1 | 73,208,506 | 73,208,506 | 1 | true | 2022-07-18T22:22:17.597Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Systemverilog: referencing to a register/variable with a string and changing its value<p>I have a sample of code of what I would like to do below</p>
<pre><c... |
72,913,416 | Discord.js multiple reaction collector<p>How do I make this code work with multiple reactions?
I would like the embed to have multiple reactions, and based on the selected reaction, it would give a different response
Here's the code:</p>
<pre><code>module.exports = {
name: 'test',
description: "ping comman... | <p>First you need to add all the needed reactions to the message:</p>
<pre class="lang-js prettyprint-override"><code>await sentMessage.react('emoji');
await sentMessage.react('emoji_2');
await sentMessage.react('emoji_3');
// ... //
</code></pre>
<p>Now, you need to edit the <code>filter(reaction, user)</code> functio... | Discord.js multiple reaction collector | javascript|discord.js | 0 | 60 | 1 | 72,917,873 | 72,917,873 | 1 | true | 2022-07-08T15:05:54.143Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Discord.js multiple reaction collector<p>How do I make this code work with multiple reactions?
I would like the embed to have multiple reactions, and based o... |
72,875,546 | What happens to an img's src after you set it?<p>I have a function that takes 3 arguments: an image object, and the filenames of 2 images. The idea is that when the user clicks on it, it toggles the image. (This might be modified later to cycle through many images.)</p>
<p>The problem is that when you set the image's s... | <p>The value returned by <a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/src" rel="nofollow noreferrer"><code>HTMLImageElement.src</code></a> is the result of a URL normalization algorithm being applied to source URL. You can approximate this with a relative path using the following method:</... | What happens to an img's src after you set it? | javascript|html|image | 0 | 60 | 2 | 72,877,636 | 72,877,636 | 1 | true | 2022-07-05T21:07:40.047Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What happens to an img's src after you set it?<p>I have a function that takes 3 arguments: an image object, and the filenames of 2 images. The idea is that w... |
72,943,200 | Type AgGridModule does not have 'ɵmod' property<p>I am currently upgrading my application from Angular 12 to Angular 13. I am using <code>webpack 5</code>, <code>ag-grid 15.0.0</code> and <code>ag-grid-angular 15.0.0</code>. Now my compilation happens properly as far as the app is concerned . However , when the app tr... | <p>After a lot of research, I figured out that we needed to move away from <code>ag-grid : 15</code> to latest version of these products : <code>"ag-grid-angular": "^28.0.0", "ag-grid-community": "^28.0.2"</code> . Post that, I had to make appropriate changes to the application... | Type AgGridModule does not have 'ɵmod' property | angular|angular13 | 0 | 60 | 1 | 72,951,995 | 72,951,995 | 1 | true | 2022-07-11T18:40:19.343Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Type AgGridModule does not have 'ɵmod' property<p>I am currently upgrading my application from Angular 12 to Angular 13. I am using <code>webpack 5</code>, ... |
72,833,154 | Linux - Check if python script is running in "screen" and run if not<p>I am using "screen" to run a number of python scripts in AWS (linux build). One of those scripts will sometimes fail, for one reason or another. I would like to write either a) a python script or b) some kind of linux command line script... | <h1>ensure that flaky script keeps running</h1>
<p>Your proposed approach could be made to work.
But a nanny script would be <em>much</em> simpler.
Call it e.g. <code>nanny.sh</code>.</p>
<pre class="lang-bash prettyprint-override"><code>#! /usr/bin/env bash
while true
do
script.py
sleep 1 # pause, so if scri... | Linux - Check if python script is running in "screen" and run if not | python|cron | -2 | 60 | 1 | 72,835,226 | 72,835,226 | 1 | true | 2022-07-01T18:08:16.307Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Linux - Check if python script is running in "screen" and run if not<p>I am using "screen" to run a number of python scripts in AWS (linux build). ... |
72,796,149 | How to find 'Text' by using selenium?<pre><code>driver = webdriver.Chrome()
URL= 'https://modernhousevn.com/collections/new-arrival/products/giuong-ngu-mh-21'
driver.get(URL)
sleep(1)
des = wait.until(EC.visibility_of_element_located((By.XPATH, "//strong[text()='Chất liệu :']/.."))).get_attribute('innerText')... | <ol>
<li>Located <code><p></code> contain <code>'Chất liệu'</code>, back to parent</li>
<li>While tag is not <code><p></code> and parent's class is not <code>panel-body</code>, back to parent</li>
<li>Find first <code><ul></code>, find all <code><li></code> in the <code><ul></code></li>
</... | How to find 'Text' by using selenium? | python|selenium | 0 | 60 | 3 | 72,796,646 | 72,796,646 | 1 | true | 2022-06-29T05:23:47.953Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to find 'Text' by using selenium?<pre><code>driver = webdriver.Chrome()
URL= 'https://modernhousevn.com/collections/new-arrival/products/giuong-ngu-mh-21... |
72,913,893 | Kotlin Arrays add element via With/let<p>I have these code segments. I want to find the optimal solution and if it's possible some explanation why my 1st piece of code is broken. I have struggled with adding elements to the existing Array<>, without minimal external stuff. I tried with <code>+=' '.plus()</code>, ... | <p>Elements cannot be added to or removed from an array. What you <em>can</em> do is create <em>new</em> arrays, with new elements, and this is what methods like <code>toTypedArray</code> and <code>plus</code> do. You need to <em>assign</em> this newly created array back to <code>program.description.data.options</code>... | Kotlin Arrays add element via With/let | arrays|kotlin|collections|kotlin-multiplatform | 1 | 60 | 1 | 72,914,143 | 72,914,143 | 1 | true | 2022-07-08T15:43:20.713Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Kotlin Arrays add element via With/let<p>I have these code segments. I want to find the optimal solution and if it's possible some explanation why my 1st pie... |
72,939,507 | Replace matching column values in multiple dataframes with NA in R<p>I have a dataframe which is like the followng:</p>
<pre><code>dat <- data.frame(participant = c(rep("01", times = 3), rep("02", times = 3)),
target = rep(c("1", "2", "3"), times = ... | <p>As you have the data frames in this format, you can set the values of the required data to <code>NA</code> in the new data frames, and then update the rows of the original data frames with these values using <code>dplyr::rows_update()</code>. This assumes you have at least <code>dplyr</code> v1.0.0.</p>
<pre class="... | Replace matching column values in multiple dataframes with NA in R | r|dataframe|na|data-wrangling | 1 | 60 | 3 | 72,939,688 | 72,939,688 | 1 | true | 2022-07-11T13:40:06.237Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Replace matching column values in multiple dataframes with NA in R<p>I have a dataframe which is like the followng:</p>
<pre><code>dat <- data.frame(parti... |
72,911,315 | How to order a grid vertically in Bootstrap<p>I have a simple grid layout in Bootstrap 5 like this:</p>
<pre><code><div class="row row-cols-1 row-cols-sm-2 row-cols-lg-3">
<div class="col border">Field1</div>
<div class="col border">Field2</div>
&l... | <p>You can add custom class on the parent element and with the additional CSS property <code>column-count</code> and two breakpoints to reduce the <code>column-count</code>. Also remove the <strong>row</strong> class from the parent element.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="tru... | How to order a grid vertically in Bootstrap | html|bootstrap-5 | 1 | 60 | 1 | 72,916,865 | 72,916,865 | 1 | true | 2022-07-08T12:19:02.877Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to order a grid vertically in Bootstrap<p>I have a simple grid layout in Bootstrap 5 like this:</p>
<pre><code><div class="row row-cols-1 row-col... |
72,836,883 | How to get text label in input type radio?<p>I made a custom radio input like this.
When selected, How do I get the value of the text label in the radio type input and bring it into the Syntax hyperlinks "Order Link"?</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel=... | <p>Yes, You can get the label of the radio by getting its <code>for</code> attribute which equals the id of the radio.</p>
<p>Also, I add a function to generate random numbers with specific length to generate the phone number.</p>
<p>I used <code>encodeURIComponent</code> to encode the <code>text</code> query parameter... | How to get text label in input type radio? | javascript|css|radio-button | 0 | 60 | 1 | 72,837,103 | 72,837,103 | 1 | true | 2022-07-02T06:12:33.613Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get text label in input type radio?<p>I made a custom radio input like this.
When selected, How do I get the value of the text label in the radio type... |
72,829,401 | Will my Admob account be banned if I export a flutter app to apk and use it on my phone<p>I initially built the application to aab and uploaded it to the play store and the application is still in the review, if I make an apk version and install it on my phone and the phones of my friends, there will be a problem knowi... | <p>This has already been answered here: <a href="https://stackoverflow.com/a/27672444/4977439">https://stackoverflow.com/a/27672444/4977439</a></p>
<p>You can distribute apps around Play Store without being banned. Your account will be disabled only when you violate the Admob <a href="https://support.google.com/admob/a... | Will my Admob account be banned if I export a flutter app to apk and use it on my phone | android|flutter|dart|google-play|admob | 0 | 60 | 1 | 72,829,541 | 72,829,541 | 1 | true | 2022-07-01T12:39:23.637Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Will my Admob account be banned if I export a flutter app to apk and use it on my phone<p>I initially built the application to aab and uploaded it to the pla... |
73,019,248 | Bicep template does not allow colon (:) in properties names<p>I am trying to use <code>resource appsettingswebsite 'Microsoft.Web/sites/config@2022-03-01'</code> to configure the values in azure for my app service. Now in azure i have values like</p>
<pre><code>FeatureFlags:featureFlag1: true
FeatureFlags:featureFlag2:... | <p>You just need to use quotes (<a href="https://github.com/Azure/bicep/pull/275" rel="nofollow noreferrer">string literals</a>):</p>
<pre class="lang-yaml prettyprint-override"><code>resource appSettings 'Microsoft.Web/sites/config@2022-03-01' = {
...
properties: {
'FeatureFlags:featureFlag1': true
'Featur... | Bicep template does not allow colon (:) in properties names | azure|azure-resource-manager|azure-bicep | 0 | 60 | 1 | 73,019,291 | 73,019,291 | 1 | true | 2022-07-18T08:17:39.350Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Bicep template does not allow colon (:) in properties names<p>I am trying to use <code>resource appsettingswebsite 'Microsoft.Web/sites/config@2022-03-01'</c... |
72,966,774 | How to write a function that runs certain SQL on certain columns in a PySpark dataframe?<p><a href="https://i.stack.imgur.com/GyL7j.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GyL7j.png" alt="enter image description here" /></a></p>
<p>I wrote some code and have this as output. The left side is b... | <p>Using a subset of your data</p>
<pre><code>data_ls = [
('maxpulse', 'select count(*) from {table} where {col} is null'),
('duration', 'select round((count(distinct {col}) / count({col})) * 100) from {table}')
]
data_sdf = spark.sparkContext.parallelize(data_ls).toDF(['column', 'query'])
# +--------+-------... | How to write a function that runs certain SQL on certain columns in a PySpark dataframe? | python|apache-spark|pyspark|apache-spark-sql | 0 | 60 | 2 | 72,970,163 | 72,970,163 | 1 | true | 2022-07-13T12:59:50.173Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to write a function that runs certain SQL on certain columns in a PySpark dataframe?<p><a href="https://i.stack.imgur.com/GyL7j.png" rel="nofollow norefe... |
72,925,872 | split arrays as string in one column of pandas to multiple columns<p>I have data frame in the below format. The description is in string format.</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>file</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td>x</td>
<td>[[array(['MIT', 'MIT', '... | <p><strong>Update,</strong> If elements in the column as string format, you can find array with <code>regex</code> formula. <em>(Note don't use eval, <a href="https://stackoverflow.com/questions/1933451/why-should-exec-and-eval-be-avoided">Why should exec() and eval() be avoided?</a>)</em></p>
<pre><code>import ast
new... | split arrays as string in one column of pandas to multiple columns | python|pandas|string|dataframe | 1 | 60 | 2 | 72,925,924 | 72,925,924 | 1 | true | 2022-07-10T02:56:49.573Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
split arrays as string in one column of pandas to multiple columns<p>I have data frame in the below format. The description is in string format.</p>
<div cla... |
72,995,434 | How to drop Primary key thats needed in a foreign key constraint in MySQL?<p>I want to drop the primary key in <strong>father</strong>. So I set the foreign key in <strong>child</strong> to delete cascade. Why this doesnt work ? Do I need to delete the <strong>foreign key</strong> first ? If so, then what the propurse ... | <blockquote>
<p>ON DELETE CASCADE constraint is used in MySQL to delete the rows from
the child table automatically, when the rows from the parent table are
deleted</p>
</blockquote>
<p>You want to remove primary key and in your case first you need to unlink the foreign key reference. So drop foreign key first.</p> | How to drop Primary key thats needed in a foreign key constraint in MySQL? | mysql|primary-key|cascade | 0 | 60 | 1 | 72,995,502 | 72,995,502 | 1 | true | 2022-07-15T14:18:53.787Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to drop Primary key thats needed in a foreign key constraint in MySQL?<p>I want to drop the primary key in <strong>father</strong>. So I set the foreign ... |
72,836,850 | libcurl is apparently crashing the application<pre><code>Config:
Windows 11 x64
Visual Studio Project: CLR Empty Project (.NET Framework)
.NET Framework: 4.6.2
libcurl: curl-7.83.1 windows build (libcurl-vc-x86-release-static-ipv6-sspi-schannel)
Project architecture: Release x86
</code></pre>
<p>Well, I'm trying to rep... | <p>As john mentioned on his comment, I fixed it up by doing it at the top of my MyForm.h file:</p>
<pre><code>[System::Runtime::InteropServices::UnmanagedFunctionPointerAttribute(System::Runtime::InteropServices::CallingConvention::Cdecl)]
delegate int DelegateProgressChanged(void* clientPointer, double totalToDownload... | libcurl is apparently crashing the application | c++|winforms|c++-cli|libcurl | -2 | 60 | 1 | 72,843,074 | 72,843,074 | 1 | true | 2022-07-02T06:06:13.407Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
libcurl is apparently crashing the application<pre><code>Config:
Windows 11 x64
Visual Studio Project: CLR Empty Project (.NET Framework)
.NET Framework: 4.6... |
72,920,098 | Get Distinct Rows By Two Columns With Ordering Desc<p>I have ms sql table like following.</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th style="text-align: left;">ID</th>
<th style="text-align: center;">Num1</th>
<th style="text-align: right;">Num2</th>
<th style="text-align: right;">Range... | <p>Provided you're using SQLServer 2017+ you can use <em>string_agg</em> via an <em>apply</em> to create the condensed groupings required (this would easily support more than 2 columns if required) and a <em>row_number</em> solution for ordering by range:</p>
<pre><code>with g as (
select *, Row_Number() over(partiti... | Get Distinct Rows By Two Columns With Ordering Desc | sql|sql-server|tsql|sql-server-2014 | 0 | 60 | 2 | 72,920,241 | 72,920,241 | 1 | true | 2022-07-09T08:52:39.603Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get Distinct Rows By Two Columns With Ordering Desc<p>I have ms sql table like following.</p>
<div class="s-table-container">
<table class="s-table">
<thead>... |
72,790,228 | Find the intersection of List<class> and List<int> in linq?<p>I have list of Class named article, and list of int. I like to do the following step in LINQ</p>
<p>my class is</p>
<pre><code>public class Article
{
public string Content { get; set;}
public int CategoryID {get; set;}
}
</code></pre>
<p>my list of ... | <p>You can try <em>filtering</em>, i.e. all <code>articles</code> from initial collection <code>Where</code> <code>filteredCategoriesID</code> <code>Contains</code> article's <code>CategoryId</code>:</p>
<pre><code>var newArticleList = articles
.Where(article => filteredCategoriesID.Contains(article.CategoryId))
... | Find the intersection of List<class> and List<int> in linq? | c#|linq|intersection | 1 | 60 | 3 | 72,790,258 | 72,790,258 | 1 | true | 2022-06-28T16:36:20.817Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Find the intersection of List<class> and List<int> in linq?<p>I have list of Class named article, and list of int. I like to do the following step in LINQ</p... |
72,831,317 | How to change the color of ElevatedButton when entering text in TextField<p>I have TextFild and ElevatedButton, by default TextFild is empty and ElevatedButton has one color set, when entering some text, I would like to change the color of ElevatedButton to another. I tried to write a condition for this, where the vari... | <p>Ok From the example i have create an example for you :</p>
<p>Basically using the</p>
<pre><code>import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBann... | How to change the color of ElevatedButton when entering text in TextField | flutter|dart|button|colors|background-color | 1 | 60 | 2 | 72,832,074 | 72,832,074 | 1 | true | 2022-07-01T15:13:14.837Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to change the color of ElevatedButton when entering text in TextField<p>I have TextFild and ElevatedButton, by default TextFild is empty and ElevatedButt... |
72,880,348 | Adding active class based on current URL<p>I am trying to add 'active' class on my link. It is saying</p>
<pre><code>Uncaught TypeError: document.querySelectorAll(...).each is not a function
</code></pre>
<p>Here is my code:</p>
<pre><code>const current = window.location.href;
document.querySelectorAll("#nav-tab a... | <p>You have a few issues with your code. Your mainly confusing jQuery methods with regular native browser methods/conventions:</p>
<ol>
<li><p>You need to use <a href="https://developer.mozilla.org/en-US/docs/Web/API/NodeList/forEach" rel="nofollow noreferrer"><code>.forEach()</code></a> and not <code>.each()</code>. T... | Adding active class based on current URL | javascript|classname | 1 | 60 | 2 | 72,880,714 | 72,880,714 | 1 | true | 2022-07-06T08:40:23.510Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Adding active class based on current URL<p>I am trying to add 'active' class on my link. It is saying</p>
<pre><code>Uncaught TypeError: document.querySelect... |
72,961,245 | Rails - "Comment.count" didn't change by 1<p>This question's been solved. Check the bottom line.</p>
<p>Nowadays, I'm building my movie review website on Ruby on Rails but stuck with the Comment.count error. Already checked and tried a lot of options, but any solutions didn't work. Actually, my website works well, but ... | <p>By looking at your <code>Comment</code> model it looks like a validation error. You have the following validations on the model but on the test, you didn't specify <code>movie_id</code>.</p>
<p><code>comment.rb</code></p>
<pre><code> validates :user_id, presence: true
validates :movie_id, presence: true
</code... | Rails - "Comment.count" didn't change by 1 | ruby-on-rails | 2 | 60 | 1 | 72,962,879 | 72,962,879 | 1 | true | 2022-07-13T05:15:57.977Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Rails - "Comment.count" didn't change by 1<p>This question's been solved. Check the bottom line.</p>
<p>Nowadays, I'm building my movie review website on Rub... |
72,847,108 | SQL command not properly ended in fetch and union using<p>Why this query return 'SQL command not properly ended' error?</p>
<pre><code>select column1, length(column1) from test10 order by length(column1), column1 asc
fetch first 1 rows only
union
select column1, length(column1) from test10 order by length(column1) des... | <p>The database has problems to identify where what belongs.</p>
<p>so you can help the parser with parenthesis</p>
<blockquote>
<pre><code>CREATE tABLE test10 (column1 varchar2(10))
</code></pre>
</blockquote>
<blockquote>
<pre><code>(select column1, length(column1)
from test10
order by length(column1), column1 as... | SQL command not properly ended in fetch and union using | sql|database|oracle | 1 | 60 | 1 | 72,847,316 | 72,847,316 | 1 | true | 2022-07-03T14:01:56.823Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SQL command not properly ended in fetch and union using<p>Why this query return 'SQL command not properly ended' error?</p>
<pre><code>select column1, length... |
72,841,687 | Replace value in list of dictionary in JSON file<p>I have a JSON file containing a list of 9000 dictionaries.</p>
<p>Sample</p>
<pre><code>[{"auftrags_id":348667,"vertrags_id":11699,"ursprungsauftrag":"",
"umsatz":0.28,"brutto":0.33,"vertrauensschadenhaft... | <p>You could use <code>sed</code> as suggested in the comment under your question. It is a command for the Linux command line (shell). See an article about Linux shell <a href="https://www.linuxjournal.com/content/linux-command-line-interface-introduction-guide" rel="nofollow noreferrer">here</a> and about the <code>se... | Replace value in list of dictionary in JSON file | python|json|postgresql | 0 | 60 | 1 | 72,842,083 | 72,842,083 | 1 | true | 2022-07-02T18:54:48.587Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Replace value in list of dictionary in JSON file<p>I have a JSON file containing a list of 9000 dictionaries.</p>
<p>Sample</p>
<pre><code>[{"auftrags_i... |
72,896,252 | React Router: navigate() from one screen to another does not pass state/parameters<p>Being pretty new to React, I'm facing an issue with navigating between 2 components.</p>
<p>My app is as follows:
App.js:</p>
<pre><code> <div className="App">
<AuthProvider>
<ThemeProvider theme... | <h3><code>react-router-dom</code> v6 Route components rendered via the element prop don't receive <a href="https://v5.reactrouter.com/web/api/Route/route-props" rel="nofollow noreferrer">route props</a>.</h3>
<p>You can use hook for getting the state given you are navigating to that page by passing some state value as ... | React Router: navigate() from one screen to another does not pass state/parameters | reactjs|react-router | 0 | 60 | 2 | 72,896,365 | 72,896,365 | 1 | true | 2022-07-07T10:31:33.640Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React Router: navigate() from one screen to another does not pass state/parameters<p>Being pretty new to React, I'm facing an issue with navigating between 2... |
73,023,895 | Combine Value in Multiple Columns (With NA condition) Into New Column<p>I have data:</p>
<pre class="lang-none prettyprint-override"><code>ID merk_ac1 merk_ac2 merk_ac3
1 a NA NA
2 NA b NA
3 NA a b
4 a,b NA c
</code></pre>
<p>I tried using <code>combine_fi... | <p>You can use apply to concatenate string from multiple columns using <code>join</code>.<br />
For unique/distinct value/element you can transform list into <code>set</code> and then <code>join</code> it <strong>set will not respect sorting order</strong> if you want in sorted you can just do <code>sorted(list(set()))... | Combine Value in Multiple Columns (With NA condition) Into New Column | python|pandas | -4 | 60 | 2 | 73,024,263 | 73,024,263 | 1 | true | 2022-07-18T14:22:01.363Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Combine Value in Multiple Columns (With NA condition) Into New Column<p>I have data:</p>
<pre class="lang-none prettyprint-override"><code>ID merk_ac1 merk... |
73,030,417 | Creating another column in pandas based on a pre-existing column<p>I have a third column in my data frame where I want to be able to create a fourth column that looks almost the same, except it has no double quotes and there is a 'user/' prefix before each ID in the list. Also, sometimes it is just a single ID vs. list... | <p>Given:</p>
<pre><code> col1 col2 col3
0 1.0 1.0 "ID278, ID289"
1 2.0 2.0 "ID275"
2 2.0 1.0 NaN
</code></pre>
<p>Doing:</p>
<pre><code>df['col4'] = (df.col3.str.strip('"') # Remove " from both ends.
.str.split(', ') # S... | Creating another column in pandas based on a pre-existing column | python|pandas|dataframe|data-cleaning | 1 | 60 | 3 | 73,031,288 | 73,031,288 | 1 | true | 2022-07-19T02:16:23.680Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Creating another column in pandas based on a pre-existing column<p>I have a third column in my data frame where I want to be able to create a fourth column t... |
72,797,064 | Handle a missing SSH connection<p>In order to connect via SSH I'm using the following code:</p>
<pre><code>import paramiko
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(IP, username=USER, password=PSW,look_for_keys=False)
</code></pre>
<p>my question is, how can I hand... | <p>You could simply use a try and catch the exception as mentioned by
<a href="https://stackoverflow.com/users/850848/martin-prikryl">martin-prikryl</a>, such as:</p>
<pre><code>try:
client.connect(host="192.168.0.8",
username="user1",
password="passwor... | Handle a missing SSH connection | python|ssh|paramiko | 2 | 60 | 1 | 72,797,470 | 72,797,470 | 1 | true | 2022-06-29T07:00:49.967Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Handle a missing SSH connection<p>In order to connect via SSH I'm using the following code:</p>
<pre><code>import paramiko
ssh = paramiko.SSHClient()
ssh.set... |
72,815,128 | awk, sed, for in bash: Print "Hello" + Name<p>I have a list.csv with the following content:</p>
<pre><code>"date";"Mr. Green Tree"
"date";"Mr. Red Apple"
"date";"Mr. Blue Car"
</code></pre>
<p>I use awk + sed to get the following output:</p>
<pre><code>awk -F ... | <p>(Using your method...) Try:</p>
<pre><code>awk -F ";" '{print $2 }' list.csv | sed 's/"//g' | while read -r line || [[ -n $line ]]; do
printf "Hello %s\n" "$line"
done
</code></pre>
<p>If you know the input will be <code>\n</code> terminated:</p>
<pre><code>awk -F ";&quo... | awk, sed, for in bash: Print "Hello" + Name | bash|for-loop|awk|sed|scripting | 0 | 60 | 3 | 72,815,332 | 72,815,332 | 1 | true | 2022-06-30T11:39:10.347Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
awk, sed, for in bash: Print "Hello" + Name<p>I have a list.csv with the following content:</p>
<pre><code>"date";"Mr. Green Tree"
"... |
72,851,511 | How to segregate locust chart based on tag?<p>Currently I am using locust to test my own Java webservice APIs, I can segregate the test in the locust file by creating different definition / <code>@task</code> like the code below, even I put the tag annotation</p>
<pre><code>from locust import HttpUser, task, tag
import... | <p>There is no built-in graph that separates by task/tag. But you can use locust-plugins’s dashboard for more advanced reporting: <a href="https://github.com/SvenskaSpel/locust-plugins/blob/master/locust_plugins/dashboards/README.md" rel="nofollow noreferrer">https://github.com/SvenskaSpel/locust-plugins/blob/master/lo... | How to segregate locust chart based on tag? | python|testing|locust | 0 | 60 | 1 | 72,854,358 | 72,854,358 | 1 | true | 2022-07-04T03:35:12.583Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to segregate locust chart based on tag?<p>Currently I am using locust to test my own Java webservice APIs, I can segregate the test in the locust file by... |
72,977,601 | How to delete a field in Firestore document checking condition with Flutter?<p>I'm working with Flutter and Firebase. I have the following document:
<a href="https://i.stack.imgur.com/hfgjm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hfgjm.png" alt="enter image description here" /></a></p>
<p>I'd... | <p>I managed to find the solution:</p>
<pre class="lang-dart prettyprint-override"><code>void convalida(
String documentId,
) {
final DocumentReference<Map<String, dynamic>> mydoc=
FirebaseFirestore.instance.collection('collection').doc(documentId);
mydoc.get().then((value) =>
value... | How to delete a field in Firestore document checking condition with Flutter? | flutter|dart|google-cloud-firestore | 0 | 60 | 1 | 72,979,509 | 72,979,509 | 1 | true | 2022-07-14T08:35:40.967Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to delete a field in Firestore document checking condition with Flutter?<p>I'm working with Flutter and Firebase. I have the following document:
<a href=... |
73,010,219 | Transform string date to Date object in JS<p>My input is get via an API, and I have this array with the following date format as strings:"<em>2022-06-29T15:30:00+00:00</em>", "<em>2022-07-01T09:00:00+00:00</em>", "<em>2022-07-05T16:00:00+00:00</em>".</p>
<p>I want to transform those date i... | <p>You can consider doing it like this:</p>
<pre><code>const str = "2022-06-29T15:30:00+00:00";
const date = new Date(str);
console.log(date); // ️ Wed Jun 29 2022 22:30:00
</code></pre>
<p>As for sorting array based on dates, you can take a look at <a href="https://stackoverflow.com/questions/10123953/how-... | Transform string date to Date object in JS | javascript|datetime | 1 | 60 | 3 | 73,010,321 | 73,010,321 | 1 | true | 2022-07-17T08:17:32.527Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Transform string date to Date object in JS<p>My input is get via an API, and I have this array with the following date format as strings:"<em>2022-06-29... |
72,882,674 | VBA userform as variable in functions<p>I have the following problem: I have a userform menu, from there I can navigate to other pages, and I want to create a "back button" for each page to return to the menu.</p>
<p>I tried to create this:</p>
<pre><code>Private Sub btnback_Click()
Call back_menu(Actions)
En... | <p>Try using the <code>hide</code> method of the userform</p>
<pre class="lang-vb prettyprint-override"><code>Sub back_menu(stage as UserForm) 'Tried: stage As Object
stage.hide
Menu.Show
End Sub
</code></pre>
<pre class="lang-vb prettyprint-override"><code>Sub next_page(frmFrom as UserForm, frmTo as UserForm)... | VBA userform as variable in functions | vba|function|object|variables|userform | 0 | 60 | 1 | 72,882,906 | 72,882,906 | 1 | true | 2022-07-06T11:18:06.670Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
VBA userform as variable in functions<p>I have the following problem: I have a userform menu, from there I can navigate to other pages, and I want to create ... |
72,852,384 | Can I hide implementation details of this concept from the end user?<p>I have looked at several similar questions on SO. Maybe I am not grokking the solutions there. In those questions when the return type is <code>auto</code> or templated then separating declaration and definition in two different units causes a failu... | <p>The return type of a function is a static property, it can't change based on runtime data.</p>
<p>If you can, lift <code>UseCase</code> to a template parameter, and use <code>if constexpr</code> to have exactly one active <code>return</code> for each instantiation.</p>
<pre><code>template<UseCase a>
auto Engin... | Can I hide implementation details of this concept from the end user? | c++|c++20|c++-concepts | 0 | 60 | 1 | 72,854,033 | 72,854,033 | 1 | true | 2022-07-04T06:09:12.710Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can I hide implementation details of this concept from the end user?<p>I have looked at several similar questions on SO. Maybe I am not grokking the solution... |
72,798,576 | Longest palindromic Substring length<p>Below code gives me longest palindromic subsequence length. How can I modify the code to get longest palindromic sub<strong>string</strong> length?</p>
<pre class="lang-java prettyprint-override"><code>public static int lp(String str, int i, int j, int ans) {
if (i == str.... | <blockquote>
<p>How can I modify the code to get longest palindromic substring length</p>
</blockquote>
<p>You then need to exclude the cases where characters are skipped. When your code is about to skip a character, the search can continue, but with <code>ans</code> reset to 0.</p>
<p>So:</p>
<pre class="lang-java pre... | Longest palindromic Substring length | string|algorithm|recursion|data-structures | 1 | 60 | 1 | 72,801,510 | 72,801,510 | 1 | true | 2022-06-29T08:57:46.090Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Longest palindromic Substring length<p>Below code gives me longest palindromic subsequence length. How can I modify the code to get longest palindromic sub<s... |
72,787,122 | Swift : What is the equivalent of regions in Android Studio?<p>I'm used to code android applications, and I'm starting in Apple development. In Android studio, it's possible to surround a bloc of code within a region, like this :</p>
<pre class="lang-java prettyprint-override"><code>//region VARIABLES
int a;
float b;
/... | <p>Yeah, I believe <code>// MARK:</code> is the closest equivalent in Swift.</p>
<p>It isn't a direct equivalent, but you can also break up the methods in your classes using extensions. Example</p>
<pre><code>class MyViewController: UIViewController {
// The main body of the view controller goes here
}
extension ... | Swift : What is the equivalent of regions in Android Studio? | android|swift|xcode | 0 | 60 | 1 | 72,788,160 | 72,788,160 | 1 | true | 2022-06-28T13:15:23.220Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Swift : What is the equivalent of regions in Android Studio?<p>I'm used to code android applications, and I'm starting in Apple development. In Android studi... |
72,890,141 | Slurm job array fails to run Rscript with shapefiles<p>I would like to run a job array via Slurm on an HPC cluster, intersecting individual circle shapefiles with a large shapefile of Census blocks, then saving the resulting intersection shapefile. I will then combine these individual shapefiles into one large one on m... | <p>3 problems identified and now solved:</p>
<ol>
<li><p>Max array size refers to the entire array. The throttle just sets how many jobs get scheduled at one time. So I needed to break my 3,086 job task into 4 separate batches. This can be done in the .sh file as: <code>#SBATCH -a 1-999</code> for job 1
<code>#SBATCH -... | Slurm job array fails to run Rscript with shapefiles | r|bash|sf|slurm|sbatch | 0 | 60 | 1 | 72,903,170 | 72,903,170 | 1 | true | 2022-07-06T21:38:37.640Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Slurm job array fails to run Rscript with shapefiles<p>I would like to run a job array via Slurm on an HPC cluster, intersecting individual circle shapefiles... |
72,828,306 | chartJS - Line Chart - DataLabels Formatting Function not working<p>I have the following HTML/JS code as follows which takes two lists:</p>
<ul>
<li>labels</li>
<li>values</li>
</ul>
<p>And converts it into a line chart with labels on the points:</p>
<pre><code><div style = "position:relative; bottom:140px; z-i... | <p>The following <code>formatter</code> works fine for me.</p>
<pre><code>formatter: v => '£' + v + 'm'
</code></pre>
<p>Please take a look at your amended and runnable code below.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre cla... | chartJS - Line Chart - DataLabels Formatting Function not working | javascript|html|flask|chart.js | 1 | 60 | 1 | 72,844,268 | 72,844,268 | 1 | true | 2022-07-01T11:05:36.530Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
chartJS - Line Chart - DataLabels Formatting Function not working<p>I have the following HTML/JS code as follows which takes two lists:</p>
<ul>
<li>labels</... |
72,900,063 | how does "for" loop works python?<p>Why does it happen, that on four while-iteration "for loop" iterates only 2 times, while the array length is 3</p>
<pre><code>import time
array = [[1, 1, 3], [2, 2, 3], [3, 3, 3]]
while True:
#print (array)
time.sleep(1)
index = 0
print (array)
for prox... | <p>When the last item of any of the arrays turns 0 (which happens after a few turns), you have the item deleted.
This makes there only be 2 items instead of 3, and the for loop runs over those items, so it only iterates twice.</p>
<p>Edit::one good solution is to make a copy of the array, so that you can use one to del... | how does "for" loop works python? | python|list | -2 | 60 | 1 | 72,900,116 | 72,900,116 | 1 | true | 2022-07-07T14:57:00.607Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how does "for" loop works python?<p>Why does it happen, that on four while-iteration "for loop" iterates only 2 times, while the array length is 3<... |
72,856,978 | How do I use the *ngIf then else with relational operators?<p>What is the correct way of doing a ngIf then else when you have a count involved? Please refer to the example below for more info:</p>
<pre><code><div *ngIf={{ returnedTotalResults }} > 0 then #paging;else #no_data_found></div>
<pagination ... | <p>You need to put your ngIf as a string, some some tags around and remove the string interpolation:</p>
<pre><code> <div *ngIf=" returnedTotalResults > 0; else no_data_found">
<pagination></pagination>
</div>
<ng-template #no_data_found>
<p>No... | How do I use the *ngIf then else with relational operators? | angular|angular-ng-if | -1 | 60 | 2 | 72,857,105 | 72,857,105 | 1 | true | 2022-07-04T12:43:24.977Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I use the *ngIf then else with relational operators?<p>What is the correct way of doing a ngIf then else when you have a count involved? Please refer ... |
73,030,706 | How to install FFTW-2.1.5 on an M1 MacBook Pro?<p>I'm trying to install fftw-2.1.5 as it is required by the GADGET3 code version I need to use. I had no issues building it on my Linux machine (running Ubuntu 22.04), but on my M1 MacBook Pro (running macOS Monterey 12.4) it crashes at the configure step.</p>
<p>Running:... | <p><strong>Disclaimer:</strong> I am fairly new to macOS and I have never had to use <em>autotools</em> before.</p>
<p>I found a similar issue <a href="https://github.com/pemsley/coot/issues/33#issuecomment-1086901325" rel="nofollow noreferrer">here</a>, so credits to the people that documented it there. I am unsure if... | How to install FFTW-2.1.5 on an M1 MacBook Pro? | c|build|apple-m1|fftw | 0 | 60 | 1 | 73,031,014 | 73,031,014 | 1 | true | 2022-07-19T03:14:02.037Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to install FFTW-2.1.5 on an M1 MacBook Pro?<p>I'm trying to install fftw-2.1.5 as it is required by the GADGET3 code version I need to use. I had no issu... |
72,816,848 | Is there a more efficient method than nested loops to search through a list and then find corresponding matches in a text file?<p>I have a list of values and I need to search through an ~1 GB text file for those values and then pull a corresponding value from the text file in the same row. Is there a more efficient met... | <p>This is exactly what a dictionary is for. Assuming <code>parts[0]</code> is unique:</p>
<pre class="lang-py prettyprint-override"><code>dic = {}
with open("test.txt") as infile:
for line in infile:
parts = line.split("|")
dic[parts[0]] = parts[2]
for name in name_list:
if ... | Is there a more efficient method than nested loops to search through a list and then find corresponding matches in a text file? | python|performance|for-loop|memory|nested-loops | 0 | 60 | 3 | 72,816,981 | 72,816,981 | 1 | true | 2022-06-30T13:39:47.733Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there a more efficient method than nested loops to search through a list and then find corresponding matches in a text file?<p>I have a list of values and... |
72,922,878 | InfluxDB: Merge Time Series Columns and multiply them<p>I try to join two tables: currents and voltages
Both are measured at the same time, with just some ms of delay. When I try to merge their Columns using union, I get a lot of nulls.
<a href="https://i.stack.imgur.com/lY6rw.png" rel="nofollow noreferrer"><img src="h... | <p>You can use <a href="https://docs.influxdata.com/flux/v0.x/stdlib/universe/pivot/" rel="nofollow noreferrer">pivot</a> to do this, and remember to sort after use pivot:</p>
<pre><code>from(bucket: "data")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_me... | InfluxDB: Merge Time Series Columns and multiply them | database|influxdb|flux | 0 | 60 | 1 | 72,925,210 | 72,925,210 | 1 | true | 2022-07-09T16:06:05.493Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
InfluxDB: Merge Time Series Columns and multiply them<p>I try to join two tables: currents and voltages
Both are measured at the same time, with just some ms... |
72,783,412 | How can I open a folder with argparse<p>I want to open a folder containing x zipfiles.</p>
<p>I have this code:</p>
<pre><code>parser = argparse.ArgumentParser(description='Test')
parser.add_argument("foldername", help="Foldername of log files archive to parse")
args = parser.parse_args()
with open(... | <p>I'm not sure why you're getting a permission error, but using <code>open</code> on a directory won't do what you want. The <a href="https://docs.python.org/3/library/functions.html#open" rel="nofollow noreferrer">documentation</a> for Python's <code>open</code> requires that its input is a string to a <em>file</em>,... | How can I open a folder with argparse | python|arguments|argparse|python-zipfile | 0 | 60 | 2 | 72,783,535 | 72,783,535 | 1 | true | 2022-06-28T08:49:32.063Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I open a folder with argparse<p>I want to open a folder containing x zipfiles.</p>
<p>I have this code:</p>
<pre><code>parser = argparse.ArgumentPars... |
72,990,260 | React router dom throws invalid hook call, cannot read properties of null, etc<pre><code>import './interface/App.css';
import { Home } from './interface/home';
import { Router, Route, Routes } from 'react-router-dom';
function App() {
return (
<div>
<Router>
<div>
<R... | <h1>Issue</h1>
<p>You are using <code>react-router-dom@6</code> and using the low-level <code>Router</code> when you should import and use one of the high-level routers (<em><code>BrowserRouter</code>, <code>MemoryRouter</code>, etc</em>) and you are using the RRDv5 <code>Route</code> component APIs. The <code>Router</... | React router dom throws invalid hook call, cannot read properties of null, etc | javascript|reactjs|react-router|react-router-dom | 1 | 60 | 1 | 72,990,424 | 72,990,424 | 1 | true | 2022-07-15T07:11:20.993Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React router dom throws invalid hook call, cannot read properties of null, etc<pre><code>import './interface/App.css';
import { Home } from './interface/home... |
72,986,445 | Regex: Remove empty sections from INI (Text) files where the files could contain multiple such sections<p>I have below resultant php.ini file, after I was able to remove the comments & spaces thro' some simple Regex find/replace steps:</p>
<pre><code>[PHP]
engine = On
short_open_tag = Off
....
....
[CLI Server]
cli... | <p>An idea to <a href="https://www.regular-expressions.info/lookaround.html" rel="nofollow noreferrer">look ahead</a> after lines starting with <code>[</code> for another opening bracket (or end).</p>
<pre><code>^\[.*+\s*+(?![^\[])
</code></pre>
<p><a href="https://regex101.com/r/1BUh4C/3" rel="nofollow noreferrer">Her... | Regex: Remove empty sections from INI (Text) files where the files could contain multiple such sections | regex|regex-lookarounds|ini|find-replace|regex-replace | 2 | 60 | 3 | 72,987,013 | 72,987,013 | 1 | true | 2022-07-14T20:42:14.433Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Regex: Remove empty sections from INI (Text) files where the files could contain multiple such sections<p>I have below resultant php.ini file, after I was ab... |
73,006,809 | How to make animation of the evolution of functions (in Python)?<p>This post can be seen as a continuation of <a href="https://stackoverflow.com/questions/73005345/plot-3d-in-python">Plot 3d in Python</a></p>
<p>Given a 2d array sol=(u(t_i,x_j): 0<=i<=m,-n<=j<=n) which stands for the values of some function... | <p>Following on from the accepted answer to <a href="https://stackoverflow.com/questions/28074461/animating-growing-line-plot-in-python-matplotlib">this question</a> I linked in my comments:</p>
<p>First, let's define a <code>update</code> function that will draw every frame of our animation:</p>
<pre><code>def update(... | How to make animation of the evolution of functions (in Python)? | python|animation|plot | -1 | 60 | 1 | 73,007,903 | 73,007,903 | 1 | true | 2022-07-16T18:41:45.420Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make animation of the evolution of functions (in Python)?<p>This post can be seen as a continuation of <a href="https://stackoverflow.com/questions/73... |
72,857,493 | stuck in if statement in JavaScript?<h2>I tried this but its not working</h2>
<p>i want to be execute both the if statements <code>if (addTxt.textLength == 0)</code> And <code>if (headingTxt.textLength == 0)</code> and then,
if both the condition will true then else block to be execute but its not working
help me to ge... | <p>You can stop the function by <code>return</code> when one of your conditions meets, and you should use <code>.value.length</code> instead of <code>.textLength</code> for finding the length of input field value.</p>
<pre><code>// If user adds a note, add it to the localStorage
let addBtn = document.getElementById(&qu... | stuck in if statement in JavaScript? | javascript|html | 0 | 60 | 5 | 72,857,753 | 72,857,753 | 1 | true | 2022-07-04T13:24:45.047Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
stuck in if statement in JavaScript?<h2>I tried this but its not working</h2>
<p>i want to be execute both the if statements <code>if (addTxt.textLength == 0... |
72,395,112 | How to catch custom java8 exception from react?<p>Following code generates exception as UserAlreadyExist.</p>
<pre><code>Optional<User> userCheck = userRepository.findByUsername(createRequest.getUsername());
if(StringUtils.hasText(userCheck.get().getUsername())){
String errorMessage = "User alrea... | <p>You can return custom Response with @RestControllerAdvice for the custom exception you are throwing.
Please check the example below.</p>
<pre><code> @RestControllerAdvice
public class ControllerExceptionHandler {
@ExceptionHandler(value = {UserAlreadyExistException.class})
@ResponseStatus(value = Http... | How to catch custom java8 exception from react? | javascript|java|reactjs|java-8|axios | 0 | 60 | 1 | 72,397,720 | 72,397,720 | 1 | true | 2022-05-26T16:32:13.500Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to catch custom java8 exception from react?<p>Following code generates exception as UserAlreadyExist.</p>
<pre><code>Optional<User> userCheck = use... |
72,378,167 | Is it possible to publish a private Apps Script add-on for Google Sheets that anyone with a link can install?<p>I have been tasked with developing a Google Sheets add-on that local middle/high school teachers can use with their students. I have a working prototype, but currently we can only distribute it by having teac... | <p>In order to publish an add-on you would need to create a GCP project to publish it.</p>
<p>When doing so, you have the option to make it private if you have a Google Workspace account as presented below:</p>
<p><a href="https://i.stack.imgur.com/mKSL0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.co... | Is it possible to publish a private Apps Script add-on for Google Sheets that anyone with a link can install? | google-apps-script|google-sheets | 0 | 60 | 1 | 72,400,075 | 72,400,075 | 1 | true | 2022-05-25T13:01:38.983Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is it possible to publish a private Apps Script add-on for Google Sheets that anyone with a link can install?<p>I have been tasked with developing a Google S... |
72,401,652 | jOOQ - DefaultRecordMapper - Case sensitivity<p>Can the <code>DefaultRecordMapper</code> work case insensitive?</p>
<p>The reason for the question is that <code>Oracle</code> and <code>H2</code> have the default behavior
of captilazing identifiers if not quoted (see <a href="https://seeq.atlassian.net/wiki/spaces/KB/pa... | <p>You can't make the <code>DefaultRecordMapper</code> case insensitive, there's currently (jOOQ 3.16) no such configuration, and there aren't any plans on implementing this as it seems unnecessary, except for edge cases like yours.</p>
<p>Some takes:</p>
<h3>Fixing the underlying problem: Inconsistent naming</h3>
<ul>... | jOOQ - DefaultRecordMapper - Case sensitivity | java|sql|jooq | 1 | 60 | 1 | 72,402,313 | 72,402,313 | 1 | true | 2022-05-27T07:05:20.780Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
jOOQ - DefaultRecordMapper - Case sensitivity<p>Can the <code>DefaultRecordMapper</code> work case insensitive?</p>
<p>The reason for the question is that <c... |
72,396,352 | Django + Gunicorn + Nginx + Python -> Link to download file from webserver<p>On my webpage served by a Debian web server hosted by amazon-lightsail behind nginx and gunicorn, a user can send a request to start a Django view function. This function add some work to a background process and check every 5s if the backgrou... | <p>Not a straight answer but a possible way to go.</p>
<p>Such a long-running tasks are usually implemented with additional tool like Celery. It is a bad practice to let view/api endpoint run as long as it takes and keep requesting process waiting until completed. Good practice is to give response as fast as you can.</... | Django + Gunicorn + Nginx + Python -> Link to download file from webserver | python|django|nginx|webserver|gunicorn | 0 | 60 | 1 | 72,403,332 | 72,403,332 | 1 | true | 2022-05-26T18:19:39.353Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Django + Gunicorn + Nginx + Python -> Link to download file from webserver<p>On my webpage served by a Debian web server hosted by amazon-lightsail behind ng... |
72,363,178 | Ajax jquery(post) doesn't pass data to php<p>I am trying to pass data to my php page:</p>
<pre><code><?php
var_dump($_POST);
if (isset($_POST['goal']) && isset($_POST['amount'])){
$goal = $_POST['goal'];
$amount = $_POST['amount'];
$array = array(
"goal" => $goal,
&q... | <p><strong>Updated answer after some live testing with Network tab in firefox web dev tools</strong></p>
<p>The problem is that the current ajax code is not sending any of the elements because of wrong content-type. Let it detect content-type automatically. For jq ajax, default seems to be <code>contentType: applicatio... | Ajax jquery(post) doesn't pass data to php | php|jquery|ajax | 0 | 60 | 2 | 72,363,787 | 72,363,787 | 1 | true | 2022-05-24T12:47:58.920Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Ajax jquery(post) doesn't pass data to php<p>I am trying to pass data to my php page:</p>
<pre><code><?php
var_dump($_POST);
if (isset($_POST['goal']) &am... |
72,242,611 | Reactivity on props Vue.js<p>I am in the beginning of learning Vue, and having a hard time understanding how to define props etc. using the composition API.</p>
<p>I have a component (ACE Editor), loaded like this:</p>
<pre class="lang-js prettyprint-override"><code><v-ace-editor
v-model:value="currentRecor... | <p>You actually don't have to called .value of a ref when using it in the template.
So you can actually remove the computed part (last line of your ) and change your template to.</p>
<pre class="lang-html prettyprint-override"><code><v-ace-editor
v-model="current.text"
/>
</code></pre>
<p>Now, assum... | Reactivity on props Vue.js | javascript|vue.js|inertiajs | 0 | 60 | 1 | 72,243,447 | 72,243,447 | 1 | true | 2022-05-14T17:40:48.813Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Reactivity on props Vue.js<p>I am in the beginning of learning Vue, and having a hard time understanding how to define props etc. using the composition API.<... |
72,320,465 | How to arrange items in ascending order in list Python<p>I have the below files in a directory:</p>
<p><a href="https://i.stack.imgur.com/eDN7Z.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eDN7Z.png" alt="enter image description here" /></a></p>
<p>Using <code>os.listdir()</code> I am reading all ... | <p>Do this to sort your files in the order shown in image uploaded in your question:</p>
<pre><code>files = os.listdir()
files.sort(key=lambda x: int(x.split("-")[3]))
</code></pre> | How to arrange items in ascending order in list Python | python|list|listdir | 0 | 60 | 3 | 72,320,754 | 72,320,754 | 1 | true | 2022-05-20T14:18:44.027Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to arrange items in ascending order in list Python<p>I have the below files in a directory:</p>
<p><a href="https://i.stack.imgur.com/eDN7Z.png" rel="nof... |
72,360,091 | Mini java chatbot<p>I am new to Java and trying to make a simple mini chatbot, that answers to 3 questions with user input and if/else statement.</p>
<p>I do not know if I am correct, but I got this far:</p>
<pre><code>import java.util.Scanner;
public class Main {
public static void main(String[] args) {
S... | <p>The problem is that you are using the same variable <code>input</code> as String and as Scanner, change the name of the variable like this:</p>
<pre><code>import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.pri... | Mini java chatbot | java|chatbot | -1 | 60 | 1 | 72,360,131 | 72,360,131 | 1 | true | 2022-05-24T09:04:44.160Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Mini java chatbot<p>I am new to Java and trying to make a simple mini chatbot, that answers to 3 questions with user input and if/else statement.</p>
<p>I do... |
72,285,451 | Undefined is not an object (evaluating 'navigation.navigate') when trying to navigate between two sites React Native<p>I try to navigate between two pages in a React Native app. I keep getting errors for my implementations but I don't know why.</p>
<p>I have the following setup for a "Home" and "Settings... | <p>You seem to be setting up a navigator but never using it, since in <code>App.js</code> you are just calling <code><Home/></code>.</p>
<ol>
<li>Change <code>App.js</code> to this:</li>
</ol>
<pre class="lang-js prettyprint-override"><code>import MyStack from "./MyStack"; // Use the correct path for th... | Undefined is not an object (evaluating 'navigation.navigate') when trying to navigate between two sites React Native | javascript|reactjs|react-native | 2 | 60 | 1 | 72,285,600 | 72,285,600 | 1 | true | 2022-05-18T08:13:16.747Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Undefined is not an object (evaluating 'navigation.navigate') when trying to navigate between two sites React Native<p>I try to navigate between two pages in... |
72,280,864 | If I ask for X, it generates duplicates, but it fails on duplicates if I ask explicitly<p>I am trying to generate pieces on a board at specific positions. One requirement is no two pieces can occupy the same position.
So the board as a list, cannot contain duplicate entries for it's position value.</p>
<p>I failed to r... | <p>Assuming that every position on the board must have a piece, you can generate boards with the following code:</p>
<pre><code>board(Ps) :-
setof(P, pos_(P), Ls),
maplist(piese_pos, Ps, Ls),
maplist(piese, Ps).
</code></pre>
<p>Example:</p>
<pre><code>?- board(Ps).
Ps = [w-k-(a-1), w-k-(a-2)] ;
Ps = [... | If I ask for X, it generates duplicates, but it fails on duplicates if I ask explicitly | prolog | 1 | 60 | 4 | 72,289,416 | 72,289,416 | 1 | true | 2022-05-17T21:28:56.530Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
If I ask for X, it generates duplicates, but it fails on duplicates if I ask explicitly<p>I am trying to generate pieces on a board at specific positions. On... |
72,349,203 | Updating deprecated code, from each() to foreach()<p>I'm working to fix some old code that triggers a warning on PHP 7.2.0, beacause <code>each()</code> is deprecated.</p>
<p>I tried to replace <code>each()</code> with <code>foreach()</code> like the following, but it doesn't work.
I found some answers on StackOverflow... | <p>It seems like the php team encourages you to manage array pointers yourself. you can replace the original array with an ArrayIterator wrapper.</p>
<pre><code>$arrayItor = new ArrayIterator($array);
</code></pre>
<p>Then your code can be updated by using this iterator.</p>
<pre><code>if ($n > 0){
if ($n !== $a... | Updating deprecated code, from each() to foreach() | php|foreach|each|php-7.2 | 0 | 60 | 1 | 72,349,647 | 72,349,647 | 1 | true | 2022-05-23T13:14:48.460Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Updating deprecated code, from each() to foreach()<p>I'm working to fix some old code that triggers a warning on PHP 7.2.0, beacause <code>each()</code> is d... |
72,394,586 | Apply CSS conditionally in a loop - VueJS<p>I have a JSON list of items that I import in my vue component,
I loop though that file in order to show them. Each item belong to a specific 'group' :</p>
<p>See <a href="https://i.stack.imgur.com/u5u67.png" rel="nofollow noreferrer">IMG</a></p>
<p>E.g. :</p>
<pre><code>{
&qu... | <p>Probably the most efficient (performance wise) and the most readable solution would be to declare a constant colorMap, outside the component, and then return the correct value or a fallback, using a method:</p>
<pre><code><script>
const colorMap = {
"list-component": '#00A3A1',
"location-med... | Apply CSS conditionally in a loop - VueJS | javascript|css|vue.js|class|binding | 1 | 60 | 2 | 72,394,998 | 72,394,998 | 1 | true | 2022-05-26T15:50:18.357Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Apply CSS conditionally in a loop - VueJS<p>I have a JSON list of items that I import in my vue component,
I loop though that file in order to show them. Eac... |
72,283,274 | How to partially initialize an array with huge load of data from API response<p>I use Axios to get a response from an endpoint and then I input that response into a variable in the form of an object. The response I get from the server has more than 10000 data.</p>
<p>My question is :</p>
<ol>
<li>How to process the dat... | <p>There are many things to look at here:</p>
<ol>
<li>Every site has a memory limit ( Assigned by the browsers ) and the site crashes if the memory exceeds.</li>
<li>The short and ugly fix would be... taking all those and storing only some part of it (<strong>Ugly fix</strong>).</li>
<li>The right and correct fix woul... | How to partially initialize an array with huge load of data from API response | javascript|node.js|reactjs|api|axios | 0 | 60 | 1 | 72,284,591 | 72,284,591 | 1 | true | 2022-05-18T04:35:48.950Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to partially initialize an array with huge load of data from API response<p>I use Axios to get a response from an endpoint and then I input that response... |
72,358,524 | Calculating Displacement based on the compass direction<p>I need some help with programming the calculation of displacement. Given the distance the object has moved in the XY plane, and the yaw (heading) of the object, I'd like to calculate the displacement of the object. For example, the object moved 5m North and 2m E... | <p>Assume you have your XY pane rotated by some angle <code>Zp</code> and have a 2D movement vector within that pane, let's say its direction rotated by <code>Zv</code> – what is total rotation of the vector, relative to the global orientation? <code>Zp + Zv</code>...</p>
<p>So all you need to do is applying the rotati... | Calculating Displacement based on the compass direction | c|math|arduino-ide | 0 | 60 | 2 | 72,359,325 | 72,359,325 | 1 | true | 2022-05-24T07:04:21.843Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Calculating Displacement based on the compass direction<p>I need some help with programming the calculation of displacement. Given the distance the object ha... |
72,293,005 | update. Help me, am I doing it wrong?<p>Here, is a code that updates the data in the fees column that corresponds to the Student ID entered by the student. There are no errors in the code, but the program doesn't seem to update the value in the database.</p>
<pre><code> Private Sub dbupdate()
'Create a connect... | <p>Are you using a debugger? I mean <em>really using</em> a debugger? Put a breakpoint after you build the sql and inspect the actual sql. Does it look correct?</p>
<pre class="lang-sql prettyprint-override"><code>UPDATE students SET fees = 'txtBalanceText'WHERE idstudents = 'txtStudentIDText
</code></pre>
<p>You may n... | update. Help me, am I doing it wrong? | mysql|vb.net | 0 | 60 | 1 | 72,293,519 | 72,293,519 | 1 | true | 2022-05-18T16:41:27.173Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
update. Help me, am I doing it wrong?<p>Here, is a code that updates the data in the fees column that corresponds to the Student ID entered by the student. T... |
72,349,571 | mongoose find in document object<p>Lets say I have a mongoose schema, something like:</p>
<pre><code>mongoose.Schema({
website_id:mongoose.SchemaTypes.ObjectId,
data:Object
})
</code></pre>
<p>where <strong>data</strong> field contains JSON Object. Something like:</p>
<pre><code>{
"actions":[
{
... | <p>Of course, there are several ways and in this case, one of the best ways is to use "aggregate"</p>
<pre><code> db.collection.aggregate([
{$unwind: "$actions"},
{ $match: {"actions.url": "http://localhost:3000/login"}},
{$group: {
_id: "$_id",
actio... | mongoose find in document object | node.js|mongoose | 2 | 60 | 2 | 72,374,225 | 72,374,225 | 1 | true | 2022-05-23T13:40:22.093Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
mongoose find in document object<p>Lets say I have a mongoose schema, something like:</p>
<pre><code>mongoose.Schema({
website_id:mongoose.SchemaTypes.Object... |
72,238,301 | Prefix every line of bash script output with time since script start<p>Main question in the title: I want to prefix every line of script output with time since start of the script.</p>
<p>Background. I use GNU parallel to run jobs, some of which produce output (most of them don't). I want to prepend each task's output ... | <p>You could add a line into the top of your <code>bash</code> script like this:</p>
<pre><code>#!/bin/bash
exec > >(trap "" INT TERM; while read line ; do printf "%d: %s\n" $SECONDS "$line"; done )
for ((i=0;i<10;i++)) ; do
sleep 1
echo hello
done
</code></pre>
<hr />
<p>If... | Prefix every line of bash script output with time since script start | bash|gnu-parallel | 1 | 60 | 2 | 72,238,580 | 72,238,580 | 1 | true | 2022-05-14T07:49:54.487Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Prefix every line of bash script output with time since script start<p>Main question in the title: I want to prefix every line of script output with time sin... |
72,330,077 | How to "double pop"?<p>I'm sorry if my title is a bit unclear, I wasn't sure how to express my problem better. I will give a quick code snippet to illustrate what I am trying to do:</p>
<pre><code>for data_file in data_files:
analyze(data_file)
def analyze(data_file):
for _ in np.arange(n_steps):
foo(d... | <p><code>foo()</code> could return <code>True</code>, if it completes, or <code>False</code> if you want to “leave early”:</p>
<pre><code>for data_file in data_files:
analyze(data_file)
def analyze(data_file):
for _ in np.arange(n_steps):
if not foo(data_file):
return
do some other things
de... | How to "double pop"? | python|for-loop|nested-for-loop | 1 | 60 | 2 | 72,330,161 | 72,330,161 | 1 | true | 2022-05-21T13:39:05.133Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to "double pop"?<p>I'm sorry if my title is a bit unclear, I wasn't sure how to express my problem better. I will give a quick code snippet to illustrate... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.