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,110,328 | Azure Digital Twins difference between properties and telemetries?<p>I'm working on an Azure Digital Twins project and I got a bit confused about my understanding of telemetry and property.</p>
<p>From <a href="https://github.com/Azure/opendigitaltwins-dtdl/blob/master/DTDL/v2/dtdlv2.md" rel="nofollow noreferrer">https... | <p>I wanted to start this answer with something other than "I feel your pain", but you're drawing a lot of good conclusions, so:</p>
<p>I feel your pain. The first link you shared is about DTDL (Digital Twins Definition Language). It's a language that's used in two places: Azure Digital Twins (ADT) and IoT Pl... | Azure Digital Twins difference between properties and telemetries? | azure|azure-digital-twins | 0 | 264 | 1 | 72,116,837 | 72,116,837 | 3 | true | 2022-05-04T08:59:06.230Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Azure Digital Twins difference between properties and telemetries?<p>I'm working on an Azure Digital Twins project and I got a bit confused about my understa... |
72,131,223 | Querying Git status with Subprocess throws Error under Linux<p>I want to query the status of the git repo using python. I am using:</p>
<pre class="lang-py prettyprint-override"><code>subprocess.check_output("[[ -z $(git status -s) ]] && echo 'clean'", shell=True).strip()
</code></pre>
<p>This works f... | <p>When you set <code>shell=True</code>, <code>subprocess</code> executes your command using <code>/bin/sh</code>. On Ubuntu, <code>/bin/sh</code> is not Bash, and you are using Bash-specific syntax (<code>[[...]]</code>). You could explicitly call out to <code>bash</code> instead:</p>
<pre><code>subprocess.check_outpu... | Querying Git status with Subprocess throws Error under Linux | python|git|command-line | 0 | 35 | 1 | 72,131,334 | 72,131,334 | 3 | true | 2022-05-05T17:19:03.637Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Querying Git status with Subprocess throws Error under Linux<p>I want to query the status of the git repo using python. I am using:</p>
<pre class="lang-py p... |
72,135,350 | SQL to replace multiple "BETWEEN ... AND"<p>Suppose I have a small lookup table like this:</p>
<pre><code>ULimit LLimit
1 4
11 14
21 24
</code></pre>
<p>I want to write an SQL to test if a particular value falls in any one of the ranges specified in that table....</p>
<p>Although equivalently I could do away with that ... | <pre><code>SELECT Field1
FROM tableA
INNER JOIN tableLimits
ON tableA.Field1 BETWEEN tableLimits.ULimit AND tableLimits.LLimit
</code></pre> | SQL to replace multiple "BETWEEN ... AND" | sql | 0 | 27 | 1 | 72,135,384 | 72,135,384 | 3 | true | 2022-05-06T01:55:21.083Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SQL to replace multiple "BETWEEN ... AND"<p>Suppose I have a small lookup table like this:</p>
<pre><code>ULimit LLimit
1 4
11 14
21 24
</code></pre>
<p>I wa... |
72,137,717 | Flex wrap and justify content not working<p>When I resize the screen the circles are not wrapping, even with <code>flex-wrap: wrap</code>.<br />
Also <code>justify-content: space-evenly</code> is not working.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class... | <p>You have given <code>width: 850px;</code> to <code>.game-canvas</code>.
So this element is taking 850px width and is not affected by screen size or screen resize.</p>
<p>A better approach can be using screen dependant width(instead of absolute width).
I modified one line in your original snippet, added <code>width: ... | Flex wrap and justify content not working | html|css|flexbox | 0 | 268 | 2 | 72,137,862 | 72,137,862 | 3 | true | 2022-05-06T07:31:34.837Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Flex wrap and justify content not working<p>When I resize the screen the circles are not wrapping, even with <code>flex-wrap: wrap</code>.<br />
Also <code>j... |
72,140,675 | Sqlfluff rule L025 breaks due to postgres `generate_series()`<p>I'm using <a href="https://www.sqlfluff.com/" rel="nofollow noreferrer">sqlfluff</a> to lint my postges code. I'm down to a single linting error, in my test code, that I dont know how to fix by adjusting my sql nor how to configure it.</p>
<p>The rules im ... | <p>I do agree with the linter here. <code>i</code> is a table alias and shouldn't be used as a column reference. It's cleaner to use</p>
<pre><code>from generate_series(1, 200) as g(i)
</code></pre>
<p>or whatever naming you prefer.</p>
<p>Then reference the value as <code>g.i</code></p> | Sqlfluff rule L025 breaks due to postgres `generate_series()` | postgresql|sqlfluff | 0 | 71 | 1 | 72,140,736 | 72,140,736 | 3 | true | 2022-05-06T11:21:31.620Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Sqlfluff rule L025 breaks due to postgres `generate_series()`<p>I'm using <a href="https://www.sqlfluff.com/" rel="nofollow noreferrer">sqlfluff</a> to lint ... |
72,140,889 | Is it necessary to use null two times at the end of the code?<p>I have one question. Help me, please.</p>
<p>I have code in my teaching proggram:</p>
<pre><code>alert(user.address ? user.address.street ? user.address.street.name : null : null);
</code></pre>
<p>But I can't understand, why he used "null" two ... | <p>The ? operator is a shorthand for an if-else assignment.</p>
<pre><code>alert(user.address ? user.address.street ? user.address.street.name : null : null);
</code></pre>
<p>Is the short form for:</p>
<pre><code>let res;
if (user.address) {
if (user.address.street) {
res = user.address.street.name;
... | Is it necessary to use null two times at the end of the code? | javascript|null | 0 | 42 | 1 | 72,140,963 | 72,140,963 | 3 | true | 2022-05-06T11:40:12.727Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is it necessary to use null two times at the end of the code?<p>I have one question. Help me, please.</p>
<p>I have code in my teaching proggram:</p>
<pre><c... |
72,141,455 | Missing type arguments for generic type 'Future<dynamic>'. Try adding an explicit type, or remove implicit-dynamic from your analysis options file<p>How do I resolve this issue without removing the implicit-dynamic form analysis options file?</p>
<p>Error:</p>
<p><a href="https://i.stack.imgur.com/ORC8P.png" rel="nofol... | <p>Add the specific type <code>void</code> and thus make it not generic:</p>
<p><code>Future<void>.delayed(...)</code></p> | Missing type arguments for generic type 'Future<dynamic>'. Try adding an explicit type, or remove implicit-dynamic from your analysis options file | flutter|dart | 0 | 142 | 1 | 72,141,620 | 72,141,620 | 3 | true | 2022-05-06T12:25:45.877Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Missing type arguments for generic type 'Future<dynamic>'. Try adding an explicit type, or remove implicit-dynamic from your analysis options file<p>How do I... |
72,143,537 | Why is my mongo query using the $in operator producting an error?<p>The following query is erroring out:</p>
<pre><code>const pastOrders = await Order.find(
{user: userId},
{status: {$in: ["delivered", "refunded"]}}
).populate({
path: 'items.product',
model: 'Prod... | <p>It should be:</p>
<pre><code>.find({user: userId, status: {$in: ["delivered", "refunded"]}})
</code></pre>
<p>No need to for the <code>},{</code> after <code>userId</code></p> | Why is my mongo query using the $in operator producting an error? | mongodb | 0 | 20 | 1 | 72,143,569 | 72,143,569 | 3 | true | 2022-05-06T14:56:25.803Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why is my mongo query using the $in operator producting an error?<p>The following query is erroring out:</p>
<pre><code>const pastOrders = await Order.find(
... |
72,143,332 | How to mock module static method in ruby rspec?<p>I am trying to write some rspec tests and I want to mock a static method from a module.</p>
<p>The setup is like this:</p>
<pre><code>module MyModule
def self.my_method
'end'
end
</code></pre>
<p>and inside rspec I want to mock my_method, like this:</p>
<pre><code>... | <p>The <a href="https://relishapp.com/rspec/rspec-mocks/v/3-11/docs/basics/allowing-messages" rel="nofollow noreferrer">new syntax</a> to stub messages in RSpec looks like this:</p>
<pre><code>allow(MyModule).to receive(:my_method).and_return('not_bla')
</code></pre>
<p>The <a href="https://relishapp.com/rspec/rspec-mo... | How to mock module static method in ruby rspec? | ruby-on-rails|ruby|rspec | 0 | 123 | 2 | 72,144,023 | 72,144,023 | 3 | true | 2022-05-06T14:43:36.420Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to mock module static method in ruby rspec?<p>I am trying to write some rspec tests and I want to mock a static method from a module.</p>
<p>The setup is... |
72,146,063 | How to print data if only matching string found in list?<pre><code>key_word = ["apple","Apple","Boy","boy"]
title1 = "Where the boy"
title2 = "The Boy playing cricket"
title3 = "hello world"
title4 = "I want to buy apple vinegar"
</code><... | <p>You have to check if your key word is in the title, and not the other way around.</p>
<pre class="lang-py prettyprint-override"><code>key_words = ["apple", "boy"]
titles = [
"Where the boy",
"The Boy playing cricket",
"hello world",
"I want to... | How to print data if only matching string found in list? | python|python-3.x|list | 0 | 62 | 3 | 72,146,125 | 72,146,125 | 3 | true | 2022-05-06T18:42:24.167Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to print data if only matching string found in list?<pre><code>key_word = ["apple","Apple","Boy","boy"]
title1 =... |
72,146,094 | Problems matching values from nested dictionary<p>In TestRail, I have created several testruns. When I execute:</p>
<pre><code>test_runs = client.send_get('get_runs/1')
pprint(test_runs)
</code></pre>
<p>The following results are returned:</p>
<pre><code>{'_links': {'next': None, 'prev': None},
'limit': 250,
'offset... | <p>You're looping over the wrong part of the datastructure that the function returned. The loop <code>for test_run in test_runs:</code> only iterates over the keys of the top-level dictionary (<code>"_links"</code>, <code>"limit"</code>, etc.).</p>
<p>You want to be looping over <code>test_runs['run... | Problems matching values from nested dictionary | python|testrail | 0 | 42 | 1 | 72,146,260 | 72,146,260 | 3 | true | 2022-05-06T18:45:07.810Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Problems matching values from nested dictionary<p>In TestRail, I have created several testruns. When I execute:</p>
<pre><code>test_runs = client.send_get('... |
72,146,860 | Different C++ fork() behavior between CentOS 7.5 & RockyLinux 8.4, Ubunu 20.04<p>I'm working with some legacy code. It works fine on a CentOS 7 system. The args array gets hosed on both a Rocky 8.4 and Ubuntu 20.04 system. I've simplified the problem and added print statements. The execv() was launching another program... | <p>THis loop</p>
<pre><code> for(uint8_t i = 0; i < stringArgs.size(); i++) {
std::string tmp(stringArgs[i]);
args[i] = const_cast<char*>(tmp.c_str());
std::cout << "\n\t"<<args[i]<<"'\n\n";
}
</code></pre>
<p>is creating an array of pointers ... | Different C++ fork() behavior between CentOS 7.5 & RockyLinux 8.4, Ubunu 20.04 | c++|c|fork | 0 | 60 | 1 | 72,146,922 | 72,146,922 | 3 | true | 2022-05-06T20:08:45.080Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Different C++ fork() behavior between CentOS 7.5 & RockyLinux 8.4, Ubunu 20.04<p>I'm working with some legacy code. It works fine on a CentOS 7 system. The a... |
72,147,511 | Constructor __init__ is written to take two position arguments, but when used, reports the error that only 1 is allowed<p>I have a class and constructor I'm working on, and I added an extra parameter to <code>__init__</code>, and now I get the error, <code>TypeError: FeatureDataset() takes 1 positional argument but 2 w... | <p>This defines a function, not a class:</p>
<pre><code>def FeatureDataset(Dataset):
</code></pre>
<p>... try ...</p>
<pre><code>class FeatureDataset(Dataset):
</code></pre> | Constructor __init__ is written to take two position arguments, but when used, reports the error that only 1 is allowed | python|constructor | 0 | 51 | 1 | 72,147,544 | 72,147,544 | 3 | true | 2022-05-06T21:23:37.517Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Constructor __init__ is written to take two position arguments, but when used, reports the error that only 1 is allowed<p>I have a class and constructor I'm ... |
72,148,345 | Array gives different values in main() and in a function()<p>I am trying to store a 1d array that stores random numbers into another 2d array.</p>
<p>So as you can see, I am trying to store the passed random array <code>a1</code> from the <code>main()</code> function to the <code>test()</code> function. And then I am a... | <p>You have two different <code>p</code> arrays: One in main and one global. The print loop in main is accessing the local <code>p</code> in main while <code>test</code> accesses the global one. That means only the global <code>p</code> gets filled with data and main is stuck with a different array that wasn't filled w... | Array gives different values in main() and in a function() | c++|arrays | 0 | 40 | 1 | 72,148,368 | 72,148,368 | 3 | true | 2022-05-06T23:37:45.193Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Array gives different values in main() and in a function()<p>I am trying to store a 1d array that stores random numbers into another 2d array.</p>
<p>So as y... |
72,148,179 | after delete a cloud function it still in gcf-sources<p>I deployed two firebase cloud functions then I deleted one of them using firebase CLI as the docs said, but I can still see it in the gcf-sources in Google cloud. Why it is still there? is it safe to delete it manually? or it will be deleted by the time.</p> | <p>Cloud Functions creates Google Cloud Storage (GCS) buckets for each region in each project in which you deploy/create Cloud Functions.</p>
<p>The GCS Buckets are named <code>gcf-source-${projectNumber}-${region}</code> where <code>projectNumber</code> and <code>region</code> are replaced by values.</p>
<p>The Bucket... | after delete a cloud function it still in gcf-sources | google-cloud-functions|gcloud | 0 | 170 | 1 | 72,148,916 | 72,148,916 | 3 | true | 2022-05-06T23:04:37.270Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
after delete a cloud function it still in gcf-sources<p>I deployed two firebase cloud functions then I deleted one of them using firebase CLI as the docs sai... |
72,149,120 | Google Cloud Compute Engine http Connection Timeout<p>I have setup a compute engine VM with 2vCPU and 2GB RAM.I have setup nginx server and setup the firewalls permissions as shown in the diagram. When I try to access the angular files hosted on the server using the external IP I get the error "<strong>The connect... | <p>Your problem is probably that you forgot to enable the Compute Engine VM <strong>network tags</strong> which attach firewall rules to network interfaces.</p>
<p>The Compute Engine edit screen has checkboxes where you can select the default firewall rules <strong>http</strong> and <strong>https</strong>.</p>
<p><a hr... | Google Cloud Compute Engine http Connection Timeout | angular|nginx|google-cloud-platform|google-compute-engine | 0 | 517 | 1 | 72,149,193 | 72,149,193 | 3 | true | 2022-05-07T02:54:23.030Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Google Cloud Compute Engine http Connection Timeout<p>I have setup a compute engine VM with 2vCPU and 2GB RAM.I have setup nginx server and setup the firewal... |
72,149,389 | Abstract class with multiple inheritance error: Can't instantiate abstract class ... with abstract method<p>I'm trying to get the following to work:</p>
<pre><code>from abc import ABC, abstractmethod
class Abc1(ABC):
def __init__(self, example_variable_1: int) -> None:
self.example_variable_1 = exampl... | <p>The issue is in <code>Abc3.__init__</code>, where you call <code>Abc1(self)</code> and <code>Abc2(self)</code>. The second of those is what is giving you the error, since creating an instance of <code>Abc2</code> is not allowed (and the first won't do what you want, even though it is technically legal, since <code>A... | Abstract class with multiple inheritance error: Can't instantiate abstract class ... with abstract method | python|abstract-class | 0 | 64 | 1 | 72,149,461 | 72,149,461 | 3 | true | 2022-05-07T03:57:05.157Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Abstract class with multiple inheritance error: Can't instantiate abstract class ... with abstract method<p>I'm trying to get the following to work:</p>
<pre... |
72,149,983 | C# - Adding condition to func results in stack overflow exception<p>I have a func as part of specification class which sorts the given iqueryable</p>
<pre><code>Func<IQueryable<T>, IOrderedQueryable<T>>? Sort { get; set; }
</code></pre>
<p>When i add more than one condition to the func like below , it... | <p>This is the problematic part:</p>
<pre class="lang-cs prettyprint-override"><code>Sort = items => Sort(items)
</code></pre>
<p>That's like writing a method that calls itself.</p>
<p>What you <em>want</em> is to evaluate <em>the existing</em> <code>Sort</code> function, not "the result of the <code>Sort</code... | C# - Adding condition to func results in stack overflow exception | c#|.net-core|entity-framework-core | 0 | 66 | 1 | 72,150,021 | 72,150,021 | 3 | true | 2022-05-07T06:18:35.077Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C# - Adding condition to func results in stack overflow exception<p>I have a func as part of specification class which sorts the given iqueryable</p>
<pre><c... |
72,150,088 | Get specific rows only after comparing with previously added rows on different date<p>There is a table which has multiple fields including a Date column at which the current record gets updated.</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>Col1</th>
<th>Col2</th>
<th>Col3</th>
<th>Date</... | <p>You can try to use <code>NOT EXISTS</code> subquery to find your logic.</p>
<pre><code>SELECT *
FROM T t1
WHERE Date = 'Today'
AND NOT EXISTS (
SELECT *
FROM T tt
WHERE Date = 'Yesterday'
AND t1.Col1 = tt.Col1
AND t1.Col2 = tt.Col2
AND t1.Col3 = tt.Col3
)
</code></pre>
<p><a href="https://dbf... | Get specific rows only after comparing with previously added rows on different date | mysql|sql | 0 | 39 | 2 | 72,150,117 | 72,150,117 | 3 | true | 2022-05-07T06:38:23.130Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get specific rows only after comparing with previously added rows on different date<p>There is a table which has multiple fields including a Date column at w... |
72,149,987 | Updating a Single Column In Room Database<p>That's the function I'm using for update:</p>
<pre><code>private fun updateSettingsDatabase(settingsDao: SettingsDao) {
lifecycleScope.launch {
settingsDao.update(SettingsEntity(
1,
nightMode=nightModeResult,
))
... | <p>If it is single or few columns that you want to update then you can write custom query.</p>
<p>In your dao class</p>
<pre><code>@Query("UPDATE settings-table SET nightMode = :nightModeResult WHERE id = :id")
fun updateNightMode(id: Int, nightModeResult: Any): Int
</code></pre> | Updating a Single Column In Room Database | android|kotlin|android-room | 0 | 330 | 2 | 72,150,367 | 72,150,367 | 3 | true | 2022-05-07T06:19:30.833Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Updating a Single Column In Room Database<p>That's the function I'm using for update:</p>
<pre><code>private fun updateSettingsDatabase(settingsDao: Settings... |
72,150,559 | Leetcode Reverse String problem not accepting in-place solution<p>I am posting two solutions below which I tried in leetcode for the problem no : 344</p>
<p><a href="https://leetcode.com/problems/reverse-string/" rel="nofollow noreferrer">https://leetcode.com/problems/reverse-string/</a></p>
<p><strong>Solution 1</stro... | <p>Question is saying do not return anything that means you need to do inplace reversing.
Also this is list of string not a string so whatever you change inside function it will be reflected in the list because lists are mutable.</p>
<p>Correct Solution will be</p>
<pre><code>class Solution:
def reverseString(self,... | Leetcode Reverse String problem not accepting in-place solution | python|arrays|python-3.x|string|in-place | 0 | 198 | 3 | 72,150,601 | 72,150,601 | 3 | true | 2022-05-07T07:54:49.227Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Leetcode Reverse String problem not accepting in-place solution<p>I am posting two solutions below which I tried in leetcode for the problem no : 344</p>
<p>... |
72,152,060 | Kotlin #toCharArray giving wrong characters<p>I'm trying to loop through characters of a string. While doing so I found out that the <code>#toCharArray</code> function doesn't split special characters correctly. Here is my testing code:</p>
<pre class="lang-kotlin prettyprint-override"><code>val text = "\uD835\uDC... | <p>Unfortunately, a Kotlin <code>Char</code> is 16-bit, and so characters outside of the basic multilingual plane needs to be represented with 2 <code>Char</code>s (surrogate pairs). One <code>Char</code> is not enough.</p>
<p>If you want to loop through all the Unicode <em>codepoints</em> in the string, use <code>code... | Kotlin #toCharArray giving wrong characters | kotlin | 0 | 59 | 2 | 72,152,241 | 72,152,241 | 3 | true | 2022-05-07T11:31:54.947Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Kotlin #toCharArray giving wrong characters<p>I'm trying to loop through characters of a string. While doing so I found out that the <code>#toCharArray</code... |
72,153,857 | Java multiple modifiers to printformat one variable<p>I want to print a string for a table, but multiple modifiers are needed for one variable</p>
<pre><code> System.out.format("%-3s %-20s %-12s %-6s %.2f %-9s\n",
id, city, date, days, price, vehicle);
}
</code></pre>
<p>i want something like t... | <p>It's not entirely clear what you want to do.</p>
<h2>Print a number, but expanded to at least 10 'width'</h2>
<p>If you want to combine the idea of <code>%.2f</code> (as in, round down to 2 digits 'after the comma'), and the idea of 'this should take up 10 width; if it is less than that, add spaces. If it is more, o... | Java multiple modifiers to printformat one variable | java|printf | 0 | 44 | 1 | 72,154,000 | 72,154,000 | 3 | true | 2022-05-07T15:21:02.807Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Java multiple modifiers to printformat one variable<p>I want to print a string for a table, but multiple modifiers are needed for one variable</p>
<pre><code... |
72,154,546 | Can someone point out the problem in my linked list implementation?<p>When I compile the following code, I get compile error that " head does not name a type".
Can someone explain what goes wrong ?</p>
<pre><code>#include <iostream>
using namespace std;
/* Link list node */
struct node {
int val;
... | <p>Only declarations are allowed outside of functions. Expressions such as <code>head->next = node(4)</code> need to be inside a function. You should move that code into <code>main()</code>.</p> | Can someone point out the problem in my linked list implementation? | c++|linked-list | 0 | 38 | 1 | 72,154,572 | 72,154,572 | 3 | true | 2022-05-07T16:41:49.770Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can someone point out the problem in my linked list implementation?<p>When I compile the following code, I get compile error that " head does not name a... |
72,155,979 | How to get a specific row count from flutter sqflite?<p>I created a local database using <code>flutter</code> <code>sqflite</code> package to store <code>tasks</code> for my task manager app. Now I want to count total number of tasks and specially the count of the <code>done tasks</code>.</p>
<h2>Summary:</h2>
<p><stro... | <p>try to use this to get count of all tasks</p>
<pre><code>var count = await database.rawQuery('SELECT COUNT(*) FROM TABLEOFTASKS');
</code></pre>
<p>and use this to get all done tasks</p>
<pre><code>var tasksDone = await database.rawQuery('SELECT COUNT(*), TABLEOFTASKS.isDone
FROM TABLEOFTASKS WHERE TABLEOFTASKS.isD... | How to get a specific row count from flutter sqflite? | database|flutter|sqlite|dart|sqflite | 0 | 192 | 1 | 72,156,167 | 72,156,167 | 3 | true | 2022-05-07T20:01:42.073Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get a specific row count from flutter sqflite?<p>I created a local database using <code>flutter</code> <code>sqflite</code> package to store <code>tas... |
72,156,477 | Pandas: how to sequentially alternate between calculating difference between two rows and skip calculation for the next row?<p>The idea would be to calculate the difference between the first and second rows, and store that value in the second row (similar to <code>.diff()</code>).</p>
<p>Then, skip the calculation betw... | <p>You can just <code>mask</code> the result</p>
<pre><code>df['B'] = df['A'].diff().mask(df.index%2!=1,0)
df
Out[469]:
A B
0 100 0.0
1 101 1.0
2 103 0.0
3 107 4.0
4 110 0.0
5 120 10.0
6 150 0.0
7 170 20.0
</code></pre>
<p>Or we do <code>groupby</code></p>
<pre><code>df['B'] = df.groupby... | Pandas: how to sequentially alternate between calculating difference between two rows and skip calculation for the next row? | python|python-3.x|pandas|dataframe|difference | 0 | 66 | 1 | 72,156,516 | 72,156,516 | 3 | true | 2022-05-07T21:28:03.207Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pandas: how to sequentially alternate between calculating difference between two rows and skip calculation for the next row?<p>The idea would be to calculate... |
72,156,403 | Cocoa Pods .xcworkspace missing my project<p>I've just started learning about CocoaPods today and I'm honestly very lost. In a tutorial, installing CocoaPods created a new .xcworkspace file, which had both their Pods and their original project. However, my new .xcworkspace file is missing all of my work from before (my... | <p>Close all Xcode windows and then just open your workspace file, no other files that contain your project.</p>
<p>You can't have your project and a workspace with your project open at the same time.</p> | Cocoa Pods .xcworkspace missing my project | swift|xcode|cocoa|swiftui|cocoapods | 0 | 127 | 1 | 72,156,619 | 72,156,619 | 3 | true | 2022-05-07T21:12:22.440Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Cocoa Pods .xcworkspace missing my project<p>I've just started learning about CocoaPods today and I'm honestly very lost. In a tutorial, installing CocoaPods... |
72,156,974 | Verify data in `for` loop<p>I have an array with strings and I have a string - <code>snowy</code> for example. The task is to verify if the <code>snowy</code> is in <code>arr</code>, if <code>yes</code>, push it into one array, if <code>no</code>, push it into another. I am not sure that use of <code>if(true)</code> is... | <p>You can do something like</p>
<pre><code> const arr = ["sunny", "rainy", "cloudy", "foggy" ]
if(arr.includes("snowy")){
someArr.push("snowy");
}else{
anotherArr.push("snowy");
}
</code></pre>
<p>In this case you are... | Verify data in `for` loop | javascript | 0 | 62 | 4 | 72,157,005 | 72,157,005 | 3 | true | 2022-05-07T23:08:37.647Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Verify data in `for` loop<p>I have an array with strings and I have a string - <code>snowy</code> for example. The task is to verify if the <code>snowy</code... |
72,157,446 | When using the Fetch API, why do post requests require more inputs than a get request?<p>How come when we use the Fetch API, it requires a significant amount of more input into the function for a <code>POST</code> request as opposed to a <code>GET</code> request. This has been a bit of a learning curve for myself. Also... | <p>TLDR, <code>POST</code> has more stuff to it.</p>
<p><code>GET</code> and <code>POST</code> are methods for <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods" rel="nofollow noreferrer">HTTP Requests</a>. The main ones of interest are:</p>
<ul>
<li><code>GET</code>: get a thing</li>
<li><code>POST</c... | When using the Fetch API, why do post requests require more inputs than a get request? | javascript|promise|fetch | 0 | 114 | 1 | 72,157,535 | 72,157,535 | 3 | true | 2022-05-08T01:25:26.913Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
When using the Fetch API, why do post requests require more inputs than a get request?<p>How come when we use the Fetch API, it requires a significant amount... |
72,154,374 | AWS Lambda Node 16 container image error ( Missing Runtime API Server configuration )<p>I wanted to create <code>node16</code> container image for aws lambda. I have following <code>Dockerfile</code> and <code>index.js</code> for lambda function. Building image (<code>docker build -t lambda-hello-world .</code>) works ... | <p>According to this <a href="https://github.com/aws/aws-lambda-nodejs-runtime-interface-client/issues/15" rel="nofollow noreferrer">issue</a>, whenever your Docker image is invoked, whether in Lambda or on your local machine, you need an entry script that will help your use the RIE proxy when necessary (e.g., on our l... | AWS Lambda Node 16 container image error ( Missing Runtime API Server configuration ) | node.js|amazon-web-services|docker|aws-lambda | 0 | 449 | 1 | 72,157,875 | 72,157,875 | 3 | true | 2022-05-07T16:19:56.390Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
AWS Lambda Node 16 container image error ( Missing Runtime API Server configuration )<p>I wanted to create <code>node16</code> container image for aws lambda... |
72,158,378 | Calculate the remaining days on view Laravel, negative days if date has passed<p>These are the values on my database, I just need to get the remaining days of each today:</p>
<p><a href="https://i.stack.imgur.com/3dSWm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3dSWm.png" alt="SQL table" /></a><... | <blockquote>
<p>the problem solved but , im confused with the may 7 , which is the 3rd
row should give me a negative value</p>
</blockquote>
<p>If you want to get the negative values, you would need to pass <code>false</code> as the second parameter of the <code>diffInDays</code> function.</p>
<pre><code>Carbon\Carbon:... | Calculate the remaining days on view Laravel, negative days if date has passed | php|laravel|php-carbon | 0 | 260 | 2 | 72,158,637 | 72,158,637 | 3 | true | 2022-05-08T05:36:03.367Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Calculate the remaining days on view Laravel, negative days if date has passed<p>These are the values on my database, I just need to get the remaining days o... |
72,156,892 | Is there a way to modularize cloudformation template?<p>Right now I am using a template in such a way:</p>
<ol>
<li>Create initial resources</li>
<li>Import existing resources (S3)</li>
<li>Update stack with new resources depending on existing resources</li>
</ol>
<p>This is boring because I have to deploy the stack in... | <p>Looks like there is an issue open for this, but AWS aren't too interested in fixing it: <a href="https://github.com/aws-cloudformation/cloudformation-coverage-roadmap/issues/79" rel="nofollow noreferrer">https://github.com/aws-cloudformation/cloudformation-coverage-roadmap/issues/79</a></p>
<p>In the mean time, you ... | Is there a way to modularize cloudformation template? | amazon-web-services|amazon-cloudformation | 0 | 90 | 1 | 72,159,156 | 72,159,156 | 3 | true | 2022-05-07T22:51:24.867Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there a way to modularize cloudformation template?<p>Right now I am using a template in such a way:</p>
<ol>
<li>Create initial resources</li>
<li>Import ... |
72,160,436 | variable expansion in echo and terminal<p>Bash version:</p>
<pre><code>debian@debian:~$ bash --version |grep release
GNU bash, version 5.1.4(1)-release (x86_64-pc-linux-gnu)
</code></pre>
<p>Variable expansion in echo:</p>
<pre><code>debian@debian:~$ a=apple
debian@debian:~$ echo '"'$a'
'
"apple
debian@de... | <p>When you hit enter to send a command line to the shell, it performs a variety of expansions (history, alias, parameter, etc), which produces a series of words. The name of the command to execute is the first word in that result that does not contain a <code>=</code> (or is not a predefined modifier like <code>time</... | variable expansion in echo and terminal | bash|variable-expansion | 0 | 34 | 1 | 72,161,463 | 72,161,463 | 3 | true | 2022-05-08T11:14:34.130Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
variable expansion in echo and terminal<p>Bash version:</p>
<pre><code>debian@debian:~$ bash --version |grep release
GNU bash, version 5.1.4(1)-release (x86... |
72,160,663 | Minesweeper algorithm in C++[KOI 2020]<p>I'm preparing KOI 2022, so, I'm solving KOI 2021, 2020 problems. KOI 2020 contest 1 1st period problem 5(See problem 5 in <a href="https://koi.or.kr/assets/koi/2020/1/problems/e1-problems.pdf" rel="nofollow noreferrer">here</a>)</p>
<p>I want to make <code><vector<vector&l... | <p>There two some simple rules to solving Minesweeper:</p>
<ol>
<li><p>If a field sees all it's mines then all blank fields don't have mines and can be uncovered.</p>
</li>
<li><p>If a field has as many blank fields as it is missing mines then they all contain mines.</p>
</li>
</ol>
<p>Keep applying those rules over an... | Minesweeper algorithm in C++[KOI 2020] | c++|algorithm|minesweeper | 0 | 57 | 1 | 72,161,488 | 72,161,488 | 3 | true | 2022-05-08T11:43:50.280Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Minesweeper algorithm in C++[KOI 2020]<p>I'm preparing KOI 2022, so, I'm solving KOI 2021, 2020 problems. KOI 2020 contest 1 1st period problem 5(See problem... |
72,160,004 | Problem with imageStore in compute shader<p>I have a problem with a very simple compute shader that just copies a texture using imageStore.</p>
<pre class="lang-c prettyprint-override"><code>#define KS 16 // kernel size
layout (local_size_x = KS, local_size_y = KS) in;
layout(location = 0) uniform sampler2D u_inputTex... | <blockquote>
<pre><code>glTexStorage2D(GL_TEXTURE_2D, 1, GL_RGBA8UI, w, h);
</code></pre>
</blockquote>
<p>If you want to use an <em>unnormalized</em> unsigned integer image, you must declare it as <code>uimage2D</code> in the sahder. <code>image2D</code> is for floating-point or normalized integer (range <code>[0,1]</... | Problem with imageStore in compute shader | opengl|compute-shader|opengl-4 | 0 | 96 | 1 | 72,161,742 | 72,161,742 | 3 | true | 2022-05-08T10:15:53.753Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Problem with imageStore in compute shader<p>I have a problem with a very simple compute shader that just copies a texture using imageStore.</p>
<pre class="l... |
72,160,935 | How to get path of shortcut's icon file?<p>Is there a way to get the path of an .ico of a short cut?
I know how to change the shortcuts icon, but how do I find the path of the shortcut's icon file?</p> | <p>You could use below function.<br />
It handles both 'regular' shrotcut files (.lnk) as well as Internet shortcut files (.url)</p>
<pre><code>function Get-ShortcutIcon {
[CmdletBinding()]
Param (
[Parameter(Mandatory = $true, ValueFromPipeline = $true)]
[Alias('FullName')]
[string]$Pat... | How to get path of shortcut's icon file? | powershell|icons|shortcut | 0 | 368 | 1 | 72,161,775 | 72,161,775 | 3 | true | 2022-05-08T12:21:40.827Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get path of shortcut's icon file?<p>Is there a way to get the path of an .ico of a short cut?
I know how to change the shortcuts icon, but how do I fi... |
72,162,288 | Multithreading with a Vector of different functions<p>I am trying to run multiple functions on different threads. I wrote this (minimal) code that works</p>
<pre class="lang-rust prettyprint-override"><code>use std::thread;
fn f1(count: usize) {
for i in 0..count { /*do something*/ }
}
fn f2(count: usize) {
f... | <p>Just as you can add the <code>Sync</code> marker with <code>impl</code>, you can also add it with <code>&dyn</code>, but you may need parenthesis to disambiguate:</p>
<pre><code>fn run(ops: &Vec<&'static (dyn Fn(usize) + Sync)>)
</code></pre>
<p>Two minor comments:</p>
<ul>
<li>Generally, using <co... | Multithreading with a Vector of different functions | multithreading|rust | 0 | 59 | 1 | 72,162,498 | 72,162,498 | 3 | true | 2022-05-08T15:02:39.950Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Multithreading with a Vector of different functions<p>I am trying to run multiple functions on different threads. I wrote this (minimal) code that works</p>
... |
72,159,216 | Embed Python in C++ (using CMake)<p>I'm trying to run a python script in c++. For example:<br></p>
<pre><code>// main.cpp
#include <python3.10/Python.h>
int main(int argc, char* argv[])
{
Py_Initialize();
PyRun_SimpleString("from time import time,ctime\n"
"print('Toda... | <p>Prefer imported targets (<a href="https://cmake.org/cmake/help/latest/module/FindPython.html#imported-targets" rel="nofollow noreferrer">https://cmake.org/cmake/help/latest/module/FindPython.html#imported-targets</a>):</p>
<pre><code>cmake_minimum_required(VERSION 3.18)
project(task_01)
find_package(Python REQUIRED... | Embed Python in C++ (using CMake) | python|c++|cmake | 0 | 350 | 2 | 72,162,717 | 72,162,717 | 3 | true | 2022-05-08T08:17:42.737Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Embed Python in C++ (using CMake)<p>I'm trying to run a python script in c++. For example:<br></p>
<pre><code>// main.cpp
#include <python3.10/Python.h>... |
72,162,106 | How to update data between tabs using Svelte Store<p>I'm creating a Store in Svelte that subscribes to value changes and stores the value on localStorage.</p>
<p>When opening the page there is an input tag with the value binded to the store. Everything works as intended and after refreshing the last value is there.</p>... | <p>There are two solutions to this, depending a bit on the use case.</p>
<h2>use an event listener</h2>
<p>You can register an event listener on the window that listens to the <code>storage</code> event and checks if the item you are interested in is the one that has changed.:</p>
<pre class="lang-js prettyprint-overri... | How to update data between tabs using Svelte Store | local-storage|svelte|svelte-store | 0 | 136 | 1 | 72,163,073 | 72,163,073 | 3 | true | 2022-05-08T14:44:51.187Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to update data between tabs using Svelte Store<p>I'm creating a Store in Svelte that subscribes to value changes and stores the value on localStorage.</p... |
72,163,427 | Change an entry in a vector to reach a target value of a function in R<p>I have the following data:</p>
<pre><code>z <- c(3,4,22,1,323,42,4,04,99,9,24,76,1)
target_mean <- 55
</code></pre>
<p>My question is: what value of z[1] (first entry in z) gets me my target mean?
The answer is 106 (I checked it by manually ... | <p>Another option that will be faster for long <code>z</code>:</p>
<pre><code>target_mean * length(z) - sum(z[-1])
# [1] 106
</code></pre>
<p>Input</p>
<pre><code>z <- c(3,4,22,1,323,42,4,04,99,9,24,76,1)
target_mean <- 55
</code></pre> | Change an entry in a vector to reach a target value of a function in R | r | 0 | 44 | 3 | 72,163,695 | 72,163,695 | 3 | true | 2022-05-08T17:15:55.603Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Change an entry in a vector to reach a target value of a function in R<p>I have the following data:</p>
<pre><code>z <- c(3,4,22,1,323,42,4,04,99,9,24,76,... |
72,163,627 | pip freeze requirements with some local file location<pre><code>pip freeze > requirements.txt
</code></pre>
<p>I use this command to generate some requirements, but the result with some the local file location. How to avoid them?</p>
<pre><code>absl-py @ file:///home/conda/feedstock_root/build_artifacts/absl-py_1637... | <p>I would try the following instead:</p>
<pre><code>pip list --format=freeze > requirements.txt
</code></pre> | pip freeze requirements with some local file location | python|pip | 0 | 346 | 2 | 72,163,768 | 72,163,768 | 3 | true | 2022-05-08T17:39:47.420Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
pip freeze requirements with some local file location<pre><code>pip freeze > requirements.txt
</code></pre>
<p>I use this command to generate some require... |
72,162,307 | Mutable Variables can not be used in request.security() but sometimes we are forced to use them. Is there a workaround? V5<p>We have a boolean variable for an event:</p>
<pre><code>SomethingHappened = (high > close) and (low < high) //
</code></pre>
<p>… which is if wanted to be limited to a certain timeframe th... | <p>The reason <code>request.security()</code> does not allow for mutable variables is because they get changed during the script's calculations based on the calculations done in the global scope of the script. For example, a mutable variable <code>a</code> can be 0 at the beginning and then get mutated to <code>a := 1<... | Mutable Variables can not be used in request.security() but sometimes we are forced to use them. Is there a workaround? V5 | pine-script|pinescript-v5 | 0 | 84 | 1 | 72,163,951 | 72,163,951 | 3 | true | 2022-05-08T15:04:42.793Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Mutable Variables can not be used in request.security() but sometimes we are forced to use them. Is there a workaround? V5<p>We have a boolean variable for a... |
72,163,796 | Pushing array values to a vector in Rust<p><em>The Rust Programming Language</em> has a task to print <a href="https://www.azlyrics.com/lyrics/andywilliams/asongandachristmastreethetwelvedaysofchristmas.html" rel="nofollow noreferrer"><em>The Twelve Days of Christmas</em></a> taking advantage of its repetitiveness.</p>... | <p>This works:</p>
<pre><code>fn main() {
let presents = [
"A song and a Christmas tree",
"Two candy canes",
"Three boughs of holly",
];
let mut current_presents = Vec::new();
for (day, present) in presents.iter().enumerate() {
current_pres... | Pushing array values to a vector in Rust | arrays|vector|rust | 0 | 144 | 2 | 72,163,991 | 72,163,991 | 3 | true | 2022-05-08T17:58:27.950Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pushing array values to a vector in Rust<p><em>The Rust Programming Language</em> has a task to print <a href="https://www.azlyrics.com/lyrics/andywilliams/a... |
72,164,796 | Function must return a value error even when it does<p>This is my code for counting inversions using merge sort but I'm getting the error "merge_sort : function must return a value" but as you can see the function does return a value. How do I fix this?</p>
<pre><code>int merge_sort(std::vector<int>&... | <p>Could it be the conditional return: "if (begin >= end) return;"</p> | Function must return a value error even when it does | recursion|return|mergesort|divide-and-conquer | 0 | 21 | 1 | 72,164,810 | 72,164,810 | 3 | true | 2022-05-08T20:17:57.057Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Function must return a value error even when it does<p>This is my code for counting inversions using merge sort but I'm getting the error "merge_sort : ... |
72,165,150 | Python lambda comprehension print i<p>I'm trying to use comprehensions to write a list of lambdas, where each lambda when called will print the index that is it's position in the list.</p>
<pre class="lang-py prettyprint-override"><code>list = [lambda : print(i) for i in range(10)]
list[0]()
</code></pre>
<p>But the p... | <p>You need to make sure that <code>i</code> is evaluated and bound inside the body of the lambda at the time the lambda is <em>defined</em>, rather than delaying it until it's <em>called</em> (by which time the loop has finished and <code>i = 9</code>). One way of doing that is to use <code>i</code> as the default va... | Python lambda comprehension print i | python|lambda|list-comprehension | 0 | 34 | 1 | 72,165,158 | 72,165,158 | 3 | true | 2022-05-08T21:16:50.463Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python lambda comprehension print i<p>I'm trying to use comprehensions to write a list of lambdas, where each lambda when called will print the index that is... |
72,165,258 | Load CSV File into JTable<p><strong>My Code:</strong></p>
<pre><code>import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import java.awt.Color;
import javax.swing.JTable;
import java.io.*;
import java.util.*;
import java... | <p>The short answer is, you never add the <code>JTable</code> to anything</p>
<p>The long answer is, well, a lot more complicated.</p>
<p><code>null</code> layouts (pixel perfect layouts) are an illusion in modern UI development, to many factors go into determine and maintaining the size and relationships of components... | Load CSV File into JTable | java|csv|swing | 0 | 119 | 1 | 72,165,423 | 72,165,423 | 3 | true | 2022-05-08T21:34:57.287Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Load CSV File into JTable<p><strong>My Code:</strong></p>
<pre><code>import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
im... |
72,166,016 | Run a bash for loop zero times<p>For a c-style language <code>for</code> loop the following executes zero times:</p>
<pre><code>for (int myvar = 0; myvar <= -3; myvar++) {
printf("hi")
}
</code></pre>
<p><code>bash</code> instead will execute the loop four times by going by -1</p>
<pre><code>for j in {0... | <pre><code>for ((j=0; j<=-3; j++)); do
echo hi
done
for ((j=first; j<=last; j+=step)); do
echo hi
done
</code></pre> | Run a bash for loop zero times | bash|for-loop | 0 | 37 | 1 | 72,166,060 | 72,166,060 | 3 | true | 2022-05-09T00:44:02.243Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Run a bash for loop zero times<p>For a c-style language <code>for</code> loop the following executes zero times:</p>
<pre><code>for (int myvar = 0; myvar <... |
72,165,908 | Keep count of records of one table in another<p>I have a table that has records in it, customer purchase info (table a). I want to make a reference table (table b) that keep tracks of how many purchases each person has made by running a count against table a. So say Customer 1 has made 15 purchases that are stored in... | <p>Denormalizing this information into a separate table is a bad idea. You risk update anomalies, and need to write complex and inefficient trigger code to keep it up to date.</p>
<p>You could create a view for this. Your best bet here is an Indexed View, which the server will maintain for you, and allow efficient quer... | Keep count of records of one table in another | sql|sql-server|tsql | 0 | 54 | 1 | 72,166,116 | 72,166,116 | 3 | true | 2022-05-09T00:15:21.317Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Keep count of records of one table in another<p>I have a table that has records in it, customer purchase info (table a). I want to make a reference table (t... |
72,165,879 | ggplot not ploting histogram<p>I'm trying to plot a mirrored histogram based on the following data (snippet):</p>
<p><a href="https://i.stack.imgur.com/GRIYe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GRIYe.png" alt="enter image description here" /></a></p>
<p>Where on the x-axis x goes from 0 t... | <p>Something like this:</p>
<pre><code>ggplot(df, aes(x=x) ) +
geom_histogram(breaks=seq(0, 150, by=10), aes(x = Ilhavo, y = ..density..), fill="#69b3a2" ) +
geom_label( aes(x=100, y=0.05, label="Ilhavo"), color="#69b3a2") +
geom_histogram(breaks=seq(0, 150, by=10), aes(x = VNTelha_M... | ggplot not ploting histogram | r|ggplot2 | 0 | 42 | 1 | 72,166,132 | 72,166,132 | 3 | true | 2022-05-09T00:05:26.717Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ggplot not ploting histogram<p>I'm trying to plot a mirrored histogram based on the following data (snippet):</p>
<p><a href="https://i.stack.imgur.com/GRIYe... |
72,166,270 | "Warning: Function components cannot be given refs" error while using Link in nextJs<blockquote>
<p>Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?</p>
</blockquote>
<p>I am getting this error when in nextJs when I wrap an Image tag insid... | <p>That error means that the element you passed cannot be used to forward a ref, so using any element that does allow that will work. Typically you'll wrap it in an <code><a></code> tag in this case. i.e.</p>
<pre><code><Link>
<a>
<Image />
</a>
</Link>
</code></pre> | "Warning: Function components cannot be given refs" error while using Link in nextJs | reactjs|next.js | 0 | 1,227 | 1 | 72,166,785 | 72,166,785 | 3 | true | 2022-05-09T01:51:05.730Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
"Warning: Function components cannot be given refs" error while using Link in nextJs<blockquote>
<p>Warning: Function components cannot be given refs. Attemp... |
72,166,814 | How to return an error message from a fuction?<p>I have a function in a C++ code which should return a certain type of data (vector in this case, I have the definition typedef Eigen::VectorXd vector from the eigen library) but I have a condition where, if one of the parameters of the fuction is not valid to the kind of... | <p>Usually you handle this kind of errors by throwing an exception.
here an example:</p>
<pre><code> Eigen::VectorXd Foo(int p1, int p2)
{
.....
if (!IsParamsValid(p1,p2))
{
throw std::invalid_argument("p1 or p2 is invalid");
}
.....
}
</code></pre> | How to return an error message from a fuction? | c++ | 0 | 62 | 2 | 72,166,900 | 72,166,900 | 3 | true | 2022-05-09T03:51:37.213Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to return an error message from a fuction?<p>I have a function in a C++ code which should return a certain type of data (vector in this case, I have the ... |
72,167,362 | How to perform n time or query using ORM?<p>I have an array of values</p>
<pre><code>values['value1','value2'....n]
</code></pre>
<p>I want to perform the following query</p>
<pre><code>res = TheModel.objects.filter(key=values[0] or key = values[1] or key = values[2]...n)
</code></pre>
<p>Here the problem is array size... | <p>You can use <a href="https://docs.djangoproject.com/en/4.0/ref/models/querysets/#in" rel="nofollow noreferrer"><code>__in</code></a> filter:</p>
<pre><code>res = TheModel.objects.filter(key__in=values)
</code></pre> | How to perform n time or query using ORM? | django|django-models|django-rest-framework|django-views|django-orm | 0 | 27 | 1 | 72,167,470 | 72,167,470 | 3 | true | 2022-05-09T05:32:56.683Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to perform n time or query using ORM?<p>I have an array of values</p>
<pre><code>values['value1','value2'....n]
</code></pre>
<p>I want to perform the fo... |
72,167,910 | how to access ["x-access-token"] in vue js front end<p>hello i've an application that uses ["x-access-token"] as token in the header, when i try to access the token in the header i keep gettting "no token provided", i use jwt for authentication</p>
<p>error i get in my console <a href="https://imag... | <p>try</p>
<pre><code> const token = localStorage.getItem("token")
axios
.get("http://localhost:5000/api/auth/user", {
headers: {
Authorization:'Bearer ' + token,
'x-access-token': token
}
})
</code></pre> | how to access ["x-access-token"] in vue js front end | javascript|node.js|vue.js|jwt|express-jwt | 0 | 589 | 1 | 72,168,492 | 72,168,492 | 3 | true | 2022-05-09T06:46:49.177Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to access ["x-access-token"] in vue js front end<p>hello i've an application that uses ["x-access-token"] as token in the header, when i try to... |
72,169,766 | Python EVAL() - AND statements<p>I am trying to use EVAL() to evaluate two statements at the same time but I am having some issues:</p>
<pre><code>metrics_dict = {}
def testA(n):
print ("testA done")
global metrics_dict
result = n**n
metrics_dict["metricA"] = result
return resul... | <p>Rather than messing with <code>eval</code>, where you're not going to be able to sidestep how <code>AND</code> works logically, you should consider encoding your check logic as a collection of independent statements:</p>
<pre><code>>>> logic = [testA(2) > 10, testB(3) > 0]
testA done
testB done
>&g... | Python EVAL() - AND statements | python|eval | 0 | 41 | 1 | 72,169,866 | 72,169,866 | 3 | true | 2022-05-09T09:30:10.207Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python EVAL() - AND statements<p>I am trying to use EVAL() to evaluate two statements at the same time but I am having some issues:</p>
<pre><code>metrics_di... |
72,170,062 | How to save a non-ggplot plot in R?<p>I have a forest plot from the package <code>metafor</code>. As it's not a ggplot, I cannot use my favourite <code>ggsave()</code>.
I have tried functions like <code>png(filename="forest_plot_bmj.png", res=315, width=3312, height=1228)</code> but the outcome I get is diffe... | <p>In base R plots, one needs to define the start of the plotting action e.g. with <code>png</code> and the end of the plotting with <code>dev.off()</code>:</p>
<pre><code>library(metafor)
dat <- escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg)
png("out.png")
forest(dat$yi... | How to save a non-ggplot plot in R? | r|ggplot2|plot|metafor | 0 | 90 | 1 | 72,170,158 | 72,170,158 | 3 | true | 2022-05-09T09:50:34.337Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to save a non-ggplot plot in R?<p>I have a forest plot from the package <code>metafor</code>. As it's not a ggplot, I cannot use my favourite <code>ggsav... |
72,170,580 | PROCESS EVENTS not working inside the OUTPUT TO - PROGRESS 4GL<p>I am using below query to export data. But its not helping me to show the progress completion when its in inside the OUTPUT TO. Cant see the real time update( Gradually percentage increase) in view frame a(Field - cProgress). I m not sure is this possible... | <p>Your code is missing a DISPLAY statement. VIEW frame just visualizes the from defined in the FORM statement, but it does not display any values.</p>
<p>So you need a</p>
<pre><code>DISPLAY iPercentage WITH FRAME a .
</code></pre>
<p>somewhere. What is your OS and Window system? GUI or TTY?</p>
<p>In TTY PROCESS EVEN... | PROCESS EVENTS not working inside the OUTPUT TO - PROGRESS 4GL | openedge|progress-4gl | 0 | 46 | 2 | 72,170,752 | 72,170,752 | 3 | true | 2022-05-09T10:32:34.197Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PROCESS EVENTS not working inside the OUTPUT TO - PROGRESS 4GL<p>I am using below query to export data. But its not helping me to show the progress completio... |
72,171,414 | How to Make TableView scroll inside ScrollView behave naturally<p>I need to do this app. The view hierarchy goes like this</p>
<pre><code>UIScrollView
-UIView (Main View)
--UIView (Top View Container)
--UITableview
</code></pre>
<p>When scrolling up the Main View, If table view has many cells, the table view should go ... | <p>First, never put tableview inside a scrollview, it's a bad practice. You could just use tableview header and embed any type of view do you want before the tableview cells.</p>
<p>here's a snipeste on how I deal with it:</p>
<pre><code>//MARK: ConfigureTableView
private func configureTableView(){
let foot... | How to Make TableView scroll inside ScrollView behave naturally | ios|swift|uitableview|uiscrollview | 0 | 220 | 1 | 72,171,534 | 72,171,534 | 3 | true | 2022-05-09T11:41:50.240Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to Make TableView scroll inside ScrollView behave naturally<p>I need to do this app. The view hierarchy goes like this</p>
<pre><code>UIScrollView
-UIVie... |
72,172,056 | Use LINQ to filter files based on separate given extension array<p>I am working on .NET CORE 6 solution. I have list of files along with each extension and another list of extensions i.e. .csv. I want to LINQ to filter files from list 1 based on list 2. i.e. if list 2 have .csv & .txt then LINQ should filter out on... | <p>You can use <a href="https://docs.microsoft.com/en-us/dotnet/api/system.linq.enumerable.where?view=net-6.0" rel="nofollow noreferrer"><code>.Where()</code></a> clause to filter <code>files</code> based on given criteria. Like,</p>
<blockquote>
<p>Filters a sequence of values based on a predicate.</p>
</blockquote>
<... | Use LINQ to filter files based on separate given extension array | c#|linq | 0 | 68 | 2 | 72,172,078 | 72,172,078 | 3 | true | 2022-05-09T12:30:19.950Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Use LINQ to filter files based on separate given extension array<p>I am working on .NET CORE 6 solution. I have list of files along with each extension and a... |
72,172,098 | How can I identify a complete response when receive lot of packets in concurrent TCP requests<p>I have a single TCP connection to a server, but possibly have multiple requests at the same time. Most of the time the response will be so big that I would constantly receive lot of data chunks. It's possible for me to check... | <p>At TCP level, in a connection, <code>request</code> and <code>response</code> do no exist, it's a single tube transferring bytes from one side to the other in order.</p>
<p>In order to handle interleaving over a single connection you have to handle it one level up the stack.</p>
<p>Possible solutions include:</p>
<o... | How can I identify a complete response when receive lot of packets in concurrent TCP requests | tcp|erlang|elixir|gen-tcp | 0 | 99 | 2 | 72,172,500 | 72,172,500 | 3 | true | 2022-05-09T12:33:56.557Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I identify a complete response when receive lot of packets in concurrent TCP requests<p>I have a single TCP connection to a server, but possibly have... |
72,169,226 | Why postgresql planner generates different executions between linux and Windows<p>We use Postgresql locally with very large queries (joins, subrequests and recursion).
On windows, the requests are executed in 4 to 8 seconds depending on the machines tested.
This time is acceptable. But on linux machines, we go to 3minu... | <p>On Linux, essentially all (204015.385 out of 217006.663 ms) of the time is spent on JIT (just in time compilation) in a vain attempt to make things faster. Just turn off jit, it is rarely useful in my experience.</p>
<p>On Windows, you probably have the fortune of not supporting JIT in the first place.</p> | Why postgresql planner generates different executions between linux and Windows | linux|windows|postgresql | 0 | 36 | 1 | 72,172,704 | 72,172,704 | 3 | true | 2022-05-09T08:47:05.923Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why postgresql planner generates different executions between linux and Windows<p>We use Postgresql locally with very large queries (joins, subrequests and r... |
72,173,855 | public variable in App class can't get referenced in other class xamarin forms<p>I have this as my <code>App.xaml.cs</code></p>
<pre><code>using System;
using System.Collections.Generic;
using Xamarin.Forms;
using System.Threading.Tasks;
using Xamarin.Forms.Xaml;
using Newtonsoft.Json;
using System.Net.Http;
namespace... | <p>you need a reference to the <strong>instance</strong> of the <code>App</code> class in order to access a non-static field or property</p>
<pre><code>var json = ((App)Application.Current).productsJSON;
</code></pre> | public variable in App class can't get referenced in other class xamarin forms | c#|xamarin|xamarin.forms | 0 | 142 | 1 | 72,173,909 | 72,173,909 | 3 | true | 2022-05-09T14:42:45.400Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
public variable in App class can't get referenced in other class xamarin forms<p>I have this as my <code>App.xaml.cs</code></p>
<pre><code>using System;
usin... |
72,173,050 | Vlookup + indexOf to find values in a CSV via Google App Script without using loop<p>The main idea is not to need looping to generate a <code>VLOOKUP</code> because it generates a huge slowdown when the amount of data is very large.</p>
<p>To VLOOKUP on data directly in the sheet I do as follows:</p>
<pre><code>functio... | <p>The first column can easily be separated after parsing using <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map" rel="nofollow noreferrer">Array.map</a>:</p>
<pre><code>const dataVlookup = Utilities.parseCsv(UrlFetchApp.fetch(url_vlookup));
const url_columnA = dataVlo... | Vlookup + indexOf to find values in a CSV via Google App Script without using loop | google-apps-script | 0 | 65 | 1 | 72,177,246 | 72,177,246 | 3 | true | 2022-05-09T13:48:12.690Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Vlookup + indexOf to find values in a CSV via Google App Script without using loop<p>The main idea is not to need looping to generate a <code>VLOOKUP</code> ... |
72,177,222 | RuntimeError: failed to find interpreter for Builtin discover of python_spec='python3.1'<h2>Description.</h2>
<p>While trying to use pre-commit hooks, I am experiencing some difficulties, including <a href="https://github.com/lava-nc/lava/releases/download/v0.3.0/lava-nc-0.3.0.tar.gz" rel="nofollow noreferrer">the late... | <p>this is unfortunately a known bug in <code>conda</code> -- though I'm unfamiliar with the status on it. they're mistakenly shipping a <code>python3.1</code> binary as the default executable (it should be called <code>python3.10</code> -- they have a <a href="https://github.com/asottile/flake8-2020" rel="nofollow no... | RuntimeError: failed to find interpreter for Builtin discover of python_spec='python3.1' | conda|pre-commit-hook|pre-commit|pre-commit.com | 0 | 1,324 | 1 | 72,178,361 | 72,178,361 | 3 | true | 2022-05-09T19:20:15.877Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
RuntimeError: failed to find interpreter for Builtin discover of python_spec='python3.1'<h2>Description.</h2>
<p>While trying to use pre-commit hooks, I am e... |
72,144,091 | Auth0 Endpoint "api/auth/me" returns a 404 Error in Next.js App<p>I have gone through the following <a href="https://auth0.com/docs/quickstart/webapp/nextjs?_ga=2.210244693.1956483687.1651804114-593144712.1651431454&_gac=1.219470315.1651573063.Cj0KCQjwpcOTBhCZARIsAEAYLuUsX_Kn2umgKqFdUl2Z_EvOpTAcbUaIVD4RPDAnRiScdkh4... | <p>I am feeling intense bittersweet emotions after finding an insultingly simple solution to this issue.</p>
<p>Found in the <a href="https://github.com/auth0/nextjs-auth0#base-path-and-internationalized-routing" rel="nofollow noreferrer">readme.md</a> of the NextJS-Auth0 repository...
This small snippet of code fixed ... | Auth0 Endpoint "api/auth/me" returns a 404 Error in Next.js App | javascript|typescript|next.js|auth0|auth0-connection | 0 | 454 | 1 | 72,178,580 | 72,178,580 | 3 | true | 2022-05-06T15:37:47.927Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Auth0 Endpoint "api/auth/me" returns a 404 Error in Next.js App<p>I have gone through the following <a href="https://auth0.com/docs/quickstart/webapp/nextjs?... |
72,179,424 | TypeScript: Check if variable has been initialised<p>I have some function as follows:</p>
<pre class="lang-js prettyprint-override"><code>const myFunction = (columns: any, data: any) => {
let label: string;
let value: number;
//some section where it assigns label and value
for (let index = 0; index < col... | <p>The reason you get the <code>used before assigned</code> error is because Typescript doesn't know that <code>undefined</code> is a possible value/type for <code>label</code> or even the other <code>value</code>.</p>
<p>Your first codeblock actually works if you just simply specify the type as:</p>
<pre><code> let l... | TypeScript: Check if variable has been initialised | typescript | 0 | 44 | 3 | 72,179,522 | 72,179,522 | 3 | true | 2022-05-10T00:12:31.470Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
TypeScript: Check if variable has been initialised<p>I have some function as follows:</p>
<pre class="lang-js prettyprint-override"><code>const myFunction = ... |
72,159,273 | using Terraform to pass a file to newly created ec2 instance without sharing the private key in "connection" section<p>My setup is:
Terraform --> AWS ec2</p>
<p>using Terraform to create the ec2 instance with SSH access.</p>
<p>The</p>
<pre><code>resource "aws_instance" "inst1" {
instance_type ... | <p>The Terraform documentation section <a href="https://www.terraform.io/language/resources/provisioners/syntax#provisioners-are-a-last-resort" rel="nofollow noreferrer">Provisioners are a Last Resort</a> raises the need to provision and pass in credentials as one of the justifications for provisioners being a "la... | using Terraform to pass a file to newly created ec2 instance without sharing the private key in "connection" section | amazon-web-services|amazon-ec2|terraform|terraform-provider-aws | 0 | 477 | 1 | 72,179,536 | 72,179,536 | 3 | true | 2022-05-08T08:28:10.227Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
using Terraform to pass a file to newly created ec2 instance without sharing the private key in "connection" section<p>My setup is:
Terraform --> AWS ec2<... |
72,179,624 | How can identify the one statement inside if without braces?<p>normally without braces we define one statement so</p>
<p>I want to ask</p>
<pre><code> if ( n > 0 )
if ( m > 0 )
printf("Condition satisfied.");
</code></pre>
<p>is this one statement or</p>
<pre><code>if ( n > 0 )
... | <p>In a case like this:</p>
<pre><code>if ( n > 0 )
if ( m > 0 )
printf(" Condition satisfied.");
else
printf(" condition not satisfied. ");
</code></pre>
<p>The <code>else</code> pairs with the innermost <code>if</code>. So the above is the same as:</p>
<pre><code... | How can identify the one statement inside if without braces? | c|if-statement|nested | 0 | 54 | 3 | 72,179,660 | 72,179,660 | 3 | true | 2022-05-10T00:56:23.103Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can identify the one statement inside if without braces?<p>normally without braces we define one statement so</p>
<p>I want to ask</p>
<pre><code> if ( n... |
72,180,376 | ModuleNotFoundError: No module named 'Adafruit'<p>I was working with a code I found online, it had:</p>
<pre><code>from Adafruit import ADS1x15
...
t = time.perf_counter() - t0
adc.stopContinuousConversion()
print('Time elapsed: %.9f s.' % t)
print()
</code></pre>
<p>But it kept showing me this error:</p>
<pre><code>T... | <p>I'm guessing you're looking for the python library Adafruit's ADS1x15.</p>
<p>From <a href="https://github.com/adafruit/Adafruit_Python_ADS1x15" rel="nofollow noreferrer">https://github.com/adafruit/Adafruit_Python_ADS1x15</a>, it looks to be deprecated. In its place, it's supposedly <a href="https://github.com/ada... | ModuleNotFoundError: No module named 'Adafruit' | python|raspberry-pi|raspbian|adafruit|adafruit-circuitpython | 0 | 538 | 1 | 72,180,454 | 72,180,454 | 3 | true | 2022-05-10T03:20:52.713Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ModuleNotFoundError: No module named 'Adafruit'<p>I was working with a code I found online, it had:</p>
<pre><code>from Adafruit import ADS1x15
...
t = time... |
72,175,382 | DBeaver import tool - transform expression syntax<p>I am transferring data into a MySQL database using the DBeaver import tool and I would like to set the value of a column to current date. This would need to go into the transform expression column as highlighted in the image. But I am unable to find the right syntax t... | <p>I was able to get it to work with:</p>
<pre><code>new("java.util.Date")
</code></pre>
<p>Thanks to Luuk for the pointer. Here is the reference: <a href="https://help.percussion.com/percussion-cm1/developers/advanced/advanced-widgets/jexl-syntax/" rel="nofollow noreferrer">https://help.percussion.com/percus... | DBeaver import tool - transform expression syntax | mysql|import|transform|dbeaver | 0 | 553 | 1 | 72,180,910 | 72,180,910 | 3 | true | 2022-05-09T16:35:34.083Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
DBeaver import tool - transform expression syntax<p>I am transferring data into a MySQL database using the DBeaver import tool and I would like to set the va... |
72,181,309 | Display Grid Image & Text Side by Side<p>I want to display Image and text side by side but its being displayed down</p>
<p><a href="https://i.stack.imgur.com/F8OXL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/F8OXL.png" alt="Display Image & Text Side By Side" /></a></p>
<pre><code>Here is the ... | <p>You just need to add a <code>display: flex</code> property to <code>grid-item</code> class in your CSS. Like this:</p>
<pre><code>.grid-item {
/* border-bottom: thin #edf1f2 solid; */
padding: 22.85px 0px;
display: flex;
align-items: center;
}
</code></pre>
<p>Codepen: <a href="https://codepen.io/suru235/pen... | Display Grid Image & Text Side by Side | html|css | 0 | 173 | 2 | 72,181,348 | 72,181,348 | 3 | true | 2022-05-10T05:51:48.947Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Display Grid Image & Text Side by Side<p>I want to display Image and text side by side but its being displayed down</p>
<p><a href="https://i.stack.imgur.com... |
72,171,056 | Why does my sensor return 0 when using ESP-NOW Two-Way Communication?<p>I have connected an ESP32 LoRa to a moisture sensor. I have a script for reading data from the sensor, which works perfectly fine on its own:</p>
<pre><code>
#define SensorPin 27
float sensorValue = 0;
void setup() {
Serial.begin(9600);
}
voi... | <p>When using WiFi - you can't use the ADC2 pins for analog input. I've seen the same issue. Here's a <a href="https://github.com/espressif/arduino-esp32/issues/440" rel="nofollow noreferrer">link</a> showing a discussion on the ESP32 github pages.</p>
<p>Switch your sensor to one of the ADC1 pins and it should work.</... | Why does my sensor return 0 when using ESP-NOW Two-Way Communication? | arduino|sensors|esp32 | 0 | 159 | 1 | 72,182,928 | 72,182,928 | 3 | true | 2022-05-09T11:13:34.620Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why does my sensor return 0 when using ESP-NOW Two-Way Communication?<p>I have connected an ESP32 LoRa to a moisture sensor. I have a script for reading data... |
72,182,845 | How to make barplot of groups in dataframes?<p>For this data:</p>
<pre><code>class <- c(1, 2, 3, 2, 1, 4, 5, 4, 2, 4)
prog <- c("Bac2", "Bac", "Master", "Bac", "Bac", "DEA", "Doctorat", "DEA", "Bac", "DEA")
myda... | <pre class="lang-r prettyprint-override"><code>class <- c(1, 2, 3, 2, 1, 4, 5, 4, 2, 4)
prog <- c("Bac2", "Bac", "Master", "Bac", "Bac", "DEA", "Doctorat", "DEA", "Bac", "DEA")
mydata <- data.frame(height = cla... | How to make barplot of groups in dataframes? | r | 0 | 49 | 3 | 72,183,174 | 72,183,174 | 3 | true | 2022-05-10T08:17:08.713Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make barplot of groups in dataframes?<p>For this data:</p>
<pre><code>class <- c(1, 2, 3, 2, 1, 4, 5, 4, 2, 4)
prog <- c("Bac2", &quo... |
72,180,076 | How to pass an object from one page component to another page component in a .NET Blazor app?<p>I have a .NET Blazor Server app and need to pass an object from one component to another. Both components are pages, meaning that they have @page directives with routes. I know how to use cascading values to pass a parameter... | <p>Using dependency injection would likely solve this issue for you.</p>
<p>Example:</p>
<ol>
<li>Create a class called "ApplicationService"</li>
<li>Create an interface in that class called "IApplicationService"</li>
</ol>
<p>You could have something like this</p>
<pre><code>public interface IAppli... | How to pass an object from one page component to another page component in a .NET Blazor app? | .net-core|parameters|blazor|razor-pages|razor-components | 0 | 689 | 2 | 72,183,754 | 72,183,754 | 3 | true | 2022-05-10T02:23:15.307Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to pass an object from one page component to another page component in a .NET Blazor app?<p>I have a .NET Blazor Server app and need to pass an object fr... |
72,184,291 | How to map a list of objects on another one with condition<p>I have two lists. One of them has an Id</p>
<pre><code>var a = new List<MyModel>
{
new MyModel()
{
id = 1,
prop1 = 1,
prop2 = 1
},
... | <p>This works for me:</p>
<pre><code>var query =
from bb in b
join aa in a on new { bb.prop1, bb.prop2 } equals new { aa.prop1, aa.prop2 }
select new { bb, aa.id };
foreach (var q in query)
q.bb.id = q.id;
</code></pre> | How to map a list of objects on another one with condition | c#|linq | 0 | 137 | 1 | 72,184,378 | 72,184,378 | 3 | true | 2022-05-10T10:01:08.590Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to map a list of objects on another one with condition<p>I have two lists. One of them has an Id</p>
<pre><code>var a = new List<MyModel>
... |
72,184,779 | document.getElementById returns null in Chrome Console<p>I know, there were millions of such questions, but I just can't find anything that's helpful :(</p>
<p>Why does <code>document.getElementById("game")</code> return <code>null</code>, even if the <code>document</code> clearly contains such element?</p>
<... | <p>The element with that ID does not belong to the <code>document</code>. It belongs to the <a href="https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_shadow_DOM" rel="nofollow noreferrer">shadow DOM</a> attached to the <code><game-theme-manager></code> element.</p> | document.getElementById returns null in Chrome Console | javascript | 0 | 155 | 1 | 72,184,848 | 72,184,848 | 3 | true | 2022-05-10T10:36:28.727Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
document.getElementById returns null in Chrome Console<p>I know, there were millions of such questions, but I just can't find anything that's helpful :(</p>
... |
72,185,934 | How to use the key special attribute inside the v-for directive using an array of arrays<ol>
<li>List item</li>
</ol>
<p>A have variable that contains an array of arrays of objects like this :</p>
<pre><code>let FooVar: Array<Array<FooObject>> = [] ;
</code></pre>
<p>i want to loop through it inside a comp... | <p>As said in the <a href="https://vuejs.org/api/built-in-special-attributes.html#key" rel="nofollow noreferrer">documentation </a></p>
<blockquote>
<p>The key special attribute is primarily used as a hint for Vue's virtual DOM algorithm to identify vnodes when diffing the new list of nodes against the old list.</p>
</... | How to use the key special attribute inside the v-for directive using an array of arrays | javascript|vue.js|vuejs3 | 0 | 35 | 2 | 72,185,989 | 72,185,989 | 3 | true | 2022-05-10T11:59:32.910Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use the key special attribute inside the v-for directive using an array of arrays<ol>
<li>List item</li>
</ol>
<p>A have variable that contains an ar... |
72,186,346 | How to create a 2-dimensional list with dataframes in Python<p>I have the following structure in my file system.
<a href="https://i.stack.imgur.com/FjgAc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FjgAc.png" alt="enter image description here" /></a></p>
<p>So I have a folder with the name "... | <p>IUUC, you can try</p>
<pre class="lang-py prettyprint-override"><code>list_df = [[pd.read_csv(f"C:/Users/User1/Desktop/Data/Building{indexBuilding }/Day{indexDay }/values.csv", sep =";") for indexDay in range(1,4)] for indexBuilding in range(1,4)]
</code></pre>
<p>Idea is to use a inner for loop<... | How to create a 2-dimensional list with dataframes in Python | python|pandas | 0 | 22 | 1 | 72,186,419 | 72,186,419 | 3 | true | 2022-05-10T12:30:26.443Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to create a 2-dimensional list with dataframes in Python<p>I have the following structure in my file system.
<a href="https://i.stack.imgur.com/FjgAc.png... |
72,189,050 | How to optimise the grouping of values in lists by key in a dictionary list?<p>The script below works but I was wondering if there is a faster solution? With very large dictionary lists I noticed a small delay.</p>
<pre class="lang-py prettyprint-override"><code>from collections import defaultdict
input = [{"firs... | <p>It seems keys in the dictionaries are the same, so you could use a dict comprehension:</p>
<pre class="lang-py prettyprint-override"><code>out = {k:[d[k] for d in input] for k in input[0]}
</code></pre>
<p>Another pretty fast alternative is to use the <code>cytoolz</code> module.</p>
<pre class="lang-py prettyprint-... | How to optimise the grouping of values in lists by key in a dictionary list? | python|list|dictionary | 0 | 34 | 1 | 72,189,110 | 72,189,110 | 3 | true | 2022-05-10T15:24:49.757Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to optimise the grouping of values in lists by key in a dictionary list?<p>The script below works but I was wondering if there is a faster solution? With... |
72,188,205 | MODX Revolution: How to stop temporarily?<p>In our project, we are migrating our website from MODX platform to React framework. In-order to test the new website, I would like to temporarily disable MODX platform from publishing the website. I tried to look for such a procedure, but to no avail. Can anyone explain how t... | <p>Please pay attention to next MODX system settings, they help you with disable your website: <code>site_status</code>, <code>site_unavailable_message</code> and <code>site_unavailable_page</code></p>
<p><a href="https://i.stack.imgur.com/usIsu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/usIsu.p... | MODX Revolution: How to stop temporarily? | web-development-server|modx-revolution | 0 | 40 | 1 | 72,189,498 | 72,189,498 | 3 | true | 2022-05-10T14:28:30.233Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
MODX Revolution: How to stop temporarily?<p>In our project, we are migrating our website from MODX platform to React framework. In-order to test the new webs... |
72,189,798 | Issue in creating a class instance using mikro-orm and typescript and inserting into postgresql database<p>I'm trying to code along to this <a href="https://www.youtube.com/watch?v=I6ypD7qv3Z8&t=2036s&ab_channel=BenAwad" rel="nofollow noreferrer">React GraphQL TypeScript tutorial</a></p>
<p>The project uses Mik... | <p>You need to mark properties that have initializer via <code>OptionalProps</code> symbol to make them optional for the <code>em.create()</code> method. Also instead of explicit <code>type</code> option you can just specify the type explicitly (inference won't work with reflect-metadata).</p>
<p>Here is an entity defi... | Issue in creating a class instance using mikro-orm and typescript and inserting into postgresql database | node.js|typescript|postgresql|mikro-orm|postgresql-14 | 0 | 274 | 2 | 72,189,938 | 72,189,938 | 3 | true | 2022-05-10T16:16:45.277Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Issue in creating a class instance using mikro-orm and typescript and inserting into postgresql database<p>I'm trying to code along to this <a href="https://... |
72,191,125 | Reset the id property of a JavaScript object<p>I have an array of objects like this</p>
<pre><code>const initialState = [
{
id: 1, author: 'author 1', title: 'Book 1', category: 'Category 1',
},
{
id: 2, author: 'author 2', title: 'Book 2', category: 'Category 2',
},
{
id: 3, author: 'author 3', t... | <p>Your code can be improved just by using the index</p>
<pre><code>state.forEach((object, index) => {
object.id = index + 1
})
</code></pre>
<p>You can also use <code>map</code> function as you suggested but it will return a new array</p>
<pre><code>const newArray = state.map((object, index) => {
object.id =... | Reset the id property of a JavaScript object | javascript|arrays|object | 0 | 59 | 2 | 72,191,182 | 72,191,182 | 3 | true | 2022-05-10T18:07:16.290Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Reset the id property of a JavaScript object<p>I have an array of objects like this</p>
<pre><code>const initialState = [
{
id: 1, author: 'author 1', ... |
72,191,097 | Migrate JSONB data to columns<p>I have a PostgreSQL database with the following schema:</p>
<pre><code>CREATE TABLE myrecords (data JSONB);
</code></pre>
<p>It has some records that look like this:</p>
<pre><code> data
---------------------------------------------
{"field1&... | <p>You can use <code>->></code> then compare the result to get a boolean value:</p>
<pre><code>update myrecords
set field1 = (data ->> 'field1') = 'enabled',
field2 = (data ->> 'field2') = 'enabled'
;
</code></pre> | Migrate JSONB data to columns | postgresql|jsonb | 0 | 169 | 1 | 72,191,185 | 72,191,185 | 3 | true | 2022-05-10T18:04:24.787Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Migrate JSONB data to columns<p>I have a PostgreSQL database with the following schema:</p>
<pre><code>CREATE TABLE myrecords (data JSONB);
</code></pre>
<p>... |
72,193,243 | Java and Javascript - different results using Unsigned right shift operator<p>I did a code migration from javascript to java,
but the results for the following operation are different:</p>
<p>in javascript:<code>-1316818646 >>> 0</code> = <code>2978148650</code>
but in java: <code>-1316818646 >>> 0</c... | <p>As @Pydawan said, <code>2978148650</code> is just the unsigned value of <code>-1316818646</code> or <code>10110001100000101111000100101010</code>. To get that in Java, call</p>
<pre><code>Integer.toUnsignedLong(-1316818646)
</code></pre> | Java and Javascript - different results using Unsigned right shift operator | javascript|java | 0 | 49 | 2 | 72,193,408 | 72,193,408 | 3 | true | 2022-05-10T21:41:51.353Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Java and Javascript - different results using Unsigned right shift operator<p>I did a code migration from javascript to java,
but the results for the followi... |
72,195,074 | The named parameter 'title' isn't defined. Issue in flutter<p>Issue</p>
<blockquote>
<p>The named parameter 'title' isn't defined. Issue in flutter</p>
</blockquote>
<p>Code:</p>
<pre class="lang-dart prettyprint-override"><code> items: [
BottomNavigationBarItem(
icon: Icon(Icons.home),
... | <p>Use <code>label</code> instead of <code>title</code> on <a href="https://api.flutter.dev/flutter/widgets/BottomNavigationBarItem-class.html" rel="nofollow noreferrer"><code>BottomNavigationBarItem</code></a>.</p>
<p>It will be like</p>
<pre><code> BottomNavigationBarItem(
icon: Icon(Icons.home),
... | The named parameter 'title' isn't defined. Issue in flutter | flutter|dart | 0 | 570 | 1 | 72,195,086 | 72,195,086 | 3 | true | 2022-05-11T03:30:21.333Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
The named parameter 'title' isn't defined. Issue in flutter<p>Issue</p>
<blockquote>
<p>The named parameter 'title' isn't defined. Issue in flutter</p>
</blo... |
72,181,231 | Webdriver Manager+Chrome Headless+Selenium+Python: webdriver does not respond to options<p><strong>System setup:</strong></p>
<ul>
<li>I used <strong>Python 3.10</strong> in my setup.</li>
<li>I used <strong>Selenium 4</strong>.</li>
<li>I used the Python <strong>webdriver manager</strong> in my test setup. (<a href="h... | <p>--headless should come with --window-size</p>
<p>Ex: "--window-size=1920,1080"</p> | Webdriver Manager+Chrome Headless+Selenium+Python: webdriver does not respond to options | python|python-3.x|selenium|selenium-chromedriver|webdriver | 0 | 561 | 1 | 72,195,453 | 72,195,453 | 3 | true | 2022-05-10T05:41:49.987Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Webdriver Manager+Chrome Headless+Selenium+Python: webdriver does not respond to options<p><strong>System setup:</strong></p>
<ul>
<li>I used <strong>Python ... |
72,195,475 | Pass Input parameter to the GET Rest API call<p>I have a REST endpoint to which I need to pass the input parameter like below within the quotes</p>
<pre><code>/api/rooms?filter=name='A1'
</code></pre>
<p>If I donot pass the parameter with quotes it will error. So within my code how can I call the end point with the inp... | <p>You can try this:</p>
<pre><code>HttpResponseMessage response = await client.GetAsync($"api/rooms?filter=name='{roomName}'").ConfigureAwait(false);
</code></pre> | Pass Input parameter to the GET Rest API call | c#|asp.net|.net|asp.net-core | 0 | 126 | 2 | 72,195,557 | 72,195,557 | 3 | true | 2022-05-11T04:34:41.047Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pass Input parameter to the GET Rest API call<p>I have a REST endpoint to which I need to pass the input parameter like below within the quotes</p>
<pre><cod... |
72,195,511 | Parameterized query not working with PHP mysql<p>i have table name "pages" with "id,title,slug" columns,I am working on core php and trying to use "parameterized update query",whenever i execute my query then its giving me following error</p>
<blockquote>
<p>Warning: mysqli_stmt::bind_para... | <p>While binding a param you should defined what type of is it, like in your case as I guess, title is <code>string</code>, slug is <code>string</code> and id is <code>integer</code></p>
<pre><code>$sql = "UPDATE pages SET title=? WHERE slug=? AND id=?";
$stmt= $conn->prepare($sql);
$stmt->bind_param(&q... | Parameterized query not working with PHP mysql | php|mysqli | 0 | 56 | 1 | 72,195,782 | 72,195,782 | 3 | true | 2022-05-11T04:41:58.647Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Parameterized query not working with PHP mysql<p>i have table name "pages" with "id,title,slug" columns,I am working on core php and tryi... |
72,196,350 | Freeing a struct of int*<p>I have a struct which i am storing an array of integers defined as:</p>
<pre><code> typedef struct {
int* numArr;
int counter;
}NumberArr;
</code></pre>
<p>I have initialised it to be: <code>(int*)malloc(sizeof(int))</code>
and reallocated when i need to add a number using: <co... | <p>This is because <code>numArr</code> is a single pointer (<code>*</code>). You just need to free it once. Your function <code>free_date</code> parameter should be a pointer to <code>NumberArr</code>, and then just pass the address of your variable like <code>&var</code>.</p>
<pre class="lang-c prettyprint-overrid... | Freeing a struct of int* | c|malloc|free|realloc | 0 | 55 | 1 | 72,196,471 | 72,196,471 | 3 | true | 2022-05-11T06:29:44.500Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Freeing a struct of int*<p>I have a struct which i am storing an array of integers defined as:</p>
<pre><code> typedef struct {
int* numArr;
int c... |
72,197,030 | How to pass a template function to another function and apply it<pre><code>// I can't change this function!
template<typename Function, typename... Args>
void RpcWriteKafka(Function func, Args&&... args) {
func(std::forward<Args>(args)...);
}
// I can change this one if necessary.
template<t... | <p>First, the first parameter type of <code>doJob</code> should be <code>std::tuple<CALLBACK, CArgs...></code> instead of <code>std::tuple<CALLBACK, CArgs&&...></code> since <code>CArgs&&</code>
cannot be deduced in such context.</p>
<p>Second, since <code>RpcWriteKafka</code> is a <em>funct... | How to pass a template function to another function and apply it | c++|templates|parameter-pack | 0 | 61 | 1 | 72,197,264 | 72,197,264 | 3 | true | 2022-05-11T07:28:36.627Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to pass a template function to another function and apply it<pre><code>// I can't change this function!
template<typename Function, typename... Args&g... |
72,199,137 | Passing class to use instanceof in a function<p>I have a class structure:</p>
<pre><code>class BonusCard{
}
class AddResourceCard extends BonusCard{
}
class AddGoldCard extends BonusCard{
}
</code></pre>
<p>Now, I also have a function in which I want to pass AddResourceCard or AddGoldCard and in someones Inventory ... | <p>I think what you are looking for is <code>card.getClass().equals(cardToRemove.getClass())</code>.</p>
<p>This compares the classes of the two objects and checks whether they are the same.
If you want to regard some hierarchy, you would then probably rather go for isAssignableFrom instead of equals</p> | Passing class to use instanceof in a function | java|instanceof | 0 | 50 | 3 | 72,199,219 | 72,199,219 | 3 | true | 2022-05-11T10:05:30.297Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Passing class to use instanceof in a function<p>I have a class structure:</p>
<pre><code>class BonusCard{
}
class AddResourceCard extends BonusCard{
}
cla... |
72,199,113 | Uncaught ValueError: mysqli_stmt::execute(): Argument #1 ($params) must be a list array<p>I'm trying to insert prepared statemant multiple values in my database through these two queries, which are both malfunctioning, returning either</p>
<blockquote>
<p>Uncaught Error: Call to undefined method mysqli_stmt::bindValue... | <p>As the error messages make clear, you're using the <a href="https://www.php.net/manual/en/book.mysqli.php" rel="nofollow noreferrer">mysqli</a> library to communicate with your database. However your code seems to be based on examples which use <a href="https://www.php.net/manual/en/book.pdo.php" rel="nofollow noref... | Uncaught ValueError: mysqli_stmt::execute(): Argument #1 ($params) must be a list array | php|mysqli|prepared-statement | 0 | 152 | 2 | 72,199,311 | 72,199,311 | 3 | true | 2022-05-11T10:04:05.117Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Uncaught ValueError: mysqli_stmt::execute(): Argument #1 ($params) must be a list array<p>I'm trying to insert prepared statemant multiple values in my datab... |
72,187,848 | HighMaps - need to make datalabels clickable<p>I'm using the small U.S. map in HighMaps and I want each state and it's datalabel to open up a new URL when clicked. I have the state working, but the label does not work.</p>
<p>this is what I tried:</p>
<pre><code>plotOptions: {
series: {
... | <p>Use the <code>this.value</code> instead of <code>e.target.point.value</code>:</p>
<pre><code>plotOptions: {
series: {
point: {
events: {
click: function() {
const url = this.value;
window.open(url);
}
}
}
}
}
</code></pre>
<p><strong>Demo:</strong>
<a href=... | HighMaps - need to make datalabels clickable | highcharts | 0 | 54 | 2 | 72,199,345 | 72,199,345 | 3 | true | 2022-05-10T14:05:14.197Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
HighMaps - need to make datalabels clickable<p>I'm using the small U.S. map in HighMaps and I want each state and it's datalabel to open up a new URL when cl... |
72,198,495 | Python typing valid boolean combinations<p>I'm trying to use Python's type checker to catch incompatible permissions. I have a permission situation where a particular action can be permitted (boolean) and required (boolean). Obviously, I want to rule out the situation where it is forbidden and also required, since this... | <p>mypy 0.941 does catch the last line only:</p>
<pre><code>$ mypy test.py
test.py:13: error: Incompatible types in assignment (expression has type "Tuple[bool, bool]", variable has type "Union[Tuple[Literal[False], Literal[False]], Tuple[Literal[True], Literal[False]], Tuple[Literal[True], Literal[True]... | Python typing valid boolean combinations | python|mypy|static-typing | 0 | 143 | 2 | 72,199,615 | 72,199,615 | 3 | true | 2022-05-11T09:22:13.270Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python typing valid boolean combinations<p>I'm trying to use Python's type checker to catch incompatible permissions. I have a permission situation where a p... |
72,201,761 | RxJS subcribe is deprecated<p>I have trouble with subcribe method. In vscode it says that subcribe is deprecated but I have no clue how to change it properly.</p>
<pre><code> public getAccount(): void{
this.accountService.getAccounts().subscribe(
(response: Account[]) => {
this.accounts = response... | <p>You should pass an observer object instead of multiple callbacks. All signatures that used multiple arguments were deprecated.</p>
<pre><code>this.accountService.getAccounts().subscribe({
next: (response: Account[]) => {
this.accounts = response;
},
error: (error: HttpErrorResponse) => {
alert(er... | RxJS subcribe is deprecated | rxjs|rxjs-observables | 0 | 105 | 1 | 72,201,918 | 72,201,918 | 3 | true | 2022-05-11T13:16:28.630Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
RxJS subcribe is deprecated<p>I have trouble with subcribe method. In vscode it says that subcribe is deprecated but I have no clue how to change it properly... |
72,194,890 | How to sort array by date?<p>I have following data:</p>
<pre><code>const data =
[{date: "2022-05-10 13:36:00", open: 155.535, low: 155.4, high: 155.67, close: 155.44},
{date: "2022-05-10 13:35:00", open: 155.23, low: 155.2102, high: 155.62, close: 155.53},
{date: "2022-05-10 13:34:00", op... | <p>You already have the dates formatted in a manner suitable for sorting. So we can write a trivial sorter for them:</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 sort... | How to sort array by date? | javascript|html|algorithm|sorting | 0 | 232 | 2 | 72,203,024 | 72,203,024 | 3 | true | 2022-05-11T02:57:07.053Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to sort array by date?<p>I have following data:</p>
<pre><code>const data =
[{date: "2022-05-10 13:36:00", open: 155.535, low: 155.4, high: 15... |
72,204,457 | Laravel how to validate if exists and belong to user<p>I need to check if the shift_id in the request exists in the database, which can be done by the following</p>
<pre><code>'shift_id' => 'required|exists:shifts,id'
</code></pre>
<p>but how can I also check if this shift_id belongs to the authenticated user</p>
<p... | <p>You can use inline validation by adding the name and value of the column after your first column check Like,</p>
<pre><code>'shift_id' => 'required|exists:shifts,id,user_id,'.auth()->user()->id,
</code></pre>
<p>And If you would like to customize the query executed by the validation rule, you may use the Ru... | Laravel how to validate if exists and belong to user | php|laravel|laravel-validation | 0 | 296 | 1 | 72,205,405 | 72,205,405 | 3 | true | 2022-05-11T16:22:12.183Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Laravel how to validate if exists and belong to user<p>I need to check if the shift_id in the request exists in the database, which can be done by the follow... |
72,204,231 | GPU Programming, CUDA or OpenCL or?<p>What is the best way to do programming for GPU?</p>
<p>I know:</p>
<ul>
<li>CUDA is very good, much developer support and very nice zo debug, but only on NVidia Hardware</li>
<li>OpenCL is very flexible, run on NVidia, AMD and Intel Hardware, run on Accellerators, GPU and CPU but a... | <p>Nvidia won't cancel OpenCL support anytime soon.</p>
<p>A newly emerging approach for portable code on GPU is SYCL. It enables higher level programming from a single source file that is then compiled twice, once for the CPU and once for GPU. The GPU part then runs on GPU via either OpenCL, CUDA or some other backend... | GPU Programming, CUDA or OpenCL or? | cuda|gpu|opencl|cpu|hip | 0 | 542 | 1 | 72,205,607 | 72,205,607 | 3 | true | 2022-05-11T16:04:02.933Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
GPU Programming, CUDA or OpenCL or?<p>What is the best way to do programming for GPU?</p>
<p>I know:</p>
<ul>
<li>CUDA is very good, much developer support a... |
72,207,152 | How can change the value of a member of a base class?<p>I have three classes:</p>
<pre><code>class Operation{
public:
virtual bool execute(const Solution& sol, Solution& newSol) = 0;
pair<int, int> pair_routes;
};
class OperationR : public Operation{
public:
OperationR(){};
bool execute(c... | <p>Your derived classes are declaring their own <code>pair_routes</code> members that <em>shadow</em> (ie, hide) the <code>pair_routes</code> member of the base <code>Operation</code> class.</p>
<p>When you execute <code>op->execute()</code>, <code>op</code> is pointing at an <code>OperationR</code> object, so it is... | How can change the value of a member of a base class? | c++|class|inheritance | 0 | 48 | 1 | 72,207,345 | 72,207,345 | 3 | true | 2022-05-11T20:16:47.857Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can change the value of a member of a base class?<p>I have three classes:</p>
<pre><code>class Operation{
public:
virtual bool execute(const Solution... |
72,207,992 | How to push my local branch to my remote branch if other people pushed their work to my remote branch<p>I'm pushing my local branch's commit (may 2022) to my remote branch(last time commit April 2022). However, other people pushed their work to my remote branch(April 2022) which I didn't pull yet.</p>
<p>I need to pull... | <p>Unless you explicitly force it, Git won't override any of your changes.</p>
<p>But it sounds like this is pretty straightforward to accomplish. All you're doing is introducing the changes that others made into your local branch and republishing the branch.</p>
<p>Here's what I'd do.</p>
<ol>
<li><code>git fetch</co... | How to push my local branch to my remote branch if other people pushed their work to my remote branch | git | 0 | 37 | 1 | 72,208,023 | 72,208,023 | 3 | true | 2022-05-11T21:52:22.363Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to push my local branch to my remote branch if other people pushed their work to my remote branch<p>I'm pushing my local branch's commit (may 2022) to my... |
72,201,951 | Select rows in Big Query using CONTAINS_SUBSTR with multiple substrings<p>I am trying to unnest Google Analytics data in Google Big Query. My goal is to find page performance indicators for a selected group of pages of which I only have the code not the entire PagePath.</p>
<p>To do this I am using the CONTAINS_SUBSTR ... | <p>Consider this one instead of using <code>CONTAINS_SUBSTR</code>:</p>
<pre class="lang-sql prettyprint-override"><code>SELECT *
FROM `your_sharded_tables_*`
WHERE _TABLE_SUFFIX BETWEEN "20210501" AND "20210831"
AND REGEXP_CONTAINS(hits.page.PagePath, r'\/(62150|27000)\/')
</code></pre> | Select rows in Big Query using CONTAINS_SUBSTR with multiple substrings | sql|google-bigquery|nested|substring|contains | 0 | 421 | 1 | 72,208,958 | 72,208,958 | 3 | true | 2022-05-11T13:29:14.607Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Select rows in Big Query using CONTAINS_SUBSTR with multiple substrings<p>I am trying to unnest Google Analytics data in Google Big Query. My goal is to find... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.